Skip to content

Commit

Permalink
Unreviewed, revert r253493 because it broke an Apple internal site
Browse files Browse the repository at this point in the history
LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-expected.txt:

Source/WebCore:

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):
* html/HTMLFormElement.h:
* loader/FormSubmission.h:
(WebCore::FormSubmission::cancel): Deleted.
(WebCore::FormSubmission::wasCancelled const): Deleted.
* loader/NavigationScheduler.cpp:

LayoutTests:

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Dec 18, 2019
1 parent 059c459 commit aecebf1
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 19 deletions.
6 changes: 6 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2019-12-17 Chris Dumez <[email protected]>

Unreviewed, revert r253493 because it broke an Apple internal site

* platform/mac/TestExpectations:

2019-12-17 Fujii Hironori <[email protected]>

[cairo] text-align:justify wrongly expands CJK ideograph characters
Expand Down
7 changes: 7 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2019-12-17 Chris Dumez <[email protected]>

Unreviewed, revert r253493 because it broke an Apple internal site

* web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3-expected.txt:
* web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-expected.txt:

2019-12-17 Chris Dumez <[email protected]>

Re-sync html/semantics/embedded-content/the-canvas-element from upstream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ This frame should navigate (to 404)

submit

PASS <button> should have the same double-submit protection as <input type=submit>
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

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ This frame should navigate (to 404)



PASS default submit action should supersede onclick submit()
FAIL default submit action should supersede onclick submit() assert_unreached: Frame1 should not get navigated by this test. Reached unreachable code

4 changes: 3 additions & 1 deletion LayoutTests/platform/mac/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1965,4 +1965,6 @@ webkit.org/b/204247 [ Catalina ] webaudio/silence-after-playback.html [ Failure

webkit.org/b/205216 imported/w3c/web-platform-tests/content-security-policy/reporting/report-same-origin-with-cookies.html [ Pass Failure ]

webkit.org/b/205361 [ Release ] crypto/workers/subtle/aes-indexeddb.html [ Pass Timeout ]
webkit.org/b/205361 [ Release ] crypto/workers/subtle/aes-indexeddb.html [ Pass Timeout ]

webkit.org/b/205164 imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html [ Pass Failure ]
12 changes: 12 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2019-12-17 Chris Dumez <[email protected]>

Unreviewed, revert r253493 because it broke an Apple internal site

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):
* html/HTMLFormElement.h:
* loader/FormSubmission.h:
(WebCore::FormSubmission::cancel): Deleted.
(WebCore::FormSubmission::wasCancelled const): Deleted.
* loader/NavigationScheduler.cpp:

2019-12-17 Fujii Hironori <[email protected]>

[cairo] text-align:justify wrongly expands CJK ideograph characters
Expand Down
6 changes: 1 addition & 5 deletions Source/WebCore/html/HTMLFormElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,7 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool proce
auto protectedThis = makeRef(*this); // Form submission can execute arbitary JavaScript.

auto shouldLockHistory = processingUserGesture ? LockHistory::No : LockHistory::Yes;
auto formSubmission = FormSubmission::create(*this, m_attributes, event, shouldLockHistory, formSubmissionTrigger);
if (m_plannedFormSubmission)
m_plannedFormSubmission->cancel();
m_plannedFormSubmission = makeWeakPtr(formSubmission.get());
frame->loader().submitForm(WTFMove(formSubmission));
frame->loader().submitForm(FormSubmission::create(*this, m_attributes, event, shouldLockHistory, formSubmissionTrigger));

if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/html/HTMLFormElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class HTMLFormElement final : public HTMLElement {
Vector<FormAssociatedElement*> m_associatedElements;
Vector<WeakPtr<HTMLImageElement>> m_imageElements;
WeakHashSet<HTMLFormControlElement> m_invalidAssociatedFormControls;
WeakPtr<FormSubmission> m_plannedFormSubmission;

bool m_wasUserSubmitted { false };
bool m_isSubmittingOrPreparingForSubmission { false };
Expand Down
9 changes: 2 additions & 7 deletions Source/WebCore/loader/FormSubmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@
#include "FormState.h"
#include "FrameLoaderTypes.h"
#include <wtf/URL.h>
#include <wtf/WeakPtr.h>

namespace WebCore {

class Event;
class FormData;
class FrameLoadRequest;

class FormSubmission : public RefCounted<FormSubmission>, public CanMakeWeakPtr<FormSubmission> {
class FormSubmission : public RefCounted<FormSubmission> {
public:
enum class Method : bool { Get, Post };
enum class Method { Get, Post };

class Attributes {
public:
Expand Down Expand Up @@ -97,15 +96,11 @@ class FormSubmission : public RefCounted<FormSubmission>, public CanMakeWeakPtr<
void setReferrer(const String& referrer) { m_referrer = referrer; }
void setOrigin(const String& origin) { m_origin = origin; }

void cancel() { m_wasCancelled = true; }
bool wasCancelled() const { return m_wasCancelled; }

private:
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.
Method m_method;
bool m_wasCancelled { false };
URL m_action;
String m_target;
String m_contentType;
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/loader/NavigationScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ class ScheduledFormSubmission : public ScheduledNavigation {

void fire(Frame& frame) override
{
if (m_submission->wasCancelled())
return;

UserGestureIndicator gestureIndicator(userGestureToForward());

// The submitForm function will find a target frame before using the redirection timer.
Expand Down

0 comments on commit aecebf1

Please sign in to comment.