Changeset 63786 in webkit


Ignore:
Timestamp:
Jul 20, 2010 4:23:28 PM (14 years ago)
Author:
jhawkins@chromium.org
Message:

2010-07-16 James Hawkins <jhawkins@chromium.org>

Reviewed by Darin Fisher.

[Chromium] Implement WebFormElement::wasUserSubmitted(). This is used to
verify that the user submitted the form instead of JS when saving form
data in AutoFill.
https://bugs.webkit.org/show_bug.cgi?id=42479

  • public/WebFormElement.h:
  • src/WebFormElement.cpp: (WebKit::WebFormElement::wasUserSubmitted):

2010-07-16 James Hawkins <jhawkins@chromium.org>

Reviewed by Darin Fisher.

Expose the form submission trigger on the HTMLFormElement object. This
is used to verify that the user submitted the form instead of JS when
saving form data in Chrome AutoFill.
https://bugs.webkit.org/show_bug.cgi?id=42479

No new tests as this is only used by the Chromium WebKit API.

  • html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement): (WebCore::HTMLFormElement::submit): (WebCore::HTMLFormElement::reset): (WebCore::HTMLFormElement::submissionTrigger):
  • html/HTMLFormElement.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63782 r63786  
     12010-07-16  James Hawkins  <jhawkins@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Expose the form submission trigger on the HTMLFormElement object. This
     6        is used to verify that the user submitted the form instead of JS when
     7        saving form data in Chrome AutoFill.
     8        https://bugs.webkit.org/show_bug.cgi?id=42479
     9
     10        No new tests as this is only used by the Chromium WebKit API.
     11
     12        * html/HTMLFormElement.cpp:
     13        (WebCore::HTMLFormElement::HTMLFormElement):
     14        (WebCore::HTMLFormElement::submit):
     15        (WebCore::HTMLFormElement::reset):
     16        (WebCore::HTMLFormElement::submissionTrigger):
     17        * html/HTMLFormElement.h:
     18
    1192010-07-20  Adam Barth  <abarth@webkit.org>
    220
  • trunk/WebCore/html/HTMLFormElement.cpp

    r61959 r63786  
    7575HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document)
    7676    : HTMLElement(tagName, document)
     77    , m_submissionTrigger(NotSubmittedByJavaScript)
    7778    , m_autocomplete(true)
    7879    , m_insubmit(false)
     
    371372
    372373    m_insubmit = true;
     374    m_submissionTrigger = formSubmissionTrigger;
    373375
    374376    HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
     
    560562}
    561563
     564FormSubmissionTrigger HTMLFormElement::submissionTrigger() const
     565{
     566    return m_submissionTrigger;
     567}
     568
    562569HTMLFormControlElement* HTMLFormElement::defaultButton() const
    563570{
  • trunk/WebCore/html/HTMLFormElement.h

    r61960 r63786  
    9999    virtual String target() const;
    100100
     101    FormSubmissionTrigger submissionTrigger() const;
     102
    101103    HTMLFormControlElement* defaultButton() const;
    102104
     
    154156    Vector<HTMLImageElement*> m_imageElements;
    155157
     158    FormSubmissionTrigger m_submissionTrigger;
     159
    156160    bool m_autocomplete : 1;
    157161    bool m_insubmit : 1;
  • trunk/WebKit/chromium/ChangeLog

    r63780 r63786  
     12010-07-16  James Hawkins  <jhawkins@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] Implement WebFormElement::wasUserSubmitted(). This is used to
     6        verify that the user submitted the form instead of JS when saving form
     7        data in AutoFill.
     8        https://bugs.webkit.org/show_bug.cgi?id=42479
     9
     10        * public/WebFormElement.h:
     11        * src/WebFormElement.cpp:
     12        (WebKit::WebFormElement::wasUserSubmitted):
     13
    1142010-07-20  Daniel Erat  <derat@chromium.org>
    215
  • trunk/WebKit/chromium/public/WebFormElement.h

    r58839 r63786  
    6464        WEBKIT_API WebString name() const;
    6565        WEBKIT_API WebString method() const;
     66        WEBKIT_API bool wasUserSubmitted() const;
    6667        WEBKIT_API void submit();
    6768        // FIXME: Deprecate and replace with WebVector<WebElement>.
  • trunk/WebKit/chromium/src/WebFormElement.cpp

    r60419 r63786  
    3232#include "WebFormElement.h"
    3333
     34#include "FormState.h"
    3435#include "HTMLFormControlElement.h"
    3536#include "HTMLFormElement.h"
     
    5657}
    5758
    58 WebString WebFormElement::name() const 
     59WebString WebFormElement::name() const
    5960{
    6061    return constUnwrap<HTMLFormElement>()->name();
    6162}
    6263
    63 WebString WebFormElement::method() const 
     64WebString WebFormElement::method() const
    6465{
    6566    return constUnwrap<HTMLFormElement>()->method();
    6667}
    67    
     68
     69bool WebFormElement::wasUserSubmitted() const
     70{
     71    return constUnwrap<HTMLFormElement>()->submissionTrigger() == NotSubmittedByJavaScript;
     72}
     73
    6874void WebFormElement::submit()
    6975{
     
    7884    result.assign(tempVector);
    7985}
    80    
     86
    8187void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
    8288{
Note: See TracChangeset for help on using the changeset viewer.