Title: [170661] trunk
Revision
170661
Author
[email protected]
Date
2014-07-01 13:29:52 -0700 (Tue, 01 Jul 2014)

Log Message

AX: HTML indeterminate IDL attribute not mapped to checkbox value=2
https://bugs.webkit.org/show_bug.cgi?id=134492

Reviewed by Andreas Kling.

Source/WebCore:
Support the indeterminate attribute in AX code.

Test: Update existing test: accessibility/aria-checked-mixed-value

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::checkboxOrRadioValue):

Tools:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::isIndeterminate):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::isIndeterminate):

LayoutTests:
* accessibility/aria-checked-mixed-value-expected.txt:
* accessibility/aria-checked-mixed-value.html:
* platform/mac/accessibility/aria-checked-mixed-value-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (170660 => 170661)


--- trunk/LayoutTests/ChangeLog	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/LayoutTests/ChangeLog	2014-07-01 20:29:52 UTC (rev 170661)
@@ -1,3 +1,14 @@
+2014-07-01  Chris Fleizach  <[email protected]>
+
+        AX: HTML indeterminate IDL attribute not mapped to checkbox value=2
+        https://bugs.webkit.org/show_bug.cgi?id=134492
+
+        Reviewed by Andreas Kling.
+
+        * accessibility/aria-checked-mixed-value-expected.txt:
+        * accessibility/aria-checked-mixed-value.html:
+        * platform/mac/accessibility/aria-checked-mixed-value-expected.txt: Added.
+
 2014-07-01  Simon Fraser  <[email protected]>
 
         [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered

Modified: trunk/LayoutTests/accessibility/aria-checked-mixed-value-expected.txt (170660 => 170661)


--- trunk/LayoutTests/accessibility/aria-checked-mixed-value-expected.txt	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/LayoutTests/accessibility/aria-checked-mixed-value-expected.txt	2014-07-01 20:29:52 UTC (rev 170661)
@@ -19,6 +19,14 @@
 Mixed: true
 
 
+Role: AXRole: AXCheckBox
+Mixed: true
+
+
+Role: AXRole: AXCheckBox
+Mixed: false
+
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/aria-checked-mixed-value.html (170660 => 170661)


--- trunk/LayoutTests/accessibility/aria-checked-mixed-value.html	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/LayoutTests/accessibility/aria-checked-mixed-value.html	2014-07-01 20:29:52 UTC (rev 170661)
@@ -11,6 +11,8 @@
 <div id="element2" role="menuitemradio" aria-checked="mixed"></div> <!-- treat as false for menuitemradio roles -->
 <div id="element3" role="checkbox" aria-checked="mixed"></div>
 <div id="element4" role="menuitemcheckbox" aria-checked="mixed"></div>
+<div id="element5" role="checkbox" indeterminate="true"></div>
+<div id="element6" role="checkbox" indeterminate="false"></div>
 
 </div>
 
@@ -22,7 +24,7 @@
     description("Tests whether mixed values are reported properly.");
 
     if (window.accessibilityController) {
-          for (var i = 1; i < 5; i++) {
+          for (var i = 1; i < 7; i++) {
               var element = accessibilityController.accessibleElementById("element" + i);
               debug("Role: " + element.role);
               debug("Mixed: " + element.isIndeterminate);

Copied: trunk/LayoutTests/platform/mac/accessibility/aria-checked-mixed-value-expected.txt (from rev 170660, trunk/LayoutTests/accessibility/aria-checked-mixed-value-expected.txt) (0 => 170661)


--- trunk/LayoutTests/platform/mac/accessibility/aria-checked-mixed-value-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-checked-mixed-value-expected.txt	2014-07-01 20:29:52 UTC (rev 170661)
@@ -0,0 +1,33 @@
+Tests whether mixed values are reported properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Role: AXRole: AXRadioButton
+Mixed: false
+
+
+Role: AXRole: AXMenuItem
+Mixed: false
+
+
+Role: AXRole: AXCheckBox
+Mixed: true
+
+
+Role: AXRole: AXMenuItem
+Mixed: true
+
+
+Role: AXRole: AXCheckBox
+Mixed: true
+
+
+Role: AXRole: AXCheckBox
+Mixed: false
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/Source/WebCore/ChangeLog (170660 => 170661)


--- trunk/Source/WebCore/ChangeLog	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/Source/WebCore/ChangeLog	2014-07-01 20:29:52 UTC (rev 170661)
@@ -1,3 +1,17 @@
+2014-07-01  Chris Fleizach  <[email protected]>
+
+        AX: HTML indeterminate IDL attribute not mapped to checkbox value=2
+        https://bugs.webkit.org/show_bug.cgi?id=134492
+
+        Reviewed by Andreas Kling.
+
+        Support the indeterminate attribute in AX code.
+
+        Test: Update existing test: accessibility/aria-checked-mixed-value
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::checkboxOrRadioValue):
+
 2014-07-01  Myles C. Maxfield  <[email protected]>
 
         Typing an automatic text replacement phrase after a br in contenteditable is not rendered as expected

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (170660 => 170661)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2014-07-01 20:29:52 UTC (rev 170661)
@@ -2085,6 +2085,9 @@
         return ButtonStateMixed;
     }
     
+    if (equalIgnoringCase(getAttribute(indeterminateAttr), "true"))
+        return ButtonStateMixed;
+    
     return ButtonStateOff;
 }
 

Modified: trunk/Tools/ChangeLog (170660 => 170661)


--- trunk/Tools/ChangeLog	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/Tools/ChangeLog	2014-07-01 20:29:52 UTC (rev 170661)
@@ -1,3 +1,15 @@
+2014-07-01  Chris Fleizach  <[email protected]>
+
+        AX: HTML indeterminate IDL attribute not mapped to checkbox value=2
+        https://bugs.webkit.org/show_bug.cgi?id=134492
+
+        Reviewed by Andreas Kling.
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::isIndeterminate):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::isIndeterminate):
+
 2014-07-01  Daniel Bates  <[email protected]>
 
         Remove unnecessary calls to std::move()

Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (170660 => 170661)


--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm	2014-07-01 20:29:52 UTC (rev 170661)
@@ -1479,8 +1479,13 @@
 
 bool AccessibilityUIElement::isIndeterminate() const
 {
-    // FIXME: implement
-    return false;
+    BOOL result = NO;
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        result = [value intValue] == 2;
+    END_AX_OBJC_EXCEPTIONS
+    return result;
 }
 
 bool AccessibilityUIElement::isIgnored() const

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (170660 => 170661)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2014-07-01 20:22:58 UTC (rev 170660)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2014-07-01 20:29:52 UTC (rev 170661)
@@ -950,8 +950,13 @@
 
 bool AccessibilityUIElement::isIndeterminate() const
 {
-    // FIXME: implement
-    return false;
+    BOOL result = NO;
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        result = [value intValue] == 2;
+    END_AX_OBJC_EXCEPTIONS
+    return result;
 }
 
 bool AccessibilityUIElement::isExpanded() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to