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

tkent at chromium.org tkent at chromium.org
Wed Dec 22 13:56:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit efb13fd5df5e47aa206ec7c764da79e764bc9350
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 30 04:22:17 2010 +0000

    2010-09-29  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Refactor HTMLInputElement: Make DeprecatedInputType private.
            https://bugs.webkit.org/show_bug.cgi?id=46791
    
            No new tests because this doesn't change any behavior.
    
            * html/HTMLInputElement.cpp:
            (WebCore::HTMLInputElement::createTypeMap):
            * html/HTMLInputElement.h:
             Move DeprecatedInputType, deprecatedInputType() and
             parseToDateComponents() to the private section, make
             createTypeMap() a member function of HTMLInputElement.
            (WebCore::HTMLInputElement::deprecatedInputType):
    2010-09-29  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Refactor HTMLInputElement: Make DeprecatedInputType private.
            https://bugs.webkit.org/show_bug.cgi?id=46791
    
            * src/WebPasswordFormUtils.cpp:
            (WebKit::findPasswordFormFields):
             Accept any text field types as a username field.
            * src/WebSearchableFormData.cpp:
            (WebCore::HasSuitableTextElement):
             Accept any text field types as a search query field.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b7a599d..be4d3ba 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-29  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Refactor HTMLInputElement: Make DeprecatedInputType private.
+        https://bugs.webkit.org/show_bug.cgi?id=46791
+
+        No new tests because this doesn't change any behavior.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::createTypeMap):
+        * html/HTMLInputElement.h:
+         Move DeprecatedInputType, deprecatedInputType() and
+         parseToDateComponents() to the private section, make
+         createTypeMap() a member function of HTMLInputElement.
+        (WebCore::HTMLInputElement::deprecatedInputType):
+
 2010-09-29  Mihai Parparita  <mihaip at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index b389be0..4790ac6 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -844,33 +844,32 @@ void HTMLInputElement::setType(const String& t)
         setAttribute(typeAttr, t);
 }
 
-typedef HashMap<String, HTMLInputElement::DeprecatedInputType, CaseFoldingHash> InputTypeMap;
-static PassOwnPtr<InputTypeMap> createTypeMap()
+PassOwnPtr<HTMLInputElement::InputTypeMap> HTMLInputElement::createTypeMap()
 {
     OwnPtr<InputTypeMap> map = adoptPtr(new InputTypeMap);
-    map->add("button", HTMLInputElement::BUTTON);
-    map->add("checkbox", HTMLInputElement::CHECKBOX);
-    map->add("color", HTMLInputElement::COLOR);
-    map->add("date", HTMLInputElement::DATE);
-    map->add("datetime", HTMLInputElement::DATETIME);
-    map->add("datetime-local", HTMLInputElement::DATETIMELOCAL);
-    map->add("email", HTMLInputElement::EMAIL);
-    map->add("file", HTMLInputElement::FILE);
-    map->add("hidden", HTMLInputElement::HIDDEN);
-    map->add("image", HTMLInputElement::IMAGE);
-    map->add("khtml_isindex", HTMLInputElement::ISINDEX);
-    map->add("month", HTMLInputElement::MONTH);
-    map->add("number", HTMLInputElement::NUMBER);
-    map->add("password", HTMLInputElement::PASSWORD);
-    map->add("radio", HTMLInputElement::RADIO);
-    map->add("range", HTMLInputElement::RANGE);
-    map->add("reset", HTMLInputElement::RESET);
-    map->add("search", HTMLInputElement::SEARCH);
-    map->add("submit", HTMLInputElement::SUBMIT);
-    map->add("tel", HTMLInputElement::TELEPHONE);
-    map->add("time", HTMLInputElement::TIME);
-    map->add("url", HTMLInputElement::URL);
-    map->add("week", HTMLInputElement::WEEK);
+    map->add("button", BUTTON);
+    map->add("checkbox", CHECKBOX);
+    map->add("color", COLOR);
+    map->add("date", DATE);
+    map->add("datetime", DATETIME);
+    map->add("datetime-local", DATETIMELOCAL);
+    map->add("email", EMAIL);
+    map->add("file", FILE);
+    map->add("hidden", HIDDEN);
+    map->add("image", IMAGE);
+    map->add("khtml_isindex", ISINDEX);
+    map->add("month", MONTH);
+    map->add("number", NUMBER);
+    map->add("password", PASSWORD);
+    map->add("radio", RADIO);
+    map->add("range", RANGE);
+    map->add("reset", RESET);
+    map->add("search", SEARCH);
+    map->add("submit", SUBMIT);
+    map->add("tel", TELEPHONE);
+    map->add("time", TIME);
+    map->add("url", URL);
+    map->add("week", WEEK);
     // No need to register "text" because it is the default type.
     return map.release();
 }
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 88e2bf7..d2e23fa 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -41,33 +41,6 @@ class VisibleSelection;
 
 class HTMLInputElement : public HTMLTextFormControlElement, public InputElement {
 public:
-    enum DeprecatedInputType {
-        TEXT = 0, // TEXT must be 0.
-        PASSWORD,
-        ISINDEX,
-        CHECKBOX,
-        RADIO,
-        SUBMIT,
-        RESET,
-        FILE,
-        HIDDEN,
-        IMAGE,
-        BUTTON,
-        SEARCH,
-        RANGE,
-        EMAIL,
-        NUMBER,
-        TELEPHONE,
-        URL,
-        COLOR,
-        DATE,
-        DATETIME,
-        DATETIMELOCAL,
-        MONTH,
-        TIME,
-        WEEK,
-    };
-
     static PassRefPtr<HTMLInputElement> create(const QualifiedName&, Document*, HTMLFormElement*);
     virtual ~HTMLInputElement();
 
@@ -175,8 +148,6 @@ public:
     virtual bool isActivatedSubmit() const;
     virtual void setActivatedSubmit(bool flag);
 
-    DeprecatedInputType deprecatedInputType() const { return static_cast<DeprecatedInputType>(m_deprecatedTypeNumber); }
-
     String altText() const;
 
     int maxResults() const { return m_maxResults; }
@@ -212,11 +183,6 @@ public:
     void addSearchResult();
     void onSearch();
 
-    // Parses the specified string as the DeprecatedInputType, and returns true if it is successfully parsed.
-    // An instance pointed by the DateComponents* parameter will have parsed values and be
-    // modified even if the parsing fails.  The DateComponents* parameter may be 0.
-    static bool parseToDateComponents(DeprecatedInputType, const String&, DateComponents*);
-
 #if ENABLE(DATALIST)
     HTMLElement* list() const;
     HTMLOptionElement* selectedOption() const;
@@ -232,8 +198,39 @@ protected:
     virtual void defaultEventHandler(Event*);
 
 private:
+    enum DeprecatedInputType {
+        TEXT = 0, // TEXT must be 0.
+        PASSWORD,
+        ISINDEX,
+        CHECKBOX,
+        RADIO,
+        SUBMIT,
+        RESET,
+        FILE,
+        HIDDEN,
+        IMAGE,
+        BUTTON,
+        SEARCH,
+        RANGE,
+        EMAIL,
+        NUMBER,
+        TELEPHONE,
+        URL,
+        COLOR,
+        DATE,
+        DATETIME,
+        DATETIMELOCAL,
+        MONTH,
+        TIME,
+        WEEK,
+    };
+
     enum AutoCompleteSetting { Uninitialized, On, Off };
 
+    typedef HashMap<String, HTMLInputElement::DeprecatedInputType, CaseFoldingHash> InputTypeMap;
+    static PassOwnPtr<InputTypeMap> createTypeMap();
+    DeprecatedInputType deprecatedInputType() const { return static_cast<DeprecatedInputType>(m_deprecatedTypeNumber); }
+
     virtual void willMoveToNewOwnerDocument();
     virtual void didMoveToNewOwnerDocument();
 
@@ -333,6 +330,11 @@ private:
     // Helper for applyStepForNumberOrRange().
     double stepBase() const;
 
+    // Parses the specified string as the DeprecatedInputType, and returns true if it is successfully parsed.
+    // An instance pointed by the DateComponents* parameter will have parsed values and be
+    // modified even if the parsing fails.  The DateComponents* parameter may be 0.
+    static bool parseToDateComponents(DeprecatedInputType, const String&, DateComponents*);
+
     // Parses the specified string for the current type, and return
     // the double value for the parsing result if the parsing
     // succeeds; Returns defaultValue otherwise. This function can
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index e3a7645..01b68bc 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-29  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Refactor HTMLInputElement: Make DeprecatedInputType private.
+        https://bugs.webkit.org/show_bug.cgi?id=46791
+
+        * src/WebPasswordFormUtils.cpp:
+        (WebKit::findPasswordFormFields):
+         Accept any text field types as a username field.
+        * src/WebSearchableFormData.cpp:
+        (WebCore::HasSuitableTextElement):
+         Accept any text field types as a search query field.
+
 2010-09-29  Kinuko Yasuda  <kinuko at chromium.org>
 
         Reviewed by Dumitru Daniliuc.
diff --git a/WebKit/chromium/src/WebPasswordFormUtils.cpp b/WebKit/chromium/src/WebPasswordFormUtils.cpp
index 6968e1a..b4997e5 100644
--- a/WebKit/chromium/src/WebPasswordFormUtils.cpp
+++ b/WebKit/chromium/src/WebPasswordFormUtils.cpp
@@ -98,9 +98,8 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
             if (!inputElement->isEnabledFormControl())
                 continue;
 
-            // FIXME: This needs to use a function other than deprecatedInputType.
-            // Does this really want to special-case TEXT, and not other text-field-like input elements?
-            if ((inputElement->deprecatedInputType() == HTMLInputElement::TEXT)
+            // Various input types such as text, url, email can be a username field.
+            if ((inputElement->isTextField() && !inputElement->isPasswordField())
                 && (inputElement->autoComplete())) {
                 fields->userName = inputElement;
                 break;
diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp
index 5fc51ca..50192eb 100644
--- a/WebKit/chromium/src/WebSearchableFormData.cpp
+++ b/WebKit/chromium/src/WebSearchableFormData.cpp
@@ -166,26 +166,19 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt
 
         bool isTextElement = false;
         if (formElement->hasTagName(HTMLNames::inputTag)) {
-            if (static_cast<const HTMLInputElement*>(formElement)->isFileUpload()) {
+            const HTMLInputElement* input = static_cast<const HTMLInputElement*>(formElement);
+            if (input->isFileUpload()) {
                 // Too big, don't try to index this.
                 return 0;
             }
 
-            if (static_cast<const HTMLInputElement*>(formElement)->isPasswordField()) {
+            if (input->isPasswordField()) {
                 // Don't store passwords! This is most likely an https anyway.
                 return 0;
             }
 
-            // FIXME: This needs to use a function on HTMLInputElement other than deprecatedInputType.
-            // Also, it's not clear why TEXT should be handled differently than, say, SEARCH.
-            switch (static_cast<const HTMLInputElement*>(formElement)->deprecatedInputType()) {
-            case HTMLInputElement::TEXT:
-            case HTMLInputElement::ISINDEX:
+            if (input->isTextField())
                 isTextElement = true;
-                break;
-            default:
-                break;
-            }
       }
 
       FormDataList dataList(encoding);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list