<!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>[187606] branches/safari-601.1-branch</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/187606">187606</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-07-30 14:20:34 -0700 (Thu, 30 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/187278">r187278</a>. rdar://problem/19908029</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6011branchLayoutTestsChangeLog">branches/safari-601.1-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationsalwayssentexpectedtxt">branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationsalwayssenthtml">branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent.html</a></li>
<li><a href="#branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationsexpectedtxt">branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationshtml">branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications.html</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreChangeLog">branches/safari-601.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreaccessibilityAXObjectCachecpp">branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreaccessibilityAXObjectCacheh">branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.h</a></li>
<li><a href="#branchessafari6011branchSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6011branchLayoutTestsplatformmacaccessibilityariamultipleliveregionsnotificationexpectedtxt">branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification-expected.txt</a></li>
<li><a href="#branchessafari6011branchLayoutTestsplatformmacaccessibilityariamultipleliveregionsnotificationhtml">branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6011branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/ChangeLog        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2015-07-30 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r187278. rdar://problem/19908029
+
+ 2015-07-23 Nan Wang <n_wang@apple.com>
+
+ AX: AccessibilityNodeObject::childrenChanged() generates too many AXLiveRegionChanged notifications
+ https://bugs.webkit.org/show_bug.cgi?id=147211
+ <rdar://problem/19908029>
+
+ Reviewed by Chris Fleizach.
+
+ * platform/mac/accessibility/aria-liveregions-notifications-always-sent-expected.txt:
+ * platform/mac/accessibility/aria-liveregions-notifications-always-sent.html:
+ * platform/mac/accessibility/aria-liveregions-notifications-expected.txt:
+ * platform/mac/accessibility/aria-liveregions-notifications.html:
+ * platform/mac/accessibility/aria-multiple-liveregions-notification-expected.txt: Added.
+ * platform/mac/accessibility/aria-multiple-liveregions-notification.html: Added.
+
+2015-07-30 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r187504. rdar://problem/21915355
</span><span class="cx">
</span><span class="cx"> 2015-07-28 Said Abou-Hallawa <sabouhallawa@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationsalwayssentexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent-expected.txt (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent-expected.txt        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent-expected.txt        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> PASS addedNotification is true
</span><ins>+PASS liveRegionChangeCount == 3 is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationsalwayssenthtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent.html (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent.html        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-always-sent.html        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -13,23 +13,18 @@
</span><span class="cx"> <div id="console"></div>
</span><span class="cx">
</span><span class="cx"> <script>
</span><ins>+ var jsTestIsAsync = true;
</ins><span class="cx">
</span><span class="cx"> description("This tests that ARIA live region notifications are sent even when an assistive technology is not accessing them directly on each update.");
</span><span class="cx">
</span><span class="cx"> if (window.accessibilityController) {
</span><del>- window.testRunner.waitUntilDone();
</del><span class="cx">
</span><del>- document.getElementById("liveregion").focus();
- liveRegion = window.accessibilityController.focusedElement;
</del><ins>+ liveRegion = accessibilityController.accessibleElementById("liveregion");
</ins><span class="cx">
</span><span class="cx"> var liveRegionChangeCount = 0;
</span><span class="cx"> function ariaCallback(notification) {
</span><span class="cx"> if (notification == "AXLiveRegionChanged") {
</span><span class="cx"> liveRegionChangeCount++;
</span><del>- if (liveRegionChangeCount == 3) {
- liveRegion.removeNotificationListener();
- window.testRunner.notifyDone();
- }
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> var addedNotification = liveRegion.addNotificationListener(ariaCallback);
</span><span class="lines">@@ -37,11 +32,33 @@
</span><span class="cx">
</span><span class="cx"> // this should trigger our live region callback for a new element.
</span><span class="cx"> for (var k = 0; k < 3; k++) {
</span><del>- var textNode = document.createTextNode("test" + k);
- document.getElementById("liveregion").appendChild(textNode);
</del><ins>+ // AXLiveRegionsChanged notifications are sent after a delay, so in order to ensure we
+ // get an notification for each operation we should avoid coalescing which can occur
+ doSetTimeout(k);
</ins><span class="cx"> }
</span><ins>+
+ // add a short delay to check after all the operations if we have exactly three notificaitons
+ setTimeout("finishTest()", 200);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ function doSetTimeout(k) {
+ setTimeout(function() {
+ operation(k);
+ }, k * 30);
+ }
+
+ function operation(k) {
+ var textNode = document.createTextNode("test" + k);
+ document.getElementById("liveregion").appendChild(textNode);
+ }
+
+ function finishTest() {
+ // We should get a total of three live region changes.
+ liveRegion.removeNotificationListener();
+ shouldBeTrue("liveRegionChangeCount == 3");
+ finishJSTest();
+ }
+
</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="branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationsexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-expected.txt (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-expected.txt        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications-expected.txt        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> PASS addedNotification is true
</span><ins>+PASS liveRegionChangeCount == 4 is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="branchessafari6011branchLayoutTestsplatformmacaccessibilityarialiveregionsnotificationshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications.html (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications.html        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-liveregions-notifications.html        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -14,6 +14,7 @@
</span><span class="cx"> <div id="console"></div>
</span><span class="cx">
</span><span class="cx"> <script>
</span><ins>+ var jsTestIsAsync = true;
</ins><span class="cx">
</span><span class="cx"> description("This tests that ARIA live regions are sending out the correct notifications. We perform four operations (add, remove, change text, change alt tag), each one should trigger a live region notification");
</span><span class="cx">
</span><span class="lines">@@ -22,41 +23,58 @@
</span><span class="cx"> function ariaCallback(notification) {
</span><span class="cx"> if (notification == "AXLiveRegionChanged") {
</span><span class="cx"> liveRegionChangeCount++;
</span><del>-
- // We should get a total of 4 live region changes.
- if (liveRegionChangeCount == 4) {
- liveRegion.removeNotificationListener();
- window.testRunner.notifyDone();
- }
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (window.accessibilityController) {
</span><del>- window.testRunner.waitUntilDone();
</del><span class="cx">
</span><del>- document.getElementById("liveregion").focus();
- liveRegion = window.accessibilityController.focusedElement;
</del><ins>+ liveRegion = accessibilityController.accessibleElementById("liveregion");
</ins><span class="cx">
</span><span class="cx"> var addedNotification = liveRegion.addNotificationListener(ariaCallback);
</span><span class="cx"> shouldBe("addedNotification", "true");
</span><span class="cx">
</span><ins>+ // AXLiveRegionsChanged notifications are sent after a delay, so in order to ensure we
+ // get an notification for each operation we should avoid coalescing which can occur
+ setTimeout("textChangeOperation()", 0);
+ setTimeout("newElementOperation()", 30);
+ setTimeout("alternativeChangeOperation()", 60);
+ setTimeout("removeElementOperation()", 90);
+
+ // add a short delay to check after all the operations if we have exactly four notificaitons
+ setTimeout("finishTest()", 200);
+ }
+
+ function textChangeOperation() {
</ins><span class="cx"> // this should trigger our live region callback for a text change.
</span><del>- document.getElementById("innerlive").innerText = "changed text";
</del><ins>+ document.getElementById("liveregion").childNodes[0].innerText = "changed text";
+ }
</ins><span class="cx">
</span><ins>+ function newElementOperation() {
</ins><span class="cx"> // this should trigger our live region callback for a new element.
</span><span class="cx"> document.getElementById("liveregion").innerHTML += "new text element";
</span><ins>+ }
</ins><span class="cx">
</span><ins>+ function alternativeChangeOperation() {
</ins><span class="cx"> // this should also trigger our live region change because its a text alternative change.
</span><span class="cx"> document.getElementById("image").setAttribute('alt', "new image text");
</span><span class="cx">
</span><span class="cx"> // Access the accessibility tree here because AX won't post the live region change
</span><span class="cx"> // notification twice when the children have already been marked as dirty.
</span><span class="cx"> liveRegion.childAtIndex(0);
</span><ins>+ }
</ins><span class="cx">
</span><ins>+ function removeElementOperation() {
</ins><span class="cx"> // this should trigger our live region callback for a removed element.
</span><span class="cx"> document.getElementById("liveregion").removeChild(document.getElementById("innerlive"));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ function finishTest() {
+ // We should get a total of four live region changes.
+ liveRegion.removeNotificationListener();
+ shouldBeTrue("liveRegionChangeCount == 4");
+ finishJSTest();
+ }
+
</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="branchessafari6011branchLayoutTestsplatformmacaccessibilityariamultipleliveregionsnotificationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification-expected.txt (0 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification-expected.txt         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification-expected.txt        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+changed text
+
+new text element
+This tests that ARIA live regions are sending out the correct notifications. We perform two operations to each aria region, at the end it should trigger two live region notifications
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS addedNotification1 is true
+PASS addedNotification2 is true
+PASS liveRegionChangeCount == 2 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari6011branchLayoutTestsplatformmacaccessibilityariamultipleliveregionsnotificationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification.html (0 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification.html         (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/platform/mac/accessibility/aria-multiple-liveregions-notification.html        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div role="group" tabindex=0 id="liveregion1" aria-live="polite" aria-relevant="additions">
+<h3 id="innerlive">text</h3>
+</div>
+
+<div role="group" tabindex=0 id="liveregion2" aria-live="polite" aria-relevant="additions">
+<img src="test.gif" width=100 height=100 alt="alt text" tabindex=0 id="image">
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+ var jsTestIsAsync = true;
+
+ description("This tests that ARIA live regions are sending out the correct notifications. We perform two operations to each aria region, at the end it should trigger two live region notifications");
+
+ var liveRegion1 = 0;
+ var liveRegion2 = 0;
+ var liveRegionChangeCount = 0;
+ function ariaCallback(notification) {
+ if (notification == "AXLiveRegionChanged") {
+ liveRegionChangeCount++;
+ }
+ }
+
+ if (window.accessibilityController) {
+
+ liveRegion1 = accessibilityController.accessibleElementById("liveregion1");
+ var addedNotification1 = liveRegion1.addNotificationListener(ariaCallback);
+ shouldBe("addedNotification1", "true");
+
+ liveRegion2 = accessibilityController.accessibleElementById("liveregion2");
+ var addedNotification2 = liveRegion2.addNotificationListener(ariaCallback);
+ shouldBe("addedNotification2", "true");
+
+ // perform operations on both live regions.
+ textChangeOperation();
+ newElementOperation();
+ alternativeChangeOperation();
+ removeElementOperation();
+
+ // add a short delay to check after all the operations if we have exactly two notificaitons
+ setTimeout("finishTest()", 10);
+ }
+
+ function textChangeOperation() {
+ // this should trigger a live region change for a text change.
+ document.getElementById("innerlive").innerText = "changed text";
+ }
+
+ function newElementOperation() {
+ // this should trigger a live region change for a new element.
+ document.getElementById("liveregion1").innerHTML += "new text element";
+ }
+
+ function alternativeChangeOperation() {
+ // this should also trigger a live region change because its a text alternative change.
+ document.getElementById("image").setAttribute('alt', "new image text");
+ }
+
+ function removeElementOperation() {
+ // this should trigger a live region change for a removed element.
+ document.getElementById("liveregion2").removeChild(document.getElementById("image"));
+ }
+
+ function finishTest() {
+ // We should get a total of two live region changes.
+ liveRegion1.removeNotificationListener();
+ liveRegion2.removeNotificationListener();
+ shouldBeTrue("liveRegionChangeCount == 2");
+ finishJSTest();
+ }
+</script>
+
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2015-07-30 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><ins>+ Merge r187278. rdar://problem/19908029
+
+ 2015-07-23 Nan Wang <n_wang@apple.com>
+
+ AX: AccessibilityNodeObject::childrenChanged() generates too many AXLiveRegionChanged notifications
+ https://bugs.webkit.org/show_bug.cgi?id=147211
+ <rdar://problem/19908029>
+
+ Reviewed by Chris Fleizach.
+
+ AccessibilityNodeObject::childrenChanged() can be called repeatedly, generating a live region
+ change notification each time. Sometimes, so many happen that VoiceOver hangs. We can use a timer
+ to make sure that we coalesce these notifications.
+
+ Test: platform/mac/accessibility/aria-multiple-liveregions-notification.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXComputedObjectAttributeCache::getIgnored):
+ (WebCore::AXObjectCache::AXObjectCache):
+ (WebCore::AXObjectCache::~AXObjectCache):
+ (WebCore::AXObjectCache::frameLoadingEventNotification):
+ (WebCore::AXObjectCache::postLiveRegionChangeNotification):
+ (WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
+ (WebCore::AXObjectCache::handleScrollbarUpdate):
+ * accessibility/AXObjectCache.h:
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::childrenChanged):
+
+2015-07-30 Matthew Hanson <matthew_hanson@apple.com>
+
</ins><span class="cx"> Merge r187504. rdar://problem/21915355
</span><span class="cx">
</span><span class="cx"> 2015-07-28 Said Abou-Hallawa <sabouhallawa@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.cpp (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.cpp        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.cpp        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">
</span><span class="cx"> // Post value change notifications for password fields or elements contained in password fields at a 40hz interval to thwart analysis of typing cadence
</span><span class="cx"> static double AccessibilityPasswordValueChangeNotificationInterval = 0.025;
</span><ins>+static double AccessibilityLiveRegionChangedNotificationInterval = 0.020;
</ins><span class="cx">
</span><span class="cx"> AccessibilityObjectInclusion AXComputedObjectAttributeCache::getIgnored(AXID id) const
</span><span class="cx"> {
</span><span class="lines">@@ -132,12 +133,14 @@
</span><span class="cx"> : m_document(document)
</span><span class="cx"> , m_notificationPostTimer(*this, &AXObjectCache::notificationPostTimerFired)
</span><span class="cx"> , m_passwordNotificationPostTimer(*this, &AXObjectCache::passwordNotificationPostTimerFired)
</span><ins>+ , m_liveRegionChangedPostTimer(*this, &AXObjectCache::liveRegionChangedNotificationPostTimerFired)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> AXObjectCache::~AXObjectCache()
</span><span class="cx"> {
</span><span class="cx"> m_notificationPostTimer.stop();
</span><ins>+ m_liveRegionChangedPostTimer.stop();
</ins><span class="cx">
</span><span class="cx"> for (const auto& object : m_objects.values()) {
</span><span class="cx"> detachWrapper(object.get(), CacheDestroyed);
</span><span class="lines">@@ -1144,6 +1147,29 @@
</span><span class="cx"> frameLoadingEventPlatformNotification(obj, loadingEvent);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void AXObjectCache::postLiveRegionChangeNotification(AccessibilityObject* object)
+{
+ if (m_liveRegionChangedPostTimer.isActive())
+ m_liveRegionChangedPostTimer.stop();
+
+ if (!m_liveRegionObjectsSet.contains(object))
+ m_liveRegionObjectsSet.add(object);
+
+ m_liveRegionChangedPostTimer.startOneShot(AccessibilityLiveRegionChangedNotificationInterval);
+}
+
+void AXObjectCache::liveRegionChangedNotificationPostTimerFired()
+{
+ m_liveRegionChangedPostTimer.stop();
+
+ if (m_liveRegionObjectsSet.isEmpty())
+ return;
+
+ for (auto& object : m_liveRegionObjectsSet)
+ postNotification(object.get(), object->document(), AXObjectCache::AXLiveRegionChanged);
+ m_liveRegionObjectsSet.clear();
+}
+
</ins><span class="cx"> void AXObjectCache::handleScrollbarUpdate(ScrollView* view)
</span><span class="cx"> {
</span><span class="cx"> if (!view)
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreaccessibilityAXObjectCacheh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.h (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.h        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/Source/WebCore/accessibility/AXObjectCache.h        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -206,6 +206,7 @@
</span><span class="cx"> void postTextReplacementNotification(Node*, AXTextEditType deletionType, const String& deletedText, AXTextEditType insertionType, const String& insertedText, const VisiblePosition&);
</span><span class="cx"> void postTextStateChangeNotification(Node*, const AXTextStateChangeIntent&, const VisibleSelection&);
</span><span class="cx"> void postTextStateChangeNotification(const Position&, const AXTextStateChangeIntent&, const VisibleSelection&);
</span><ins>+ void postLiveRegionChangeNotification(AccessibilityObject*);
</ins><span class="cx">
</span><span class="cx"> enum AXLoadingEvent {
</span><span class="cx"> AXLoadingStarted,
</span><span class="lines">@@ -260,6 +261,8 @@
</span><span class="cx">
</span><span class="cx"> void notificationPostTimerFired();
</span><span class="cx">
</span><ins>+ void liveRegionChangedNotificationPostTimerFired();
+
</ins><span class="cx"> void postTextStateChangeNotification(AccessibilityObject*, const AXTextStateChangeIntent&, const VisibleSelection&);
</span><span class="cx">
</span><span class="cx"> bool enqueuePasswordValueChangeNotification(AccessibilityObject*);
</span><span class="lines">@@ -287,6 +290,9 @@
</span><span class="cx"> Timer m_passwordNotificationPostTimer;
</span><span class="cx">
</span><span class="cx"> ListHashSet<RefPtr<AccessibilityObject>> m_passwordNotificationsToPost;
</span><ins>+
+ Timer m_liveRegionChangedPostTimer;
+ ListHashSet<RefPtr<AccessibilityObject>> m_liveRegionObjectsSet;
</ins><span class="cx">
</span><span class="cx"> AXTextStateChangeIntent m_textSelectionIntent;
</span><span class="cx"> bool m_isSynchronizingSelection { false };
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (187605 => 187606)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2015-07-30 20:57:36 UTC (rev 187605)
+++ branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2015-07-30 21:20:34 UTC (rev 187606)
</span><span class="lines">@@ -152,8 +152,11 @@
</span><span class="cx"> // In other words, they need to be sent even when the screen reader has not accessed this live region since the last update.
</span><span class="cx">
</span><span class="cx"> // If this element supports ARIA live regions, then notify the AT of changes.
</span><ins>+ // Sometimes this function can be called many times within a short period of time, leading to posting too many AXLiveRegionChanged
+ // notifications. To fix this, we used a timer to make sure we only post one notification for the children changes within a pre-defined
+ // time interval.
</ins><span class="cx"> if (parent->supportsARIALiveRegion())
</span><del>- cache->postNotification(parent, parent->document(), AXObjectCache::AXLiveRegionChanged);
</del><ins>+ cache->postLiveRegionChangeNotification(parent);
</ins><span class="cx">
</span><span class="cx"> // If this element is an ARIA text control, notify the AT of changes.
</span><span class="cx"> if ((parent->isARIATextControl() || parent->hasContentEditableAttributeSet()) && !parent->isNativeTextControl())
</span></span></pre>
</div>
</div>
</body>
</html>