Diff
Modified: trunk/LayoutTests/ChangeLog (290244 => 290245)
--- trunk/LayoutTests/ChangeLog 2022-02-21 15:24:30 UTC (rev 290244)
+++ trunk/LayoutTests/ChangeLog 2022-02-21 15:46:11 UTC (rev 290245)
@@ -1,3 +1,20 @@
+2022-02-21 Tyler Wilcock <[email protected]>
+
+ AX: Add test for r290130 (https://trac.webkit.org/changeset/290130/webkit)
+ https://bugs.webkit.org/show_bug.cgi?id=236848
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/dynamically-changing-iframe-remains-accessible-expected.txt: Added.
+ * accessibility/dynamically-changing-iframe-remains-accessible.html: Added.
+ * accessibility/resources/purple-pineapple-text.html:
+ Added so we can switch iframe source between multiple simple documents.
+ * platform/ios/TestExpectations:
+ Enable new test.
+ * platform/mac-wk1/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt: Added.
+ * resources/accessibility-helper.js:
+ (sleep): Added.
+
2022-02-20 Jon Lee <[email protected]>
Unreviewed gardening for GPU Process bots
Added: trunk/LayoutTests/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt (0 => 290245)
--- trunk/LayoutTests/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt 2022-02-21 15:46:11 UTC (rev 290245)
@@ -0,0 +1,30 @@
+This test ensures that an iframe that changes its document dynamically remains accessible.
+
+Beginning search traversal from the body element.
+
+AXRole: AXTextField
+text-input-outside-iframe
+
+AXRole: AXScrollArea
+
+AXRole: AXWebArea
+
+AXRole: AXGroup
+
+AXRole: AXStaticText
+AXValue: Purple pineapple
+
+AXRole: AXScrollArea
+
+AXRole: AXWebArea
+
+AXRole: AXGroup
+
+AXRole: AXStaticText
+AXValue: Purple pineapple
+
+Traversed 9 elements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/dynamically-changing-iframe-remains-accessible.html (0 => 290245)
--- trunk/LayoutTests/accessibility/dynamically-changing-iframe-remains-accessible.html (rev 0)
+++ trunk/LayoutTests/accessibility/dynamically-changing-iframe-remains-accessible.html 2022-02-21 15:46:11 UTC (rev 290245)
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body id="body">
+
+<input type="text" id="text-input-outside-iframe">
+<iframe id="iframe-contentwindow" width=500 height=500></iframe>
+<iframe id="iframe-src" width=500 height=500></iframe>
+
+<script>
+ var testOutput = "This test ensures that an iframe that changes its document dynamically remains accessible.\n\n";
+
+ if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
+
+ var contentWindowIframe = document.getElementById('iframe-contentwindow');
+ var srcIframe = document.getElementById('iframe-src');
+
+ setTimeout(async () => {
+ const updateIframeMilliseconds = 500;
+ const firstHtmlFilePath = "resources/text.html";
+ const secondHtmlFilePath = "resources/purple-pineapple-text.html";
+
+ contentWindowIframe.contentWindow.location = firstHtmlFilePath;
+ srcIframe.src = ""
+ await sleep(updateIframeMilliseconds);
+
+ contentWindowIframe.contentWindow.location = secondHtmlFilePath;
+ srcIframe.src = ""
+ await sleep(updateIframeMilliseconds);
+
+ traverseBodyContent();
+ debug(testOutput);
+ finishJSTest();
+ }, 0);
+ }
+
+ function traverseBodyContent() {
+ const body = accessibilityController.accessibleElementById("body");
+
+ testOutput += "Beginning search traversal from the body element.\n";
+ let elementCount = 0;
+ let searchResult = null;
+ while (true) {
+ searchResult = body.uiElementForSearchPredicate(searchResult, true, "AXAnyTypeSearchKey", "", false);
+ if (!searchResult)
+ break;
+
+ const role = searchResult.role;
+ testOutput += `\n${role}`;
+ if (role.includes("StaticText")) {
+ let textContent = accessibilityController.platformName === "ios" ? searchResult.description : searchResult.stringValue;
+ testOutput += `\n${textContent}`;
+ }
+
+ if (searchResult.domIdentifier)
+ testOutput += `\n${searchResult.domIdentifier}`;
+
+ testOutput += "\n";
+ elementCount += 1;
+ }
+ testOutput += `\nTraversed ${elementCount} elements.`;
+ }
+
+</script>
+</body>
+</html>
+
Added: trunk/LayoutTests/accessibility/resources/purple-pineapple-text.html (0 => 290245)
--- trunk/LayoutTests/accessibility/resources/purple-pineapple-text.html (rev 0)
+++ trunk/LayoutTests/accessibility/resources/purple-pineapple-text.html 2022-02-21 15:46:11 UTC (rev 290245)
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+</head>
+<body>
+ Purple pineapple
+</body>
+</html>
+
Modified: trunk/LayoutTests/platform/glib/TestExpectations (290244 => 290245)
--- trunk/LayoutTests/platform/glib/TestExpectations 2022-02-21 15:24:30 UTC (rev 290244)
+++ trunk/LayoutTests/platform/glib/TestExpectations 2022-02-21 15:46:11 UTC (rev 290245)
@@ -342,6 +342,7 @@
# Missing AccessibilityUIElement::uiElementForSearchPredicate implementation.
accessibility/table-search-traversal.html [ Skip ]
+accessibility/dynamically-changing-iframe-remains-accessible.html [ Skip ]
webkit.org/b/212805 accessibility/svg-text.html [ Failure ]
Modified: trunk/LayoutTests/platform/ios/TestExpectations (290244 => 290245)
--- trunk/LayoutTests/platform/ios/TestExpectations 2022-02-21 15:24:30 UTC (rev 290244)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2022-02-21 15:46:11 UTC (rev 290245)
@@ -2098,6 +2098,7 @@
webkit.org/b/150366 accessibility/aria-table-attributes.html [ Pass ]
accessibility/table-search-traversal.html [ Pass ]
+accessibility/dynamically-changing-iframe-remains-accessible.html [ Pass ]
accessibility/selected-state-changed-notifications.html [ Pass ]
accessibility/element-line-rects-and-text.html [ Pass ]
Added: trunk/LayoutTests/platform/ios/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt (0 => 290245)
--- trunk/LayoutTests/platform/ios/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/ios/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt 2022-02-21 15:46:11 UTC (rev 290245)
@@ -0,0 +1,18 @@
+This test ensures that an iframe that changes its document dynamically remains accessible.
+
+Beginning search traversal from the body element.
+
+TextField
+text-input-outside-iframe
+
+StaticText
+AXLabel: Purple pineapple
+
+StaticText
+AXLabel: Purple pineapple
+
+Traversed 3 elements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/platform/mac-wk1/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt (0 => 290245)
--- trunk/LayoutTests/platform/mac-wk1/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/accessibility/dynamically-changing-iframe-remains-accessible-expected.txt 2022-02-21 15:46:11 UTC (rev 290245)
@@ -0,0 +1,26 @@
+This test ensures that an iframe that changes its document dynamically remains accessible.
+
+Beginning search traversal from the body element.
+
+AXRole: AXTextField
+text-input-outside-iframe
+
+AXRole: AXWebArea
+
+AXRole: AXGroup
+
+AXRole: AXStaticText
+AXValue: Purple pineapple
+
+AXRole: AXWebArea
+
+AXRole: AXGroup
+
+AXRole: AXStaticText
+AXValue: Purple pineapple
+
+Traversed 7 elements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: trunk/LayoutTests/platform/win/TestExpectations (290244 => 290245)
--- trunk/LayoutTests/platform/win/TestExpectations 2022-02-21 15:24:30 UTC (rev 290244)
+++ trunk/LayoutTests/platform/win/TestExpectations 2022-02-21 15:46:11 UTC (rev 290245)
@@ -475,6 +475,7 @@
# Missing AccessibilityUIElement::uiElementForSearchPredicate implementation.
accessibility/table-search-traversal.html [ Skip ]
+accessibility/dynamically-changing-iframe-remains-accessible.html [ Skip ]
# TODO Conic gradients
http/wpt/css/css-images-4/conic-gradient-parsing.html [ Skip ]
Modified: trunk/LayoutTests/resources/accessibility-helper.js (290244 => 290245)
--- trunk/LayoutTests/resources/accessibility-helper.js 2022-02-21 15:24:30 UTC (rev 290244)
+++ trunk/LayoutTests/resources/accessibility-helper.js 2022-02-21 15:46:11 UTC (rev 290245)
@@ -106,6 +106,10 @@
return accessibilityObject.childAtIndex(index);
}
+function sleep(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+}
+
function waitFor(condition)
{
return new Promise((resolve, reject) => {