Diff
Modified: trunk/LayoutTests/ChangeLog (127367 => 127368)
--- trunk/LayoutTests/ChangeLog 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/LayoutTests/ChangeLog 2012-09-01 08:53:50 UTC (rev 127368)
@@ -1,5 +1,24 @@
2012-09-01 Joanmarie Diggs <[email protected]>
+ [Gtk] No accessible caret-moved events found in certain content
+ https://bugs.webkit.org/show_bug.cgi?id=72811
+
+ Part of the bug was due to extraneous accessible objects resulting
+ from unignored inline and block spans.
+
+ Reviewed by Chris Fleizach.
+
+ Added new test, updated the results of one test to reflect the fix,
+ corrected a test with a mismatched element tag.
+
+ * platform/gtk/accessibility/aria-roles-unignored-expected.txt: Corrected results having fixed tag.
+ * platform/gtk/accessibility/aria-roles-unignored.html: Fixed mismatched element tag.
+ * platform/gtk/accessibility/media-element-expected.txt: Updated to reflect removal of extraneous object.
+ * platform/gtk/accessibility/spans-expected.txt: Added.
+ * platform/gtk/accessibility/spans.html: Added.
+
+2012-09-01 Joanmarie Diggs <[email protected]>
+
[Gtk] Incorrect/unexpected characters in the text of certain accessibles
https://bugs.webkit.org/show_bug.cgi?id=95180
Modified: trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored-expected.txt (127367 => 127368)
--- trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored-expected.txt 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored-expected.txt 2012-09-01 08:53:50 UTC (rev 127368)
@@ -18,7 +18,7 @@
PASS element.role is 'AXRole: heading'
PASS element.role is 'AXRole: form'
PASS element.role is 'AXRole: push button'
-PASS element.role is 'AXRole: panel'
+PASS element.role is 'AXRole: section'
PASS element.role is 'AXRole: entry'
PASS successfullyParsed is true
Modified: trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored.html (127367 => 127368)
--- trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored.html 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/LayoutTests/platform/gtk/accessibility/aria-roles-unignored.html 2012-09-01 08:53:50 UTC (rev 127368)
@@ -14,7 +14,7 @@
<form>A form with a button <button name="button" value="Button">Click me!</button></form>
<form role="button">Just a button <button name="button" value="Button">Click me!</button></form>
-<div>Just some text inside a div</form>
+<div>Just some text inside a div</div>
<div role="textbox">This div is contains a textbox (an entry)</div>
<p id="description"></p>
@@ -51,7 +51,7 @@
// Divs
element = webArea.childAtIndex(5);
- shouldBe("element.role", "'AXRole: panel'");
+ shouldBe("element.role", "'AXRole: section'");
element = webArea.childAtIndex(6);
shouldBe("element.role", "'AXRole: entry'");
}
Modified: trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt (127367 => 127368)
--- trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt 2012-09-01 08:53:50 UTC (rev 127368)
@@ -13,10 +13,6 @@
description: AXDescription:
- role: AXRole: panel
-
-
- description: AXDescription:
role: AXRole: slider
Added: trunk/LayoutTests/platform/gtk/accessibility/spans-expected.txt (0 => 127368)
--- trunk/LayoutTests/platform/gtk/accessibility/spans-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/gtk/accessibility/spans-expected.txt 2012-09-01 08:53:50 UTC (rev 127368)
@@ -0,0 +1,36 @@
+first block span
+inline span
+second block span
+first block span
+inline span
+second block span
+
+first block span
+inline span
+second block span
+first block span
+inline span
+second block span
+This tests that both block spans and inline spans get folded into the parent object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.role is 'AXRole: heading'
+PASS element.childrenCount is 0
+PASS element.role is 'AXRole: heading'
+PASS element.childrenCount is 1
+PASS link.role is 'AXRole: link'
+PASS link.childrenCount is 0
+PASS element.role is 'AXRole: list'
+PASS element.childrenCount is 2
+PASS item.role is 'AXRole: list item'
+PASS item.childrenCount is 0
+PASS item.role is 'AXRole: list item'
+PASS item.childrenCount is 1
+PASS link.role is 'AXRole: link'
+PASS link.childrenCount is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/platform/gtk/accessibility/spans.html (0 => 127368)
--- trunk/LayoutTests/platform/gtk/accessibility/spans.html (rev 0)
+++ trunk/LayoutTests/platform/gtk/accessibility/spans.html 2012-09-01 08:53:50 UTC (rev 127368)
@@ -0,0 +1,78 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+<h4>
+ <span style="display:block;">first block span</span>
+ <span>inline span</span>
+ <span style="display:block;">second block span</span>
+</h4>
+<h4>
+ <a href=""
+ <span style="display:block;">first block span</span>
+ <span>inline span</span>
+ <span style="display:block;">second block span</span>
+ </a>
+</h4>
+<ol>
+ <li>
+ <span style="display:block;">first block span</span>
+ <span>inline span</span>
+ <span style="display:block;">second block span</span>
+ </li>
+ <li>
+ <a href=""
+ <span style="display:block;">first block span</span>
+ <span>inline span</span>
+ <span style="display:block;">second block span</span>
+ </a>
+ </li>
+</ol>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This tests that both block spans and inline spans get folded into the parent object");
+
+if (window.layoutController) {
+ testRunner.dumpAsText();
+}
+
+if (window.accessibilityController) {
+ document.getElementById("body").focus();
+ var webArea = accessibilityController.focusedElement;
+
+ var element = webArea.childAtIndex(0);
+ shouldBe("element.role", "'AXRole: heading'");
+ shouldBe("element.childrenCount", "0");
+
+ element = webArea.childAtIndex(1);
+ shouldBe("element.role", "'AXRole: heading'");
+ shouldBe("element.childrenCount", "1");
+
+ var link = element.childAtIndex(0);
+ shouldBe("link.role", "'AXRole: link'");
+ shouldBe("link.childrenCount", "0");
+
+ element = webArea.childAtIndex(2);
+ shouldBe("element.role", "'AXRole: list'");
+ shouldBe("element.childrenCount", "2");
+
+ var item = element.childAtIndex(0);
+ shouldBe("item.role", "'AXRole: list item'");
+ shouldBe("item.childrenCount", "0");
+
+ item = element.childAtIndex(1);
+ shouldBe("item.role", "'AXRole: list item'");
+ shouldBe("item.childrenCount", "1");
+
+ link = item.childAtIndex(0);
+ shouldBe("link.role", "'AXRole: link'");
+ shouldBe("link.childrenCount", "0");
+}
+
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (127367 => 127368)
--- trunk/Source/WebCore/ChangeLog 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/Source/WebCore/ChangeLog 2012-09-01 08:53:50 UTC (rev 127368)
@@ -1,5 +1,24 @@
2012-09-01 Joanmarie Diggs <[email protected]>
+ [Gtk] No accessible caret-moved events found in certain content
+ https://bugs.webkit.org/show_bug.cgi?id=72811
+
+ Part of the bug was due to extraneous accessible objects resulting
+ from unignored inline and block spans.
+
+ Reviewed by Chris Fleizach.
+
+ Test: platform/gtk/accessibility/spans.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): Ignore objects that have spanTag tag name.
+ * accessibility/gtk/AccessibilityObjectAtk.cpp:
+ (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): Ignore most anonymous blocks.
+ * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
+ (roleIsTextType): Add ListItem to the roles which should implement AtkText.
+
+2012-09-01 Joanmarie Diggs <[email protected]>
+
[Gtk] Incorrect/unexpected characters in the text of certain accessibles
https://bugs.webkit.org/show_bug.cgi?id=95180
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (127367 => 127368)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2012-09-01 08:53:50 UTC (rev 127368)
@@ -1953,6 +1953,15 @@
// if this element has aria attributes on it, it should not be ignored.
if (supportsARIAAttributes())
return false;
+
+ // <span> tags are inline tags and not meant to convey information if they have no other aria
+ // information on them. If we don't ignore them, they may emit signals expected to come from
+ // their parent. In addition, because included spans are GroupRole objects, and GroupRole
+ // objects are often containers with meaningful information, the inclusion of a span can have
+ // the side effect of causing the immediate parent accessible to be ignored. This is especially
+ // problematic for platforms which have distinct roles for textual block elements.
+ if (node && node->hasTagName(spanTag))
+ return true;
if (m_renderer->isBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
return !toRenderBlock(m_renderer)->firstLineBox() && !mouseButtonListener();
Modified: trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp (127367 => 127368)
--- trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp 2012-09-01 08:53:50 UTC (rev 127368)
@@ -78,6 +78,21 @@
if (role == UnknownRole)
return IgnoreObject;
+ // Block spans result in objects of ATK_ROLE_PANEL which are almost always unwanted.
+ // However, if we ignore block spans whose parent is the body, the child controls
+ // will become immediate children of the ATK_ROLE_DOCUMENT_FRAME and any text will
+ // become text within the document frame itself. This ultimately may be what we want
+ // and would largely be consistent with what we see from Gecko. However, ignoring
+ // spans whose parent is the body changes the current behavior we see from WebCore.
+ // Until we have sufficient time to properly analyze these cases, we will defer to
+ // WebCore. We only check that the parent is not aria because we do not expect
+ // anonymous blocks which are aria-related to themselves have an aria role, nor
+ // have we encountered instances where the parent of an anonymous block also lacked
+ // an aria role but the grandparent had one.
+ if (renderer()->isAnonymousBlock() && !parent->renderer()->isBody()
+ && parent->ariaRoleAttribute() == UnknownRole)
+ return IgnoreObject;
+
return DefaultBehavior;
}
Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp (127367 => 127368)
--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp 2012-09-01 08:43:04 UTC (rev 127367)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp 2012-09-01 08:53:50 UTC (rev 127368)
@@ -820,7 +820,7 @@
static bool roleIsTextType(AccessibilityRole role)
{
- return role == ParagraphRole || role == HeadingRole || role == DivRole || role == CellRole;
+ return role == ParagraphRole || role == HeadingRole || role == DivRole || role == CellRole || role == ListItemRole;
}
static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)