Diff
Modified: trunk/LayoutTests/ChangeLog (279400 => 279401)
--- trunk/LayoutTests/ChangeLog 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/ChangeLog 2021-06-30 05:37:56 UTC (rev 279401)
@@ -1,3 +1,21 @@
+2021-06-29 Tim Nguyen <[email protected]>
+
+ Implement form[method=dialog]
+ https://bugs.webkit.org/show_bug.cgi?id=226172
+
+ Reviewed by Chris Dumez.
+
+ Marked relevant WPT as pass & unskipped relevant test.
+
+ * platform/gtk/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt: Added.
+ * platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * TestExpectations:
+
2021-06-29 Chris Dumez <[email protected]>
Resync speech-api WPT tests from upstream
Modified: trunk/LayoutTests/TestExpectations (279400 => 279401)
--- trunk/LayoutTests/TestExpectations 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/TestExpectations 2021-06-30 05:37:56 UTC (rev 279401)
@@ -472,7 +472,6 @@
imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/select-event.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-submit-remove-children.html [ Skip ]
-imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/referrer-no-referrer.sub.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/referrer-origin-when-cross-origin.sub.html [ Skip ]
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/referrer-origin.sub.html [ Skip ]
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279400 => 279401)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-06-30 05:37:56 UTC (rev 279401)
@@ -1,3 +1,15 @@
+2021-06-29 Tim Nguyen <[email protected]>
+
+ Implement form[method=dialog]
+ https://bugs.webkit.org/show_bug.cgi?id=226172
+
+ Reviewed by Chris Dumez.
+
+ Marked relevant WPT as pass & unskipped relevant test.
+
+ * web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:
+
2021-06-29 Chris Dumez <[email protected]>
Resync speech-api WPT tests from upstream
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -521,11 +521,11 @@
PASS form.method: setAttribute() to "post\0"
PASS form.method: setAttribute() to "ost"
PASS form.method: setAttribute() to "POST"
-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog"
PASS form.method: setAttribute() to "xdialog"
PASS form.method: setAttribute() to "dialog\0"
PASS form.method: setAttribute() to "ialog"
-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG"
PASS form.method: IDL set to ""
PASS form.method: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS form.method: IDL set to undefined
@@ -551,11 +551,11 @@
PASS form.method: IDL set to "post\0"
PASS form.method: IDL set to "ost"
PASS form.method: IDL set to "POST"
-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog"
PASS form.method: IDL set to "xdialog"
PASS form.method: IDL set to "dialog\0"
PASS form.method: IDL set to "ialog"
-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG"
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to ""
@@ -3519,11 +3519,11 @@
PASS button.formMethod: setAttribute() to "post\0"
PASS button.formMethod: setAttribute() to "ost"
PASS button.formMethod: setAttribute() to "POST"
-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog"
PASS button.formMethod: setAttribute() to "xdialog"
PASS button.formMethod: setAttribute() to "dialog\0"
PASS button.formMethod: setAttribute() to "ialog"
-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG"
PASS button.formMethod: IDL set to ""
PASS button.formMethod: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS button.formMethod: IDL set to undefined
@@ -3549,11 +3549,11 @@
PASS button.formMethod: IDL set to "post\0"
PASS button.formMethod: IDL set to "ost"
PASS button.formMethod: IDL set to "POST"
-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog"
PASS button.formMethod: IDL set to "xdialog"
PASS button.formMethod: IDL set to "dialog\0"
PASS button.formMethod: IDL set to "ialog"
-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG"
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to ""
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (279400 => 279401)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -1,9 +1,8 @@
-Confirm
+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 formmethod attribute should use dialog form submission
+PASS closing the dialog while submitting should stop the submission
-FAIL click the form submission button should close the dialog assert_false: dialog should be closed now expected false got true
-FAIL form submission should return correct value promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
-FAIL no returnValue when there's no result. promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
-FAIL input image button should return the coordianates promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
-FAIL formmethod attribute should use dialog form submission promise_test: Unhandled rejection with value: object "InvalidStateError: The object is in an invalid state."
-
Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -632,11 +632,11 @@
PASS form.method: setAttribute() to "ost"
PASS form.method: setAttribute() to "POST"
PASS form.method: setAttribute() to "poſt"
-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog"
PASS form.method: setAttribute() to "xdialog"
PASS form.method: setAttribute() to "dialog\0"
PASS form.method: setAttribute() to "ialog"
-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG"
PASS form.method: IDL set to ""
PASS form.method: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS form.method: IDL set to undefined
@@ -666,11 +666,11 @@
PASS form.method: IDL set to "ost"
PASS form.method: IDL set to "POST"
PASS form.method: IDL set to "poſt"
-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog"
PASS form.method: IDL set to "xdialog"
PASS form.method: IDL set to "dialog\0"
PASS form.method: IDL set to "ialog"
-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG"
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to ""
@@ -4180,11 +4180,11 @@
PASS button.formMethod: setAttribute() to "ost"
PASS button.formMethod: setAttribute() to "POST"
PASS button.formMethod: setAttribute() to "poſt"
-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog"
PASS button.formMethod: setAttribute() to "xdialog"
PASS button.formMethod: setAttribute() to "dialog\0"
PASS button.formMethod: setAttribute() to "ialog"
-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG"
PASS button.formMethod: IDL set to ""
PASS button.formMethod: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS button.formMethod: IDL set to undefined
@@ -4214,11 +4214,11 @@
PASS button.formMethod: IDL set to "ost"
PASS button.formMethod: IDL set to "POST"
PASS button.formMethod: IDL set to "poſt"
-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog"
PASS button.formMethod: IDL set to "xdialog"
PASS button.formMethod: IDL set to "dialog\0"
PASS button.formMethod: IDL set to "ialog"
-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG"
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to ""
Modified: trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -1150,7 +1150,7 @@
PASS form.method: setAttribute() to "POST" followed by getAttribute()
PASS form.method: setAttribute() to "POST" followed by IDL get
PASS form.method: setAttribute() to "dialog" followed by getAttribute()
-FAIL form.method: setAttribute() to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog" followed by IDL get
PASS form.method: setAttribute() to "xdialog" followed by getAttribute()
PASS form.method: setAttribute() to "xdialog" followed by IDL get
PASS form.method: setAttribute() to "dialog\0" followed by getAttribute()
@@ -1158,7 +1158,7 @@
PASS form.method: setAttribute() to "ialog" followed by getAttribute()
PASS form.method: setAttribute() to "ialog" followed by IDL get
PASS form.method: setAttribute() to "DIALOG" followed by getAttribute()
-FAIL form.method: setAttribute() to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG" followed by IDL get
PASS form.method: IDL set to "" should not throw
PASS form.method: IDL set to "" followed by getAttribute()
PASS form.method: IDL set to "" followed by IDL get
@@ -1235,7 +1235,7 @@
PASS form.method: IDL set to "POST" followed by IDL get
PASS form.method: IDL set to "dialog" should not throw
PASS form.method: IDL set to "dialog" followed by getAttribute()
-FAIL form.method: IDL set to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog" followed by IDL get
PASS form.method: IDL set to "xdialog" should not throw
PASS form.method: IDL set to "xdialog" followed by getAttribute()
PASS form.method: IDL set to "xdialog" followed by IDL get
@@ -1247,7 +1247,7 @@
PASS form.method: IDL set to "ialog" followed by IDL get
PASS form.method: IDL set to "DIALOG" should not throw
PASS form.method: IDL set to "DIALOG" followed by getAttribute()
-FAIL form.method: IDL set to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG" followed by IDL get
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to "" followed by getAttribute()
@@ -8272,7 +8272,7 @@
PASS button.formMethod: setAttribute() to "POST" followed by getAttribute()
PASS button.formMethod: setAttribute() to "POST" followed by IDL get
PASS button.formMethod: setAttribute() to "dialog" followed by getAttribute()
-FAIL button.formMethod: setAttribute() to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog" followed by IDL get
PASS button.formMethod: setAttribute() to "xdialog" followed by getAttribute()
PASS button.formMethod: setAttribute() to "xdialog" followed by IDL get
PASS button.formMethod: setAttribute() to "dialog\0" followed by getAttribute()
@@ -8280,7 +8280,7 @@
PASS button.formMethod: setAttribute() to "ialog" followed by getAttribute()
PASS button.formMethod: setAttribute() to "ialog" followed by IDL get
PASS button.formMethod: setAttribute() to "DIALOG" followed by getAttribute()
-FAIL button.formMethod: setAttribute() to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG" followed by IDL get
PASS button.formMethod: IDL set to "" should not throw
PASS button.formMethod: IDL set to "" followed by getAttribute()
PASS button.formMethod: IDL set to "" followed by IDL get
@@ -8357,7 +8357,7 @@
PASS button.formMethod: IDL set to "POST" followed by IDL get
PASS button.formMethod: IDL set to "dialog" should not throw
PASS button.formMethod: IDL set to "dialog" followed by getAttribute()
-FAIL button.formMethod: IDL set to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog" followed by IDL get
PASS button.formMethod: IDL set to "xdialog" should not throw
PASS button.formMethod: IDL set to "xdialog" followed by getAttribute()
PASS button.formMethod: IDL set to "xdialog" followed by IDL get
@@ -8369,7 +8369,7 @@
PASS button.formMethod: IDL set to "ialog" followed by IDL get
PASS button.formMethod: IDL set to "DIALOG" should not throw
PASS button.formMethod: IDL set to "DIALOG" followed by getAttribute()
-FAIL button.formMethod: IDL set to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG" followed by IDL get
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to "" followed by getAttribute()
Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -632,11 +632,11 @@
PASS form.method: setAttribute() to "ost"
PASS form.method: setAttribute() to "POST"
PASS form.method: setAttribute() to "poſt"
-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog"
PASS form.method: setAttribute() to "xdialog"
PASS form.method: setAttribute() to "dialog\0"
PASS form.method: setAttribute() to "ialog"
-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG"
PASS form.method: IDL set to ""
PASS form.method: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS form.method: IDL set to undefined
@@ -666,11 +666,11 @@
PASS form.method: IDL set to "ost"
PASS form.method: IDL set to "POST"
PASS form.method: IDL set to "poſt"
-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog"
PASS form.method: IDL set to "xdialog"
PASS form.method: IDL set to "dialog\0"
PASS form.method: IDL set to "ialog"
-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG"
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to ""
@@ -4180,11 +4180,11 @@
PASS button.formMethod: setAttribute() to "ost"
PASS button.formMethod: setAttribute() to "POST"
PASS button.formMethod: setAttribute() to "poſt"
-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog"
PASS button.formMethod: setAttribute() to "xdialog"
PASS button.formMethod: setAttribute() to "dialog\0"
PASS button.formMethod: setAttribute() to "ialog"
-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG"
PASS button.formMethod: IDL set to ""
PASS button.formMethod: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS button.formMethod: IDL set to undefined
@@ -4214,11 +4214,11 @@
PASS button.formMethod: IDL set to "ost"
PASS button.formMethod: IDL set to "POST"
PASS button.formMethod: IDL set to "poſt"
-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog"
PASS button.formMethod: IDL set to "xdialog"
PASS button.formMethod: IDL set to "dialog\0"
PASS button.formMethod: IDL set to "ialog"
-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG"
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to ""
Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (0 => 279401)
--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (rev 0)
+++ 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 05:37:56 UTC (rev 279401)
@@ -0,0 +1,10 @@
+Confirm
+
+
+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 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."
+
Modified: trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -632,11 +632,11 @@
PASS form.method: setAttribute() to "ost"
PASS form.method: setAttribute() to "POST"
PASS form.method: setAttribute() to "poſt"
-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog"
PASS form.method: setAttribute() to "xdialog"
PASS form.method: setAttribute() to "dialog\0"
PASS form.method: setAttribute() to "ialog"
-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG"
PASS form.method: IDL set to ""
PASS form.method: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS form.method: IDL set to undefined
@@ -666,11 +666,11 @@
PASS form.method: IDL set to "ost"
PASS form.method: IDL set to "POST"
PASS form.method: IDL set to "poſt"
-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog"
PASS form.method: IDL set to "xdialog"
PASS form.method: IDL set to "dialog\0"
PASS form.method: IDL set to "ialog"
-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG"
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to ""
@@ -4180,11 +4180,11 @@
PASS button.formMethod: setAttribute() to "ost"
PASS button.formMethod: setAttribute() to "POST"
PASS button.formMethod: setAttribute() to "poſt"
-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog"
PASS button.formMethod: setAttribute() to "xdialog"
PASS button.formMethod: setAttribute() to "dialog\0"
PASS button.formMethod: setAttribute() to "ialog"
-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG"
PASS button.formMethod: IDL set to ""
PASS button.formMethod: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS button.formMethod: IDL set to undefined
@@ -4214,11 +4214,11 @@
PASS button.formMethod: IDL set to "ost"
PASS button.formMethod: IDL set to "POST"
PASS button.formMethod: IDL set to "poſt"
-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog"
PASS button.formMethod: IDL set to "xdialog"
PASS button.formMethod: IDL set to "dialog\0"
PASS button.formMethod: IDL set to "ialog"
-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG"
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to ""
Modified: trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -632,11 +632,11 @@
PASS form.method: setAttribute() to "ost"
PASS form.method: setAttribute() to "POST"
PASS form.method: setAttribute() to "poſt"
-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog"
PASS form.method: setAttribute() to "xdialog"
PASS form.method: setAttribute() to "dialog\0"
PASS form.method: setAttribute() to "ialog"
-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG"
PASS form.method: IDL set to ""
PASS form.method: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS form.method: IDL set to undefined
@@ -666,11 +666,11 @@
PASS form.method: IDL set to "ost"
PASS form.method: IDL set to "POST"
PASS form.method: IDL set to "poſt"
-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog"
PASS form.method: IDL set to "xdialog"
PASS form.method: IDL set to "dialog\0"
PASS form.method: IDL set to "ialog"
-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG"
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to ""
@@ -4180,11 +4180,11 @@
PASS button.formMethod: setAttribute() to "ost"
PASS button.formMethod: setAttribute() to "POST"
PASS button.formMethod: setAttribute() to "poſt"
-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog"
PASS button.formMethod: setAttribute() to "xdialog"
PASS button.formMethod: setAttribute() to "dialog\0"
PASS button.formMethod: setAttribute() to "ialog"
-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG"
PASS button.formMethod: IDL set to ""
PASS button.formMethod: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS button.formMethod: IDL set to undefined
@@ -4214,11 +4214,11 @@
PASS button.formMethod: IDL set to "ost"
PASS button.formMethod: IDL set to "POST"
PASS button.formMethod: IDL set to "poſt"
-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog"
PASS button.formMethod: IDL set to "xdialog"
PASS button.formMethod: IDL set to "dialog\0"
PASS button.formMethod: IDL set to "ialog"
-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG"
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to ""
Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)
--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt 2021-06-30 05:37:56 UTC (rev 279401)
@@ -632,11 +632,11 @@
PASS form.method: setAttribute() to "ost"
PASS form.method: setAttribute() to "POST"
PASS form.method: setAttribute() to "poſt"
-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "dialog"
PASS form.method: setAttribute() to "xdialog"
PASS form.method: setAttribute() to "dialog\0"
PASS form.method: setAttribute() to "ialog"
-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: setAttribute() to "DIALOG"
PASS form.method: IDL set to ""
PASS form.method: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS form.method: IDL set to undefined
@@ -666,11 +666,11 @@
PASS form.method: IDL set to "ost"
PASS form.method: IDL set to "POST"
PASS form.method: IDL set to "poſt"
-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "dialog"
PASS form.method: IDL set to "xdialog"
PASS form.method: IDL set to "dialog\0"
PASS form.method: IDL set to "ialog"
-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS form.method: IDL set to "DIALOG"
PASS form.name: typeof IDL attribute
PASS form.name: IDL get with DOM attribute unset
PASS form.name: setAttribute() to ""
@@ -4180,11 +4180,11 @@
PASS button.formMethod: setAttribute() to "ost"
PASS button.formMethod: setAttribute() to "POST"
PASS button.formMethod: setAttribute() to "poſt"
-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "dialog"
PASS button.formMethod: setAttribute() to "xdialog"
PASS button.formMethod: setAttribute() to "dialog\0"
PASS button.formMethod: setAttribute() to "ialog"
-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: setAttribute() to "DIALOG"
PASS button.formMethod: IDL set to ""
PASS button.formMethod: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo "
PASS button.formMethod: IDL set to undefined
@@ -4214,11 +4214,11 @@
PASS button.formMethod: IDL set to "ost"
PASS button.formMethod: IDL set to "POST"
PASS button.formMethod: IDL set to "poſt"
-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "dialog"
PASS button.formMethod: IDL set to "xdialog"
PASS button.formMethod: IDL set to "dialog\0"
PASS button.formMethod: IDL set to "ialog"
-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
+PASS button.formMethod: IDL set to "DIALOG"
PASS button.formNoValidate: typeof IDL attribute
PASS button.formNoValidate: IDL get with DOM attribute unset
PASS button.formNoValidate: setAttribute() to ""
Modified: trunk/Source/WebCore/ChangeLog (279400 => 279401)
--- trunk/Source/WebCore/ChangeLog 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/ChangeLog 2021-06-30 05:37:56 UTC (rev 279401)
@@ -1,3 +1,38 @@
+2021-06-29 Tim Nguyen <[email protected]>
+
+ Implement form[method=dialog]
+ https://bugs.webkit.org/show_bug.cgi?id=226172
+
+ Reviewed by Chris Dumez.
+
+ Marked relevant WPT as pass & unskipped relevant test.
+
+ * html/HTMLFormControlElement.h:
+ (WebCore::HTMLFormControlElement::resultForDialogSubmit const):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::submit):
+ (WebCore::HTMLFormElement::submitDialog):
+ * html/HTMLFormElement.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::resultForDialogSubmit const):
+ * html/HTMLInputElement.h:
+ * html/ImageInputType.cpp:
+ (WebCore::ImageInputType::resultForDialogSubmit const):
+ * html/ImageInputType.h:
+ * html/InputType.cpp:
+ (WebCore::InputType::resultForDialogSubmit const):
+ * html/InputType.h:
+ * loader/FormSubmission.cpp:
+ (WebCore::FormSubmission::Attributes::parseMethodType):
+ (WebCore::FormSubmission::FormSubmission):
+ (WebCore::FormSubmission::create):
+ (WebCore::FormSubmission::populateFrameLoadRequest):
+ (WebCore::FormSubmission::requestURL const):
+ * loader/FormSubmission.h:
+ (WebCore::FormSubmission::Attributes::methodString):
+ (WebCore::FormSubmission::data const):
+ (WebCore::FormSubmission::returnValue const):
+
2021-06-29 Johnson Zhou <[email protected]>
Encoding specified in the 'charset' attribute should have precedence over 'content' attribute
Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (279400 => 279401)
--- trunk/Source/WebCore/html/HTMLFormControlElement.h 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h 2021-06-30 05:37:56 UTC (rev 279401)
@@ -128,6 +128,8 @@
virtual bool isSubmitButton() const { return false; }
+ virtual String resultForDialogSubmit() const { return attributeWithoutSynchronization(HTMLNames::valueAttr); }
+
using Node::ref;
using Node::deref;
Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (279400 => 279401)
--- trunk/Source/WebCore/html/HTMLFormElement.cpp 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp 2021-06-30 05:37:56 UTC (rev 279401)
@@ -37,6 +37,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
+#include "HTMLDialogElement.h"
#include "HTMLFieldSetElement.h"
#include "HTMLFormControlsCollection.h"
#include "HTMLImageElement.h"
@@ -51,6 +52,7 @@
#include "Page.h"
#include "RadioNodeList.h"
#include "RenderTextControl.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptDisallowedScope.h"
#include "Settings.h"
#include "UserGestureIndicator.h"
@@ -399,7 +401,11 @@
m_plannedFormSubmission->cancel();
m_plannedFormSubmission = makeWeakPtr(formSubmission.get());
- frame->loader().submitForm(WTFMove(formSubmission));
+
+ if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && formSubmission->method() == FormSubmission::Method::Dialog)
+ submitDialog(WTFMove(formSubmission));
+ else
+ frame->loader().submitForm(WTFMove(formSubmission));
if (firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
@@ -408,6 +414,20 @@
m_isSubmittingOrPreparingForSubmission = false;
}
+// https://html.spec.whatwg.org/#submit-dialog
+void HTMLFormElement::submitDialog(Ref<FormSubmission>&& formSubmission)
+{
+ // Let subject be the nearest ancestor dialog element of form, if any.
+ RefPtr dialog = ancestorsOfType<HTMLDialogElement>(*this).first();
+
+ // If there isn't one, or if it does not have an open attribute, do nothing.
+ if (!dialog || !dialog->isOpen())
+ return;
+
+ // Then, close the dialog subject. If there is a result, let that be the return value.
+ dialog->close(formSubmission->returnValue());
+}
+
void HTMLFormElement::reset()
{
if (m_isInResetFunction)
Modified: trunk/Source/WebCore/html/HTMLFormElement.h (279400 => 279401)
--- trunk/Source/WebCore/html/HTMLFormElement.h 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/HTMLFormElement.h 2021-06-30 05:37:56 UTC (rev 279401)
@@ -143,6 +143,8 @@
void submit(Event*, bool activateSubmitButton, bool processingUserGesture, FormSubmissionTrigger, HTMLFormControlElement* submitter = nullptr);
+ void submitDialog(Ref<FormSubmission>&&);
+
unsigned formElementIndexWithFormAttribute(Element*, unsigned rangeStart, unsigned rangeEnd);
unsigned formElementIndex(FormAssociatedElement*);
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (279400 => 279401)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2021-06-30 05:37:56 UTC (rev 279401)
@@ -2150,4 +2150,9 @@
m_inputType->capsLockStateMayHaveChanged();
}
+String HTMLInputElement::resultForDialogSubmit() const
+{
+ return m_inputType->resultForDialogSubmit();
+}
+
} // namespace
Modified: trunk/Source/WebCore/html/HTMLInputElement.h (279400 => 279401)
--- trunk/Source/WebCore/html/HTMLInputElement.h 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/HTMLInputElement.h 2021-06-30 05:37:56 UTC (rev 279401)
@@ -345,6 +345,8 @@
ExceptionOr<void> setSelectionRangeForBindings(int start, int end, const String& direction);
+ String resultForDialogSubmit() const final;
+
protected:
HTMLInputElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
Modified: trunk/Source/WebCore/html/ImageInputType.cpp (279400 => 279401)
--- trunk/Source/WebCore/html/ImageInputType.cpp 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/ImageInputType.cpp 2021-06-30 05:37:56 UTC (rev 279401)
@@ -215,4 +215,9 @@
return 0;
}
+String ImageInputType::resultForDialogSubmit() const
+{
+ return makeString(m_clickLocation.x(), ',', m_clickLocation.y());
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/html/ImageInputType.h (279400 => 279401)
--- trunk/Source/WebCore/html/ImageInputType.h 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/ImageInputType.h 2021-06-30 05:37:56 UTC (rev 279401)
@@ -55,6 +55,7 @@
bool shouldRespectHeightAndWidthAttributes() final;
unsigned height() const final;
unsigned width() const final;
+ String resultForDialogSubmit() const final;
IntPoint m_clickLocation; // Valid only during HTMLFormElement::submitIfPossible().
};
Modified: trunk/Source/WebCore/html/InputType.cpp (279400 => 279401)
--- trunk/Source/WebCore/html/InputType.cpp 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/InputType.cpp 2021-06-30 05:37:56 UTC (rev 279401)
@@ -1083,4 +1083,10 @@
return nullptr;
}
+String InputType::resultForDialogSubmit() const
+{
+ ASSERT(element());
+ return element()->value();
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/html/InputType.h (279400 => 279401)
--- trunk/Source/WebCore/html/InputType.h 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/html/InputType.h 2021-06-30 05:37:56 UTC (rev 279401)
@@ -397,6 +397,8 @@
virtual String displayString() const;
+ virtual String resultForDialogSubmit() const;
+
protected:
explicit InputType(Type type, HTMLInputElement& element)
: m_type(type)
Modified: trunk/Source/WebCore/loader/FormSubmission.cpp (279400 => 279401)
--- trunk/Source/WebCore/loader/FormSubmission.cpp 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/loader/FormSubmission.cpp 2021-06-30 05:37:56 UTC (rev 279401)
@@ -84,6 +84,13 @@
url.setQuery(makeString(query, '&', body));
}
+ASCIILiteral FormSubmission::Attributes::methodString(Method method)
+{
+ if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && method == Method::Dialog)
+ return "dialog"_s;
+ return method == Method::Post ? "post"_s : "get"_s;
+}
+
void FormSubmission::Attributes::parseAction(const String& action)
{
// FIXME: Can we parse into a URL?
@@ -107,7 +114,13 @@
FormSubmission::Method FormSubmission::Attributes::parseMethodType(const String& type)
{
- return equalLettersIgnoringASCIICase(type, "post") ? FormSubmission::Method::Post : FormSubmission::Method::Get;
+ if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && equalLettersIgnoringASCIICase(type, "dialog"))
+ return FormSubmission::Method::Dialog;
+
+ if (equalLettersIgnoringASCIICase(type, "post"))
+ return FormSubmission::Method::Post;
+
+ return FormSubmission::Method::Get;
}
void FormSubmission::Attributes::updateMethodType(const String& type)
@@ -115,6 +128,17 @@
m_method = parseMethodType(type);
}
+inline FormSubmission::FormSubmission(Method method, const String& returnValue, const URL& action, const String& target, const String& contentType, LockHistory lockHistory, Event* event)
+ : m_method(method)
+ , m_action(action)
+ , m_target(target)
+ , m_contentType(contentType)
+ , m_lockHistory(lockHistory)
+ , m_event(event)
+ , m_returnValue(returnValue)
+{
+}
+
inline FormSubmission::FormSubmission(Method method, const URL& action, const String& target, const String& contentType, Ref<FormState>&& state, Ref<FormData>&& data, const String& boundary, LockHistory lockHistory, Event* event)
: m_method(method)
, m_action(action)
@@ -158,12 +182,20 @@
if (!(attributeValue = submitter->attributeWithoutSynchronization(formtargetAttr)).isNull())
copiedAttributes.setTarget(attributeValue);
}
-
+
auto& document = form.document();
+ auto encodingType = copiedAttributes.encodingType();
auto actionURL = document.completeURL(copiedAttributes.action().isEmpty() ? document.url().string() : copiedAttributes.action());
+
+ if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && copiedAttributes.method() == Method::Dialog) {
+ String returnValue = submitter ? submitter->resultForDialogSubmit() : emptyString();
+ return adoptRef(*new FormSubmission(copiedAttributes.method(), returnValue, actionURL, form.effectiveTarget(event, submitter.get()), encodingType, lockHistory, event));
+ }
+
+ ASSERT(copiedAttributes.method() == Method::Post || copiedAttributes.method() == Method::Get);
+
bool isMailtoForm = actionURL.protocolIs("mailto");
bool isMultiPartForm = false;
- auto encodingType = copiedAttributes.encodingType();
document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(actionURL, ContentSecurityPolicy::InsecureRequestType::FormSubmission);
@@ -220,16 +252,20 @@
URL FormSubmission::requestURL() const
{
+ ASSERT(m_method == Method::Post || m_method == Method::Get);
+
if (m_method == Method::Post)
return m_action;
URL requestURL(m_action);
- requestURL.setQuery(m_formData->flattenToString());
+ requestURL.setQuery(m_formData->flattenToString());
return requestURL;
}
void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
{
+ ASSERT(m_method == Method::Post || m_method == Method::Get);
+
if (!m_target.isEmpty())
frameRequest.setFrameName(m_target);
Modified: trunk/Source/WebCore/loader/FormSubmission.h (279400 => 279401)
--- trunk/Source/WebCore/loader/FormSubmission.h 2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/Source/WebCore/loader/FormSubmission.h 2021-06-30 05:37:56 UTC (rev 279401)
@@ -32,6 +32,7 @@
#include "FormState.h"
#include "FrameLoaderTypes.h"
+#include "RuntimeEnabledFeatures.h"
#include <wtf/URL.h>
#include <wtf/WeakPtr.h>
@@ -44,7 +45,7 @@
class FormSubmission : public RefCounted<FormSubmission>, public CanMakeWeakPtr<FormSubmission> {
public:
- enum class Method : bool { Get, Post };
+ enum class Method : uint8_t { Get, Post, Dialog };
class Attributes {
public:
@@ -51,7 +52,7 @@
Method method() const { return m_method; }
static Method parseMethodType(const String&);
void updateMethodType(const String&);
- static ASCIILiteral methodString(Method method) { return method == Method::Post ? "post"_s : "get"_s; }
+ static ASCIILiteral methodString(Method);
const String& action() const { return m_action; }
void parseAction(const String&);
@@ -87,7 +88,7 @@
const String& contentType() const { return m_contentType; }
FormState& state() const { return *m_formState; }
Ref<FormState> takeState() { return m_formState.releaseNonNull(); }
- FormData& data() const { return m_formData; }
+ FormData& data() const { return *m_formData; }
const String boundary() const { return m_boundary; }
LockHistory lockHistory() const { return m_lockHistory; }
Event* event() const { return m_event.get(); }
@@ -94,6 +95,8 @@
const String& referrer() const { return m_referrer; }
const String& origin() const { return m_origin; }
+ const String& returnValue() const { return m_returnValue; }
+
void clearTarget() { m_target = { }; }
void setReferrer(const String& referrer) { m_referrer = referrer; }
void setOrigin(const String& origin) { m_origin = origin; }
@@ -102,6 +105,10 @@
bool wasCancelled() const { return m_wasCancelled; }
private:
+ // dialog form submissions
+ FormSubmission(Method, const String& returnValue, const URL& action, const String& target, const String& contentType, LockHistory, Event*);
+
+ // get/post form submissions
FormSubmission(Method, const URL& action, const String& target, const String& contentType, Ref<FormState>&&, Ref<FormData>&&, const String& boundary, LockHistory, Event*);
// FIXME: Hold an instance of Attributes instead of individual members.
@@ -111,12 +118,14 @@
String m_target;
String m_contentType;
RefPtr<FormState> m_formState;
- Ref<FormData> m_formData;
+ RefPtr<FormData> m_formData;
String m_boundary;
LockHistory m_lockHistory;
RefPtr<Event> m_event;
String m_referrer;
String m_origin;
+
+ String m_returnValue; // for form[method=dialog]
};
} // namespace WebCore