Title: [223117] trunk
Revision
223117
Author
[email protected]
Date
2017-10-09 20:19:22 -0700 (Mon, 09 Oct 2017)

Log Message

It should not be possible to submit a form that is disconnected
https://bugs.webkit.org/show_bug.cgi?id=178099

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline several WPT tests now that more checks are passing.

* web-platform-tests/dom/events/Event-dispatch-click-expected.txt:
* web-platform-tests/html/semantics/forms/the-button-element/button-click-submits-expected.txt:

Source/WebCore:

It should not be possible to submit a form that is disconnected. Both Firefox and Chrome agree with the specification.

This is as per:
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 1)
which refers to:
https://html.spec.whatwg.org/multipage/links.html#cannot-navigate

Form cannot navigate when it is disconnected.

No new tests, rebaselined existing tests.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (223116 => 223117)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-10-10 02:48:39 UTC (rev 223116)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-10-10 03:19:22 UTC (rev 223117)
@@ -1,5 +1,17 @@
 2017-10-09  Chris Dumez  <[email protected]>
 
+        It should not be possible to submit a form that is disconnected
+        https://bugs.webkit.org/show_bug.cgi?id=178099
+
+        Reviewed by Sam Weinig.
+
+        Rebaseline several WPT tests now that more checks are passing.
+
+        * web-platform-tests/dom/events/Event-dispatch-click-expected.txt:
+        * web-platform-tests/html/semantics/forms/the-button-element/button-click-submits-expected.txt:
+
+2017-10-09  Chris Dumez  <[email protected]>
+
         usemap-casing.html test passes in browser, fails in LayoutTests because it is taller than 600px
         https://bugs.webkit.org/show_bug.cgi?id=178053
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-click-expected.txt (223116 => 223117)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-click-expected.txt	2017-10-10 02:48:39 UTC (rev 223116)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-click-expected.txt	2017-10-10 03:19:22 UTC (rev 223117)
@@ -12,5 +12,5 @@
 PASS disabled checkbox still has activation behavior, part 2 
 PASS disconnected checkbox should be checked 
 PASS disconnected radio should be checked 
-FAIL disconnected form should not submit assert_false: expected false got true
+PASS disconnected form should not submit 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-click-submits-expected.txt (223116 => 223117)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-click-submits-expected.txt	2017-10-10 02:48:39 UTC (rev 223116)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-button-element/button-click-submits-expected.txt	2017-10-10 03:19:22 UTC (rev 223117)
@@ -5,9 +5,9 @@
 hello
 
 PASS clicking a button with .click() should trigger a submit (form connected) 
-FAIL clicking a button with .click() should not trigger a submit (form disconnected) assert_unreached: Form should not be submitted Reached unreachable code
+PASS clicking a button with .click() should not trigger a submit (form disconnected) 
 PASS clicking a button by dispatching an event should trigger a submit (form connected) 
-FAIL clicking a button by dispatching an event should not trigger a submit (form disconnected) assert_unreached: Form should not be submitted Reached unreachable code
+PASS clicking a button by dispatching an event should not trigger a submit (form disconnected) 
 PASS clicking a button that cancels the event should not trigger a submit 
 PASS clicking a disabled button (via disabled attribute) should not trigger submit 
 PASS clicking a disabled button (via ancestor fieldset) should not trigger submit 

Modified: trunk/Source/WebCore/ChangeLog (223116 => 223117)


--- trunk/Source/WebCore/ChangeLog	2017-10-10 02:48:39 UTC (rev 223116)
+++ trunk/Source/WebCore/ChangeLog	2017-10-10 03:19:22 UTC (rev 223117)
@@ -1,3 +1,24 @@
+2017-10-09  Chris Dumez  <[email protected]>
+
+        It should not be possible to submit a form that is disconnected
+        https://bugs.webkit.org/show_bug.cgi?id=178099
+
+        Reviewed by Sam Weinig.
+
+        It should not be possible to submit a form that is disconnected. Both Firefox and Chrome agree with the specification.
+
+        This is as per:
+        https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 1)
+        which refers to:
+        https://html.spec.whatwg.org/multipage/links.html#cannot-navigate
+
+        Form cannot navigate when it is disconnected.
+
+        No new tests, rebaselined existing tests.
+
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::prepareForSubmission):
+
 2017-10-09  Myles C. Maxfield  <[email protected]>
 
         Delete button doesn't fully delete certain emoji

Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (223116 => 223117)


--- trunk/Source/WebCore/html/HTMLFormElement.cpp	2017-10-10 02:48:39 UTC (rev 223116)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp	2017-10-10 03:19:22 UTC (rev 223117)
@@ -257,6 +257,9 @@
 
 void HTMLFormElement::prepareForSubmission(Event& event)
 {
+    if (!isConnected())
+        return;
+
     Frame* frame = document().frame();
     if (m_isSubmittingOrPreparingForSubmission || !frame)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to