WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
42479
[Chromium] Implement WebFormElement::userSubmitted().
https://bugs.webkit.org/show_bug.cgi?id=42479
Summary
[Chromium] Implement WebFormElement::userSubmitted().
James Hawkins
Reported
2010-07-16 13:33:19 PDT
[Chromium] Implement WebFormElement::userSubmitted().
Attachments
Patch
(4.97 KB, patch)
2010-07-16 13:34 PDT
,
James Hawkins
no flags
Details
Formatted Diff
Diff
Patch
(4.85 KB, patch)
2010-07-19 17:35 PDT
,
James Hawkins
no flags
Details
Formatted Diff
Diff
Patch
(5.51 KB, patch)
2010-07-20 13:27 PDT
,
James Hawkins
fishd
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
James Hawkins
Comment 1
2010-07-16 13:34:51 PDT
Created
attachment 61843
[details]
Patch
David Holloway
Comment 2
2010-07-16 14:31:03 PDT
LGTM.
Jay Civelli
Comment 3
2010-07-16 16:22:33 PDT
LGTM
Kent Tamura
Comment 4
2010-07-17 05:19:14 PDT
Comment on
attachment 61843
[details]
Patch Could you explain why we need this change in ChangeLog please?
Darin Fisher (:fishd, Google)
Comment 5
2010-07-17 20:54:17 PDT
Comment on
attachment 61843
[details]
Patch WebCore/html/HTMLFormElement.cpp:409 + // common browsers( sick! ) allow it be canceled. both spellings are correct according to the dictionary. probably better to leave the existing code unchanged. WebKit/chromium/src/WebFormElement.cpp:71 + return constUnwrap<HTMLFormElement>()->submissionTrigger() == NotSubmittedByJavaScript; are you sure you don't want to expose an enum for the variety of submission trigger types? WebKit/chromium/src/WebFormElement.cpp:69 + bool WebFormElement::userSubmitted() const I'm having a hard time understanding what this method name implies. Is this telling me that the user already submitted this form? what happens if the form is submitted multiple times (e.g., suppose it has a target that corresponds to an IFRAME)? what if the form is submitted once by javascript and then once by user action? what if the user clicks on a link, and some javascript runs, which then calls form.submit()? would that be regarded as a non-user submitted form?
James Hawkins
Comment 6
2010-07-19 17:03:41 PDT
(In reply to
comment #4
)
> (From update of
attachment 61843
[details]
) > Could you explain why we need this change in ChangeLog please?
Added more info to the ChangeLog.
James Hawkins
Comment 7
2010-07-19 17:08:16 PDT
(In reply to
comment #5
)
> (From update of
attachment 61843
[details]
) > WebCore/html/HTMLFormElement.cpp:409 > + // common browsers( sick! ) allow it be canceled. > both spellings are correct according to the dictionary. probably > better to leave the existing code unchanged. >
Done.
> WebKit/chromium/src/WebFormElement.cpp:71 > + return constUnwrap<HTMLFormElement>()->submissionTrigger() == NotSubmittedByJavaScript; > are you sure you don't want to expose an enum for the variety > of submission trigger types? >
I thought about it, but decided not to over-engineer it for now (keeping it simple). If a client needs to know more than just whether a user submitted the form, it's simple to add.
> WebKit/chromium/src/WebFormElement.cpp:69 > + bool WebFormElement::userSubmitted() const > I'm having a hard time understanding what this method name implies. Is > this telling me that the user already submitted this form? what happens > if the form is submitted multiple times (e.g., suppose it has a target > that corresponds to an IFRAME)? what if the form is submitted once by > javascript and then once by user action? >
What do you think about wasUserSubmitted()? The value returned is for the last submitted form, so in the case you mention, if the client calls this method after the user submitted the form, it will return true.
> what if the user clicks on a link, and some javascript runs, which > then calls form.submit()? would that be regarded as a non-user > submitted form?
From my reading of the code, this latter case will not be consider user-submitted.
James Hawkins
Comment 8
2010-07-19 17:35:29 PDT
Created
attachment 62018
[details]
Patch
Darin Fisher (:fishd, Google)
Comment 9
2010-07-19 22:50:25 PDT
(In reply to
comment #7
)
> I thought about it, but decided not to over-engineer it for now (keeping it > simple). If a client needs to know more than just whether a user submitted > the form, it's simple to add.
OK
> What do you think about wasUserSubmitted()? The value returned is for the last > submitted form, so in the case you mention, if the client calls this method > after the user submitted the form, it will return true.
Sounds better. The verb helps.
> > what if the user clicks on a link, and some javascript runs, which > > then calls form.submit()? would that be regarded as a non-user > > submitted form? > > From my reading of the code, this latter case will not be consider user- > submitted.
OK
James Hawkins
Comment 10
2010-07-20 13:27:54 PDT
Created
attachment 62105
[details]
Patch
James Hawkins
Comment 11
2010-07-20 13:31:05 PDT
(In reply to
comment #9
)
> (In reply to
comment #7
) > > > What do you think about wasUserSubmitted()? The value returned is for the last > > submitted form, so in the case you mention, if the client calls this method > > after the user submitted the form, it will return true. > > Sounds better. The verb helps. >
Done
James Hawkins
Comment 12
2010-07-20 16:23:41 PDT
Committed
r63786
: <
http://trac.webkit.org/changeset/63786
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug