[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jhawkins at chromium.org jhawkins at chromium.org
Wed Dec 22 11:22:33 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 01efe407fbdeafa0f96731b314765de9c497b91c
Author: jhawkins at chromium.org <jhawkins at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 23:23:28 2010 +0000

    2010-07-16  James Hawkins  <jhawkins at 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 at 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:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63786 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9ea12c1..c8d510c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-16  James Hawkins  <jhawkins at 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:
+
 2010-07-20  Adam Barth  <abarth at webkit.org>
 
         Unreviewed.
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index 2eface2..4d6b603 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -74,6 +74,7 @@ static int64_t generateFormDataIdentifier()
 
 HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document)
     : HTMLElement(tagName, document)
+    , m_submissionTrigger(NotSubmittedByJavaScript)
     , m_autocomplete(true)
     , m_insubmit(false)
     , m_doingsubmit(false)
@@ -370,6 +371,7 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
     }
 
     m_insubmit = true;
+    m_submissionTrigger = formSubmissionTrigger;
 
     HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
     bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
@@ -559,6 +561,11 @@ String HTMLFormElement::target() const
     return getAttribute(targetAttr);
 }
 
+FormSubmissionTrigger HTMLFormElement::submissionTrigger() const
+{
+    return m_submissionTrigger;
+}
+
 HTMLFormControlElement* HTMLFormElement::defaultButton() const
 {
     for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h
index a2a5897..5aa9a5c 100644
--- a/WebCore/html/HTMLFormElement.h
+++ b/WebCore/html/HTMLFormElement.h
@@ -98,6 +98,8 @@ public:
 
     virtual String target() const;
 
+    FormSubmissionTrigger submissionTrigger() const;
+
     HTMLFormControlElement* defaultButton() const;
 
     bool checkValidity();
@@ -153,6 +155,8 @@ private:
     Vector<HTMLFormControlElement*> m_associatedElements;
     Vector<HTMLImageElement*> m_imageElements;
 
+    FormSubmissionTrigger m_submissionTrigger;
+
     bool m_autocomplete : 1;
     bool m_insubmit : 1;
     bool m_doingsubmit : 1;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3490157..551db21 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-16  James Hawkins  <jhawkins at 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-20  Daniel Erat  <derat at chromium.org>
 
         Reviewed by Ojan Vafai.
diff --git a/WebKit/chromium/public/WebFormElement.h b/WebKit/chromium/public/WebFormElement.h
index 6a0b24e..2b4ee53 100644
--- a/WebKit/chromium/public/WebFormElement.h
+++ b/WebKit/chromium/public/WebFormElement.h
@@ -63,6 +63,7 @@ namespace WebKit {
         WEBKIT_API WebString action() const;
         WEBKIT_API WebString name() const;
         WEBKIT_API WebString method() const;
+        WEBKIT_API bool wasUserSubmitted() const;
         WEBKIT_API void submit();
         // FIXME: Deprecate and replace with WebVector<WebElement>.
         WEBKIT_API void getNamedElements(const WebString&, WebVector<WebNode>&);
diff --git a/WebKit/chromium/src/WebFormElement.cpp b/WebKit/chromium/src/WebFormElement.cpp
index 8b4ce04..9c77732 100644
--- a/WebKit/chromium/src/WebFormElement.cpp
+++ b/WebKit/chromium/src/WebFormElement.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "WebFormElement.h"
 
+#include "FormState.h"
 #include "HTMLFormControlElement.h"
 #include "HTMLFormElement.h"
 #include "HTMLInputElement.h"
@@ -55,16 +56,21 @@ WebString WebFormElement::action() const
     return constUnwrap<HTMLFormElement>()->action();
 }
 
-WebString WebFormElement::name() const 
+WebString WebFormElement::name() const
 {
     return constUnwrap<HTMLFormElement>()->name();
 }
 
-WebString WebFormElement::method() const 
+WebString WebFormElement::method() const
 {
     return constUnwrap<HTMLFormElement>()->method();
 }
-    
+
+bool WebFormElement::wasUserSubmitted() const
+{
+    return constUnwrap<HTMLFormElement>()->submissionTrigger() == NotSubmittedByJavaScript;
+}
+
 void WebFormElement::submit()
 {
     unwrap<HTMLFormElement>()->submit();
@@ -77,7 +83,7 @@ void WebFormElement::getNamedElements(const WebString& name,
     unwrap<HTMLFormElement>()->getNamedElements(name, tempVector);
     result.assign(tempVector);
 }
-    
+
 void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
 {
     const HTMLFormElement* form = constUnwrap<HTMLFormElement>();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list