Title: [284174] trunk
Revision
284174
Author
[email protected]
Date
2021-10-14 10:53:03 -0700 (Thu, 14 Oct 2021)

Log Message

Don't run focusing steps on disconnected or inert <dialog>
https://bugs.webkit.org/show_bug.cgi?id=231721

Reviewed by Antti Koivisto.

Marked relevant WPTs as passing.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-disconnected-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt:

Source/WebCore:

* html/HTMLDialogElement.cpp:
(WebCore::HTMLDialogElement::runFocusingSteps):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (284173 => 284174)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-14 17:49:57 UTC (rev 284173)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-14 17:53:03 UTC (rev 284174)
@@ -1,3 +1,15 @@
+2021-10-14  Tim Nguyen  <[email protected]>
+
+        Don't run focusing steps on disconnected or inert <dialog>
+        https://bugs.webkit.org/show_bug.cgi?id=231721
+
+        Reviewed by Antti Koivisto.
+
+        Marked relevant WPTs as passing.
+
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-disconnected-expected.txt:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt:
+
 2021-10-14  Alexey Shvayka  <[email protected]>
 
         AudioContext::getOutputTimestamp() uses incorrect global object as a high-res timestamp origin

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-disconnected-expected.txt (284173 => 284174)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-disconnected-expected.txt	2021-10-14 17:49:57 UTC (rev 284173)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-disconnected-expected.txt	2021-10-14 17:53:03 UTC (rev 284174)
@@ -1,9 +1,5 @@
 
 
-FAIL dialog.show(): focusing steps should not run on disconnected <dialog> assert_equals: Focusing steps should not run expected Element node <input></input> but got Element node <body>
-<input>
-<script>
-test(() => {
-  const outerInput =...
+PASS dialog.show(): focusing steps should not run on disconnected <dialog>
 PASS Test that focusing steps do not run when dialog is disconnected
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt (284173 => 284174)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt	2021-10-14 17:49:57 UTC (rev 284173)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt	2021-10-14 17:53:03 UTC (rev 284174)
@@ -1,6 +1,4 @@
 
 
-FAIL Dialog focusing steps should not run when dialog is inert assert_equals: Dialog focusing steps should not run when dialog is inert expected Element node <input id="outer-input"></input> but got Element node <body>
-<input id="outer-input">
-<dialog inert="" open="">...
+PASS Dialog focusing steps should not run when dialog is inert
 

Modified: trunk/Source/WebCore/ChangeLog (284173 => 284174)


--- trunk/Source/WebCore/ChangeLog	2021-10-14 17:49:57 UTC (rev 284173)
+++ trunk/Source/WebCore/ChangeLog	2021-10-14 17:53:03 UTC (rev 284174)
@@ -1,3 +1,15 @@
+2021-10-14  Tim Nguyen  <[email protected]>
+
+        Don't run focusing steps on disconnected or inert <dialog>
+        https://bugs.webkit.org/show_bug.cgi?id=231721
+
+        Reviewed by Antti Koivisto.
+
+        Marked relevant WPTs as passing.
+
+        * html/HTMLDialogElement.cpp:
+        (WebCore::HTMLDialogElement::runFocusingSteps):
+
 2021-10-14  Alexey Shvayka  <[email protected]>
 
         AudioContext::getOutputTimestamp() uses incorrect global object as a high-res timestamp origin

Modified: trunk/Source/WebCore/html/HTMLDialogElement.cpp (284173 => 284174)


--- trunk/Source/WebCore/html/HTMLDialogElement.cpp	2021-10-14 17:49:57 UTC (rev 284173)
+++ trunk/Source/WebCore/html/HTMLDialogElement.cpp	2021-10-14 17:53:03 UTC (rev 284174)
@@ -119,6 +119,11 @@
 // https://html.spec.whatwg.org/multipage/interactive-elements.html#dialog-focusing-steps
 void HTMLDialogElement::runFocusingSteps()
 {
+    if (!isConnected())
+        return;
+
+    // Ensure renderer and inert style are up-to-date.
+    document().updateStyleIfNeeded();
     if (renderer() && renderer()->style().effectiveInert())
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to