Diff
Modified: trunk/LayoutTests/ChangeLog (279942 => 279943)
--- trunk/LayoutTests/ChangeLog 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/ChangeLog 2021-07-15 13:09:55 UTC (rev 279943)
@@ -1,3 +1,14 @@
+2021-07-15 Tim Nguyen <[email protected]>
+
+ Re-import html/semantics/interactive-elements/the-dialog-element WPT
+ https://bugs.webkit.org/show_bug.cgi?id=227986
+
+ Unreviewed.
+
+ Upstream commit: https://github.com/web-platform-tests/wpt/commit/10a8411ba8ed0012da5ecefc6eba9956a13b2c21
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:
+
2021-07-15 Philippe Normand <[email protected]>
[GStreamer][Pipewire] Implement getDisplayMedia() backend
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279942 => 279943)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-07-15 13:09:55 UTC (rev 279943)
@@ -1,3 +1,17 @@
+2021-07-15 Tim Nguyen <[email protected]>
+
+ Re-import html/semantics/interactive-elements/the-dialog-element WPT
+ https://bugs.webkit.org/show_bug.cgi?id=227986
+
+ Unreviewed.
+
+ Upstream commit: https://github.com/web-platform-tests/wpt/commit/10a8411ba8ed0012da5ecefc6eba9956a13b2c21
+
+ * 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-open-expected.txt:
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html:
+
2021-07-15 Ziran Sun <[email protected]>
Resync web-platform-tests/css/css-grid tests from upstream
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (279942 => 279943)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt 2021-07-15 13:09:55 UTC (rev 279943)
@@ -5,4 +5,5 @@
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
+PASS calling form.submit() in click handler of submit button should start the submission synchronously
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html (279942 => 279943)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html 2021-07-15 13:09:55 UTC (rev 279943)
@@ -99,5 +99,33 @@
assert_equals(dialog.returnValue, "", "dialog's returnValue remains the same");
}, "closing the dialog while submitting should stop the submission");
+promise_test(async () => {
+ const dialog = document.querySelector('dialog');
+ dialog.returnValue = undefined;
+ dialog.showModal();
+
+ let submitEvent = false;
+ const dialogForm = document.getElementById('dialogForm');
+ dialogForm._onsubmit_ = function() {
+ submitEvent = true;
+ assert_false(dialog.open, "dialog should be closed");
+ assert_equals(dialog.returnValue, "", "dialog's returnValue remains the same");
+ };
+
+ const button = document.querySelector('button');
+ button.value = "sushi";
+ button._onclick_ = function() {
+ dialogForm.submit();
+ assert_false(dialog.open, "dialog should be closed now");
+ // The returnValue should be "" because there is no submitter
+ assert_equals(dialog.returnValue, "", "returnValue shouldn be empty string");
+ };
+
+ button.click();
+ assert_true(submitEvent, "Should have submit event");
+ assert_false(dialog.open, "dialog should be closed");
+ assert_equals(dialog.returnValue, "", "dialog's returnValue remains the same");
+}, "calling form.submit() in click handler of submit button should start the submission synchronously");
+
</script>
</body>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-expected.txt (279942 => 279943)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-expected.txt 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open-expected.txt 2021-07-15 13:09:55 UTC (rev 279943)
@@ -4,4 +4,5 @@
PASS On getting, the IDL open attribute must return true if the content open attribute is set, and false if it is absent.
PASS On setting, the content open attribute must be removed if the IDL open attribute is set to false, and must be present if the IDL open attribute is set to true.
+FAIL On setting it to false, the close event should not be fired assert_unreached: close event should not be fired when just setting the open attribute Reached unreachable code
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html (279942 => 279943)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-open.html 2021-07-15 13:09:55 UTC (rev 279943)
@@ -27,4 +27,17 @@
d2.open = false;
assert_false(d2.hasAttribute("open"));
}, "On setting, the content open attribute must be removed if the IDL open attribute is set to false, and must be present if the IDL open attribute is set to true.");
+
+ async_test(function(t){
+ d2.open = true;
+ assert_true(d2.hasAttribute("open"));
+ d2._onclose_ = t.unreached_func("close event should not be fired when just setting the open attribute");
+ d2.open = false;
+ assert_false(d2.hasAttribute("open"));
+
+ // close event is async, give it a chance to be fired
+ t.step_timeout(function() {
+ t.done();
+ }, 0);
+ }, "On setting it to false, the close event should not be fired");
</script>
Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (279942 => 279943)
--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt 2021-07-15 12:54:50 UTC (rev 279942)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt 2021-07-15 13:09:55 UTC (rev 279943)
@@ -7,4 +7,5 @@
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."
+FAIL calling form.submit() in click handler of submit button should start the submission synchronously promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."