Title: [279409] trunk/LayoutTests
Revision
279409
Author
[email protected]
Date
2021-06-30 06:36:14 -0700 (Wed, 30 Jun 2021)

Log Message

Re-import html/semantics/interactive-elements/the-dialog-element WPT
https://bugs.webkit.org/show_bug.cgi?id=227523

Reviewed by Antti Koivisto.

WPT Revision: https://github.com/web-platform-tests/wpt/commit/616577e3962171d2ffe41472e13f6353e6ea43ef

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html: Added.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html: Added.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport-expected.txt: Removed.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html: Removed.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close-expected.txt: Added.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close.html: Added.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log:

LayoutTests:

* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt: Added.
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (279408 => 279409)


--- trunk/LayoutTests/ChangeLog	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/ChangeLog	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,5 +1,18 @@
 2021-06-30  Tim Nguyen  <[email protected]>
 
+        Re-import html/semantics/interactive-elements/the-dialog-element WPT
+        https://bugs.webkit.org/show_bug.cgi?id=227523
+
+        Reviewed by Antti Koivisto.
+
+        WPT Revision: https://github.com/web-platform-tests/wpt/commit/616577e3962171d2ffe41472e13f6353e6ea43ef
+
+        * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:
+        * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt: Added.
+        * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:
+
+2021-06-30  Tim Nguyen  <[email protected]>
+
         Support -internal- prefix for pseudo classes and rename :-webkit-direct-focus to :-internal-direct-focus
         https://bugs.webkit.org/show_bug.cgi?id=227522
 

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,5 +1,31 @@
 2021-06-30  Tim Nguyen  <[email protected]>
 
+        Re-import html/semantics/interactive-elements/the-dialog-element WPT
+        https://bugs.webkit.org/show_bug.cgi?id=227523
+
+        Reviewed by Antti Koivisto.
+
+        WPT Revision: https://github.com/web-platform-tests/wpt/commit/616577e3962171d2ffe41472e13f6353e6ea43ef
+
+        * resources/import-expectations.json:
+        * resources/resource-files.json:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html: Added.
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html:
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html: Added.
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport-expected.txt: Removed.
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html: Removed.
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close-expected.txt: Added.
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close.html: Added.
+        * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log:
+
+2021-06-30  Tim Nguyen  <[email protected]>
+
         Implement support for <dialog> element close event
         https://bugs.webkit.org/show_bug.cgi?id=227493
 

Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2021-06-30 13:36:14 UTC (rev 279409)
@@ -300,6 +300,7 @@
     "web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html": "skip", 
     "web-platform-tests/html/semantics/forms/the-textarea-element": "import", 
     "web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html": "skip", 
+    "web-platform-tests/html/semantics/interactive-elements/the-dialog-element/": "import", 
     "web-platform-tests/html/semantics/interactive-elements/the-summary-element": "skip", 
     "web-platform-tests/html/semantics/links/downloading-resources": "import", 
     "web-platform-tests/html/semantics/links/following-hyperlinks": "skip", 

Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/resources/resource-files.json	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json	2021-06-30 13:36:14 UTC (rev 279409)
@@ -2572,6 +2572,8 @@
         "web-platform-tests/html/semantics/forms/the-label-element/iframe-label-attributes.html",
         "web-platform-tests/html/semantics/forms/the-textarea-element/wrap-enumerated-ascii-case-insensitive-child.html",
         "web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html",
+        "web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html",
+        "web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html",
         "web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-popup.html",
         "web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-1.html",
         "web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/support/noopener-target-2.html",
@@ -2776,4 +2778,4 @@
         "web-platform-tests/xhr/xmlhttprequest-sync-block-defer-scripts-subframe.html",
         "web-platform-tests/xhr/xmlhttprequest-sync-not-hang-scriptloader-subframe.html"
     ]
-}
+}
\ No newline at end of file

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,16 +1,12 @@
 
 FAIL showModal() should center in the viewport assert_approx_equals: expected 291 +/- 1 but got -500
-PASS The dialog is a positioned element, so the top and bottom should not have style auto.
 FAIL Dialog should be recentered if showModal() is called after close() assert_approx_equals: expected 291 +/- 1 but got -1000
 PASS Dialog should not recenter on relayout.
 FAIL A tall dialog should be positioned at the top of the viewport. assert_equals: expected 0 but got -500
-FAIL The dialog should be centered regardless of the presence of a horizontal scrollbar. assert_approx_equals: expected -9700 +/- 1 but got -500
-FAIL Centering should work when dialog is inside positioned containers. assert_approx_equals: expected -9700 +/- 1 but got 330
+FAIL The dialog should be centered regardless of the presence of a horizontal scrollbar. assert_approx_equals: expected 0 +/- 1 but got -500
+FAIL Centering should work when dialog is inside positioned containers. assert_approx_equals: expected 275 +/- 1 but got 330
 PASS A centered dialog's position should survive becoming display:none temporarily.
-FAIL Dialog should lose centering when removed from the document. assert_not_equals: got disallowed value 320
+FAIL Dialog should not still be centered when removed, and re-added to the document. assert_approx_equals: expected 285 +/- 1 but got 320
 PASS Dialog's specified position should survive after close() and showModal().
-FAIL Dialog should be recentered if showModal() is called after removing 'open'. assert_approx_equals: expected -9700 +/- 1 but got -1000
-FAIL Dialog should not be centered if showModal() was called when an ancestor had display 'none'. assert_equals: expected 9500 but got 330
-PASS A dialog with specified 'top' should be positioned as usual
-PASS A dialog with specified 'bottom' should be positioned as usual
+FAIL Dialog should be recentered if showModal() is called after removing 'open'. assert_approx_equals: expected 0 +/- 1 but got -500
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -15,8 +15,8 @@
 dialog {
     border: 0;
     padding: 0;
-    height: auto;
-    width: auto;
+    max-width: 100%;
+    max-height: 100%;
 }
 
 #absolute-div {
@@ -40,13 +40,8 @@
 <script>
 "use strict";
 
-function checkNotVerticallyCentered(dialog) {
-    var centeredTop = (window.innerHeight - dialog.offsetHeight) / 2;
-    assert_not_equals(dialog.getBoundingClientRect().top, centeredTop);
-}
-
 function checkVerticallyCentered(dialog) {
-    var centeredTop = (window.innerHeight - dialog.offsetHeight) / 2;
+    var centeredTop = (document.documentElement.clientHeight - dialog.offsetHeight) / 2;
     // Using approx equals because getBoundingClientRect() and centeredTop
     // are calculated by different parts of the engine. Due to the loss
     // of precision, the numbers might not equal exactly.
@@ -77,23 +72,7 @@
 test(function() {
     this.add_cleanup(reset);
 
-    assert_equals(window.getComputedStyle(dialog).top, 'auto');
-    assert_equals(window.getComputedStyle(dialog).bottom, 'auto');
-
-    dialog.style.height = '20px';
     dialog.showModal();
-
-    assert_not_equals(window.getComputedStyle(dialog).top, 'auto');
-    assert_not_equals(window.getComputedStyle(dialog).bottom, 'auto');
-
-    // Set back original value to 'height'.
-    dialog.style.height = 'auto';
-}, "The dialog is a positioned element, so the top and bottom should not have style auto.");
-
-test(function() {
-    this.add_cleanup(reset);
-
-    dialog.showModal();
     dialog.close();
     window.scroll(0, 2 * window.scrollY);
     dialog.showModal();
@@ -122,7 +101,7 @@
     assert_equals(dialog.getBoundingClientRect().top, 0);
 
     // Set back original value to 'height'.
-    dialog.style.height = 'auto';
+    dialog.style.height = 'fit-content';
 }, "A tall dialog should be positioned at the top of the viewport.");
 
 test(function() {
@@ -167,13 +146,12 @@
     relativeContainer.appendChild(dialog);
 
     dialog.showModal();
-    assert_not_equals(dialog.getBoundingClientRect().top, relativeContainer.getBoundingClientRect().top);
+    checkVerticallyCentered(dialog);
     dialog.remove();
 
     relativeContainer.appendChild(dialog);
-    assert_equals(dialog.parentNode, relativeContainer);
-    assert_equals(dialog.getBoundingClientRect().top, relativeContainer.getBoundingClientRect().top);
-}, "Dialog should lose centering when removed from the document.");
+    assert_equals(relativeContainer.getBoundingClientRect().top, dialog.getBoundingClientRect().top);
+}, "Dialog should not still be centered when removed, and re-added to the document.");
 
 test(function() {
     this.add_cleanup(reset);
@@ -186,7 +164,7 @@
     assert_equals(dialog.getBoundingClientRect().top, expectedTop);
 
     // Set back original value to 'top'.
-    dialog.style.top = 'auto';
+    dialog.style.top = '0';
 }, "Dialog's specified position should survive after close() and showModal().");
 
 test(function() {
@@ -194,43 +172,7 @@
 
     dialog.showModal();
     dialog.removeAttribute('open');
-    window.scroll(0, window.scrollY * 2);
-    checkNotVerticallyCentered(dialog);
     dialog.showModal();
     checkVerticallyCentered(dialog);
 }, "Dialog should be recentered if showModal() is called after removing 'open'.");
-
-test(function() {
-    this.add_cleanup(reset);
-
-    dialog.remove();
-    absoluteContainer.appendChild(dialog);
-    absoluteContainer.style.display = 'none';
-    dialog.showModal();
-    absoluteContainer.style.display = 'block';
-    // Since dialog's containing block is the ICB, it's statically positioned after <body>.
-    assert_equals(dialog.getBoundingClientRect().top, document.body.getBoundingClientRect().bottom);
-}, "Dialog should not be centered if showModal() was called when an ancestor had display 'none'.");
-
-test(function() {
-    this.add_cleanup(reset);
-
-    var offset = 50;
-    dialog.style.top = offset + 'px';
-    dialog.showModal();
-    assert_equals(dialog.getBoundingClientRect().top + window.scrollY, offset);
-    // Set back original value to 'top'.
-    dialog.style.top = 'auto';
-}, "A dialog with specified 'top' should be positioned as usual");
-
-test(function() {
-    this.add_cleanup(reset);
-
-    var offset = 50;
-    dialog.style.bottom = offset + 'px';
-    dialog.showModal();
-    assert_equals(dialog.getBoundingClientRect().bottom + window.scrollY, window.innerHeight - offset);
-    // Set back original value to 'bottom'.
-    dialog.style.bottom = 'auto';
-}, "A dialog with specified 'bottom' should be positioned as usual");
 </script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,17 +1,25 @@
 
-FAIL horizontal-tb: tall viewport assert_equals: expected "45px" but got "8px"
-FAIL horizontal-tb: wide viewport assert_equals: expected "15px" but got "8px"
-FAIL horizontal-tb: square viewport assert_equals: expected "45px" but got "8px"
-FAIL horizontal-tb: dialog and viewport match assert_equals: expected "0px" but got "8px"
-FAIL horizontal-tb: dialog bigger than viewport assert_equals: expected "0px" but got "8px"
-FAIL vertical-rl: tall viewport assert_equals: expected "10px" but got "12px"
-FAIL vertical-lr: tall viewport assert_equals: expected "10px" but got "12px"
-FAIL vertical-lr: dialog bigger than viewport assert_equals: expected "0px" but got "-18px"
-FAIL vertical-rl (dialog horizontal-tb): tall viewport assert_equals: expected "10px" but got "0px"
-FAIL vertical-lr (dialog horizontal-tb): tall viewport assert_equals: expected "10px" but got "0px"
-PASS vertical-lr (dialog horizontal-tb): dialog bigger than viewport
-FAIL horizontal-tb (container vertical-rl): tall viewport assert_equals: expected "10px" but got "8px"
-FAIL vertical-rl (container horizontal-tb): tall viewport assert_equals: expected "45px" but got "8px"
-FAIL horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport assert_equals: expected "10px" but got "0px"
-FAIL vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport assert_equals: expected "45px" but got "0px"
+FAIL horizontal-tb: tall viewport, default-sizes: true assert_approx_equals: expected 41 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb: tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb: wide viewport, default-sizes: true assert_approx_equals: expected 11 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb: wide viewport, default-sizes: false assert_equals: expected 15 but got 8
+FAIL horizontal-tb: square viewport, default-sizes: true assert_approx_equals: expected 41 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb: square viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb: dialog and viewport match, default-sizes: false assert_equals: expected 0 but got 8
+FAIL vertical-rl: tall viewport, default-sizes: true assert_approx_equals: expected 11 +/- 0.016666666666666666 but got 14
+FAIL vertical-rl: tall viewport, default-sizes: false assert_equals: expected 10 but got 12
+FAIL vertical-lr: tall viewport, default-sizes: true assert_approx_equals: expected 11 +/- 0.016666666666666666 but got 8
+FAIL vertical-lr: tall viewport, default-sizes: false assert_equals: expected 10 but got 8
+FAIL vertical-rl (dialog horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 41 +/- 0.016666666666666666 but got 8
+FAIL vertical-rl (dialog horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL vertical-lr (dialog horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 41 +/- 0.016666666666666666 but got 8
+FAIL vertical-lr (dialog horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb (container vertical-rl): tall viewport, default-sizes: true assert_approx_equals: expected 11 +/- 0.016666666666666666 but got 14
+FAIL horizontal-tb (container vertical-rl): tall viewport, default-sizes: false assert_equals: expected 10 but got 12
+FAIL vertical-rl (container horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 41 +/- 0.016666666666666666 but got 8
+FAIL vertical-rl (container horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 41 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport, default-sizes: true assert_approx_equals: expected 11 +/- 0.016666666666666666 but got 14
+FAIL vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport, default-sizes: false assert_equals: expected 10 but got 12
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -14,12 +14,15 @@
     writing-mode: {{GET[dialog-writing-mode]}};
     border: none;
     padding: 0;
-    margin: 0;
+    max-width: initial;
+    max-height: initial;
+    width: {{GET[dialog-width]}};
+    height: {{GET[dialog-height]}};
   }
 </style>
 
 <div id="container">
-  <dialog style="width: 20px; height: 10px;">X</dialog> <!-- sync width and height with centering.html -->
+  <dialog>X</dialog>
 </div>
 
 <script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -11,53 +11,59 @@
 "use strict";
 
 // Be sure to sync with centering-iframe.html
-const DIALOG_WIDTH = 20;
-const DIALOG_HEIGHT = 10;
+const dialogWidth = 20;
+const dialogHeight = 10;
 
-testDialogCentering("horizontal-tb", "", "", "tall viewport", 40, 100, "top", 100 / 2 - DIALOG_HEIGHT / 2);
-testDialogCentering("horizontal-tb", "", "", "wide viewport", 100, 40, "top", 40 / 2 - DIALOG_HEIGHT / 2);
-testDialogCentering("horizontal-tb", "", "", "square viewport", 100, 100, "top", 100 / 2 - DIALOG_HEIGHT / 2);
-testDialogCentering("horizontal-tb", "", "", "dialog and viewport match", DIALOG_WIDTH, DIALOG_HEIGHT, "top", 0);
-testDialogCentering("horizontal-tb", "", "", "dialog bigger than viewport", 100, DIALOG_HEIGHT / 2, "top", 0);
+testDialogCentering("horizontal-tb", "", "", "tall viewport", 40, 100);
+testDialogCentering("horizontal-tb", "", "", "wide viewport", 100, 40);
+testDialogCentering("horizontal-tb", "", "", "square viewport", 100, 100);
+testDialogCentering("horizontal-tb", "", "", "dialog and viewport match", dialogWidth, dialogHeight);
 
-testDialogCentering("vertical-rl", "", "", "tall viewport", 40, 100, "left", 40 / 2 - DIALOG_WIDTH / 2);
-testDialogCentering("vertical-lr", "", "", "tall viewport", 40, 100, "right", 40 / 2 - DIALOG_WIDTH / 2);
-testDialogCentering("vertical-lr", "", "", "dialog bigger than viewport", DIALOG_WIDTH / 2, 100, "right", 0);
+testDialogCentering("vertical-rl", "", "", "tall viewport", 40, 100);
+testDialogCentering("vertical-lr", "", "", "tall viewport", 40, 100);
 
-testDialogCentering("vertical-rl", "", "horizontal-tb", "tall viewport", 40, 100, "left", 40 / 2 - DIALOG_WIDTH / 2);
-testDialogCentering("vertical-lr", "", "horizontal-tb", "tall viewport", 40, 100, "right", 40 / 2 - DIALOG_WIDTH / 2);
-testDialogCentering("vertical-lr", "", "horizontal-tb", "dialog bigger than viewport", DIALOG_WIDTH / 2, 100, "right", 0);
+testDialogCentering("vertical-rl", "", "horizontal-tb", "tall viewport", 40, 100);
+testDialogCentering("vertical-lr", "", "horizontal-tb", "tall viewport", 40, 100);
 
-testDialogCentering("horizontal-tb", "vertical-rl", "", "tall viewport", 40, 100, "right", 40 / 2 - DIALOG_WIDTH / 2);
-testDialogCentering("vertical-rl", "horizontal-tb", "", "tall viewport", 40, 100, "top", 100 / 2 - DIALOG_HEIGHT / 2);
+testDialogCentering("horizontal-tb", "vertical-rl", "", "tall viewport", 40, 100);
+testDialogCentering("vertical-rl", "horizontal-tb", "", "tall viewport", 40, 100);
 
-testDialogCentering("horizontal-tb", "vertical-rl", "horizontal-tb", "tall viewport", 40, 100, "right", 40 / 2 - DIALOG_WIDTH / 2);
-testDialogCentering("vertical-rl", "horizontal-tb", "vertical-rl", "tall viewport", 40, 100, "top", 100 / 2 - DIALOG_HEIGHT / 2);
+testDialogCentering("horizontal-tb", "vertical-rl", "horizontal-tb", "tall viewport", 40, 100);
+testDialogCentering("vertical-rl", "horizontal-tb", "vertical-rl", "tall viewport", 40, 100);
 
-function testDialogCentering(writingMode, containerWritingMode, dialogWritingMode, label, iframeWidth, iframeHeight, property, numericValue) {
-  async_test(t => {
-    const iframe = document.createElement("iframe");
-    iframe.src = ""
-    iframe.width = iframeWidth;
-    iframe.height = iframeHeight;
-    iframe._onload_ = t.step_func_done(() => {
-      const dialog = iframe.contentDocument.querySelector("dialog");
-      const dialogStyle = iframe.contentWindow.getComputedStyle(dialog);
-      assert_equals(dialogStyle[property], numericValue + "px");
-      assert_equals(dialogStyle['inset-inline-start'], "0px");
-      assert_equals(dialogStyle['inset-inline-end'], "0px");
+function testDialogCentering(writingMode, containerWritingMode, dialogWritingMode, label, iframeWidth, iframeHeight) {
+  const dialogSizesToTest = [["", ""], [dialogWidth.toString()+'px', dialogHeight.toString()+'px']];
+  for (const dialogSizes of dialogSizesToTest) {
+    const isDefaultSize = dialogSizes[0] == "";
+    // This test doesn't make sense if the dialog sizes are default
+    if (isDefaultSize && label == "dialog and viewport match") {
+      continue;
+    }
 
-      const dialogWM = dialogWritingMode || containerWritingMode || writingMode || "horizontal-tb";
-      if (dialogWM.startsWith("vertical")) {
-        assert_equals(dialogStyle['top'], "0px");
-        assert_equals(dialogStyle['bottom'], "0px");
-      } else {
-        assert_equals(dialogStyle['left'], "0px");
-        assert_equals(dialogStyle['right'], "0px");
-      }
-    });
-    document.body.appendChild(iframe);
-  }, writingMode + (containerWritingMode ? ` (container ${containerWritingMode})` : "") +
-     (dialogWritingMode ? ` (dialog ${dialogWritingMode})` : "") + `: ${label}`);
+    async_test(t => {
+      const iframe = document.createElement("iframe");
+      iframe.src = ""
+      iframe.width = iframeWidth;
+      iframe.height = iframeHeight;
+      iframe._onload_ = t.step_func_done(() => {
+        const dialog = iframe.contentDocument.querySelector("dialog");
+        const dialogRect = dialog.getBoundingClientRect();
+
+        const expectedLeftOffset = iframeWidth / 2 - dialogRect.width / 2;
+        const expectedTopOffset = Math.max(iframeHeight / 2 - dialogRect.height / 2, 0);
+
+        if (isDefaultSize) {
+          assert_approx_equals(dialogRect.left, expectedLeftOffset, 1/60);
+          assert_approx_equals(dialogRect.top, expectedTopOffset, 1/60);
+        } else {
+          assert_equals(dialogRect.left, expectedLeftOffset);
+          assert_equals(dialogRect.top, expectedTopOffset);
+        }
+      });
+      document.body.appendChild(iframe);
+    }, writingMode + (containerWritingMode ? ` (container ${containerWritingMode})` : "") +
+       (dialogWritingMode ? ` (dialog ${dialogWritingMode})` : "") + `: ${label}` + `, default-sizes: ${isDefaultSize}`);
+
+  }
 }
 </script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html (0 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<link rel="help" href=""
+
+<body _onload_=dlg.show()>
+<dialog id="dlg">
+  <audio></audio>
+  <video></video>
+</dialog>
+
+This test passes if it does not crash.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -2,7 +2,7 @@
 PASS click the form submission button should close the dialog
 PASS form submission should return correct value
 PASS no returnValue when there's no result.
-PASS input image button should return the coordianates
+PASS input image button should return the coordinates
 PASS formmethod attribute should use dialog form submission
 PASS closing the dialog while submitting should stop the submission
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <meta charset=urf-8>
+<meta name=viewport content="width=device-width,initial-scale=1">
 <title>Test dialog form submission</title>
 <script src=""
 <script src=""
@@ -68,7 +69,7 @@
   assert_false(dialog.open, "dialog should be closed now");
   assert_not_equals(dialog.returnValue, "", "returnValue shouldn't be empty string");
   assert_equals(dialog.returnValue, expectedReturnValue, "returnValue should be the offsets of the click");
-}, "input image button should return the coordianates");
+}, "input image button should return the coordinates");
 
 promise_test(async () => {
   const dialog = document.querySelector('dialog');

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html (0 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<script>
+  const dialog = document.createElement("dialog");
+  dialog.show();
+</script>

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport-expected.txt (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,3 +0,0 @@
-
-FAIL Tests modal dialog's containing block is the initial containing block assert_equals: expected null but got Element node <div style="position: absolute; top: 5000px; left: 5000px...
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-body {
-    margin: 0;
-}
-
-dialog {
-    padding : 0;
-}
-</style>
-<script src=""
-<script src=""
-</head>
-<body style="height: 10000px; width: 10000px">
-<div style="position: absolute; top: 5000px; left: 5000px; width: 20px;">
-    <dialog style="top: 1200px; left: 1200px; right: auto; height: 100px; width: 50%;">
-    </dialog>
-</div>
-<script>
-"use strict";
-function checkPosition(dialog) {
-    assert_equals(dialog.offsetParent, null);
-    assert_equals(dialog.offsetTop, 1200);
-    assert_equals(dialog.offsetLeft, 1200);
-    // Since dialog's 'width' is '50%', the expected width is half of the
-    // viewport width, but viewport width may be odd.
-    var expectedWidth = document.documentElement.clientWidth / 2;
-    assert_approx_equals(dialog.clientWidth, expectedWidth, 0.5);
-}
-
-test(function() {
-  // The dialog should be onscreen with a width of 50% of the viewport. It is the child of a
-  // narrow element positioned off screen, but its containing block is the initial containing
-  // block, so its position and percent lengths are relative to that.
-  window.scroll(1000, 1000);
-  var dialog = document.querySelector('dialog');
-  dialog.showModal();
-  checkPosition(dialog);
-  dialog.close();
-}, "Tests modal dialog's containing block is the initial containing block");
-</script>
-</body>
-</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close-expected.txt (0 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -0,0 +1,12 @@
+
+
+
+PASS Focus should be moved to the previously focused element(Simple dialog usage)
+FAIL Focus should be moved to the previously focused element(Complex dialog usage) assert_equals: expected Element node <input></input> but got Element node <body>
+
+<dialog>
+    <button id="button1">This is a butto...
+PASS Focus should be moved to the body if the previously focused element is removed
+PASS Focus should be moved to the shadow DOM host if the previouly focused element is a shadow DOM node
+FAIL Focus should not scroll if the previously focused element is outside the viewport assert_true: expected true got false
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close.html (0 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close.html	2021-06-30 13:36:14 UTC (rev 279409)
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<meta charset=urf-8>
+<meta name=viewport content="width=device-width,initial-scale=1">
+<title>Test focus is moved to the previously focused element when dialog is closed</title>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+
+<body>
+<input />
+<dialog>
+    <button id="button1">This is a button1</button>
+    <button id="button2">This is a button2</button>
+    <button id="button3">This is a button3</button>
+</dialog>
+<script>
+
+// Test focus is moved to the previously focused element
+function test_move_to_previously_focused(showModal) {
+  const input = document.querySelector("input");
+  input.focus();
+  const dialog = document.querySelector('dialog');
+  if (showModal) {
+    dialog.showModal();
+  } else {
+    dialog.show();
+  }
+  dialog.close();
+
+  assert_equals(document.activeElement, input);
+}
+
+// Test focus is moved to the previously focused element with some complex dialog usage
+async function test_move_to_previously_focused_with_complex_dialog_usage(showModal) {
+  const input = document.querySelector("input");
+  input.focus();
+  const dialog = document.querySelector('dialog');
+  if (showModal) {
+    dialog.showModal();
+  } else {
+    dialog.show();
+  }
+
+  const button1 = document.getElementById("button1");
+  const button2 = document.getElementById("button2");
+  const button3 = document.getElementById("button3");
+
+  await test_driver.click(button1);
+  await test_driver.click(button2);
+  await test_driver.click(button3);
+
+  dialog.close();
+
+  assert_equals(document.activeElement, input);
+}
+
+// Test focus is moved to <body> if the previously focused
+// element can't be focused
+function test_move_to_body_if_fails(showModal) {
+  const input = document.querySelector("input");
+  input.focus();
+  const dialog = document.querySelector('dialog');
+  if (showModal) {
+    dialog.showModal();
+  } else {
+    dialog.show();
+  }
+  dialog.close();
+  input.remove();
+  assert_equals(document.activeElement, document.body);
+  document.body.appendChild(input);
+}
+
+// Test focus is moved to shadow host if the previously
+// focused element is a shadow node.
+function test_move_to_shadow_host(showModal) {
+  const shadowHost = document.createElement("div");
+
+  const shadowRoot = shadowHost.attachShadow({mode: 'open'});
+  shadowRoot.appendChild(document.createElement("input"));
+
+  document.body.appendChild(shadowHost);
+  const inputElement = shadowRoot.querySelector("input");
+  inputElement.focus();
+
+  assert_equals(document.activeElement, shadowHost);
+  assert_equals(shadowRoot.activeElement, inputElement);
+
+  const dialog = document.querySelector('dialog');
+  if (showModal) {
+    dialog.showModal();
+  } else {
+    dialog.show();
+  }
+  dialog.close();
+
+  assert_equals(document.activeElement, shadowHost);
+  assert_equals(shadowRoot.activeElement, inputElement);
+}
+
+// Test moving the focus doesn't scroll the viewport
+function test_move_focus_dont_scroll_viewport(showModal) {
+  const outViewPortButton = document.createElement("button");
+  outViewPortButton.style.top = (window.innerHeight + 10).toString() + "px";
+  outViewPortButton.style.position = "absolute";
+  document.body.appendChild(outViewPortButton);
+
+  outViewPortButton.focus();
+  // Since the outViewPortButton is focused, so the viewport should be
+  // scrolled to it
+  assert_true(document.documentElement.scrollTop > 0 );
+
+  const dialog = document.querySelector('dialog');
+  if (showModal) {
+    dialog.showModal();
+  } else {
+    dialog.show();
+  }
+
+  window.scrollTo(0, 0);
+  assert_equals(document.documentElement.scrollTop, 0);
+
+  dialog.close();
+  assert_equals(document.documentElement.scrollTop, 0);
+
+  assert_equals(document.activeElement, outViewPortButton);
+}
+
+test(() => {
+  test_move_to_previously_focused(true);
+  test_move_to_previously_focused(false);
+}, 'Focus should be moved to the previously focused element(Simple dialog usage)');
+
+promise_test(async () => {
+  await test_move_to_previously_focused_with_complex_dialog_usage(true);
+  await test_move_to_previously_focused_with_complex_dialog_usage(false);
+}, 'Focus should be moved to the previously focused element(Complex dialog usage)');
+
+test(() => {
+  test_move_to_body_if_fails(true);
+  test_move_to_body_if_fails(false);
+}, 'Focus should be moved to the body if the previously focused element is removed');
+
+test(() => {
+  test_move_to_shadow_host(true);
+  test_move_to_shadow_host(false);
+}, 'Focus should be moved to the shadow DOM host if the previouly focused element is a shadow DOM node');
+
+test(() => {
+  test_move_focus_dont_scroll_viewport(true);
+  test_move_focus_dont_scroll_viewport(false);
+}, 'Focus should not scroll if the previously focused element is outside the viewport');
+</script>
+</body>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log (279408 => 279409)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/w3c-import.log	2021-06-30 13:36:14 UTC (rev 279409)
@@ -17,6 +17,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-iframe.sub.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-audio-video-crash.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-just-once.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus-multiple-times.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-autofocus.html
@@ -24,11 +25,12 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-enabled.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-prevent-autofocus.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-not-in-tree-crash.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-return-value.html
-/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-scrolled-viewport.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-remove.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal.html
+/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/focus-after-close.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-does-not-match-disabled-selector.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable.html
 /LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document.html

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt (279408 => 279409)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/abspos-dialog-layout-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -1,16 +1,12 @@
 
 FAIL showModal() should center in the viewport assert_approx_equals: expected 290 +/- 1 but got -500
-PASS The dialog is a positioned element, so the top and bottom should not have style auto.
 FAIL Dialog should be recentered if showModal() is called after close() assert_approx_equals: expected 290 +/- 1 but got -1000
 PASS Dialog should not recenter on relayout.
 FAIL A tall dialog should be positioned at the top of the viewport. assert_equals: expected 0 but got -500
-FAIL The dialog should be centered regardless of the presence of a horizontal scrollbar. assert_approx_equals: expected -9700 +/- 1 but got -500
-FAIL Centering should work when dialog is inside positioned containers. assert_approx_equals: expected -9700 +/- 1 but got 330
+FAIL The dialog should be centered regardless of the presence of a horizontal scrollbar. assert_approx_equals: expected 0 +/- 1 but got -500
+FAIL Centering should work when dialog is inside positioned containers. assert_approx_equals: expected 275 +/- 1 but got 330
 PASS A centered dialog's position should survive becoming display:none temporarily.
-FAIL Dialog should lose centering when removed from the document. assert_not_equals: got disallowed value 320
+FAIL Dialog should not still be centered when removed, and re-added to the document. assert_approx_equals: expected 285 +/- 1 but got 320
 PASS Dialog's specified position should survive after close() and showModal().
-FAIL Dialog should be recentered if showModal() is called after removing 'open'. assert_approx_equals: expected -9700 +/- 1 but got -1000
-FAIL Dialog should not be centered if showModal() was called when an ancestor had display 'none'. assert_equals: expected 9500 but got 330
-PASS A dialog with specified 'top' should be positioned as usual
-PASS A dialog with specified 'bottom' should be positioned as usual
+FAIL Dialog should be recentered if showModal() is called after removing 'open'. assert_approx_equals: expected 0 +/- 1 but got -500
 

Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt (0 => 279409)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/centering-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -0,0 +1,25 @@
+
+FAIL horizontal-tb: tall viewport, default-sizes: true assert_approx_equals: expected 40 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb: tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb: wide viewport, default-sizes: true assert_approx_equals: expected 10 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb: wide viewport, default-sizes: false assert_equals: expected 15 but got 8
+FAIL horizontal-tb: square viewport, default-sizes: true assert_approx_equals: expected 40 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb: square viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb: dialog and viewport match, default-sizes: false assert_equals: expected 0 but got 8
+FAIL vertical-rl: tall viewport, default-sizes: true assert_approx_equals: expected 10 +/- 0.016666666666666666 but got 12
+FAIL vertical-rl: tall viewport, default-sizes: false assert_equals: expected 10 but got 12
+FAIL vertical-lr: tall viewport, default-sizes: true assert_approx_equals: expected 10 +/- 0.016666666666666666 but got 8
+FAIL vertical-lr: tall viewport, default-sizes: false assert_equals: expected 10 but got 8
+FAIL vertical-rl (dialog horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 40 +/- 0.016666666666666666 but got 8
+FAIL vertical-rl (dialog horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL vertical-lr (dialog horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 40 +/- 0.016666666666666666 but got 8
+FAIL vertical-lr (dialog horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb (container vertical-rl): tall viewport, default-sizes: true assert_approx_equals: expected 10 +/- 0.016666666666666666 but got 12
+FAIL horizontal-tb (container vertical-rl): tall viewport, default-sizes: false assert_equals: expected 10 but got 12
+FAIL vertical-rl (container horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 40 +/- 0.016666666666666666 but got 8
+FAIL vertical-rl (container horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport, default-sizes: true assert_approx_equals: expected 40 +/- 0.016666666666666666 but got 8
+FAIL horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport, default-sizes: false assert_equals: expected 45 but got 8
+FAIL vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport, default-sizes: true assert_approx_equals: expected 10 +/- 0.016666666666666666 but got 12
+FAIL vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport, default-sizes: false assert_equals: expected 10 but got 12
+

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (279408 => 279409)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt	2021-06-30 12:53:29 UTC (rev 279408)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt	2021-06-30 13:36:14 UTC (rev 279409)
@@ -4,7 +4,7 @@
 PASS click the form submission button should close the dialog
 PASS form submission should return correct value
 PASS no returnValue when there's no result.
-FAIL input image button should return the coordianates assert_false: dialog should be closed now expected false got true
+FAIL input image button should return the coordinates assert_false: dialog should be closed now expected false got true
 FAIL formmethod attribute should use dialog form submission promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
 FAIL closing the dialog while submitting should stop the submission promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to