Title: [151841] trunk
Revision
151841
Author
[email protected]
Date
2013-06-21 09:35:34 -0700 (Fri, 21 Jun 2013)

Log Message

Source/WebCore: [Windows] AX: Radio buttons with "tab" role should describe themselves as tabs
https://bugs.webkit.org/show_bug.cgi?id=117837

Reviewed by Chris Fleizach.

accessibility/aria-tab-role-on-buttons.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute): Indicate that certain accessibility
types (such as Tabs) can be selected.
* accessibility/AccessibilityNodeObject.h: Signature for canSelectAttribute override.

Source/WebKit/win: [Windows] AX: Radio buttons with "tab" role should describe themselves as tabs.
https://bugs.webkit.org/show_bug.cgi?id=117837

Reviewed by Chris Fleizach.

* AccessibleBase.cpp:
(MSAARole): Don't expose TabRole as a radio button to satisfy buggy screen readers.

LayoutTests: [Windows] AX: Radio buttons with "tab" role should describe themselves as tabs.
https://bugs.webkit.org/show_bug.cgi?id=117837

Reviewed by Chris Fleizach.

* accessibility/aria-tab-role-on-buttons.html: Added.
* accessibility/aria-tab-role-on-buttons-expected.txt: Added.
* platform/win/aria-tab-role-on-buttons-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (151840 => 151841)


--- trunk/LayoutTests/ChangeLog	2013-06-21 16:12:54 UTC (rev 151840)
+++ trunk/LayoutTests/ChangeLog	2013-06-21 16:35:34 UTC (rev 151841)
@@ -1,3 +1,14 @@
+2013-06-20  Brent Fulgham  <[email protected]>
+
+        [Windows] AX: Radio buttons with "tab" role should describe themselves as tabs.
+        https://bugs.webkit.org/show_bug.cgi?id=117837
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/aria-tab-role-on-buttons.html: Added.
+        * accessibility/aria-tab-role-on-buttons-expected.txt: Added.
+        * platform/win/aria-tab-role-on-buttons-expected.txt: Added.
+
 2013-06-21  Radu Stavila  <[email protected]>
 
         Improve the reattaching process while applying the :hover style

Added: trunk/LayoutTests/accessibility/aria-tab-role-on-buttons.html (0 => 151841)


--- trunk/LayoutTests/accessibility/aria-tab-role-on-buttons.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/aria-tab-role-on-buttons.html	2013-06-21 16:35:34 UTC (rev 151841)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div role="tablist">
+    <button id="tab a" role="tab" aria-selected="true">Tab A</button>
+    <button id="tab b" role="tab" aria-selected="false">Tab B</button>
+    <button id="tab c" role="tab" aria-selected="false">Tab C</button>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that the aria roles for tab and tablist work as expected for buttons.");
+
+    if (window.accessibilityController) {
+
+          var body = document.getElementById("body");
+          body.focus();
+
+          var tabList = accessibilityController.focusedElement.childAtIndex(0);
+          var tab1 = tabList.childAtIndex(0);
+          var tab2 = tabList.childAtIndex(1);
+          var tabPanel = accessibilityController.focusedElement.childAtIndex(1);
+
+          debug("tabList.role = " + tabList.role);
+          debug("tab1.role = " + tab1.role);
+          debug("tab1.title = " + tab1.title);
+          shouldBe("tab1.childrenCount", "0");
+          debug("tab2.role = " + tab2.role);
+          debug("tab2.title = " + tab2.title);
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/platform/mac/accessibility/aria-tab-role-on-buttons-expected.txt (0 => 151841)


--- trunk/LayoutTests/platform/mac/accessibility/aria-tab-role-on-buttons-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-tab-role-on-buttons-expected.txt	2013-06-21 16:35:34 UTC (rev 151841)
@@ -0,0 +1,16 @@
+Tab A  Tab B  Tab C
+This tests that the aria roles for tab and tablist work as expected for buttons.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+tabList.role = AXRole: AXTabGroup
+tab1.role = AXRole: AXRadioButton
+tab1.title = AXTitle: Tab A
+PASS tab1.childrenCount is 0
+tab2.role = AXRole: AXRadioButton
+tab2.title = AXTitle: Tab B
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/win/accessibility/aria-tab-role-on-buttons-expected.txt (0 => 151841)


--- trunk/LayoutTests/platform/win/accessibility/aria-tab-role-on-buttons-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/win/accessibility/aria-tab-role-on-buttons-expected.txt	2013-06-21 16:35:34 UTC (rev 151841)
@@ -0,0 +1,16 @@
+Tab A  Tab B  Tab C
+This tests that the aria roles for tab and tablist work as expected for buttons.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+tabList.role = page tab list
+tab1.role = page tab
+tab1.title = Tab A
+PASS tab1.childrenCount is 0
+tab2.role = page tab
+tab2.title = Tab B
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/Source/WebCore/ChangeLog (151840 => 151841)


--- trunk/Source/WebCore/ChangeLog	2013-06-21 16:12:54 UTC (rev 151840)
+++ trunk/Source/WebCore/ChangeLog	2013-06-21 16:35:34 UTC (rev 151841)
@@ -1,3 +1,17 @@
+2013-06-20  Brent Fulgham  <[email protected]>
+
+        [Windows] AX: Radio buttons with "tab" role should describe themselves as tabs
+        https://bugs.webkit.org/show_bug.cgi?id=117837
+
+        Reviewed by Chris Fleizach.
+
+        accessibility/aria-tab-role-on-buttons.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::canSetSelectedAttribute): Indicate that certain accessibility
+        types (such as Tabs) can be selected.
+        * accessibility/AccessibilityNodeObject.h: Signature for canSelectAttribute override.
+
 2013-06-21  Allan Sandfeld Jensen  <[email protected]>
 
         Remove unused GesturePinch events

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (151840 => 151841)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-06-21 16:12:54 UTC (rev 151840)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-06-21 16:35:34 UTC (rev 151841)
@@ -1902,4 +1902,23 @@
     return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, "true");
 }
 
+bool AccessibilityNodeObject::canSetSelectedAttribute() const
+{
+    // Elements that can be selected
+    switch (roleValue()) {
+    case CellRole:
+    case RadioButtonRole:
+    case RowHeaderRole:
+    case RowRole:
+    case TabListRole:
+    case TabRole:
+    case TreeGridRole:
+    case TreeItemRole:
+    case TreeRole:
+        return isEnabled();
+    default:
+        return false;
+    }
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (151840 => 151841)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2013-06-21 16:12:54 UTC (rev 151840)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2013-06-21 16:35:34 UTC (rev 151841)
@@ -100,6 +100,8 @@
     virtual bool isRequired() const;
     virtual bool supportsRequiredAttribute() const;
 
+    virtual bool canSetSelectedAttribute() const OVERRIDE;
+
     void setNode(Node*);
     virtual Node* node() const { return m_node; }
     virtual Document* document() const;

Modified: trunk/Source/WebKit/win/AccessibleBase.cpp (151840 => 151841)


--- trunk/Source/WebKit/win/AccessibleBase.cpp	2013-06-21 16:12:54 UTC (rev 151840)
+++ trunk/Source/WebKit/win/AccessibleBase.cpp	2013-06-21 16:35:34 UTC (rev 151841)
@@ -918,11 +918,8 @@
             return ROLE_SYSTEM_OUTLINEITEM;
         case WebCore::TabPanelRole:
             return ROLE_SYSTEM_GROUPING;
-        // Note: TabRole seems like it should map to ROLE_SYSTEM_PAGETAB, but Mac OS maps
-        // this to the equivalent of ROLE_SYSTEM_RADIOBUTTON. To provide consistent behavior
-        // on both platforms we will follow that mapping:
         case WebCore::TabRole:
-            return ROLE_SYSTEM_RADIOBUTTON;
+            return ROLE_SYSTEM_PAGETAB;
         case WebCore::ApplicationRole:
             return ROLE_SYSTEM_APPLICATION;
         case WebCore::ApplicationDialogRole:

Modified: trunk/Source/WebKit/win/ChangeLog (151840 => 151841)


--- trunk/Source/WebKit/win/ChangeLog	2013-06-21 16:12:54 UTC (rev 151840)
+++ trunk/Source/WebKit/win/ChangeLog	2013-06-21 16:35:34 UTC (rev 151841)
@@ -1,3 +1,13 @@
+2013-06-20  Brent Fulgham  <[email protected]>
+
+        [Windows] AX: Radio buttons with "tab" role should describe themselves as tabs.
+        https://bugs.webkit.org/show_bug.cgi?id=117837
+
+        Reviewed by Chris Fleizach.
+
+        * AccessibleBase.cpp:
+        (MSAARole): Don't expose TabRole as a radio button to satisfy buggy screen readers.
+
 2013-06-21  Christophe Dumez  <[email protected]>
 
         REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to