Title: [154496] trunk
Revision
154496
Author
[email protected]
Date
2013-08-23 10:24:52 -0700 (Fri, 23 Aug 2013)

Log Message

<https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as aria-expanded="false" (AXExpanded = NO)

Reviewed by Darin Adler.

Source/WebCore:

Don't support the ARIA expanded attribute unless the value is one of the defined ARIA values (true/false).

Test: platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html

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

LayoutTests:

* platform/mac/accessibility/aria-expanded-not-exposed-when-undefined-expected.txt: Added.
* platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (154495 => 154496)


--- trunk/LayoutTests/ChangeLog	2013-08-23 17:20:47 UTC (rev 154495)
+++ trunk/LayoutTests/ChangeLog	2013-08-23 17:24:52 UTC (rev 154496)
@@ -1,3 +1,12 @@
+2013-08-23  Chris Fleizach  <[email protected]>
+
+        <https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as aria-expanded="false" (AXExpanded = NO)
+
+        Reviewed by Darin Adler.
+
+        * platform/mac/accessibility/aria-expanded-not-exposed-when-undefined-expected.txt: Added.
+        * platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html: Added.
+
 2013-08-23  Allan Sandfeld Jensen  <[email protected]>
 
         Moving expectations from Qt 5.0 WK2 to Qt WK2 - Part 7

Added: trunk/LayoutTests/platform/mac/accessibility/aria-expanded-not-exposed-when-undefined-expected.txt (0 => 154496)


--- trunk/LayoutTests/platform/mac/accessibility/aria-expanded-not-exposed-when-undefined-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-expanded-not-exposed-when-undefined-expected.txt	2013-08-23 17:24:52 UTC (rev 154496)
@@ -0,0 +1,14 @@
+This tests that AXExpanded is only exposed when aria-expanded is used with a supported value.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+aria-expanded=true - AXExpanded is exposed: true
+aria-expanded=false - AXExpanded is exposed: true
+aria-expanded=asdfasdf - AXExpanded is NOT exposed: true
+aria-expanded='' - AXExpanded is NOT exposed: true
+aria-expanded is not present - AXExpanded is NOT exposed: true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html (0 => 154496)


--- trunk/LayoutTests/platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html	2013-08-23 17:24:52 UTC (rev 154496)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="content">
+
+<div id="test1" role="tabpanel" aria-expanded="true">Test 1</div>
+<div id="test2" role="tabpanel" aria-expanded="false">Test 2</div>
+<div id="test3" role="tabpanel" aria-expanded="asdfasdf">Test 3</div>
+<div id="test4" role="tabpanel" aria-expanded="">Test 4</div>
+<div id="test5" role="tabpanel">Test 5</div>
+
+</div>
+
+<div id="console"></div>
+
+<script>
+
+    function elementSupportsExpanded(elementId) {
+        return accessibilityController.accessibleElementById(elementId).isAttributeSupported("AXExpanded");
+    }
+
+    description("This tests that AXExpanded is only exposed when aria-expanded is used with a supported value.");
+
+    if (window.accessibilityController) {
+
+          debug("aria-expanded=true - AXExpanded is exposed: " + elementSupportsExpanded("test1"));
+          debug("aria-expanded=false - AXExpanded is exposed: " + elementSupportsExpanded("test2"));
+          debug("aria-expanded=asdfasdf - AXExpanded is NOT exposed: " + !elementSupportsExpanded("test3"));
+          debug("aria-expanded='' - AXExpanded is NOT exposed: " + !elementSupportsExpanded("test4"));
+          debug("aria-expanded is not present - AXExpanded is NOT exposed: " + !elementSupportsExpanded("test5"));
+    }
+
+    document.getElementById("content").style.visibility = "hidden";
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (154495 => 154496)


--- trunk/Source/WebCore/ChangeLog	2013-08-23 17:20:47 UTC (rev 154495)
+++ trunk/Source/WebCore/ChangeLog	2013-08-23 17:24:52 UTC (rev 154496)
@@ -1,3 +1,16 @@
+2013-08-23  Chris Fleizach  <[email protected]>
+
+        <https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as aria-expanded="false" (AXExpanded = NO)
+
+        Reviewed by Darin Adler.
+
+        Don't support the ARIA expanded attribute unless the value is one of the defined ARIA values (true/false).
+
+        Test: platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::supportsARIAExpanded):
+
 2013-08-17  Darin Adler  <[email protected]>
 
         <https://webkit.org/b/119945> Some cleanup for PasteboardIOS

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (154495 => 154496)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2013-08-23 17:20:47 UTC (rev 154495)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2013-08-23 17:24:52 UTC (rev 154496)
@@ -1648,7 +1648,9 @@
     
 bool AccessibilityObject::supportsARIAExpanded() const
 {
-    return !getAttribute(aria_expandedAttr).isEmpty();
+    // Undefined values should not result in this attribute being exposed to ATs according to ARIA.
+    const AtomicString& expanded = getAttribute(aria_expandedAttr);
+    return equalIgnoringCase(expanded, "true") || equalIgnoringCase(expanded, "false");
 }
     
 bool AccessibilityObject::isExpanded() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to