<!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>[170806] trunk/LayoutTests</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/170806">170806</a></dd>
<dt>Author</dt> <dd>mario.prada@samsung.com</dd>
<dt>Date</dt> <dd>2014-07-04 08:31:57 -0700 (Fri, 04 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>buildAccessibilityTree() needs to be removed from individual layout tests
https://bugs.webkit.org/show_bug.cgi?id=95286

Reviewed by Chris Fleizach.

Extracted two functions to 'dump' and 'touch' the accessibility
hierarchies out of different layout tests and into a single file,
living in LayoutTests/resources/accessibility-helper.js

* resources/accessibility-helper.js: Added.
(dumpAccessibilityTree): New, based on buildAccessibilityTree()
for the cases where it was used to actually 'dump' it into the output.
(touchAccessibilityTree): Same, but for the cases where we don't
want to dump the accessibility tree, just to make sure is generated.

Updated affected layout tests to use the newly added helper functions.

* accessibility/adjacent-continuations-cause-assertion-failure.html: Updated.
* accessibility/children-changed-sends-notification.html: Ditto.
* accessibility/deleting-iframe-destroys-axcache.html: Ditto.
* accessibility/div-within-anchors-causes-crash.html: Ditto.
* accessibility/first-letter-text-transform-causes-crash.html: Ditto.
* accessibility/image-map-update-parent-crash.html: Ditto.
* accessibility/table-with-empty-thead-causes-crash.html: Ditto.
* platform/efl/accessibility/media-emits-object-replacement.html: Ditto.
* platform/gtk/accessibility/entry-and-password.html: Ditto.
* platform/gtk/accessibility/media-emits-object-replacement.html: Ditto.
* platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: Ditto.

Updated Mac specific expectations not to print the &quot;End of test&quot; element.

* platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
* platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Ditto.
* platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt: Ditto.
* platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt: Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilityadjacentcontinuationscauseassertionfailurehtml">trunk/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitychildrenchangedsendsnotificationexpectedtxt">trunk/LayoutTests/accessibility/children-changed-sends-notification-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitychildrenchangedsendsnotificationhtml">trunk/LayoutTests/accessibility/children-changed-sends-notification.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitydeletingiframedestroysaxcachehtml">trunk/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitydivwithinanchorscausescrashhtml">trunk/LayoutTests/accessibility/div-within-anchors-causes-crash.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilityfirstlettertexttransformcausescrashhtml">trunk/LayoutTests/accessibility/first-letter-text-transform-causes-crash.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilityimagemapupdateparentcrashhtml">trunk/LayoutTests/accessibility/image-map-update-parent-crash.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytablewithemptytheadcausescrashhtml">trunk/LayoutTests/accessibility/table-with-empty-thead-causes-crash.html</a></li>
<li><a href="#trunkLayoutTestsplatformeflaccessibilitymediaemitsobjectreplacementhtml">trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtkaccessibilityentryandpasswordhtml">trunk/LayoutTests/platform/gtk/accessibility/entry-and-password.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtkaccessibilitymediaemitsobjectreplacementhtml">trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtkaccessibilityreplacedobjectsinanonymousblockshtml">trunk/LayoutTests/platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityadjacentcontinuationscauseassertionfailureexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitydeletingiframedestroysaxcacheexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitydivwithinanchorscausescrashexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2accessibilitydeletingiframedestroysaxcacheexpectedtxt">trunk/LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsresourcesaccessibilityhelperjs">trunk/LayoutTests/resources/accessibility-helper.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/ChangeLog        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-07-04  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
+
+        buildAccessibilityTree() needs to be removed from individual layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=95286
+
+        Reviewed by Chris Fleizach.
+
+        Extracted two functions to 'dump' and 'touch' the accessibility
+        hierarchies out of different layout tests and into a single file,
+        living in LayoutTests/resources/accessibility-helper.js
+
+        * resources/accessibility-helper.js: Added.
+        (dumpAccessibilityTree): New, based on buildAccessibilityTree()
+        for the cases where it was used to actually 'dump' it into the output.
+        (touchAccessibilityTree): Same, but for the cases where we don't
+        want to dump the accessibility tree, just to make sure is generated.
+
+        Updated affected layout tests to use the newly added helper functions.
+
+        * accessibility/adjacent-continuations-cause-assertion-failure.html: Updated.
+        * accessibility/children-changed-sends-notification.html: Ditto.
+        * accessibility/deleting-iframe-destroys-axcache.html: Ditto.
+        * accessibility/div-within-anchors-causes-crash.html: Ditto.
+        * accessibility/first-letter-text-transform-causes-crash.html: Ditto.
+        * accessibility/image-map-update-parent-crash.html: Ditto.
+        * accessibility/table-with-empty-thead-causes-crash.html: Ditto.
+        * platform/efl/accessibility/media-emits-object-replacement.html: Ditto.
+        * platform/gtk/accessibility/entry-and-password.html: Ditto.
+        * platform/gtk/accessibility/media-emits-object-replacement.html: Ditto.
+        * platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: Ditto.
+
+        Updated Mac specific expectations not to print the &quot;End of test&quot; element.
+
+        * platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
+        * platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Ditto.
+        * platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt: Ditto.
+        * platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt: Ditto.
+
</ins><span class="cx"> 2014-07-04  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r159345): Lines are clipped between pages when printing web content from Safari
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityadjacentcontinuationscauseassertionfailurehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/adjacent-continuations-cause-assertion-failure.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,36 +1,14 @@
</span><span class="cx"> &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt;
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = &quot;&quot;;
-        for (var i = 0; i &lt; indent; i++)
-            str += &quot;    &quot;;
-        str += accessibilityObject.role;
-        str += &quot; &quot; + accessibilityObject.stringValue;
-        str += &quot;\n&quot;;
-        document.getElementById(&quot;tree&quot;).innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-&lt;/script&gt;
</del><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;span&gt;&lt;div&gt;&lt;/div&gt;&lt;/span&gt;&lt;span&gt;x&lt;div&gt;y&lt;/div&gt;z&lt;/span&gt;
</span><span class="cx"> 
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><ins>+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
</span><span class="cx"> &lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</span><span class="lines">@@ -41,8 +19,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         // Build the accessibility tree up until 'End of test' is encountered.
</span><ins>+        window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;)
+
</ins><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
</del><ins>+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitychildrenchangedsendsnotificationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/children-changed-sends-notification-expected.txt (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/children-changed-sends-notification-expected.txt        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/children-changed-sends-notification-expected.txt        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -5,7 +5,6 @@
</span><span class="cx"> 
</span><span class="cx"> Plain text paragraph 
</span><span class="cx"> 
</span><del>-End of test
</del><span class="cx"> PARAGRAPH notification: AXChildrenAdded
</span><span class="cx"> GLOBAL notification: AXChildrenAdded on element with role AXRole: AXParagraph
</span><span class="cx"> PARAGRAPH notification: AXChildrenRemoved
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitychildrenchangedsendsnotificationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/children-changed-sends-notification.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/children-changed-sends-notification.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/children-changed-sends-notification.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,12 +1,12 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
</span><span class="cx"> &lt;p id=&quot;paragraph&quot;&gt;Plain text paragraph &lt;a id=&quot;testLink&quot; href=&quot;#&quot;&gt;with a link at the end&lt;/a&gt;&lt;/p&gt;
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -15,19 +15,6 @@
</span><span class="cx"> 
</span><span class="cx"> description(&quot;This test ensures that a notification is being emitted when children are added or removed for an accessibility object&quot;);
</span><span class="cx"> 
</span><del>-function touchAccessibilityTree(accessibilityObject) {
-    if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-        return false;
-
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i &lt; count; ++i) {
-        if (!touchAccessibilityTree(accessibilityObject.childAtIndex(i)))
-            return false;
-    }
-
-    return true;
-}
-
</del><span class="cx"> function runTest() {
</span><span class="cx">     window.paragraphNotificationCount = 0;
</span><span class="cx">     window.globalNotificationCount = 0;
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitydeletingiframedestroysaxcachehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,42 +1,19 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><del>-
-  &lt;script&gt;
</del><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
</ins><span class="cx">     if (window.testRunner)
</span><span class="cx">         testRunner.waitUntilDone();
</span><span class="cx"> 
</span><del>-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = &quot;&quot;;
-        for (var i = 0; i &lt; indent; i++)
-            str += &quot;    &quot;;
-        str += accessibilityObject.role;
-        str += &quot; &quot; + accessibilityObject.stringValue;
-
-        if (accessibilityObject.role == '')
-            str += accessibilityObject.allAttributes();
-
-        str += &quot;\n&quot;;
-        document.getElementById(&quot;console&quot;).innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-
</del><span class="cx">     function runTest()
</span><span class="cx">     {
</span><span class="cx">         description(&quot;This tests that deleting an iframe doesn't cause the accessibility cache to be destroyed and recreated.&quot;);
</span><span class="cx"> 
</span><span class="cx">         if (window.accessibilityController) {
</span><span class="cx">             window.root = accessibilityController.rootElement;
</span><ins>+            window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+
</ins><span class="cx">             window.body = root.childAtIndex(0);
</span><span class="cx">             window.before = body.childAtIndex(0);
</span><span class="cx">             window.iframe = body.childAtIndex(1).childAtIndex(0);
</span><span class="lines">@@ -49,8 +26,8 @@
</span><span class="cx">             window.frameButton = window.frameGroup.childAtIndex(0);
</span><span class="cx">             window.frameButtonRole = window.frameButton.role;
</span><span class="cx"> 
</span><del>-            document.getElementById(&quot;console&quot;).innerText += &quot;\nBefore:\n&quot;;
-            buildAccessibilityTree(root, 0);
</del><ins>+            document.getElementById(&quot;tree&quot;).innerText += &quot;\nBefore:\n&quot;;
+            dumpAccessibilityTree(root, stopElement, 0, true);
</ins><span class="cx"> 
</span><span class="cx">             // Remove the iframe.
</span><span class="cx">             document.body.removeChild(document.getElementById(&quot;iframe&quot;));
</span><span class="lines">@@ -60,9 +37,9 @@
</span><span class="cx">             window.newBefore = newBody.childAtIndex(0);
</span><span class="cx">             window.newAfter = newBody.childAtIndex(1);
</span><span class="cx"> 
</span><del>-            document.getElementById(&quot;console&quot;).innerText += &quot;\nAfter:\n&quot;;
-            buildAccessibilityTree(newRoot, 0);
-            document.getElementById(&quot;console&quot;).innerText += &quot;\n&quot;;
</del><ins>+            document.getElementById(&quot;tree&quot;).innerText += &quot;\nAfter:\n&quot;;
+            dumpAccessibilityTree(newRoot, stopElement, 0, true);
+            document.getElementById(&quot;tree&quot;).innerText += &quot;\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">             // Make sure that the accessibility objects from the iframe's nodes
</span><span class="cx">             // are now invalid by checking that their role is changed - this
</span><span class="lines">@@ -97,9 +74,10 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;p&gt;After&lt;/p&gt;
</span><span class="cx"> 
</span><del>-&lt;p&gt;End of test&lt;/p&gt;
</del><ins>+&lt;p id=&quot;stopElement&quot;&gt;End of test&lt;/p&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
</span><ins>+&lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</ins><span class="cx"> &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitydivwithinanchorscausescrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/div-within-anchors-causes-crash.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/div-within-anchors-causes-crash.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/div-within-anchors-causes-crash.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,30 +1,8 @@
</span><span class="cx"> &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt; 
</span><span class="cx"> &lt;html&gt; 
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt; 
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = &quot;&quot;;
-        for (var i = 0; i &lt; indent; i++)
-            str += &quot;    &quot;;
-        str += accessibilityObject.role;
-        str += &quot; &quot; + accessibilityObject.stringValue;
-        str += &quot;\n&quot;;
-        document.getElementById(&quot;tree&quot;).innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-&lt;/script&gt; 
</del><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt; 
</span><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt; 
</span><span class="cx"> &lt;body&gt; 
</span><span class="cx">  
</span><span class="lines">@@ -34,7 +12,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;a href=&quot;about:blank&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/a&gt; 
</span><span class="cx"> 
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><ins>+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</span><span class="cx">  
</span><span class="lines">@@ -46,17 +24,19 @@
</span><span class="cx">  
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         // First build up full accessibility tree.
</span><ins>+        window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+
</ins><span class="cx">         document.getElementById(&quot;tree&quot;).innerText += &quot;Before:\n&quot;;
</span><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
-        
</del><ins>+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
+
</ins><span class="cx">         // Remove anchor that causes debug assert in AccessibilityRenderObject::addChildren
</span><span class="cx">         document.body.removeChild(document.body.children[2])
</span><span class="cx">         
</span><span class="cx">         // Build up full accessibility tree again.
</span><span class="cx">         document.getElementById(&quot;tree&quot;).innerText += &quot;After:\n&quot;;
</span><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
</del><ins>+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
</ins><span class="cx">     }
</span><span class="cx">  
</span><span class="cx"> &lt;/script&gt; 
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityfirstlettertexttransformcausescrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/first-letter-text-transform-causes-crash.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/first-letter-text-transform-causes-crash.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/first-letter-text-transform-causes-crash.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -4,15 +4,8 @@
</span><span class="cx"> &lt;style&gt;
</span><span class="cx">        dt:first-letter{text-transform:uppercase;}
</span><span class="cx"> &lt;/style&gt;
</span><del>-&lt;script&gt;
-
-    function buildAccessibilityTree(accessibilityObject) {
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i)
-            buildAccessibilityTree(accessibilityObject.childAtIndex(i));
-    }
-&lt;/script&gt;
</del><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -30,7 +23,7 @@
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         // Build up full accessibility tree.
</span><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement);
</del><ins>+        touchAccessibilityTree(accessibilityController.focusedElement);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityimagemapupdateparentcrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/image-map-update-parent-crash.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/image-map-update-parent-crash.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/image-map-update-parent-crash.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,34 +1,24 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><del>-
</del><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx"> 
</span><span class="cx"> if (window.testRunner)
</span><span class="cx">   testRunner.waitUntilDone();
</span><span class="cx"> 
</span><del>-function buildAccessibilityTree(accessibilityObject, indent) {
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i &lt; count; ++i) {
-         if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-            return false;
-    }
-
-    return true;
-}
-
</del><span class="cx"> function runAXTest() {
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">    description(&quot;This tests that an image map's hold on it's parent will be cleared if the parent goes away.&quot;);
</span><span class="cx"> 
</span><span class="cx">    // First access all children using AX
</span><del>-   buildAccessibilityTree(accessibilityController.rootElement, 0);
</del><ins>+   touchAccessibilityTree(accessibilityController.rootElement);
</ins><span class="cx"> 
</span><span class="cx">    var child = document.getElementById('img'); child.parentNode.removeChild(child);
</span><del>- 
</del><ins>+
</ins><span class="cx">    // Now verify we haven't crashed.
</span><del>-   buildAccessibilityTree(accessibilityController.rootElement, 0);
</del><ins>+   touchAccessibilityTree(accessibilityController.rootElement);
</ins><span class="cx"> 
</span><span class="cx">    if (window.testRunner)
</span><span class="cx">        testRunner.notifyDone();
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytablewithemptytheadcausescrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/table-with-empty-thead-causes-crash.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/table-with-empty-thead-causes-crash.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/accessibility/table-with-empty-thead-causes-crash.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,17 +1,8 @@
</span><span class="cx"> &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt;
-
-    function buildAccessibilityTree(accessibilityObject) {
-        accessibilityObject.isEnabled
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i)
-            buildAccessibilityTree(accessibilityObject.childAtIndex(i));
-    }
-&lt;/script&gt;
</del><span class="cx"> &lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -29,7 +20,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement);
</del><ins>+        touchAccessibilityTree(accessibilityController.focusedElement);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflaccessibilitymediaemitsobjectreplacementhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/efl/accessibility/media-emits-object-replacement.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,29 +1,8 @@
</span><span class="cx"> &lt;!DOCTYPE HTML&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt;
-function buildAccessibilityTree(accessibilityObject, indent) {
-    var str = &quot;&quot;;
-    for (var i = 0; i &lt; indent; i++)
-        str += &quot;    &quot;;
-    str += accessibilityObject.role;
-    str += &quot; &quot; + accessibilityObject.stringValue;
-    str += &quot;\n&quot;;
-    document.getElementById(&quot;tree&quot;).innerText += str;
-
-    if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-        return false;
-
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i &lt; count; ++i) {
-        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-            return false;
-    }
-
-    return true;
-}
-&lt;/script&gt;
</del><span class="cx"> &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../../../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -39,7 +18,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><ins>+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -51,8 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> if (window.accessibilityController) {
</span><span class="cx">     // Build the accessibility tree up until 'End of test' is encountered.
</span><ins>+    window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+
</ins><span class="cx">     document.body.focus();
</span><del>-    buildAccessibilityTree(accessibilityController.focusedElement, 0);
</del><ins>+    dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
</ins><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkaccessibilityentryandpasswordhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/accessibility/entry-and-password.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/accessibility/entry-and-password.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/gtk/accessibility/entry-and-password.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,30 +1,8 @@
</span><span class="cx"> &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt; 
</span><span class="cx"> &lt;html&gt; 
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt; 
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = &quot;&quot;;
-        for (var i = 0; i &lt; indent; i++)
-            str += &quot;    &quot;;
-        str += accessibilityObject.role;
-        str += &quot; &quot; + accessibilityObject.stringValue;
-        str += &quot;\n&quot;;
-        document.getElementById(&quot;tree&quot;).innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-&lt;/script&gt; 
</del><span class="cx"> &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt; 
</span><ins>+&lt;script src=&quot;../../../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt; 
</span><span class="cx"> &lt;body&gt; 
</span><span class="cx">  
</span><span class="lines">@@ -33,7 +11,7 @@
</span><span class="cx"> &lt;input type='password' name='passwordEntry' value='123' /&gt;
</span><span class="cx"> &lt;/form&gt;
</span><span class="cx"> 
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><ins>+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</span><span class="cx">  
</span><span class="lines">@@ -45,8 +23,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         // Build the accessibility tree up until 'End of test' is encountered.
</span><ins>+        window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+
</ins><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
</del><ins>+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkaccessibilitymediaemitsobjectreplacementhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/gtk/accessibility/media-emits-object-replacement.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,29 +1,8 @@
</span><span class="cx"> &lt;!DOCTYPE HTML&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt;
-function buildAccessibilityTree(accessibilityObject, indent) {
-    var str = &quot;&quot;;
-    for (var i = 0; i &lt; indent; i++)
-        str += &quot;    &quot;;
-    str += accessibilityObject.role;
-    str += &quot; &quot; + accessibilityObject.stringValue;
-    str += &quot;\n&quot;;
-    document.getElementById(&quot;tree&quot;).innerText += str;
-
-    if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-        return false;
-
-    var count = accessibilityObject.childrenCount;
-    for (var i = 0; i &lt; count; ++i) {
-        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-            return false;
-    }
-
-    return true;
-}
-&lt;/script&gt;
</del><span class="cx"> &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><ins>+&lt;script src=&quot;../../../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -39,7 +18,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><ins>+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -51,8 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> if (window.accessibilityController) {
</span><span class="cx">     // Build the accessibility tree up until 'End of test' is encountered.
</span><ins>+    window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+
</ins><span class="cx">     document.body.focus();
</span><del>-    buildAccessibilityTree(accessibilityController.focusedElement, 0);
</del><ins>+    dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
</ins><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkaccessibilityreplacedobjectsinanonymousblockshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -1,30 +1,8 @@
</span><span class="cx"> &lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt; 
</span><span class="cx"> &lt;html&gt; 
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt; 
-
-    function buildAccessibilityTree(accessibilityObject, indent) {
-        var str = &quot;&quot;;
-        for (var i = 0; i &lt; indent; i++)
-            str += &quot;    &quot;;
-        str += accessibilityObject.role;
-        str += &quot; &quot; + accessibilityObject.stringValue;
-        str += &quot;\n&quot;;
-        document.getElementById(&quot;tree&quot;).innerText += str;
-
-        if (accessibilityObject.stringValue.indexOf('End of test') &gt;= 0)
-            return false;
-
-        var count = accessibilityObject.childrenCount;
-        for (var i = 0; i &lt; count; ++i) {
-            if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
-                return false;
-        }
-
-        return true;
-    }
-&lt;/script&gt; 
-&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt; 
</del><ins>+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../resources/accessibility-helper.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/head&gt; 
</span><span class="cx"> &lt;body&gt; 
</span><span class="cx">  
</span><span class="lines">@@ -47,7 +25,7 @@
</span><span class="cx"> &lt;img src=&quot;foo&quot; alt=&quot;I should be an image&quot; /&gt;
</span><span class="cx"> &lt;/h3&gt;
</span><span class="cx"> 
</span><del>-&lt;div&gt;End of test&lt;/div&gt;
</del><ins>+&lt;div id=&quot;stopElement&quot;&gt;End of test&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;pre id=&quot;tree&quot;&gt;&lt;/pre&gt;
</span><span class="cx">  
</span><span class="lines">@@ -59,8 +37,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (window.accessibilityController) {
</span><span class="cx">         // Build the accessibility tree up until 'End of test' is encountered.
</span><ins>+        window.stopElement = accessibilityController.accessibleElementById(&quot;stopElement&quot;);
+
</ins><span class="cx">         document.body.focus();
</span><del>-        buildAccessibilityTree(accessibilityController.focusedElement, 0);
</del><ins>+        dumpAccessibilityTree(accessibilityController.focusedElement, stopElement, 0);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityadjacentcontinuationscauseassertionfailureexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -13,7 +13,6 @@
</span><span class="cx">         AXRole: AXStaticText AXValue: y
</span><span class="cx">     AXRole: AXStaticText AXValue: z
</span><span class="cx">     AXRole: AXGroup AXValue: 
</span><del>-        AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilitydeletingiframedestroysaxcacheexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><span class="cx">             AXRole: AXStaticText AXValue: After
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><del>-            AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> 
</span><span class="cx"> After:
</span><span class="cx"> AXRole: AXScrollArea 
</span><span class="lines">@@ -33,7 +32,6 @@
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><span class="cx">             AXRole: AXStaticText AXValue: After
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><del>-            AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> 
</span><span class="cx"> PASS frameBodyRole == frameBody.role is false
</span><span class="cx"> PASS frameGroupRole == frameGroup.role is false
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilitydivwithinanchorscausescrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -3,11 +3,9 @@
</span><span class="cx"> AXRole: AXWebArea AXValue: 
</span><span class="cx">     AXRole: AXLink AXValue: 
</span><span class="cx">     AXRole: AXGroup AXValue: 
</span><del>-        AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> After:
</span><span class="cx"> AXRole: AXWebArea AXValue: 
</span><span class="cx">     AXRole: AXGroup AXValue: 
</span><del>-        AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> This can cause a crash.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2accessibilitydeletingiframedestroysaxcacheexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt (170805 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt        2014-07-04 13:55:55 UTC (rev 170805)
+++ trunk/LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><span class="cx">             AXRole: AXStaticText AXValue: After
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><del>-            AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> 
</span><span class="cx"> After:
</span><span class="cx"> AXRole: AXScrollArea AXValue: 
</span><span class="lines">@@ -33,7 +32,6 @@
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><span class="cx">             AXRole: AXStaticText AXValue: After
</span><span class="cx">         AXRole: AXGroup AXValue: 
</span><del>-            AXRole: AXStaticText AXValue: End of test
</del><span class="cx"> 
</span><span class="cx"> PASS frameBodyRole == frameBody.role is false
</span><span class="cx"> PASS frameGroupRole == frameGroup.role is false
</span></span></pre></div>
<a id="trunkLayoutTestsresourcesaccessibilityhelperjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/resources/accessibility-helper.js (0 => 170806)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/resources/accessibility-helper.js                                (rev 0)
+++ trunk/LayoutTests/resources/accessibility-helper.js        2014-07-04 15:31:57 UTC (rev 170806)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+function dumpAccessibilityTree(accessibilityObject, stopElement, indent, allAttributesIfNeeded) {
+    var str = &quot;&quot;;
+    var i = 0;
+
+    for (i = 0; i &lt; indent; i++)
+        str += &quot;    &quot;;
+    str += accessibilityObject.role;
+    str += &quot; &quot; + accessibilityObject.stringValue;
+    str += allAttributesIfNeeded &amp;&amp; accessibilityObject.role == '' ? accessibilityObject.allAttributes() : '';
+    str += &quot;\n&quot;;
+
+    document.getElementById(&quot;tree&quot;).innerText += str;
+
+    if (stopElement &amp;&amp; stopElement.isEqual(accessibilityObject))
+        return;
+
+    var count = accessibilityObject.childrenCount;
+    for (i = 0; i &lt; count; ++i) {
+        if (!dumpAccessibilityTree(accessibilityObject.childAtIndex(i), stopElement, indent + 1, allAttributesIfNeeded))
+            return false;
+    }
+
+    return true;
+}
+
+function touchAccessibilityTree(accessibilityObject) {
+    var count = accessibilityObject.childrenCount;
+    for (var i = 0; i &lt; count; ++i) {
+        if (!touchAccessibilityTree(accessibilityObject.childAtIndex(i)))
+            return false;
+    }
+
+    return true;
+}
</ins></span></pre>
</div>
</div>

</body>
</html>