[Webkit-unassigned] [Bug 42479] [Chromium] Implement WebFormElement::userSubmitted().

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 19 17:08:17 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=42479





--- Comment #7 from James Hawkins <jhawkins at chromium.org>  2010-07-19 17:08:16 PST ---
(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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list