Changeset 253799 in webkit
- Timestamp:
- Dec 19, 2019 4:28:57 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r253795 r253799 1 2019-12-19 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=205164 5 <rdar://problem/57879042> 6 7 Reviewed by Ryosuke Niwa. 8 9 * fast/forms/form-double-submission-expected.txt: Added. 10 * fast/forms/form-double-submission.html: Added. 11 * fast/forms/resources/form-double-submission-frame.html: Added. 12 Add layout test for the regression that was introduced the first time this patch landed. 13 14 * http/tests/misc/multiple-submit-expected.txt: 15 Rebaseline test due to behavior change. I have verified that our new behavior on this test is 16 aligned with Firefox 71 and Chrome 79. 17 18 * platform/mac/TestExpectations: 19 Unskip tests that are no longer flaky. 20 1 21 2019-12-19 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/LayoutTests/http/tests/misc/multiple-submit-expected.txt
r19940 r253799 1 submitted=form 21 submitted=form1 -
trunk/LayoutTests/imported/w3c/ChangeLog
r253797 r253799 1 2019-12-19 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=205164 5 <rdar://problem/57879042> 6 7 Reviewed by Ryosuke Niwa. 8 9 Rebaseline tests that are now passing. 10 11 * web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3-expected.txt: 12 * web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-expected.txt: 13 1 14 2019-12-19 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3-expected.txt
r253666 r253799 5 5 submit 6 6 7 FAIL <button> should have the same double-submit protection as <input type=submit> assert_unreached: Frame1 should not get navigated by this test. Reached unreachable code 7 PASS <button> should have the same double-submit protection as <input type=submit> 8 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-expected.txt
r253666 r253799 5 5 6 6 7 FAIL default submit action should supersede onclick submit() assert_unreached: Frame1 should not get navigated by this test. Reached unreachable code 7 PASS default submit action should supersede onclick submit() 8 8 -
trunk/LayoutTests/platform/mac/TestExpectations
r253768 r253799 1964 1964 webkit.org/b/205361 [ Release ] crypto/workers/subtle/aes-indexeddb.html [ Pass Timeout ] 1965 1965 1966 webkit.org/b/205164 imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html [ Pass Failure ]1967 webkit.org/b/205164 imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit.html [ Pass Failure ]1968 1969 1966 webkit.org/b/205403 accessibility/presentation-role-iframe.html [ Pass Failure ] -
trunk/Source/WebCore/ChangeLog
r253790 r253799 1 2019-12-19 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=205164 5 <rdar://problem/57879042> 6 7 Reviewed by Ryosuke Niwa. 8 9 Submitting a form should cancel any pending navigation scheduled by a previous submission of this form: 10 - https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 22.3) 11 12 No new tests, rebaselined existing tests. 13 14 Test: fast/forms/form-double-submission.html 15 16 * html/HTMLFormElement.cpp: 17 (WebCore::HTMLFormElement::submit): 18 * html/HTMLFormElement.h: 19 * loader/FormSubmission.h: 20 (WebCore::FormSubmission::cancel): 21 (WebCore::FormSubmission::wasCancelled const): 22 23 * loader/FrameLoader.cpp: 24 (WebCore::FrameLoader::submitForm): 25 Drop previous non-standard compliant logic to avoid double-form submission. 26 27 * loader/NavigationScheduler.cpp: 28 1 29 2019-12-19 Ryosuke Niwa <rniwa@webkit.org> 2 30 -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r253666 r253799 359 359 360 360 auto shouldLockHistory = processingUserGesture ? LockHistory::No : LockHistory::Yes; 361 frame->loader().submitForm(FormSubmission::create(*this, m_attributes, event, shouldLockHistory, formSubmissionTrigger)); 361 auto formSubmission = FormSubmission::create(*this, m_attributes, event, shouldLockHistory, formSubmissionTrigger); 362 if (m_plannedFormSubmission) 363 m_plannedFormSubmission->cancel(); 364 m_plannedFormSubmission = makeWeakPtr(formSubmission.get()); 365 frame->loader().submitForm(WTFMove(formSubmission)); 362 366 363 367 if (needButtonActivation && firstSuccessfulSubmitButton) -
trunk/Source/WebCore/html/HTMLFormElement.h
r253666 r253799 182 182 Vector<WeakPtr<HTMLImageElement>> m_imageElements; 183 183 WeakHashSet<HTMLFormControlElement> m_invalidAssociatedFormControls; 184 WeakPtr<FormSubmission> m_plannedFormSubmission; 184 185 185 186 bool m_wasUserSubmitted { false }; -
trunk/Source/WebCore/loader/FormSubmission.h
r253666 r253799 34 34 #include "FrameLoaderTypes.h" 35 35 #include <wtf/URL.h> 36 #include <wtf/WeakPtr.h> 36 37 37 38 namespace WebCore { … … 41 42 class FrameLoadRequest; 42 43 43 class FormSubmission : public RefCounted<FormSubmission> {44 class FormSubmission : public RefCounted<FormSubmission>, public CanMakeWeakPtr<FormSubmission> { 44 45 public: 45 enum class Method { Get, Post };46 enum class Method : bool { Get, Post }; 46 47 47 48 class Attributes { … … 97 98 void setOrigin(const String& origin) { m_origin = origin; } 98 99 100 void cancel() { m_wasCancelled = true; } 101 bool wasCancelled() const { return m_wasCancelled; } 102 99 103 private: 100 104 FormSubmission(Method, const URL& action, const String& target, const String& contentType, Ref<FormState>&&, Ref<FormData>&&, const String& boundary, LockHistory, Event*); … … 102 106 // FIXME: Hold an instance of Attributes instead of individual members. 103 107 Method m_method; 108 bool m_wasCancelled { false }; 104 109 URL m_action; 105 110 String m_target; -
trunk/Source/WebCore/loader/FrameLoader.cpp
r253654 r253799 486 486 return; 487 487 488 // FIXME: We'd like to remove this altogether and fix the multiple form submission issue another way. 489 490 // We do not want to submit more than one form from the same page, nor do we want to submit a single 491 // form more than once. This flag prevents these from happening; not sure how other browsers prevent this. 492 // The flag is reset in each time we start dispatching a new mouse or key down event, and 493 // also in setView since this part may get reused for a page from the back/forward cache. 494 // The form multi-submit logic here is only needed when we are submitting a form that affects this frame. 495 496 // FIXME: Frame targeting is only one of the ways the submission could end up doing something other 497 // than replacing this frame's content, so this check is flawed. On the other hand, the check is hardly 498 // needed any more now that we reset m_submittedFormURL on each mouse or key down event. 499 500 if (m_frame.tree().isDescendantOf(targetFrame)) { 501 if (m_submittedFormURL == submission->requestURL()) 502 return; 488 if (m_frame.tree().isDescendantOf(targetFrame)) 503 489 m_submittedFormURL = submission->requestURL(); 504 }505 490 506 491 submission->setReferrer(outgoingReferrer()); -
trunk/Source/WebCore/loader/NavigationScheduler.cpp
r253666 r253799 278 278 void fire(Frame& frame) override 279 279 { 280 if (m_submission->wasCancelled()) 281 return; 282 280 283 UserGestureIndicator gestureIndicator(userGestureToForward()); 281 284
Note: See TracChangeset
for help on using the changeset viewer.