<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[184890] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/184890">184890</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2015-05-26 17:53:00 -0700 (Tue, 26 May 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>AX: display:none content exposed to accessibility when aria-hidden is toggled on ancestor element
https://bugs.webkit.org/show_bug.cgi?id=139142
Reviewed by Darin Adler.
Source/WebCore:
Amend the code that determines when an invisible, but aria-hidden=false, element is exposed to accessibility.
The new guideline is that you must have aria-hidden=false on every node that is not rendered (except text which inherits)
otherwise the element will not be visible.
Modified existing test: accessibility/aria-hidden-false-works-in-subtrees.html
* accessibility/AXObjectCache.cpp:
(WebCore::isNodeAriaVisible):
(WebCore::AXObjectCache::rootWebArea):
LayoutTests:
* accessibility/aria-hidden-false-works-in-subtrees.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariahiddenfalseworksinsubtreeshtml">trunk/LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (184889 => 184890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-05-27 00:18:58 UTC (rev 184889)
+++ trunk/LayoutTests/ChangeLog        2015-05-27 00:53:00 UTC (rev 184890)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2015-05-26 Chris Fleizach <cfleizach@apple.com>
+
+ AX: display:none content exposed to accessibility when aria-hidden is toggled on ancestor element
+ https://bugs.webkit.org/show_bug.cgi?id=139142
+
+ Reviewed by Darin Adler.
+
+ * accessibility/aria-hidden-false-works-in-subtrees.html:
+
</ins><span class="cx"> 2015-05-26 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Overhanging float sets are not cleaned up properly when floating renderer is destroyed.
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariahiddenfalseworksinsubtreeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html (184889 => 184890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html        2015-05-27 00:18:58 UTC (rev 184889)
+++ trunk/LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html        2015-05-27 00:53:00 UTC (rev 184890)
</span><span class="lines">@@ -5,20 +5,59 @@
</span><span class="cx"> </head>
</span><span class="cx"> <body id="body">
</span><span class="cx">
</span><ins>+<div id="content">
+
</ins><span class="cx"> <div hidden aria-hidden="false" aria-label="group0">
</span><span class="cx"> <div aria-hidden="true" aria-label="group1">
</span><span class="cx"> ignore me
</span><span class="cx"> </div>
</span><del>- <div role="group" aria-label="group2">
- <div role="button" aria-label="button1">button</div>
</del><ins>+ <div aria-hidden="false" role="group" aria-label="group2">
+ <div aria-hidden="false" role="button" aria-label="button1">button</div>
</ins><span class="cx"> don't ignore me
</span><span class="cx"> </div>
</span><span class="cx"> </div>
</span><span class="cx">
</span><ins>+<!-- The text node should be visible because it inherits from the parent -->
+<div id="group3" hidden aria-hidden="false">
+text3
+</div>
+
+<!-- The text node should be visible because it inherits from the parent, and all parents need aria-hidden=false -->
+<div id="group4" hidden aria-hidden="false">
+ <div role="group" hidden aria-hidden="false">
+ text4
+ </div>
+</div>
+
+<!-- The text node should NOT be visible because it inherits from the parent, and all parents need aria-hidden=false -->
+<div id="group5" role="group">
+ <div hidden>
+ <div role="group" hidden aria-hidden="false">
+ text5
+ </div>
+ </div>
+</div>
+
+<!-- The button inside should NOT be visible because it is not marked as aria-hidden -->
+<div id="group6" hidden aria-hidden="false">
+ <div aria-hidden="false">
+ <button>button</button>
+ </div>
+</div>
+
+<!-- The button inside should be visible because it is marked as aria-hidden and all its parents are too -->
+<div id="group7" hidden aria-hidden="false">
+ <div aria-hidden="false">
+ <button aria-hidden="false">button</button>
+ </div>
+</div>
+
</ins><span class="cx"> <div id="iframe">
</span><span class="cx"> <iframe onload="testiFrameContent();" aria-hidden="false" src="resources/cake.png">hidden content</iframe>
</span><span class="cx"> </div>
</span><span class="cx">
</span><ins>+</div>
+
</ins><span class="cx"> <p id="description"></p>
</span><span class="cx"> <div id="console"></div>
</span><span class="cx">
</span><span class="lines">@@ -34,6 +73,8 @@
</span><span class="cx"> iframeChild = iframe.childAtIndex(0);
</span><span class="cx"> debug("iFrame child role: " + iframeChild.role);
</span><span class="cx">
</span><ins>+ document.getElementById("content").style.visibility = "hidden";
+
</ins><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -53,10 +94,37 @@
</span><span class="cx"> if (window.accessibilityController) {
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="cx">
</span><del>- var root = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0);
</del><ins>+ var root = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0);
</ins><span class="cx"> dumpAccessibilityChildren(root, 0);
</span><del>-}
</del><span class="cx">
</span><ins>+ // Text inside aria-hidden=false inherits from parent.
+ var object = accessibilityController.accessibleElementById("group3").childAtIndex(0);
+ shouldBe("object.role", "'AXRole: AXStaticText'");
+ var stringValue = object.stringValue.replace(/\n/g, '');
+ shouldBe("stringValue", "'AXValue: text3'");
+
+ // Text inside nested aria-hidden=false inherits from parent.
+ object = accessibilityController.accessibleElementById("group4").childAtIndex(0).childAtIndex(0);
+ shouldBe("object.role", "'AXRole: AXStaticText'");
+ stringValue = object.stringValue.replace(/\n/g, '');
+ shouldBe("stringValue", "'AXValue: text4 '");
+
+ // When not all the parents have aria-hidden=false, element should not be visible.
+ object = accessibilityController.accessibleElementById("group5").childAtIndex(0);
+ shouldBeTrue("!object || !object.isValid");
+
+ // Objects that don't have aria-hidden=false are not visible when the parents have that attribute.
+ object = accessibilityController.accessibleElementById("group6").childAtIndex(0);
+ shouldBe("object.role", "'AXRole: AXGroup'");
+ shouldBe("object.childrenCount", "0");
+
+ // When all objects have aria-hidden=false, then the elements are visible.
+ object = accessibilityController.accessibleElementById("group7").childAtIndex(0);
+ shouldBe("object.role", "'AXRole: AXGroup'");
+ shouldBe("object.childrenCount", "1");
+ shouldBe("object.childAtIndex(0).role", "'AXRole: AXButton'");
+ }
+
</ins><span class="cx"> </script>
</span><span class="cx">
</span><span class="cx"> <script src="../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184889 => 184890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-05-27 00:18:58 UTC (rev 184889)
+++ trunk/Source/WebCore/ChangeLog        2015-05-27 00:53:00 UTC (rev 184890)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-05-26 Chris Fleizach <cfleizach@apple.com>
+
+ AX: display:none content exposed to accessibility when aria-hidden is toggled on ancestor element
+ https://bugs.webkit.org/show_bug.cgi?id=139142
+
+ Reviewed by Darin Adler.
+
+ Amend the code that determines when an invisible, but aria-hidden=false, element is exposed to accessibility.
+
+ The new guideline is that you must have aria-hidden=false on every node that is not rendered (except text which inherits)
+ otherwise the element will not be visible.
+
+ Modified existing test: accessibility/aria-hidden-false-works-in-subtrees.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::isNodeAriaVisible):
+ (WebCore::AXObjectCache::rootWebArea):
+
</ins><span class="cx"> 2015-05-26 Roger Fong <roger_fong@apple.com>
</span><span class="cx">
</span><span class="cx"> Enable element unsigned index in WebGL2 again.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (184889 => 184890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-05-27 00:18:58 UTC (rev 184889)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-05-27 00:53:00 UTC (rev 184890)
</span><span class="lines">@@ -1300,20 +1300,30 @@
</span><span class="cx"> {
</span><span class="cx"> if (!node)
</span><span class="cx"> return false;
</span><del>-
- // To determine if a node is ARIA visible, we need to check the parent hierarchy to see if anyone specifies
- // aria-hidden explicitly.
</del><ins>+
+ // ARIA Node visibility is controlled by aria-hidden
+ // 1) if aria-hidden=true, the whole subtree is hidden
+ // 2) if aria-hidden=false, and the object is rendered, there's no effect
+ // 3) if aria-hidden=false, and the object is NOT rendered, then it must have
+ // aria-hidden=false on each parent until it gets to a rendered object
+ // 3b) a text node inherits a parents aria-hidden value
+ bool requiresAriaHiddenFalse = !node->renderer();
+ bool ariaHiddenFalsePresent = false;
</ins><span class="cx"> for (Node* testNode = node; testNode; testNode = testNode->parentNode()) {
</span><span class="cx"> if (is<Element>(*testNode)) {
</span><span class="cx"> const AtomicString& ariaHiddenValue = downcast<Element>(*testNode).fastGetAttribute(aria_hiddenAttr);
</span><del>- if (equalIgnoringCase(ariaHiddenValue, "false"))
- return true;
</del><span class="cx"> if (equalIgnoringCase(ariaHiddenValue, "true"))
</span><span class="cx"> return false;
</span><ins>+
+ bool ariaHiddenFalse = equalIgnoringCase(ariaHiddenValue, "false");
+ if (!testNode->renderer() && !ariaHiddenFalse)
+ return false;
+ if (!ariaHiddenFalsePresent && ariaHiddenFalse)
+ ariaHiddenFalsePresent = true;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return false;
</del><ins>+ return !requiresAriaHiddenFalse || ariaHiddenFalsePresent;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> AccessibilityObject* AXObjectCache::rootWebArea()
</span></span></pre>
</div>
</div>
</body>
</html>