Commit d67d4c4e authored by cfleizach@apple.com's avatar cfleizach@apple.com
Browse files

<https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as...

<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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c13a747c
2013-08-23 Chris Fleizach <cfleizach@apple.com>
<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 <allan.jensen@digia.com>
 
Moving expectations from Qt 5.0 WK2 to Qt WK2 - Part 7
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
</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="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2013-08-23 Chris Fleizach <cfleizach@apple.com>
<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 <darin@apple.com>
 
<https://webkit.org/b/119945> Some cleanup for PasteboardIOS
......@@ -1648,7 +1648,9 @@ int AccessibilityObject::ariaPosInSet() const
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment