<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279401] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279401">279401</a></dd>
<dt>Author</dt> <dd>ntim@apple.com</dd>
<dt>Date</dt> <dd>2021-06-29 22:37:56 -0700 (Tue, 29 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>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.

LayoutTests/imported/w3c:

* web-platform-tests/html/dom/reflection-forms-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt:

Source/WebCore:

* 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):

LayoutTests:

* 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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsinteractiveelementsthedialogelementdialogformsubmissionexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiosimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2importedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwpeimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementh">trunk/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementcpp">trunk/Source/WebCore/html/HTMLFormElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementh">trunk/Source/WebCore/html/HTMLFormElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlImageInputTypecpp">trunk/Source/WebCore/html/ImageInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageInputTypeh">trunk/Source/WebCore/html/ImageInputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypecpp">trunk/Source/WebCore/html/InputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypeh">trunk/Source/WebCore/html/InputType.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFormSubmissioncpp">trunk/Source/WebCore/loader/FormSubmission.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFormSubmissionh">trunk/Source/WebCore/loader/FormSubmission.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestshtmlsemanticsinteractiveelementsthedialogelementdialogformsubmissionexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/ChangeLog 2021-06-30 05:37:56 UTC (rev 279401)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2021-06-29  Tim Nguyen  <ntim@apple.com>
+
+        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:
+
</ins><span class="cx"> 2021-06-29  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Resync speech-api WPT tests from upstream
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-06-30 02:13:41 UTC (rev 279400)
+++ trunk/LayoutTests/TestExpectations  2021-06-30 05:37:56 UTC (rev 279401)
</span><span class="lines">@@ -472,7 +472,6 @@
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/select-event.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/textfieldselection-setRangeText.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-submit-remove-children.html [ Skip ]
</span><del>-imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission.html [ Skip ]
</del><span class="cx"> imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/referrer-no-referrer.sub.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/referrer-origin-when-cross-origin.sub.html [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/referrer-origin.sub.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-06-29  Tim Nguyen  <ntim@apple.com>
+
+        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:
+
</ins><span class="cx"> 2021-06-29  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Resync speech-api WPT tests from upstream
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -521,11 +521,11 @@
</span><span class="cx"> PASS form.method: setAttribute() to "post\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ost"
</span><span class="cx"> PASS form.method: setAttribute() to "POST"
</span><del>-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog"
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog"
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ialog"
</span><del>-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS form.method: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS form.method: IDL set to undefined
</span><span class="lines">@@ -551,11 +551,11 @@
</span><span class="cx"> PASS form.method: IDL set to "post\0"
</span><span class="cx"> PASS form.method: IDL set to "ost"
</span><span class="cx"> PASS form.method: IDL set to "POST"
</span><del>-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog"
</ins><span class="cx"> PASS form.method: IDL set to "xdialog"
</span><span class="cx"> PASS form.method: IDL set to "dialog\0"
</span><span class="cx"> PASS form.method: IDL set to "ialog"
</span><del>-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG"
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to ""
</span><span class="lines">@@ -3519,11 +3519,11 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "post\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ost"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST"
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog"
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog"
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS button.formMethod: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS button.formMethod: IDL set to undefined
</span><span class="lines">@@ -3549,11 +3549,11 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "post\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ost"
</span><span class="cx"> PASS button.formMethod: IDL set to "POST"
</span><del>-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog"
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog"
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog"
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG"
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to ""
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsinteractiveelementsthedialogelementdialogformsubmissionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,9 +1,8 @@
</span><del>-Confirm
</del><span class="cx"> 
</span><ins>+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
</ins><span class="cx"> 
</span><del>-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."
-
</del></span></pre></div>
<a id="trunkLayoutTestsplatformgtkimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -632,11 +632,11 @@
</span><span class="cx"> PASS form.method: setAttribute() to "ost"
</span><span class="cx"> PASS form.method: setAttribute() to "POST"
</span><span class="cx"> PASS form.method: setAttribute() to "poſt"
</span><del>-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog"
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog"
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ialog"
</span><del>-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS form.method: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS form.method: IDL set to undefined
</span><span class="lines">@@ -666,11 +666,11 @@
</span><span class="cx"> PASS form.method: IDL set to "ost"
</span><span class="cx"> PASS form.method: IDL set to "POST"
</span><span class="cx"> PASS form.method: IDL set to "poſt"
</span><del>-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog"
</ins><span class="cx"> PASS form.method: IDL set to "xdialog"
</span><span class="cx"> PASS form.method: IDL set to "dialog\0"
</span><span class="cx"> PASS form.method: IDL set to "ialog"
</span><del>-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG"
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to ""
</span><span class="lines">@@ -4180,11 +4180,11 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ost"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "poſt"
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog"
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog"
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS button.formMethod: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS button.formMethod: IDL set to undefined
</span><span class="lines">@@ -4214,11 +4214,11 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "ost"
</span><span class="cx"> PASS button.formMethod: IDL set to "POST"
</span><span class="cx"> PASS button.formMethod: IDL set to "poſt"
</span><del>-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog"
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog"
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog"
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG"
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to ""
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiosimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1150,7 +1150,7 @@
</span><span class="cx"> PASS form.method: setAttribute() to "POST" followed by getAttribute()
</span><span class="cx"> PASS form.method: setAttribute() to "POST" followed by IDL get
</span><span class="cx"> PASS form.method: setAttribute() to "dialog" followed by getAttribute()
</span><del>-FAIL form.method: setAttribute() to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog" followed by IDL get
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog" followed by getAttribute()
</span><span class="cx"> PASS form.method: setAttribute() to "xdialog" followed by IDL get
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0" followed by getAttribute()
</span><span class="lines">@@ -1158,7 +1158,7 @@
</span><span class="cx"> PASS form.method: setAttribute() to "ialog" followed by getAttribute()
</span><span class="cx"> PASS form.method: setAttribute() to "ialog" followed by IDL get
</span><span class="cx"> PASS form.method: setAttribute() to "DIALOG" followed by getAttribute()
</span><del>-FAIL form.method: setAttribute() to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG" followed by IDL get
</ins><span class="cx"> PASS form.method: IDL set to "" should not throw
</span><span class="cx"> PASS form.method: IDL set to "" followed by getAttribute()
</span><span class="cx"> PASS form.method: IDL set to "" followed by IDL get
</span><span class="lines">@@ -1235,7 +1235,7 @@
</span><span class="cx"> PASS form.method: IDL set to "POST" followed by IDL get
</span><span class="cx"> PASS form.method: IDL set to "dialog" should not throw
</span><span class="cx"> PASS form.method: IDL set to "dialog" followed by getAttribute()
</span><del>-FAIL form.method: IDL set to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog" followed by IDL get
</ins><span class="cx"> PASS form.method: IDL set to "xdialog" should not throw
</span><span class="cx"> PASS form.method: IDL set to "xdialog" followed by getAttribute()
</span><span class="cx"> PASS form.method: IDL set to "xdialog" followed by IDL get
</span><span class="lines">@@ -1247,7 +1247,7 @@
</span><span class="cx"> PASS form.method: IDL set to "ialog" followed by IDL get
</span><span class="cx"> PASS form.method: IDL set to "DIALOG" should not throw
</span><span class="cx"> PASS form.method: IDL set to "DIALOG" followed by getAttribute()
</span><del>-FAIL form.method: IDL set to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG" followed by IDL get
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to "" followed by getAttribute()
</span><span class="lines">@@ -8272,7 +8272,7 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST" followed by getAttribute()
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST" followed by IDL get
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog" followed by getAttribute()
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog" followed by IDL get
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog" followed by getAttribute()
</span><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog" followed by IDL get
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0" followed by getAttribute()
</span><span class="lines">@@ -8280,7 +8280,7 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog" followed by getAttribute()
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog" followed by IDL get
</span><span class="cx"> PASS button.formMethod: setAttribute() to "DIALOG" followed by getAttribute()
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG" followed by IDL get
</ins><span class="cx"> PASS button.formMethod: IDL set to "" should not throw
</span><span class="cx"> PASS button.formMethod: IDL set to "" followed by getAttribute()
</span><span class="cx"> PASS button.formMethod: IDL set to "" followed by IDL get
</span><span class="lines">@@ -8357,7 +8357,7 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "POST" followed by IDL get
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog" should not throw
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog" followed by getAttribute()
</span><del>-FAIL button.formMethod: IDL set to "dialog" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog" followed by IDL get
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog" should not throw
</span><span class="cx"> PASS button.formMethod: IDL set to "xdialog" followed by getAttribute()
</span><span class="cx"> PASS button.formMethod: IDL set to "xdialog" followed by IDL get
</span><span class="lines">@@ -8369,7 +8369,7 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog" followed by IDL get
</span><span class="cx"> PASS button.formMethod: IDL set to "DIALOG" should not throw
</span><span class="cx"> PASS button.formMethod: IDL set to "DIALOG" followed by getAttribute()
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" followed by IDL get assert_equals: expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG" followed by IDL get
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to "" followed by getAttribute()
</span></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -632,11 +632,11 @@
</span><span class="cx"> PASS form.method: setAttribute() to "ost"
</span><span class="cx"> PASS form.method: setAttribute() to "POST"
</span><span class="cx"> PASS form.method: setAttribute() to "poſt"
</span><del>-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog"
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog"
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ialog"
</span><del>-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS form.method: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS form.method: IDL set to undefined
</span><span class="lines">@@ -666,11 +666,11 @@
</span><span class="cx"> PASS form.method: IDL set to "ost"
</span><span class="cx"> PASS form.method: IDL set to "POST"
</span><span class="cx"> PASS form.method: IDL set to "poſt"
</span><del>-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog"
</ins><span class="cx"> PASS form.method: IDL set to "xdialog"
</span><span class="cx"> PASS form.method: IDL set to "dialog\0"
</span><span class="cx"> PASS form.method: IDL set to "ialog"
</span><del>-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG"
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to ""
</span><span class="lines">@@ -4180,11 +4180,11 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ost"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "poſt"
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog"
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog"
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS button.formMethod: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS button.formMethod: IDL set to undefined
</span><span class="lines">@@ -4214,11 +4214,11 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "ost"
</span><span class="cx"> PASS button.formMethod: IDL set to "POST"
</span><span class="cx"> PASS button.formMethod: IDL set to "poſt"
</span><del>-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog"
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog"
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog"
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG"
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to ""
</span></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestshtmlsemanticsinteractiveelementsthedialogelementdialogformsubmissionexpectedtxt"></a>
<div class="addfile"><h4>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)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+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."
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -632,11 +632,11 @@
</span><span class="cx"> PASS form.method: setAttribute() to "ost"
</span><span class="cx"> PASS form.method: setAttribute() to "POST"
</span><span class="cx"> PASS form.method: setAttribute() to "poſt"
</span><del>-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog"
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog"
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ialog"
</span><del>-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS form.method: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS form.method: IDL set to undefined
</span><span class="lines">@@ -666,11 +666,11 @@
</span><span class="cx"> PASS form.method: IDL set to "ost"
</span><span class="cx"> PASS form.method: IDL set to "POST"
</span><span class="cx"> PASS form.method: IDL set to "poſt"
</span><del>-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog"
</ins><span class="cx"> PASS form.method: IDL set to "xdialog"
</span><span class="cx"> PASS form.method: IDL set to "dialog\0"
</span><span class="cx"> PASS form.method: IDL set to "ialog"
</span><del>-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG"
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to ""
</span><span class="lines">@@ -4180,11 +4180,11 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ost"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "poſt"
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog"
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog"
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS button.formMethod: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS button.formMethod: IDL set to undefined
</span><span class="lines">@@ -4214,11 +4214,11 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "ost"
</span><span class="cx"> PASS button.formMethod: IDL set to "POST"
</span><span class="cx"> PASS button.formMethod: IDL set to "poſt"
</span><del>-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog"
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog"
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog"
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG"
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to ""
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2importedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -632,11 +632,11 @@
</span><span class="cx"> PASS form.method: setAttribute() to "ost"
</span><span class="cx"> PASS form.method: setAttribute() to "POST"
</span><span class="cx"> PASS form.method: setAttribute() to "poſt"
</span><del>-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog"
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog"
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ialog"
</span><del>-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS form.method: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS form.method: IDL set to undefined
</span><span class="lines">@@ -666,11 +666,11 @@
</span><span class="cx"> PASS form.method: IDL set to "ost"
</span><span class="cx"> PASS form.method: IDL set to "POST"
</span><span class="cx"> PASS form.method: IDL set to "poſt"
</span><del>-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog"
</ins><span class="cx"> PASS form.method: IDL set to "xdialog"
</span><span class="cx"> PASS form.method: IDL set to "dialog\0"
</span><span class="cx"> PASS form.method: IDL set to "ialog"
</span><del>-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG"
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to ""
</span><span class="lines">@@ -4180,11 +4180,11 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ost"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "poſt"
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog"
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog"
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS button.formMethod: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS button.formMethod: IDL set to undefined
</span><span class="lines">@@ -4214,11 +4214,11 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "ost"
</span><span class="cx"> PASS button.formMethod: IDL set to "POST"
</span><span class="cx"> PASS button.formMethod: IDL set to "poſt"
</span><del>-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog"
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog"
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog"
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG"
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to ""
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwpeimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -632,11 +632,11 @@
</span><span class="cx"> PASS form.method: setAttribute() to "ost"
</span><span class="cx"> PASS form.method: setAttribute() to "POST"
</span><span class="cx"> PASS form.method: setAttribute() to "poſt"
</span><del>-FAIL form.method: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "dialog"
</ins><span class="cx"> PASS form.method: setAttribute() to "xdialog"
</span><span class="cx"> PASS form.method: setAttribute() to "dialog\0"
</span><span class="cx"> PASS form.method: setAttribute() to "ialog"
</span><del>-FAIL form.method: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS form.method: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS form.method: IDL set to undefined
</span><span class="lines">@@ -666,11 +666,11 @@
</span><span class="cx"> PASS form.method: IDL set to "ost"
</span><span class="cx"> PASS form.method: IDL set to "POST"
</span><span class="cx"> PASS form.method: IDL set to "poſt"
</span><del>-FAIL form.method: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "dialog"
</ins><span class="cx"> PASS form.method: IDL set to "xdialog"
</span><span class="cx"> PASS form.method: IDL set to "dialog\0"
</span><span class="cx"> PASS form.method: IDL set to "ialog"
</span><del>-FAIL form.method: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS form.method: IDL set to "DIALOG"
</ins><span class="cx"> PASS form.name: typeof IDL attribute
</span><span class="cx"> PASS form.name: IDL get with DOM attribute unset
</span><span class="cx"> PASS form.name: setAttribute() to ""
</span><span class="lines">@@ -4180,11 +4180,11 @@
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ost"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "POST"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "poſt"
</span><del>-FAIL button.formMethod: setAttribute() to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "dialog"
</ins><span class="cx"> PASS button.formMethod: setAttribute() to "xdialog"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "dialog\0"
</span><span class="cx"> PASS button.formMethod: setAttribute() to "ialog"
</span><del>-FAIL button.formMethod: setAttribute() to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: setAttribute() to "DIALOG"
</ins><span class="cx"> PASS button.formMethod: IDL set to ""
</span><span class="cx"> 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 "
</span><span class="cx"> PASS button.formMethod: IDL set to undefined
</span><span class="lines">@@ -4214,11 +4214,11 @@
</span><span class="cx"> PASS button.formMethod: IDL set to "ost"
</span><span class="cx"> PASS button.formMethod: IDL set to "POST"
</span><span class="cx"> PASS button.formMethod: IDL set to "poſt"
</span><del>-FAIL button.formMethod: IDL set to "dialog" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "dialog"
</ins><span class="cx"> PASS button.formMethod: IDL set to "xdialog"
</span><span class="cx"> PASS button.formMethod: IDL set to "dialog\0"
</span><span class="cx"> PASS button.formMethod: IDL set to "ialog"
</span><del>-FAIL button.formMethod: IDL set to "DIALOG" assert_equals: IDL get expected "dialog" but got "get"
</del><ins>+PASS button.formMethod: IDL set to "DIALOG"
</ins><span class="cx"> PASS button.formNoValidate: typeof IDL attribute
</span><span class="cx"> PASS button.formNoValidate: IDL get with DOM attribute unset
</span><span class="cx"> PASS button.formNoValidate: setAttribute() to ""
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2021-06-29  Tim Nguyen  <ntim@apple.com>
+
+        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):
+
</ins><span class="cx"> 2021-06-29  Johnson Zhou  <qiaosong_zhou@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Encoding specified in the 'charset' attribute should have precedence over 'content' attribute
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -128,6 +128,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool isSubmitButton() const { return false; }
</span><span class="cx"> 
</span><ins>+    virtual String resultForDialogSubmit() const { return attributeWithoutSynchronization(HTMLNames::valueAttr); }
+
</ins><span class="cx">     using Node::ref;
</span><span class="cx">     using Node::deref;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "FrameLoaderClient.h"
</span><ins>+#include "HTMLDialogElement.h"
</ins><span class="cx"> #include "HTMLFieldSetElement.h"
</span><span class="cx"> #include "HTMLFormControlsCollection.h"
</span><span class="cx"> #include "HTMLImageElement.h"
</span><span class="lines">@@ -51,6 +52,7 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "RadioNodeList.h"
</span><span class="cx"> #include "RenderTextControl.h"
</span><ins>+#include "RuntimeEnabledFeatures.h"
</ins><span class="cx"> #include "ScriptDisallowedScope.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="lines">@@ -399,7 +401,11 @@
</span><span class="cx">         m_plannedFormSubmission->cancel();
</span><span class="cx"> 
</span><span class="cx">     m_plannedFormSubmission = makeWeakPtr(formSubmission.get());
</span><del>-    frame->loader().submitForm(WTFMove(formSubmission));
</del><ins>+    
+    if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && formSubmission->method() == FormSubmission::Method::Dialog)
+        submitDialog(WTFMove(formSubmission));
+    else
+        frame->loader().submitForm(WTFMove(formSubmission));
</ins><span class="cx"> 
</span><span class="cx">     if (firstSuccessfulSubmitButton)
</span><span class="cx">         firstSuccessfulSubmitButton->setActivatedSubmit(false);
</span><span class="lines">@@ -408,6 +414,20 @@
</span><span class="cx">     m_isSubmittingOrPreparingForSubmission = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// 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());
+}
+
</ins><span class="cx"> void HTMLFormElement::reset()
</span><span class="cx"> {
</span><span class="cx">     if (m_isInResetFunction)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.h (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -143,6 +143,8 @@
</span><span class="cx"> 
</span><span class="cx">     void submit(Event*, bool activateSubmitButton, bool processingUserGesture, FormSubmissionTrigger, HTMLFormControlElement* submitter = nullptr);
</span><span class="cx"> 
</span><ins>+    void submitDialog(Ref<FormSubmission>&&);
+
</ins><span class="cx">     unsigned formElementIndexWithFormAttribute(Element*, unsigned rangeStart, unsigned rangeEnd);
</span><span class="cx">     unsigned formElementIndex(FormAssociatedElement*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -2150,4 +2150,9 @@
</span><span class="cx">     m_inputType->capsLockStateMayHaveChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String HTMLInputElement::resultForDialogSubmit() const
+{
+    return m_inputType->resultForDialogSubmit();
+}
+
</ins><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -345,6 +345,8 @@
</span><span class="cx"> 
</span><span class="cx">     ExceptionOr<void> setSelectionRangeForBindings(int start, int end, const String& direction);
</span><span class="cx"> 
</span><ins>+    String resultForDialogSubmit() const final;
+
</ins><span class="cx"> protected:
</span><span class="cx">     HTMLInputElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageInputType.cpp (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -215,4 +215,9 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String ImageInputType::resultForDialogSubmit() const
+{
+    return makeString(m_clickLocation.x(), ',', m_clickLocation.y());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageInputType.h (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">     bool shouldRespectHeightAndWidthAttributes() final;
</span><span class="cx">     unsigned height() const final;
</span><span class="cx">     unsigned width() const final;
</span><ins>+    String resultForDialogSubmit() const final;
</ins><span class="cx"> 
</span><span class="cx">     IntPoint m_clickLocation; // Valid only during HTMLFormElement::submitIfPossible().
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.cpp (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1083,4 +1083,10 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String InputType::resultForDialogSubmit() const
+{
+    ASSERT(element());
+    return element()->value();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.h (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -397,6 +397,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String displayString() const;
</span><span class="cx"> 
</span><ins>+    virtual String resultForDialogSubmit() const;
+
</ins><span class="cx"> protected:
</span><span class="cx">     explicit InputType(Type type, HTMLInputElement& element)
</span><span class="cx">         : m_type(type)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFormSubmissioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FormSubmission.cpp (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -84,6 +84,13 @@
</span><span class="cx">         url.setQuery(makeString(query, '&', body));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ASCIILiteral FormSubmission::Attributes::methodString(Method method)
+{
+    if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && method == Method::Dialog)
+        return "dialog"_s;
+    return method == Method::Post ? "post"_s : "get"_s;
+}
+
</ins><span class="cx"> void FormSubmission::Attributes::parseAction(const String& action)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Can we parse into a URL?
</span><span class="lines">@@ -107,7 +114,13 @@
</span><span class="cx"> 
</span><span class="cx"> FormSubmission::Method FormSubmission::Attributes::parseMethodType(const String& type)
</span><span class="cx"> {
</span><del>-    return equalLettersIgnoringASCIICase(type, "post") ? FormSubmission::Method::Post : FormSubmission::Method::Get;
</del><ins>+    if (RuntimeEnabledFeatures::sharedFeatures().dialogElementEnabled() && equalLettersIgnoringASCIICase(type, "dialog"))
+        return FormSubmission::Method::Dialog;
+
+    if (equalLettersIgnoringASCIICase(type, "post"))
+        return FormSubmission::Method::Post;
+
+    return FormSubmission::Method::Get;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FormSubmission::Attributes::updateMethodType(const String& type)
</span><span class="lines">@@ -115,6 +128,17 @@
</span><span class="cx">     m_method = parseMethodType(type);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+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)
+{
+}
+
</ins><span class="cx"> 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)
</span><span class="cx">     : m_method(method)
</span><span class="cx">     , m_action(action)
</span><span class="lines">@@ -158,12 +182,20 @@
</span><span class="cx">         if (!(attributeValue = submitter->attributeWithoutSynchronization(formtargetAttr)).isNull())
</span><span class="cx">             copiedAttributes.setTarget(attributeValue);
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     auto& document = form.document();
</span><ins>+    auto encodingType = copiedAttributes.encodingType();
</ins><span class="cx">     auto actionURL = document.completeURL(copiedAttributes.action().isEmpty() ? document.url().string() : copiedAttributes.action());
</span><ins>+
+    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);
+
</ins><span class="cx">     bool isMailtoForm = actionURL.protocolIs("mailto");
</span><span class="cx">     bool isMultiPartForm = false;
</span><del>-    auto encodingType = copiedAttributes.encodingType();
</del><span class="cx"> 
</span><span class="cx">     document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(actionURL, ContentSecurityPolicy::InsecureRequestType::FormSubmission);
</span><span class="cx"> 
</span><span class="lines">@@ -220,16 +252,20 @@
</span><span class="cx"> 
</span><span class="cx"> URL FormSubmission::requestURL() const
</span><span class="cx"> {
</span><ins>+    ASSERT(m_method == Method::Post || m_method == Method::Get);
+
</ins><span class="cx">     if (m_method == Method::Post)
</span><span class="cx">         return m_action;
</span><span class="cx"> 
</span><span class="cx">     URL requestURL(m_action);
</span><del>-    requestURL.setQuery(m_formData->flattenToString());    
</del><ins>+    requestURL.setQuery(m_formData->flattenToString());
</ins><span class="cx">     return requestURL;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
</span><span class="cx"> {
</span><ins>+    ASSERT(m_method == Method::Post || m_method == Method::Get);
+
</ins><span class="cx">     if (!m_target.isEmpty())
</span><span class="cx">         frameRequest.setFrameName(m_target);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFormSubmissionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FormSubmission.h (279400 => 279401)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "FormState.h"
</span><span class="cx"> #include "FrameLoaderTypes.h"
</span><ins>+#include "RuntimeEnabledFeatures.h"
</ins><span class="cx"> #include <wtf/URL.h>
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx"> 
</span><span class="lines">@@ -44,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> class FormSubmission : public RefCounted<FormSubmission>, public CanMakeWeakPtr<FormSubmission> {
</span><span class="cx"> public:
</span><del>-    enum class Method : bool { Get, Post };
</del><ins>+    enum class Method : uint8_t { Get, Post, Dialog };
</ins><span class="cx"> 
</span><span class="cx">     class Attributes {
</span><span class="cx">     public:
</span><span class="lines">@@ -51,7 +52,7 @@
</span><span class="cx">         Method method() const { return m_method; }
</span><span class="cx">         static Method parseMethodType(const String&);
</span><span class="cx">         void updateMethodType(const String&);
</span><del>-        static ASCIILiteral methodString(Method method) { return method == Method::Post ? "post"_s : "get"_s; }
</del><ins>+        static ASCIILiteral methodString(Method);
</ins><span class="cx"> 
</span><span class="cx">         const String& action() const { return m_action; }
</span><span class="cx">         void parseAction(const String&);
</span><span class="lines">@@ -87,7 +88,7 @@
</span><span class="cx">     const String& contentType() const { return m_contentType; }
</span><span class="cx">     FormState& state() const { return *m_formState; }
</span><span class="cx">     Ref<FormState> takeState() { return m_formState.releaseNonNull(); }
</span><del>-    FormData& data() const { return m_formData; }
</del><ins>+    FormData& data() const { return *m_formData; }
</ins><span class="cx">     const String boundary() const { return m_boundary; }
</span><span class="cx">     LockHistory lockHistory() const { return m_lockHistory; }
</span><span class="cx">     Event* event() const { return m_event.get(); }
</span><span class="lines">@@ -94,6 +95,8 @@
</span><span class="cx">     const String& referrer() const { return m_referrer; }
</span><span class="cx">     const String& origin() const { return m_origin; }
</span><span class="cx"> 
</span><ins>+    const String& returnValue() const { return m_returnValue; }
+
</ins><span class="cx">     void clearTarget() { m_target = { }; }
</span><span class="cx">     void setReferrer(const String& referrer) { m_referrer = referrer; }
</span><span class="cx">     void setOrigin(const String& origin) { m_origin = origin; }
</span><span class="lines">@@ -102,6 +105,10 @@
</span><span class="cx">     bool wasCancelled() const { return m_wasCancelled; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    // dialog form submissions
+    FormSubmission(Method, const String& returnValue, const URL& action, const String& target, const String& contentType, LockHistory, Event*);
+
+    // get/post form submissions
</ins><span class="cx">     FormSubmission(Method, const URL& action, const String& target, const String& contentType, Ref<FormState>&&, Ref<FormData>&&, const String& boundary, LockHistory, Event*);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Hold an instance of Attributes instead of individual members.
</span><span class="lines">@@ -111,12 +118,14 @@
</span><span class="cx">     String m_target;
</span><span class="cx">     String m_contentType;
</span><span class="cx">     RefPtr<FormState> m_formState;
</span><del>-    Ref<FormData> m_formData;
</del><ins>+    RefPtr<FormData> m_formData;
</ins><span class="cx">     String m_boundary;
</span><span class="cx">     LockHistory m_lockHistory;
</span><span class="cx">     RefPtr<Event> m_event;
</span><span class="cx">     String m_referrer;
</span><span class="cx">     String m_origin;
</span><ins>+
+    String m_returnValue; // for form[method=dialog]
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>