- Revision
- 158195
- Author
- [email protected]
- Date
- 2013-10-29 09:40:08 -0700 (Tue, 29 Oct 2013)
Log Message
AX: elements with explicit tabindex should expose AXFocused as writable, since mouse clicks can focus it
https://bugs.webkit.org/show_bug.cgi?id=121335
Reviewed by Mario Sanchez Prada.
Source/WebCore:
Re-order logic that determines if a <span> should appear as an accessible element.
The change is that if an element canSetFocus() it should always be in the AX tree.
Test: accessibility/tabindex-elements-are-accessible.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
LayoutTests:
* accessibility/tabindex-elements-are-accessible-expected.txt: Added.
* accessibility/tabindex-elements-are-accessible.html: Added.
New test to ensure that if tabindex is on an element, it is in the AX tree.
* platform/mac/accessibility/table-with-row-col-of-headers-expected.txt:
* platform/mac/accessibility/table-with-row-col-of-headers.html:
Update to reflect that if an ignored <table> has a tabindex, then it should at least be an AXGroup
* platform/mac/accessibility/update-children-when-aria-role-changes.html:
Update so that the <span> elements being used don't have tabindex, which forces them to be in the AX tree,
which changes the output of the test (basically we'd need to query the child of those elements instead).
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (158194 => 158195)
--- trunk/LayoutTests/ChangeLog 2013-10-29 16:32:44 UTC (rev 158194)
+++ trunk/LayoutTests/ChangeLog 2013-10-29 16:40:08 UTC (rev 158195)
@@ -1,3 +1,20 @@
+2013-10-29 Chris Fleizach <[email protected]>
+
+ AX: elements with explicit tabindex should expose AXFocused as writable, since mouse clicks can focus it
+ https://bugs.webkit.org/show_bug.cgi?id=121335
+
+ Reviewed by Mario Sanchez Prada.
+
+ * accessibility/tabindex-elements-are-accessible-expected.txt: Added.
+ * accessibility/tabindex-elements-are-accessible.html: Added.
+ New test to ensure that if tabindex is on an element, it is in the AX tree.
+ * platform/mac/accessibility/table-with-row-col-of-headers-expected.txt:
+ * platform/mac/accessibility/table-with-row-col-of-headers.html:
+ Update to reflect that if an ignored <table> has a tabindex, then it should at least be an AXGroup
+ * platform/mac/accessibility/update-children-when-aria-role-changes.html:
+ Update so that the <span> elements being used don't have tabindex, which forces them to be in the AX tree,
+ which changes the output of the test (basically we'd need to query the child of those elements instead).
+
2013-10-28 Chris Fleizach <[email protected]>
AX: Webkit does not expose AXRequired on input type=file
Added: trunk/LayoutTests/accessibility/tabindex-elements-are-accessible-expected.txt (0 => 158195)
--- trunk/LayoutTests/accessibility/tabindex-elements-are-accessible-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/tabindex-elements-are-accessible-expected.txt 2013-10-29 16:40:08 UTC (rev 158195)
@@ -0,0 +1,28 @@
+test test test
+test
+
+This tests that if tabindex is set on an object, it will be accessible (even if it is usually not)
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Item 1: Is focusable: true
+Item 1: AXRole: AXGroup
+
+
+Item 2: Is focusable: true
+Item 2: AXRole: AXGroup
+
+
+Item 3: Is focusable: true
+Item 3: AXRole: AXGroup
+
+
+Item 4: Is focusable: true
+Item 4: AXRole: AXGroup
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/tabindex-elements-are-accessible.html (0 => 158195)
--- trunk/LayoutTests/accessibility/tabindex-elements-are-accessible.html (rev 0)
+++ trunk/LayoutTests/accessibility/tabindex-elements-are-accessible.html 2013-10-29 16:40:08 UTC (rev 158195)
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+
+<span tabindex="-1" id="item1">test</span>
+<span tabindex="0" id="item2">test</span>
+<span tabindex="1" id="item3">test</span>
+
+<p tabindex="-1" id="item4">test
+
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests that if tabindex is set on an object, it will be accessible (even if it is usually not)");
+
+ if (window.accessibilityController) {
+ for (var k = 1; k < 5; k++) {
+ var item = accessibilityController.accessibleElementById("item" + k);
+ debug("Item " + k + ": Is focusable: " + item.isFocusable);
+ debug("Item " + k + ": " + item.role);
+ debug("\n");
+ }
+ }
+
+</script>
+
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/mac/accessibility/table-with-row-col-of-headers-expected.txt (158194 => 158195)
--- trunk/LayoutTests/platform/mac/accessibility/table-with-row-col-of-headers-expected.txt 2013-10-29 16:32:44 UTC (rev 158194)
+++ trunk/LayoutTests/platform/mac/accessibility/table-with-row-col-of-headers-expected.txt 2013-10-29 16:40:08 UTC (rev 158195)
@@ -13,8 +13,8 @@
PASS accessibilityController.focusedElement.role is 'AXRole: AXTable'
PASS accessibilityController.focusedElement.role is 'AXRole: AXTable'
-PASS accessibilityController.focusedElement.role is 'AXRole: AXWebArea'
-PASS accessibilityController.focusedElement.role is 'AXRole: AXWebArea'
+PASS accessibilityController.focusedElement.role is 'AXRole: AXGroup'
+PASS accessibilityController.focusedElement.role is 'AXRole: AXGroup'
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/platform/mac/accessibility/table-with-row-col-of-headers.html (158194 => 158195)
--- trunk/LayoutTests/platform/mac/accessibility/table-with-row-col-of-headers.html 2013-10-29 16:32:44 UTC (rev 158194)
+++ trunk/LayoutTests/platform/mac/accessibility/table-with-row-col-of-headers.html 2013-10-29 16:40:08 UTC (rev 158195)
@@ -66,10 +66,10 @@
shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXTable'");
document.getElementById("table3").focus();
- shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXWebArea'");
+ shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXGroup'");
document.getElementById("table4").focus();
- shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXWebArea'");
+ shouldBe("accessibilityController.focusedElement.role", "'AXRole: AXGroup'");
}
</script>
Modified: trunk/LayoutTests/platform/mac/accessibility/update-children-when-aria-role-changes.html (158194 => 158195)
--- trunk/LayoutTests/platform/mac/accessibility/update-children-when-aria-role-changes.html 2013-10-29 16:32:44 UTC (rev 158194)
+++ trunk/LayoutTests/platform/mac/accessibility/update-children-when-aria-role-changes.html 2013-10-29 16:40:08 UTC (rev 158195)
@@ -10,8 +10,8 @@
<body>
<div id="parent" tabindex=0 role="group">
- <span tabindex=0 role="button" id="button1">button 1</span>
- <span tabindex=0 id="button2" title="button 2"></span>
+ <span role="button" id="button1">button 1</span>
+ <span id="button2" title="button 2"></span>
</div>
<p id="description"></p>
Modified: trunk/Source/WebCore/ChangeLog (158194 => 158195)
--- trunk/Source/WebCore/ChangeLog 2013-10-29 16:32:44 UTC (rev 158194)
+++ trunk/Source/WebCore/ChangeLog 2013-10-29 16:40:08 UTC (rev 158195)
@@ -1,3 +1,19 @@
+2013-10-29 Chris Fleizach <[email protected]>
+
+ AX: elements with explicit tabindex should expose AXFocused as writable, since mouse clicks can focus it
+ https://bugs.webkit.org/show_bug.cgi?id=121335
+
+ Reviewed by Mario Sanchez Prada.
+
+ Re-order logic that determines if a <span> should appear as an accessible element.
+ The change is that if an element canSetFocus() it should always be in the AX tree.
+
+ Test: accessibility/tabindex-elements-are-accessible.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+
2013-10-29 Philippe Normand <[email protected]>
[GTK] enable media-stream in build-webkit
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (158194 => 158195)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2013-10-29 16:32:44 UTC (rev 158194)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2013-10-29 16:40:08 UTC (rev 158195)
@@ -1219,15 +1219,6 @@
return false;
#endif
- // <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->isRenderBlockFlow() && m_renderer->childrenInline() && !canSetFocusAttribute())
return !toRenderBlockFlow(m_renderer)->hasLines() && !mouseButtonListener();
@@ -1306,6 +1297,15 @@
return false;
#endif
+ // <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;
+
// Other non-ignored host language elements
if (node && node->hasTagName(dfnTag))
return false;
@@ -2542,8 +2542,8 @@
if (m_renderer->isRenderBlockFlow())
return GroupRole;
- // If the element does not have role, but it has ARIA attributes, accessibility should fallback to exposing it as a group.
- if (supportsARIAAttributes())
+ // If the element does not have role, but it has ARIA attributes, or accepts tab focus, accessibility should fallback to exposing it as a group.
+ if (supportsARIAAttributes() || canSetFocusAttribute())
return GroupRole;
return UnknownRole;