<!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>[286948] 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/286948">286948</a></dd>
<dt>Author</dt> <dd>tyler_w@apple.com</dd>
<dt>Date</dt> <dd>2021-12-13 08:20:39 -0800 (Mon, 13 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Make aria-hidden-update.html, focusable-div.html, mac/invalid-status-for-input-types.html, and mac/css-speech-speak.html pass in --release isolated tree mode
https://bugs.webkit.org/show_bug.cgi?id=234198

Reviewed by Chris Fleizach.

Make the following tests async or otherwise isolated-tree friendly
(i.e. by using accessibleElementById instead of document.getElementById().focus() +
accessibilityController.focusedElement to get a JS reference to an AX object).

* accessibility/aria-hidden-update-expected.txt:
* accessibility/aria-hidden-update.html:
* accessibility/focusable-div-expected.txt:
* accessibility/focusable-div.html:
* accessibility/mac/invalid-status-for-input-types-expected.txt:
* accessibility/mac/invalid-status-for-input-types.html:
Make these tests async. These tests must be async to pass in isolated
tree mode because they use JS to dynamically change the page.
* accessibility/mac/css-speech-speak-expected.txt:
* accessibility/mac/css-speech-speak.html:
Use accessibleElementById instead of document.getElementById().focus() +
accessibilityController.focusedElement to get references to JS AX objects.

* platform/glib/TestExpectations:
* platform/win/TestExpectations:
Skip accessibility/focusable-div.html due to lack of
AccessibilityUIElement::domIdentifier implementation.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariahiddenupdateexpectedtxt">trunk/LayoutTests/accessibility/aria-hidden-update-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityariahiddenupdatehtml">trunk/LayoutTests/accessibility/aria-hidden-update.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilityfocusabledivexpectedtxt">trunk/LayoutTests/accessibility/focusable-div-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityfocusabledivhtml">trunk/LayoutTests/accessibility/focusable-div.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymaccssspeechspeakexpectedtxt">trunk/LayoutTests/accessibility/mac/css-speech-speak-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymaccssspeechspeakhtml">trunk/LayoutTests/accessibility/mac/css-speech-speak.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacinvalidstatusforinputtypesexpectedtxt">trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacinvalidstatusforinputtypeshtml">trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types.html</a></li>
<li><a href="#trunkLayoutTestsplatformglibTestExpectations">trunk/LayoutTests/platform/glib/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/ChangeLog 2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2021-12-13  Tyler Wilcock  <tyler_w@apple.com>
+
+        AX: Make aria-hidden-update.html, focusable-div.html, mac/invalid-status-for-input-types.html, and mac/css-speech-speak.html pass in --release isolated tree mode
+        https://bugs.webkit.org/show_bug.cgi?id=234198
+
+        Reviewed by Chris Fleizach.
+
+        Make the following tests async or otherwise isolated-tree friendly
+        (i.e. by using accessibleElementById instead of document.getElementById().focus() +
+        accessibilityController.focusedElement to get a JS reference to an AX object).
+
+        * accessibility/aria-hidden-update-expected.txt:
+        * accessibility/aria-hidden-update.html:
+        * accessibility/focusable-div-expected.txt:
+        * accessibility/focusable-div.html:
+        * accessibility/mac/invalid-status-for-input-types-expected.txt:
+        * accessibility/mac/invalid-status-for-input-types.html:
+        Make these tests async. These tests must be async to pass in isolated
+        tree mode because they use JS to dynamically change the page.
+        * accessibility/mac/css-speech-speak-expected.txt:
+        * accessibility/mac/css-speech-speak.html:
+        Use accessibleElementById instead of document.getElementById().focus() +
+        accessibilityController.focusedElement to get references to JS AX objects.
+
+        * platform/glib/TestExpectations:
+        * platform/win/TestExpectations:
+        Skip accessibility/focusable-div.html due to lack of
+        AccessibilityUIElement::domIdentifier implementation.
+
</ins><span class="cx"> 2021-12-13  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Fix ServiceWorker downloads
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariahiddenupdateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/aria-hidden-update-expected.txt (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-hidden-update-expected.txt  2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/aria-hidden-update-expected.txt     2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1,20 +1,19 @@
</span><del>-Button 1
-Button 2
-Button 3
</del><span class="cx"> This test makes sure that when aria-hidden changes, the AX hierarchy is updated.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS parent.childAtIndex(0).isEqual(button1) is true
-PASS parent.childAtIndex(1).isEqual(button2) is true
-PASS parent.childAtIndex(2).isEqual(button3) is true
-PASS parent.childAtIndex(0).isEqual(button1) is true
-PASS parent.childAtIndex(1).isEqual(button3) is true
-PASS parent.childAtIndex(0).isEqual(button3) is true
-PASS parent.childAtIndex(0).isEqual(button2) is true
-PASS parent.childAtIndex(1).isEqual(button3) is true
</del><ins>+PASS container.childAtIndex(0).isEqual(button1) is true
+PASS container.childAtIndex(1).isEqual(button2) is true
+PASS container.childAtIndex(2).isEqual(button3) is true
+PASS container.childAtIndex(0).isEqual(button1) is true
+PASS container.childAtIndex(1).isEqual(button3) === true
+PASS container.childAtIndex(0).isEqual(button3) === true
+PASS container.childAtIndex(0).isEqual(button2) === true
+PASS container.childAtIndex(1).isEqual(button3) === true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><del>-
</del><ins>+Button 1
+Button 2
+Button 3
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilityariahiddenupdatehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/aria-hidden-update.html (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/aria-hidden-update.html  2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/aria-hidden-update.html     2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1,66 +1,51 @@
</span><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
</ins><span class="cx"> <html>
</span><del>-<html>
</del><span class="cx"> <head>
</span><del>-<script src="../resources/js-test-pre.js"></script>
</del><ins>+<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
</ins><span class="cx"> </head>
</span><del>-<body id="body">

-    <div role="group" tabindex="0" id="parent">
</del><ins>+<body>
+
+<div role="group" tabindex="0" id="container">
</ins><span class="cx">     <div role="button" id="button1" tabindex="0">Button 1</div>
</span><span class="cx">     <div role="button" id="button2" tabindex="0">Button 2</div>
</span><span class="cx">     <div role="button" id="button3" tabindex="0">Button 3</div>
</span><ins>+</div>
</ins><span class="cx"> 
</span><del>-    </div>
</del><ins>+<script>
+    description("This test makes sure that when aria-hidden changes, the AX hierarchy is updated.");
</ins><span class="cx"> 
</span><ins>+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
</ins><span class="cx"> 
</span><del>-    <p id="description"></p>
-    <div id="console"></div>
-     
-    <script>
-        if (window.accessibilityController) {
-            jsTestIsAsync = true;
-            description("This test makes sure that when aria-hidden changes, the AX hierarchy is updated.");
</del><ins>+        var container = accessibilityController.accessibleElementById("container");
+        var button1 = accessibilityController.accessibleElementById("button1");;
+        var button2 = accessibilityController.accessibleElementById("button2");;
+        var button3 = accessibilityController.accessibleElementById("button3");;
</ins><span class="cx"> 
</span><del>-            // Get the parent element.
-            document.getElementById("parent").focus();
-            var parent = accessibilityController.focusedElement;
-            
-            // Get all three children.
-            document.getElementById("button1").focus();
-            var button1 = accessibilityController.focusedElement;
-            document.getElementById("button2").focus();
-            var button2 = accessibilityController.focusedElement;
-            document.getElementById("button3").focus();
-            var button3 = accessibilityController.focusedElement;
-      
-            // Verify that the 3 children are present.
-            shouldBeTrue("parent.childAtIndex(0).isEqual(button1)");
-            shouldBeTrue("parent.childAtIndex(1).isEqual(button2)");
-            shouldBeTrue("parent.childAtIndex(2).isEqual(button3)");
</del><ins>+        // Verify that the 3 buttons are present as children.
+        shouldBeTrue("container.childAtIndex(0).isEqual(button1)");
+        shouldBeTrue("container.childAtIndex(1).isEqual(button2)");
+        shouldBeTrue("container.childAtIndex(2).isEqual(button3)");
</ins><span class="cx"> 
</span><del>-            // Make the 2nd button hidden. Only 1 and 3 should be present.
-            document.getElementById("button2").setAttribute("aria-hidden", "true");
-            setTimeout(function() {
-                shouldBeTrue("parent.childAtIndex(0).isEqual(button1)");
-                shouldBeTrue("parent.childAtIndex(1).isEqual(button3)");
</del><ins>+        // Make the 2nd button hidden. Only 1 and 3 should be present.
+        document.getElementById("button2").setAttribute("aria-hidden", "true");
+        shouldBeTrue("container.childAtIndex(0).isEqual(button1)");
+        setTimeout(async function() {
+            await expectAsyncExpression("container.childAtIndex(1).isEqual(button3)", "true");
</ins><span class="cx">            
</span><del>-                // Make the 1st button hidden. Only 3 should be present.
-                document.getElementById("button1").setAttribute("aria-hidden", "true");
-                setTimeout(function() {
-                    shouldBeTrue("parent.childAtIndex(0).isEqual(button3)");
</del><ins>+            // Make the 1st button hidden. Only 3 should be present.
+            document.getElementById("button1").setAttribute("aria-hidden", "true");
+            await expectAsyncExpression("container.childAtIndex(0).isEqual(button3)", "true");
</ins><span class="cx"> 
</span><del>-                    // Make the 2nd button not hidden. 2 and 3 should be present.
-                    document.getElementById("button2").setAttribute("aria-hidden", "false");
-                    setTimeout(function() {
-                        shouldBeTrue("parent.childAtIndex(0).isEqual(button2)");
-                        shouldBeTrue("parent.childAtIndex(1).isEqual(button3)");
-                        finishJSTest();
-                    }, 0);
-                }, 0);
-            }, 0);
-        }
-    </script>
</del><ins>+            // Make the 2nd button not hidden. 2 and 3 should be present.
+            document.getElementById("button2").setAttribute("aria-hidden", "false");
+            await expectAsyncExpression("container.childAtIndex(0).isEqual(button2)", "true");
+            await expectAsyncExpression("container.childAtIndex(1).isEqual(button3)", "true");
</ins><span class="cx"> 
</span><del>-<script src="../resources/js-test-post.js"></script>
</del><ins>+            finishJSTest();
+        }, 0);
+    }
+</script>
</ins><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityfocusabledivexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/focusable-div-expected.txt (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/focusable-div-expected.txt       2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/focusable-div-expected.txt  2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -3,22 +3,22 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS document.activeElement == link is true
</del><ins>+PASS document.activeElement.id is "link"
</ins><span class="cx"> PASS lastChar(axLink.title) is "A"
</span><del>-PASS document.activeElement == div is true
</del><ins>+PASS document.activeElement.id is "div"
</ins><span class="cx"> PASS lastChar(axDiv.title) is ' '
</span><del>-PASS document.activeElement == div2 is true
</del><ins>+PASS document.activeElement.id is "div2"
</ins><span class="cx"> PASS lastChar(axDiv2.title) is ' '
</span><del>-PASS document.activeElement == div3 is true
</del><ins>+PASS document.activeElement.id is "div3"
</ins><span class="cx"> PASS lastChar(accNameForDiv3) is "D"
</span><del>-PASS document.activeElement == div4 is true
</del><ins>+PASS document.activeElement.id is "div4"
</ins><span class="cx"> PASS axDiv4.title.indexOf('Link') is -1
</span><del>-PASS document.activeElement == div5 is true
</del><ins>+PASS document.activeElement.id is "div5"
</ins><span class="cx"> PASS axDiv5.title.indexOf('Link') is -1
</span><span class="cx"> PASS axDiv5.title.indexOf('Initial text before link') >= 0 is false
</span><del>-PASS document.activeElement == div6 is true
</del><ins>+PASS document.activeElement.id is "div6"
</ins><span class="cx"> PASS axDiv6.title.indexOf('List item') is -1
</span><del>-PASS document.activeElement == div7 is true
</del><ins>+PASS document.activeElement.id is "div7"
</ins><span class="cx"> PASS axDiv7.title.indexOf('List item') is -1
</span><span class="cx"> PASS axDiv7.title.indexOf('Initial text before list') >= 0 is false
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityfocusabledivhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/focusable-div.html (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/focusable-div.html       2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/focusable-div.html  2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1,92 +1,80 @@
</span><del>-<!DOCTYPE HTML>
</del><ins>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
</ins><span class="cx"> <html>
</span><ins>+<head>
+<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
+</head>
</ins><span class="cx"> <body>
</span><del>-<script src="../resources/js-test-pre.js"></script>
-<script src="../resources/accessibility-helper.js"></script>
</del><span class="cx"> 
</span><span class="cx"> <div id="content">
</span><ins>+    <!-- A link always gets its accessible text from contents. -->
+    <a id="link" href="#">A</a>
</ins><span class="cx"> 
</span><del>-<!-- A link always gets its accessible text from contents. -->
-<a id="link" href="#">A</a>
</del><ins>+    <!-- A generic focusable div should not get its accessible text from contents. -->
+    <div id="div" tabindex="0">B</div>
+    <div id="div2" tabindex="0"><div></div>C</div>
+    <div id="div3" tabindex="0" aria-label="D"></div>
</ins><span class="cx"> 
</span><del>-<!-- A generic focusable div should not get its accessible text from contents. -->
-<div id="div" tabindex="0">B</div>
-<div id="div2" tabindex="0"><div></div>C</div>
-<div id="div3" tabindex="0" aria-label="D"></div>
</del><ins>+    <!-- A generic focusable div should not get accessible text from children that are focusable or containers. -->
+    <div id="div4" tabindex="0"><a href="#">Link</a></div>
+    <div id="div5" tabindex="0">Initial text before link<a href="#">Link</a></div>
+    <div id="div6" tabindex="0"><ul><li>List item</li></ul></div>
+    <div id="div7" tabindex="0">Initial text before list<ul><li>List item</li></ul></div>
+</div>
</ins><span class="cx"> 
</span><del>-<!-- A generic focusable div should not get accessible text from children that are focusable or containers. -->
-<div id="div4" tabindex="0"><a href="#">Link</a></div>
-<div id="div5" tabindex="0">Initial text before link<a href="#">Link</a></div>
-<div id="div6" tabindex="0"><ul><li>List item</li></ul></div>
-<div id="div7" tabindex="0">Initial text before list<ul><li>List item</li></ul></div>
-</div>
-<div id="console"></div>
</del><span class="cx"> <script>
</span><del>-description("This test makes sure that a generic focusable div can get accessibility focus. It should not get accessible text from its children automatically though.");
</del><ins>+    description("This test makes sure that a generic focusable div can get accessibility focus. It should not get accessible text from its children automatically though.");
</ins><span class="cx"> 
</span><del>-if (window.testRunner && window.accessibilityController) {
-    window.testRunner.dumpAsText();
-
</del><span class="cx">     function lastChar(str) {
</span><span class="cx">         return str.substr(str.length - 1);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var link = document.getElementById('link');
-    link.focus();
-    shouldBe("document.activeElement == link", "true");
-    window.axLink = accessibilityController.focusedElement;
-    shouldBe("lastChar(axLink.title)", "\"A\"");
</del><ins>+    async function waitForFocus(id) {
+        document.getElementById(id).focus();
+        shouldBe("document.activeElement.id", `"${id}"`);
+        let axFocusedElement;
+        await waitFor(() => {
+            axFocusedElement = accessibilityController.focusedElement;
+            return axFocusedElement && axFocusedElement.domIdentifier === id;
+        });
+        return axFocusedElement;
+    }
</ins><span class="cx"> 
</span><del>-    var div = document.getElementById('div');
-    div.focus();
-    shouldBe("document.activeElement == div", "true");
-    window.axDiv = accessibilityController.focusedElement;
-    shouldBe("lastChar(axDiv.title)", "' '");
</del><ins>+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
</ins><span class="cx"> 
</span><del>-    var div2 = document.getElementById('div2');
-    div2.focus();
-    shouldBe("document.activeElement == div2", "true");
-    window.axDiv2 = accessibilityController.focusedElement;
-    shouldBe("lastChar(axDiv2.title)", "' '");
</del><ins>+        setTimeout(async function() {
+            window.axLink = await waitForFocus("link");
+            shouldBe("lastChar(axLink.title)", "\"A\"");
</ins><span class="cx"> 
</span><del>-    var div3 = document.getElementById('div3');
-    div3.focus();
-    shouldBe("document.activeElement == div3", "true");
-    window.axDiv3 = accessibilityController.focusedElement;
-    var accNameForDiv3 = platformValueForW3CName(axDiv3);
-    shouldBe("lastChar(accNameForDiv3)", "\"D\"");
</del><ins>+            window.axDiv = await waitForFocus("div");
+            shouldBe("lastChar(axDiv.title)", "' '");
</ins><span class="cx"> 
</span><del>-    var div4 = document.getElementById('div4');
-    div4.focus();
-    shouldBe("document.activeElement == div4", "true");
-    window.axDiv4 = accessibilityController.focusedElement;
-    shouldBe("axDiv4.title.indexOf('Link')", "-1");
</del><ins>+            window.axDiv2 = await waitForFocus("div2");
+            shouldBe("lastChar(axDiv2.title)", "' '");
</ins><span class="cx"> 
</span><del>-    var div5 = document.getElementById('div5');
-    div5.focus();
-    shouldBe("document.activeElement == div5", "true");
-    window.axDiv5 = accessibilityController.focusedElement;
-    shouldBe("axDiv5.title.indexOf('Link')", "-1");
-    shouldBe("axDiv5.title.indexOf('Initial text before link') >= 0", "false");
</del><ins>+            window.accNameForDiv3 = platformValueForW3CName(await waitForFocus("div3"));
+            shouldBe("lastChar(accNameForDiv3)", "\"D\"");
</ins><span class="cx"> 
</span><del>-    var div6 = document.getElementById('div6');
-    div6.focus();
-    shouldBe("document.activeElement == div6", "true");
-    window.axDiv6 = accessibilityController.focusedElement;
-    shouldBe("axDiv6.title.indexOf('List item')", "-1");
</del><ins>+            window.axDiv4 = await waitForFocus("div4");
+            shouldBe("axDiv4.title.indexOf('Link')", "-1");
</ins><span class="cx"> 
</span><del>-    var div7 = document.getElementById('div7');
-    div7.focus();
-    shouldBe("document.activeElement == div7", "true");
-    window.axDiv7 = accessibilityController.focusedElement;
-    shouldBe("axDiv7.title.indexOf('List item')", "-1");
-    shouldBe("axDiv7.title.indexOf('Initial text before list') >= 0", "false");
</del><ins>+            window.axDiv5 = await waitForFocus("div5");
+            shouldBe("axDiv5.title.indexOf('Link')", "-1");
+            shouldBe("axDiv5.title.indexOf('Initial text before link') >= 0", "false");
</ins><span class="cx"> 
</span><del>-    document.getElementById("content").style.visibility = "hidden";
-}
</del><ins>+            window.axDiv6 = await waitForFocus("div6");
+            shouldBe("axDiv6.title.indexOf('List item')", "-1");
</ins><span class="cx"> 
</span><ins>+            window.axDiv7 = await waitForFocus("div7");
+            shouldBe("axDiv7.title.indexOf('List item')", "-1");
+            shouldBe("axDiv7.title.indexOf('Initial text before list') >= 0", "false");
+
+            document.getElementById("content").style.visibility = "hidden";
+
+            finishJSTest();
+        }, 0);
+    }
</ins><span class="cx"> </script>
</span><del>-
-<script src="../resources/js-test-post.js"></script>
</del><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymaccssspeechspeakexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/mac/css-speech-speak-expected.txt (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/css-speech-speak-expected.txt        2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/mac/css-speech-speak-expected.txt   2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -12,15 +12,24 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'spell-out'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal, digits'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal, literal-punctuation'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal, no-punctuation'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal, digits, literal-punctuation'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'spell-out, literal-punctuation'
-PASS accessibilityController.focusedElement.childAtIndex(0).speakAs is 'normal, digits'
</del><ins>+Testing #initial
+PASS element.childAtIndex(0).speakAs is "normal"
+Testing #speech-normal
+PASS element.childAtIndex(0).speakAs is "normal"
+Testing #speech-spellout
+PASS element.childAtIndex(0).speakAs is "spell-out"
+Testing #speech-digits
+PASS element.childAtIndex(0).speakAs is "normal, digits"
+Testing #speech-literalpunc
+PASS element.childAtIndex(0).speakAs is "normal, literal-punctuation"
+Testing #speech-nopunc
+PASS element.childAtIndex(0).speakAs is "normal, no-punctuation"
+Testing #speech-digits-and-literal
+PASS element.childAtIndex(0).speakAs is "normal, digits, literal-punctuation"
+Testing #speech-spell-and-literal
+PASS element.childAtIndex(0).speakAs is "spell-out, literal-punctuation"
+Testing #testlink
+PASS element.childAtIndex(0).speakAs is "normal, digits"
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymaccssspeechspeakhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/mac/css-speech-speak.html (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/css-speech-speak.html        2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/mac/css-speech-speak.html   2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -39,34 +39,23 @@
</span><span class="cx"> 
</span><span class="cx">     description("This tests that using the CSS3-speech property 'speak-as' works as from a WebCore level (not a platform level, that is up to the platforms)");
</span><span class="cx"> 
</span><ins>+    var element;
+    function expectValueForId(id, expectedValue) {
+        debug(`Testing #${id}`)
+        element = accessibilityController.accessibleElementById(id);
+        shouldBe("element.childAtIndex(0).speakAs", `"${expectedValue}"`);
+    }
+
</ins><span class="cx">     if (window.accessibilityController) {
</span><del>-
-          document.getElementById("initial").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal'");
-
-          document.getElementById("speech-normal").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal'");
-
-          document.getElementById("speech-spellout").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'spell-out'");
-
-          document.getElementById("speech-digits").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, digits'");
-
-          document.getElementById("speech-literalpunc").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, literal-punctuation'");
-
-          document.getElementById("speech-nopunc").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, no-punctuation'");
-
-          document.getElementById("speech-digits-and-literal").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, digits, literal-punctuation'");
-
-          document.getElementById("speech-spell-and-literal").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'spell-out, literal-punctuation'");
-
-          document.getElementById("testlink").focus();
-          shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, digits'");
</del><ins>+        expectValueForId("initial", "normal");
+        expectValueForId("speech-normal", "normal");
+        expectValueForId("speech-spellout", "spell-out");
+        expectValueForId("speech-digits", "normal, digits");
+        expectValueForId("speech-literalpunc", "normal, literal-punctuation");
+        expectValueForId("speech-nopunc", "normal, no-punctuation");
+        expectValueForId("speech-digits-and-literal", "normal, digits, literal-punctuation");
+        expectValueForId("speech-spell-and-literal", "spell-out, literal-punctuation");
+        expectValueForId("testlink", "normal, digits");
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacinvalidstatusforinputtypesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types-expected.txt (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types-expected.txt  2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types-expected.txt     2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1,13 +1,21 @@
</span><del>-
</del><span class="cx"> This tests that we are exposing correct invalid status for different types.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS: AXInvalid is true.
-PASS: AXInvalid is false.
-PASS: AXInvalid is true.
-PASS: AXInvalid is false.
-PASS: AXInvalid is true.
-PASS: AXInvalid is false.
</del><ins>+Testing #number-input-valid
+PASS input.stringAttributeValue('AXInvalid') is 'false'
+Testing #url-input-invalid
+PASS input.stringAttributeValue('AXInvalid') is 'true'
+Testing #url-input-valid
+PASS input.stringAttributeValue('AXInvalid') is 'false'
+Testing #email-input-invalid
+PASS input.stringAttributeValue('AXInvalid') is 'true'
+Testing #email-input-valid
+PASS input.stringAttributeValue('AXInvalid') is 'false'
+Testing #number-input-invalid
+PASS input.stringAttributeValue('AXInvalid') is 'true'
+PASS successfullyParsed is true
</ins><span class="cx"> 
</span><ins>+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacinvalidstatusforinputtypeshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types.html (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types.html  2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/accessibility/mac/invalid-status-for-input-types.html     2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1,56 +1,54 @@
</span><span class="cx"> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><del>-<script src="../../resources/js-test-pre.js"></script>
</del><ins>+<script src="../../resources/js-test.js"></script>
+<script src="../../resources/accessibility-helper.js"></script>
</ins><span class="cx"> </head>
</span><del>-<body id="body">
</del><ins>+<body>
</ins><span class="cx"> 
</span><del>-<div id="examples">
-    <input class="ex" data-expected="true" type="number" value="abc">
-    <input class="ex" data-expected="false" type="number" value="10">
-    
-    <input class="ex" data-expected="true" type="url" value="abc">
-    <input class="ex" data-expected="false" type="url" value="http://abc.com">
-    
-    <input class="ex" data-expected="true" type="email" value="abc">
-    <input class="ex" data-expected="false" type="email" value="abc@abc.com">
-</div>
</del><ins>+<input id="number-input-invalid" type="number" value="abc">
+<input id="number-input-valid" type="number" value="10">
</ins><span class="cx"> 
</span><del>-<p id="description"></p>
-<div id="console"></div>
</del><ins>+<input id="url-input-invalid" type="url" value="abc">
+<input id="url-input-valid" type="url" value="http://abc.com">
</ins><span class="cx"> 
</span><ins>+<input id="email-input-invalid" type="email" value="abc">
+<input id="email-input-valid" type="email" value="abc@abc.com">
+
</ins><span class="cx"> <script>
</span><del>-
</del><span class="cx">     description("This tests that we are exposing correct invalid status for different types.");
</span><span class="cx"> 
</span><del>-    function $(id){
-        return document.getElementById(id);
</del><ins>+    var input;
+    function expectAXInvalid(id, expectedValue) {
+        debug(`Testing #${id}`);
+        input = accessibilityController.accessibleElementById(id);
+        shouldBe("input.stringAttributeValue('AXInvalid')", `'${expectedValue}'`);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    var result = $('console');
-    function verify(value, expectation, element) {
-      if (value === expectation)
-        result.innerText += "PASS: AXInvalid is " + value + ".\n";
-      else
-        result.innerText += "FAIL: AXInvalid is " + value + ". Expected: " + expectation + ". " + (element ? element.outerHTML : "") + "\n";
-    }
-
</del><span class="cx">     if (window.accessibilityController) {
</span><ins>+        window.jsTestIsAsync = true;
</ins><span class="cx"> 
</span><del>-        var examples = document.querySelectorAll(".ex");
-        for (var i = 0, c = examples.length; i < c; i++) {
-            var el = examples[i];
-            el.focus();
-            if (i == 0)
-                eventSender.keyDown('a');
-            var expectation = el.getAttribute("data-expected");
-            var value = accessibilityController.focusedElement.stringAttributeValue('AXInvalid');
-            verify(value, expectation, el);
-        }
</del><ins>+        expectAXInvalid("number-input-valid", false);
+        expectAXInvalid("url-input-invalid", true);
+        expectAXInvalid("url-input-valid", false);
+        expectAXInvalid("email-input-invalid", true);
+        expectAXInvalid("email-input-valid", false);
+
+        setTimeout(async function() {
+            // For <input type="number" value="abc"> inputs, we must explicitly send a non-number keystroke for it to be
+            // considered invalid at the HTMLInputElement level despite the `value` attribute clearly not being a valid number.
+            document.getElementById("number-input-invalid").focus();
+            eventSender.keyDown("a");
+            await waitFor(() => {
+                input = accessibilityController.accessibleElementById("number-input-invalid");
+                return input && input.stringAttributeValue("AXInvalid") === "true";
+            });
+            expectAXInvalid("number-input-invalid", true);
+
+            finishJSTest();
+        }, 0);
</ins><span class="cx">     }
</span><del>-
</del><span class="cx"> </script>
</span><del>-
-<script src="../resources/js-test-post.js"></script>
</del><span class="cx"> </body>
</span><span class="cx"> </html>
</span><ins>+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformglibTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/glib/TestExpectations (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/glib/TestExpectations 2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/platform/glib/TestExpectations    2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -307,6 +307,9 @@
</span><span class="cx"> # AccessibilityUIElement::isInCell().
</span><span class="cx"> accessibility/ancestor-computation.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Need to implement AccessibilityUIElement::domIdentifier() for this test to pass after webkit.org/b/234198.
+accessibility/focusable-div.html [ Skip ]
+
</ins><span class="cx"> webkit.org/b/212805 accessibility/svg-text.html [ Failure ]
</span><span class="cx"> 
</span><span class="cx"> # Added in r263823. Both tests are timing out.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (286947 => 286948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations  2021-12-13 15:18:11 UTC (rev 286947)
+++ trunk/LayoutTests/platform/win/TestExpectations     2021-12-13 16:20:39 UTC (rev 286948)
</span><span class="lines">@@ -1570,7 +1570,11 @@
</span><span class="cx"> [ Release ] accessibility/element-haspopup.html [ Failure ]
</span><span class="cx"> [ Debug ] accessibility/element-haspopup.html [ Skip ] # Crash (Debug Assertion)
</span><span class="cx"> [ Debug ] accessibility/first-letter-text-transform-causes-crash.html [ Skip ] # Crash (Debug Assertion)
</span><del>-webkit.org/b/140867 [ Debug ] accessibility/focusable-div.html [ Skip ]
</del><ins>+
+# In addition to the issues raised in the associated bug, also need to implement
+# AccessibilityUIElement::domIdentifier() for this test to pass due to webkit.org/b/234198.
+webkit.org/b/140867 accessibility/focusable-div.html [ Skip ]
+
</ins><span class="cx"> [ Release ] accessibility/frame-disconnect-textmarker-cache-crash.html [ Failure ]
</span><span class="cx"> [ Debug ] accessibility/frame-disconnect-textmarker-cache-crash.html [ Skip ] # Crash (Debug Assertion)
</span><span class="cx"> [ Debug ] accessibility/hang-in-isignored.html [ Skip ] # Crash (Debug Assertion)
</span></span></pre>
</div>
</div>

</body>
</html>