<!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>[191931] 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/191931">191931</a></dd>
<dt>Author</dt> <dd>n_wang@apple.com</dd>
<dt>Date</dt> <dd>2015-11-02 17:52:38 -0800 (Mon, 02 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Add support for ARIA 1.1 attribute 'aria-modal' for dialog and alertdialog
https://bugs.webkit.org/show_bug.cgi?id=138566

Reviewed by Chris Fleizach.

Source/WebCore:

Added support for aria-modal attribute on dialog/alertdialog roles.
When modal dialog is displayed, all other contents will be unaccessible.

Tests: accessibility/aria-modal-multiple-dialogs.html
       accessibility/aria-modal.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::AXObjectCache):
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::AXObjectCache::findAriaModalNodes):
(WebCore::AXObjectCache::updateCurrentAriaModalNode):
(WebCore::AXObjectCache::isNodeVisible):
(WebCore::AXObjectCache::ariaModalNode):
(WebCore::AXObjectCache::focusedImageMapUIElement):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::handleAriaModalChange):
(WebCore::AXObjectCache::labelChanged):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::handleActiveDescendantChanged):
(WebCore::AXObjectCache::handleAriaExpandedChange):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::handleAriaModalChange):
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
(WebCore::AXObjectCache::handleScrollbarUpdate):
(WebCore::AXObjectCache::handleAttributeChanged):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaCurrentState):
(WebCore::AccessibilityObject::isAriaModalDescendant):
(WebCore::AccessibilityObject::ignoredFromARIAModalPresence):
(WebCore::AccessibilityObject::hasTagName):
(WebCore::AccessibilityObject::defaultObjectInclusion):
* accessibility/AccessibilityObject.h:
* html/HTMLAttributeNames.in:

LayoutTests:

* accessibility/aria-modal-expected.txt: Added.
* accessibility/aria-modal-multiple-dialogs-expected.txt: Added.
* accessibility/aria-modal-multiple-dialogs.html: Added.
* accessibility/aria-modal.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCacheh">trunk/Source/WebCore/accessibility/AXObjectCache.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAttributeNamesin">trunk/Source/WebCore/html/HTMLAttributeNames.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilityariamodalexpectedtxt">trunk/LayoutTests/accessibility/aria-modal-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariamodalmultipledialogsexpectedtxt">trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariamodalmultipledialogshtml">trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariamodalhtml">trunk/LayoutTests/accessibility/aria-modal.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/LayoutTests/ChangeLog        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-11-02  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: Add support for ARIA 1.1 attribute 'aria-modal' for dialog and alertdialog
+        https://bugs.webkit.org/show_bug.cgi?id=138566
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/aria-modal-expected.txt: Added.
+        * accessibility/aria-modal-multiple-dialogs-expected.txt: Added.
+        * accessibility/aria-modal-multiple-dialogs.html: Added.
+        * accessibility/aria-modal.html: Added.
+
</ins><span class="cx"> 2015-11-02  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: IBDObjectStore.delete() support.
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariamodalexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/aria-modal-expected.txt (0 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-modal-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/aria-modal-expected.txt        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+This tests that aria-modal on dialog makes other elements inert.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS backgroundAccessible() is false
+PASS backgroundAccessible() is true
+PASS backgroundAccessible() is false
+PASS okBtn.isIgnored is false
+PASS backgroundAccessible() is true
+PASS backgroundAccessible() is true
+PASS backgroundAccessible() is false
+PASS backgroundAccessible() is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Other page content with a dummy focusable element
+
+Display a dialog
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariamodalmultipledialogsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs-expected.txt (0 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs-expected.txt        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+This tests that aria-modal works correctly on multiple dialogs
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS backgroundAccessible() is true
+PASS backgroundAccessible() is false
+PASS dialog1Accessible() is true
+PASS backgroundAccessible() is false
+PASS dialog1Accessible() is false
+PASS closeBtn.isIgnored is false
+PASS backgroundAccessible() is false
+PASS dialog1Accessible() is true
+PASS backgroundAccessible() is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Other page content with a dummy focusable element
+
+Display a dialog
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariamodalmultipledialogshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs.html (0 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/aria-modal-multiple-dialogs.html        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;style&gt;
+.box-hidden {
+    display: none;
+}
+&lt;/style&gt;
+
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div id=&quot;bg&quot;&gt;
+&lt;p id=&quot;bgContent&quot;&gt;Other page content with &lt;a href=&quot;#&quot;&gt;a dummy focusable element&lt;/a&gt;&lt;/p&gt;
+&lt;p&gt;&lt;a onclick=&quot;toggleDialog(document.getElementById('box'),'show'); return false;&quot; href=&quot;#&quot; role=&quot;button&quot; id=&quot;displayBtn&quot;&gt;Display a dialog&lt;/a&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;div role=&quot;dialog&quot; aria-labelledby=&quot;myDialog&quot; id=&quot;box&quot; class=&quot;box-hidden&quot; tabindex=&quot;-1&quot;&gt;
+    &lt;h3 id=&quot;myDialog&quot;&gt;Just an example.&lt;/h3&gt;
+    &lt;button id=&quot;ok&quot; onclick=&quot;toggleDialog(document.getElementById('box'),'hide');&quot; class=&quot;close-button&quot;&gt;OK&lt;/button&gt;
+    &lt;button onclick=&quot;toggleDialog(document.getElementById('box2'),'show');&quot; id=&quot;new&quot;&gt;New&lt;/button&gt;
+&lt;/div&gt;
+
+&lt;div role=&quot;dialog&quot; aria-labelledby=&quot;myDialog2&quot; id=&quot;box2&quot; class=&quot;box-hidden&quot; tabindex=&quot;-1&quot;&gt;
+    &lt;h3 id=&quot;myDialog2&quot;&gt;Another dialog.&lt;/h3&gt;
+    &lt;button id=&quot;close&quot; onclick=&quot;toggleDialog(document.getElementById('box2'),'hide');&quot; class=&quot;close-button&quot;&gt;Close&lt;/button&gt;
+&lt;/div&gt;
+
+
+&lt;script&gt;
+
+    description(&quot;This tests that aria-modal works correctly on multiple dialogs&quot;);
+
+    if (window.accessibilityController) {
+        // Background should be accessible after loading.
+        shouldBeTrue(&quot;backgroundAccessible()&quot;);
+        
+        // Click the display button, dialog1 shows and background becomes unaccessible.
+        document.getElementById(&quot;displayBtn&quot;).click();
+        shouldBeFalse(&quot;backgroundAccessible()&quot;);
+        shouldBeTrue(&quot;dialog1Accessible()&quot;);
+        
+        // Click the new button, dialog2 shows and background/dialog1 should both be unaccessible.
+        document.getElementById(&quot;new&quot;).click();
+        shouldBeFalse(&quot;backgroundAccessible()&quot;);
+        shouldBeFalse(&quot;dialog1Accessible()&quot;);
+        var closeBtn = accessibilityController.accessibleElementById(&quot;close&quot;);
+        shouldBeFalse(&quot;closeBtn.isIgnored&quot;);
+        
+        // Close dialog2, dialog1 should become accessible but not the background
+        document.getElementById(&quot;close&quot;).click();
+        shouldBeFalse(&quot;backgroundAccessible()&quot;);
+        shouldBeTrue(&quot;dialog1Accessible()&quot;);
+        
+        // Close dialog1, background should be accessible.
+        document.getElementById(&quot;ok&quot;).click();
+        shouldBeTrue(&quot;backgroundAccessible()&quot;);
+    }
+    
+    function backgroundAccessible() {
+        var displayBtn = accessibilityController.accessibleElementById(&quot;displayBtn&quot;);
+        var bgContent = accessibilityController.accessibleElementById(&quot;bgContent&quot;);
+        if (!displayBtn || !bgContent)
+            return false;
+        return !displayBtn.isIgnored &amp;&amp; !bgContent.isIgnored;
+    }
+    
+    function dialog1Accessible() {
+         var okBtn = accessibilityController.accessibleElementById(&quot;ok&quot;);
+         var newBtn = accessibilityController.accessibleElementById(&quot;new&quot;);
+         if (!okBtn || !newBtn)
+             return false;
+         return !okBtn.isIgnored &amp;&amp; !newBtn.isIgnored;
+    }
+    
+    function toggleDialog(dialog, sh) {
+    if (sh == &quot;show&quot;) {
+        // show the dialog 
+        dialog.style.display = 'block';
+        dialog.setAttribute(&quot;aria-modal&quot;, &quot;true&quot;);
+    } else {
+        dialog.style.display = 'none';
+        dialog.setAttribute(&quot;aria-modal&quot;, &quot;false&quot;); 
+    }
+}
+
+&lt;/script&gt;
+
+
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariamodalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/aria-modal.html (0 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-modal.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/aria-modal.html        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div id=&quot;bg&quot;&gt;
+&lt;p id=&quot;bgContent&quot;&gt;Other page content with &lt;a href=&quot;#&quot;&gt;a dummy focusable element&lt;/a&gt;&lt;/p&gt;
+&lt;p&gt;&lt;a onclick=&quot;toggleDialog('show'); return false;&quot; href=&quot;#&quot; role=&quot;button&quot; id=&quot;displayBtn&quot;&gt;Display a dialog&lt;/a&gt;&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;div role=&quot;dialog&quot; aria-modal=&quot;true&quot; aria-labelledby=&quot;myDialog&quot; id=&quot;box&quot; class=&quot;box-hidden&quot; tabindex=&quot;-1&quot;&gt;
+    &lt;h3 id=&quot;myDialog&quot;&gt;Just an example.&lt;/h3&gt;
+    &lt;button id=&quot;ok&quot; onclick=&quot;toggleDialog('hide');&quot; class=&quot;close-button&quot;&gt;OK&lt;/button&gt;
+    &lt;button onclick=&quot;toggleDialog('hide');&quot; class=&quot;close-button&quot;&gt;Cancel&lt;/button&gt;
+&lt;/div&gt;
+
+
+&lt;script&gt;
+
+    description(&quot;This tests that aria-modal on dialog makes other elements inert.&quot;);
+
+    if (window.accessibilityController) {
+        // Background should be unaccessible after loading, since the 
+        // dialog is displayed and aria-modal=true.
+        shouldBeFalse(&quot;backgroundAccessible()&quot;);
+        
+        // Close the dialog, background should be accessible.
+        document.getElementById(&quot;ok&quot;).click();
+        shouldBeTrue(&quot;backgroundAccessible()&quot;);
+        
+        // Click the display button, dialog shows and background becomes unaccessible.
+        document.getElementById(&quot;displayBtn&quot;).click();
+        shouldBeFalse(&quot;backgroundAccessible()&quot;);
+        var okBtn = accessibilityController.accessibleElementById(&quot;ok&quot;);
+        shouldBeFalse(&quot;okBtn.isIgnored&quot;);
+        
+        // Test the case that aria-modal=true when dialog is hidden won't affect other objects.
+        // 1. Dialog not rendered
+        document.getElementById(&quot;ok&quot;).click();
+        document.getElementById(&quot;box&quot;).setAttribute(&quot;aria-modal&quot;, &quot;true&quot;);
+        shouldBeTrue(&quot;backgroundAccessible()&quot;);
+        // 2. Dialog is aria hidden
+        document.getElementById(&quot;displayBtn&quot;).click();
+        document.getElementById(&quot;box&quot;).setAttribute(&quot;aria-hidden&quot;, &quot;true&quot;);
+        shouldBeTrue(&quot;backgroundAccessible()&quot;);
+        document.getElementById(&quot;box&quot;).setAttribute(&quot;aria-hidden&quot;, &quot;false&quot;);
+        shouldBeFalse(&quot;backgroundAccessible()&quot;);
+        
+        // Test modal dialog is removed from DOM tree.
+        var dialog = document.getElementById(&quot;box&quot;);
+        dialog.parentNode.removeChild(dialog);
+        shouldBeTrue(&quot;backgroundAccessible()&quot;);
+    }
+    
+    function backgroundAccessible() {
+        var displayBtn = accessibilityController.accessibleElementById(&quot;displayBtn&quot;);
+        var bgContent = accessibilityController.accessibleElementById(&quot;bgContent&quot;);
+        
+        if (!displayBtn || !bgContent)
+            return false;
+        
+        return !displayBtn.isIgnored &amp;&amp; !bgContent.isIgnored;
+    }
+    
+    function toggleDialog(sh) {
+        dialog = document.getElementById(&quot;box&quot;);
+    if (sh == &quot;show&quot;) {
+        // show the dialog 
+        dialog.style.display = 'block';
+        dialog.setAttribute(&quot;aria-modal&quot;, &quot;true&quot;);
+    } else {
+        dialog.style.display = 'none';
+        dialog.setAttribute(&quot;aria-modal&quot;, &quot;false&quot;); 
+    }
+}
+
+&lt;/script&gt;
+
+
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/Source/WebCore/ChangeLog        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2015-11-02  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: Add support for ARIA 1.1 attribute 'aria-modal' for dialog and alertdialog
+        https://bugs.webkit.org/show_bug.cgi?id=138566
+
+        Reviewed by Chris Fleizach.
+
+        Added support for aria-modal attribute on dialog/alertdialog roles.
+        When modal dialog is displayed, all other contents will be unaccessible.
+
+        Tests: accessibility/aria-modal-multiple-dialogs.html
+               accessibility/aria-modal.html
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::AXObjectCache):
+        (WebCore::AXObjectCache::~AXObjectCache):
+        (WebCore::AXObjectCache::findAriaModalNodes):
+        (WebCore::AXObjectCache::updateCurrentAriaModalNode):
+        (WebCore::AXObjectCache::isNodeVisible):
+        (WebCore::AXObjectCache::ariaModalNode):
+        (WebCore::AXObjectCache::focusedImageMapUIElement):
+        (WebCore::AXObjectCache::remove):
+        (WebCore::AXObjectCache::handleAttributeChanged):
+        (WebCore::AXObjectCache::handleAriaModalChange):
+        (WebCore::AXObjectCache::labelChanged):
+        * accessibility/AXObjectCache.h:
+        (WebCore::AXObjectCache::handleActiveDescendantChanged):
+        (WebCore::AXObjectCache::handleAriaExpandedChange):
+        (WebCore::AXObjectCache::handleAriaRoleChanged):
+        (WebCore::AXObjectCache::handleAriaModalChange):
+        (WebCore::AXObjectCache::handleFocusedUIElementChanged):
+        (WebCore::AXObjectCache::handleScrollbarUpdate):
+        (WebCore::AXObjectCache::handleAttributeChanged):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::ariaCurrentState):
+        (WebCore::AccessibilityObject::isAriaModalDescendant):
+        (WebCore::AccessibilityObject::ignoredFromARIAModalPresence):
+        (WebCore::AccessibilityObject::hasTagName):
+        (WebCore::AccessibilityObject::defaultObjectInclusion):
+        * accessibility/AccessibilityObject.h:
+        * html/HTMLAttributeNames.in:
+
</ins><span class="cx"> 2015-11-02  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: IBDObjectStore.delete() support.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -142,7 +142,9 @@
</span><span class="cx">     , m_notificationPostTimer(*this, &amp;AXObjectCache::notificationPostTimerFired)
</span><span class="cx">     , m_passwordNotificationPostTimer(*this, &amp;AXObjectCache::passwordNotificationPostTimerFired)
</span><span class="cx">     , m_liveRegionChangedPostTimer(*this, &amp;AXObjectCache::liveRegionChangedNotificationPostTimerFired)
</span><ins>+    , m_currentAriaModalNode(nullptr)
</ins><span class="cx"> {
</span><ins>+    findAriaModalNodes();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AXObjectCache::~AXObjectCache()
</span><span class="lines">@@ -157,6 +159,91 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AXObjectCache::findAriaModalNodes()
+{
+    // Traverse the DOM tree to look for the aria-modal=true nodes.
+    for (Element* element = ElementTraversal::firstWithin(document().rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
+        
+        // Must have dialog or alertdialog role
+        if (!nodeHasRole(element, &quot;dialog&quot;) &amp;&amp; !nodeHasRole(element, &quot;alertdialog&quot;))
+            continue;
+        if (!equalIgnoringCase(element-&gt;fastGetAttribute(aria_modalAttr), &quot;true&quot;))
+            continue;
+        
+        m_ariaModalNodesSet.add(element);
+    }
+    
+    // Set the current valid aria-modal node if possible.
+    updateCurrentAriaModalNode();
+}
+
+void AXObjectCache::updateCurrentAriaModalNode()
+{
+    // There might be multiple nodes with aria-modal=true set.
+    // We use this function to pick the one we want.
+    m_currentAriaModalNode = nullptr;
+    if (m_ariaModalNodesSet.isEmpty())
+        return;
+    
+    // We only care about the nodes which are visible.
+    ListHashSet&lt;RefPtr&lt;Node&gt;&gt; visibleNodes;
+    for (auto&amp; object : m_ariaModalNodesSet) {
+        if (isNodeVisible(object))
+            visibleNodes.add(object);
+    }
+    
+    if (visibleNodes.isEmpty())
+        return;
+    
+    // If any of the node are keyboard focused, we want to pick that.
+    Node* focusedNode = document().focusedElement();
+    for (auto&amp; object : visibleNodes) {
+        if (focusedNode != nullptr &amp;&amp; focusedNode-&gt;isDescendantOf(object.get())) {
+            m_currentAriaModalNode = object.get();
+            break;
+        }
+    }
+    
+    // If none of the nodes are focused, we want to pick the last dialog in the DOM.
+    if (!m_currentAriaModalNode)
+        m_currentAriaModalNode = visibleNodes.last().get();
+}
+
+bool AXObjectCache::isNodeVisible(Node* node) const
+{
+    if (!is&lt;Element&gt;(node))
+        return false;
+    
+    RenderObject* renderer = node-&gt;renderer();
+    if (!renderer)
+        return false;
+    const RenderStyle&amp; style = renderer-&gt;style();
+    if (style.display() == NONE || style.visibility() != VISIBLE)
+        return false;
+    
+    // We also need to consider aria hidden status.
+    if (!isNodeAriaVisible(node))
+        return false;
+    
+    return true;
+}
+
+Node* AXObjectCache::ariaModalNode()
+{
+    // This function returns the valid aria modal node.
+    if (m_ariaModalNodesSet.isEmpty())
+        return nullptr;
+    
+    // Check the current valid aria modal node first.
+    // Usually when one dialog sets aria-modal=true, that dialog is the one we want.
+    if (isNodeVisible(m_currentAriaModalNode))
+        return m_currentAriaModalNode;
+    
+    // Recompute the valid aria modal node when m_currentAriaModalNode is null or hidden.
+    updateCurrentAriaModalNode();
+    return isNodeVisible(m_currentAriaModalNode) ? m_currentAriaModalNode : nullptr;
+}
+
</ins><span class="cx"> AccessibilityObject* AXObjectCache::focusedImageMapUIElement(HTMLAreaElement* areaElement)
</span><span class="cx"> {
</span><span class="cx">     // Find the corresponding accessibility object for the HTMLAreaElement. This should be
</span><span class="lines">@@ -571,6 +658,12 @@
</span><span class="cx">     remove(axID);
</span><span class="cx">     m_nodeObjectMapping.remove(node);
</span><span class="cx"> 
</span><ins>+    // Cleanup for aria modal nodes.
+    if (m_currentAriaModalNode == node)
+        m_currentAriaModalNode = nullptr;
+    if (m_ariaModalNodesSet.contains(node))
+        m_ariaModalNodesSet.remove(node);
+    
</ins><span class="cx">     if (node-&gt;renderer()) {
</span><span class="cx">         remove(node-&gt;renderer());
</span><span class="cx">         return;
</span><span class="lines">@@ -1248,10 +1341,34 @@
</span><span class="cx">         childrenChanged(element-&gt;parentNode(), element);
</span><span class="cx">     else if (attrName == aria_invalidAttr)
</span><span class="cx">         postNotification(element, AXObjectCache::AXInvalidStatusChanged);
</span><ins>+    else if (attrName == aria_modalAttr)
+        handleAriaModalChange(element);
</ins><span class="cx">     else
</span><span class="cx">         postNotification(element, AXObjectCache::AXAriaAttributeChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AXObjectCache::handleAriaModalChange(Node* node)
+{
+    if (!is&lt;Element&gt;(node))
+        return;
+    
+    if (!nodeHasRole(node, &quot;dialog&quot;) &amp;&amp; !nodeHasRole(node, &quot;alertdialog&quot;))
+        return;
+    
+    stopCachingComputedObjectAttributes();
+    if (equalIgnoringCase(downcast&lt;Element&gt;(*node).fastGetAttribute(aria_modalAttr), &quot;true&quot;)) {
+        // Add the newly modified node to the modal nodes set, and set it to be the current valid aria modal node.
+        // We will recompute the current valid aria modal node in ariaModalNode() when this node is not visible.
+        m_ariaModalNodesSet.add(node);
+        m_currentAriaModalNode = node;
+    } else {
+        // Remove the node from the modal nodes set. There might be other visible modal nodes, so we recompute here.
+        m_ariaModalNodesSet.remove(node);
+        updateCurrentAriaModalNode();
+    }
+    startCachingComputedObjectAttributesUntilTreeMutates();
+}
+
</ins><span class="cx"> void AXObjectCache::labelChanged(Element* element)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(is&lt;HTMLLabelElement&gt;(*element));
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.h        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -128,6 +128,9 @@
</span><span class="cx">     void handleScrolledToAnchor(const Node* anchorNode);
</span><span class="cx">     void handleAriaExpandedChange(Node*);
</span><span class="cx">     void handleScrollbarUpdate(ScrollView*);
</span><ins>+    
+    void handleAriaModalChange(Node*);
+    Node* ariaModalNode();
</ins><span class="cx"> 
</span><span class="cx">     void handleAttributeChanged(const QualifiedName&amp; attrName, Element*);
</span><span class="cx">     void recomputeIsIgnored(RenderObject* renderer);
</span><span class="lines">@@ -271,6 +274,11 @@
</span><span class="cx">     void handleMenuOpened(Node*);
</span><span class="cx">     void handleLiveRegionCreated(Node*);
</span><span class="cx">     void handleMenuItemSelected(Node*);
</span><ins>+    
+    // aria-modal related
+    void findAriaModalNodes();
+    void updateCurrentAriaModalNode();
+    bool isNodeVisible(Node*) const;
</ins><span class="cx"> 
</span><span class="cx">     Document&amp; m_document;
</span><span class="cx">     HashMap&lt;AXID, RefPtr&lt;AccessibilityObject&gt;&gt; m_objects;
</span><span class="lines">@@ -293,6 +301,9 @@
</span><span class="cx">     
</span><span class="cx">     Timer m_liveRegionChangedPostTimer;
</span><span class="cx">     ListHashSet&lt;RefPtr&lt;AccessibilityObject&gt;&gt; m_liveRegionObjectsSet;
</span><ins>+    
+    Node* m_currentAriaModalNode;
+    ListHashSet&lt;Node*&gt; m_ariaModalNodesSet;
</ins><span class="cx"> 
</span><span class="cx">     AXTextStateChangeIntent m_textSelectionIntent;
</span><span class="cx">     bool m_isSynchronizingSelection { false };
</span><span class="lines">@@ -348,6 +359,7 @@
</span><span class="cx"> inline void AXObjectCache::handleActiveDescendantChanged(Node*) { }
</span><span class="cx"> inline void AXObjectCache::handleAriaExpandedChange(Node*) { }
</span><span class="cx"> inline void AXObjectCache::handleAriaRoleChanged(Node*) { }
</span><ins>+inline void AXObjectCache::handleAriaModalChange(Node*) { }
</ins><span class="cx"> inline void AXObjectCache::handleFocusedUIElementChanged(Node*, Node*) { }
</span><span class="cx"> inline void AXObjectCache::handleScrollbarUpdate(ScrollView*) { }
</span><span class="cx"> inline void AXObjectCache::handleAttributeChanged(const QualifiedName&amp;, Element*) { }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;AccessibilityTable.h&quot;
</span><span class="cx"> #include &quot;DOMTokenList.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><ins>+#include &quot;ElementIterator.h&quot;
</ins><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;FocusController.h&quot;
</span><span class="lines">@@ -1846,6 +1847,45 @@
</span><span class="cx">     return ARIACurrentTrue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AccessibilityObject::isAriaModalDescendant(Node* ariaModalNode) const
+{
+    if (!ariaModalNode || !this-&gt;element())
+        return false;
+    
+    if (this-&gt;element() == ariaModalNode)
+        return true;
+    
+    // ARIA 1.1 aria-modal, indicates whether an element is modal when displayed.
+    // For the decendants of the modal object, they should also be considered as aria-modal=true.
+    for (auto&amp; ancestor : elementAncestors(this-&gt;element())) {
+        if (&amp;ancestor == ariaModalNode)
+            return true;
+    }
+    return false;
+}
+
+bool AccessibilityObject::ignoredFromARIAModalPresence() const
+{
+    // We shouldn't ignore the top node.
+    if (!node() || !node()-&gt;parentNode())
+        return false;
+    
+    AXObjectCache* cache = axObjectCache();
+    if (!cache)
+        return false;
+    
+    // ariaModalNode is the current displayed modal dialog.
+    Node* ariaModalNode = cache-&gt;ariaModalNode();
+    if (!ariaModalNode)
+        return false;
+    
+    // We only want to ignore the objects within the same frame as the modal dialog.
+    if (ariaModalNode-&gt;document().frame() != this-&gt;frame())
+        return false;
+    
+    return !isAriaModalDescendant(ariaModalNode);
+}
+
</ins><span class="cx"> bool AccessibilityObject::hasTagName(const QualifiedName&amp; tagName) const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><span class="lines">@@ -2786,6 +2826,9 @@
</span><span class="cx">     if (isARIAHidden())
</span><span class="cx">         return IgnoreObject;
</span><span class="cx">     
</span><ins>+    if (ignoredFromARIAModalPresence())
+        return IgnoreObject;
+    
</ins><span class="cx">     if (isPresentationalChildOfAriaRole())
</span><span class="cx">         return IgnoreObject;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -631,6 +631,10 @@
</span><span class="cx">     const AtomicString&amp; roleDescription() const;
</span><span class="cx">     AccessibilityARIACurrentState ariaCurrentState() const;
</span><span class="cx">     
</span><ins>+    // This function checks if the object should be ignored when there's a modal dialog displayed.
+    bool ignoredFromARIAModalPresence() const;
+    bool isAriaModalDescendant(Node*) const;
+    
</ins><span class="cx">     bool supportsARIASetSize() const;
</span><span class="cx">     bool supportsARIAPosInSet() const;
</span><span class="cx">     int ariaSetSize() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAttributeNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAttributeNames.in (191930 => 191931)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAttributeNames.in        2015-11-03 01:19:17 UTC (rev 191930)
+++ trunk/Source/WebCore/html/HTMLAttributeNames.in        2015-11-03 01:52:38 UTC (rev 191931)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> aria-labelledby
</span><span class="cx"> aria-level
</span><span class="cx"> aria-live
</span><ins>+aria-modal
</ins><span class="cx"> aria-multiline
</span><span class="cx"> aria-multiselectable
</span><span class="cx"> aria-orientation
</span></span></pre>
</div>
</div>

</body>
</html>