Title: [271839] branches/safari-611-branch/LayoutTests
Revision
271839
Author
alanc...@apple.com
Date
2021-01-25 14:12:17 -0800 (Mon, 25 Jan 2021)

Log Message

Cherry-pick r271453. rdar://problem/73477471

    Fix for LayoutTests/accessibility/mac/details-summary.html in isolated tree mode.
    https://bugs.webkit.org/show_bug.cgi?id=220597

    Reviewed by Chris Fleizach.

    - Use Promises to wait for the expanded state change.
    - Added a comment to clarify why it is necessary to fetch a new
    accessible object by ID every time after setting the AXExpanded
    attribute for <details> elements.

    * accessibility/mac/details-summary-expected.txt:
    The order in which the notifications come through changed.
    * accessibility/mac/details-summary.html:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271453 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611-branch/LayoutTests/ChangeLog (271838 => 271839)


--- branches/safari-611-branch/LayoutTests/ChangeLog	2021-01-25 22:12:14 UTC (rev 271838)
+++ branches/safari-611-branch/LayoutTests/ChangeLog	2021-01-25 22:12:17 UTC (rev 271839)
@@ -1,5 +1,42 @@
 2021-01-25  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r271453. rdar://problem/73477471
+
+    Fix for LayoutTests/accessibility/mac/details-summary.html in isolated tree mode.
+    https://bugs.webkit.org/show_bug.cgi?id=220597
+    
+    Reviewed by Chris Fleizach.
+    
+    - Use Promises to wait for the expanded state change.
+    - Added a comment to clarify why it is necessary to fetch a new
+    accessible object by ID every time after setting the AXExpanded
+    attribute for <details> elements.
+    
+    * accessibility/mac/details-summary-expected.txt:
+    The order in which the notifications come through changed.
+    * accessibility/mac/details-summary.html:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-13  Andres Gonzalez  <andresg...@apple.com>
+
+            Fix for LayoutTests/accessibility/mac/details-summary.html in isolated tree mode.
+            https://bugs.webkit.org/show_bug.cgi?id=220597
+
+            Reviewed by Chris Fleizach.
+
+            - Use Promises to wait for the expanded state change.
+            - Added a comment to clarify why it is necessary to fetch a new
+            accessible object by ID every time after setting the AXExpanded
+            attribute for <details> elements.
+
+            * accessibility/mac/details-summary-expected.txt:
+            The order in which the notifications come through changed.
+            * accessibility/mac/details-summary.html:
+
+2021-01-25  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r271436. rdar://problem/73477448
 
     REGRESSION(r268666) Incorrect vertical position inside grid items with padding

Modified: branches/safari-611-branch/LayoutTests/accessibility/mac/details-summary-expected.txt (271838 => 271839)


--- branches/safari-611-branch/LayoutTests/accessibility/mac/details-summary-expected.txt	2021-01-25 22:12:14 UTC (rev 271838)
+++ branches/safari-611-branch/LayoutTests/accessibility/mac/details-summary-expected.txt	2021-01-25 22:12:17 UTC (rev 271839)
@@ -17,10 +17,12 @@
 PASS summary1.subrole is 'AXSubrole: AXSummary'
 PASS summary1.title is 'AXTitle: Some open info'
 PASS details1.isAttributeSettable('AXExpanded') is true
+Received AXExpandedChanged notification
 PASS details1.isExpanded is false
 PASS summary1.isExpanded is false
 PASS details1.isExpanded is false
 PASS summary1.isExpanded is false
+Received AXExpandedChanged notification
 PASS details1.isExpanded is true
 PASS summary1.isExpanded is true
 PASS details1.isExpanded is true
@@ -29,8 +31,6 @@
 PASS details2.isExpanded is false
 PASS details3.subrole is 'AXSubrole: AXApplicationGroup'
 PASS details3.isExpanded is true
-Received AXExpandedChanged notification
-Received AXExpandedChanged notification
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: branches/safari-611-branch/LayoutTests/accessibility/mac/details-summary.html (271838 => 271839)


--- branches/safari-611-branch/LayoutTests/accessibility/mac/details-summary.html	2021-01-25 22:12:14 UTC (rev 271838)
+++ branches/safari-611-branch/LayoutTests/accessibility/mac/details-summary.html	2021-01-25 22:12:17 UTC (rev 271839)
@@ -2,6 +2,7 @@
 <html>
 <head>
 <script src=""
+<script src=""
 </head>
 <body id="body">
 
@@ -24,23 +25,15 @@
 <div id="console"></div>
 
 <script>
-
     description("This tests some basic attributes about the details element.");
 
-    var callbackCount = 0;
     if (window.accessibilityController) {
         window.jsTestIsAsync = true;
 
         var body = accessibilityController.rootElement.childAtIndex(0);
         body.addNotificationListener(function(notification) {
-            if (notification == "AXExpandedChanged") {
-                callbackCount++;
+            if (notification == "AXExpandedChanged")
                 debug("Received " + notification + " notification ");
-
-                if (callbackCount == 2) {
-                   finishJSTest();
-                }
-            }
         });
 
         var details1 = accessibilityController.accessibleElementById("details1");
@@ -55,7 +48,15 @@
 
         // Toggle the expanded state.
         details1.setBoolAttributeValue("AXExpanded", false);
+
+        // After toggling the expanded state on a <details> element, the underlying HTMLDetailsElement goes away and it is replaced by a new object.
+        // Thus, we need to retrieve the corresponding accessible object again since the current one becomes defunct.
+        // See HTMLDetailsElement::toggleOpen().
+        setTimeout(async function() {
+            await waitFor(() => {
         details1 = accessibilityController.accessibleElementById("details1");
+                return !details1.isExpanded;
+            });
         summary1 = accessibilityController.accessibleElementById("summary1");
         shouldBeFalse("details1.isExpanded");
         shouldBeFalse("summary1.isExpanded");
@@ -62,7 +63,10 @@
 
         // Give it the same value to make sure we don't expand.
         details1.setBoolAttributeValue("AXExpanded", false);
+            await waitFor(() => {
         details1 = accessibilityController.accessibleElementById("details1");
+                return !details1.isExpanded;
+            });
         summary1 = accessibilityController.accessibleElementById("summary1");
         shouldBeFalse("details1.isExpanded");
         shouldBeFalse("summary1.isExpanded");
@@ -69,7 +73,10 @@
 
         // Set to expand again.
         details1.setBoolAttributeValue("AXExpanded", true);
+            await waitFor(() => {
         details1 = accessibilityController.accessibleElementById("details1");
+                return details1.isExpanded;
+            });
         summary1 = accessibilityController.accessibleElementById("summary1");
         shouldBeTrue("details1.isExpanded");
         shouldBeTrue("summary1.isExpanded");
@@ -76,23 +83,27 @@
 
         // And duplicate the true state to make sure it doesn't toggle off.
         details1.setBoolAttributeValue("AXExpanded", true);
+            await waitFor(() => {
         details1 = accessibilityController.accessibleElementById("details1");
+                return details1.isExpanded;
+            });
         summary1 = accessibilityController.accessibleElementById("summary1");
         shouldBeTrue("details1.isExpanded");
         shouldBeTrue("summary1.isExpanded");
 
-        var details2 = accessibilityController.accessibleElementById("details2");
+            details2 = accessibilityController.accessibleElementById("details2");
         shouldBe("details2.subrole", "'AXSubrole: AXDetails'");
         shouldBeFalse("details2.isExpanded");
 
         // Expanded status should be correct when detail has group role
-        var details3 = accessibilityController.accessibleElementById("details3");
+            details3 = accessibilityController.accessibleElementById("details3");
         shouldBe("details3.subrole", "'AXSubrole: AXApplicationGroup'");
         shouldBeTrue("details3.isExpanded");
+
+            finishJSTest();
+        }, 0);
     }
-
 </script>
-
 <script src=""
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to