[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

eric at webkit.org eric at webkit.org
Fri Feb 26 22:17:30 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 9b18314f361a2c0a967404c9b4523859cd2f4106
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 11 03:47:38 2010 +0000

    2010-02-10  James Hawkins  <jhawkins at chromium.org>
    
            Reviewed by Eric Seidel.
    
            [Chromium] Remove code from SuggestionsPopup that was removed in a
            previous revision of AutocompletePopup and accidentally added back in
            the refactoring.
    
            https://bugs.webkit.org/show_bug.cgi?id=34818
    
            * src/AutoFillPopupMenuClient.cpp:
            * src/AutoFillPopupMenuClient.h: Added property svn:eol-style.
            * src/SuggestionsPopupMenuClient.cpp:
            (WebKit::SuggestionsPopupMenuClient::popupDidHide):
            (WebKit::SuggestionsPopupMenuClient::setTextFromItem):
            (WebKit::SuggestionsPopupMenuClient::initialize):
            * src/SuggestionsPopupMenuClient.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 217fda6..2f88e5a 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-10  James Hawkins  <jhawkins at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Chromium] Remove code from SuggestionsPopup that was removed in a
+        previous revision of AutocompletePopup and accidentally added back in
+        the refactoring.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34818
+
+        * src/AutoFillPopupMenuClient.cpp:
+        * src/AutoFillPopupMenuClient.h: Added property svn:eol-style.
+        * src/SuggestionsPopupMenuClient.cpp:
+        (WebKit::SuggestionsPopupMenuClient::popupDidHide):
+        (WebKit::SuggestionsPopupMenuClient::setTextFromItem):
+        (WebKit::SuggestionsPopupMenuClient::initialize):
+        * src/SuggestionsPopupMenuClient.h:
+
 2010-02-10  Nate Chapin  <japhet at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index bdb44c8..8e6cab4 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -59,17 +59,6 @@ void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex)
     m_labels.remove(listIndex);
 }
 
-void AutoFillPopupMenuClient:: selectionChanged(unsigned listIndex,
-                                                bool fireEvents) {
-    if (listIndex == static_cast<unsigned>(-1)) {
-        SuggestionsPopupMenuClient::selectionChanged(listIndex, fireEvents);
-        return;
-    }
-
-    ASSERT(listIndex >= 0 && listIndex < m_names.size());
-    setSuggestedValue(m_names[listIndex]);
-}
-
 void AutoFillPopupMenuClient::initialize(
     HTMLInputElement* textField,
     const WebVector<WebString>& names,
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h
index e1fd100..1912fa3 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.h
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h
@@ -50,9 +50,6 @@ public:
     virtual WebString getSuggestion(unsigned listIndex) const;
     virtual void removeSuggestionAtIndex(unsigned listIndex);
 
-    // WebCore::PopupMenuClient implementation:
-    virtual void selectionChanged(unsigned listIndex, bool fireEvents);
-
     void initialize(WebCore::HTMLInputElement*,
                     const WebVector<WebString>& names,
                     const WebVector<WebString>& labels,
diff --git a/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp b/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp
index 32679ae..b4a77a3 100644
--- a/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp
+++ b/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp
@@ -69,20 +69,6 @@ void SuggestionsPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvent
         static_cast<HTMLInputElement*>(m_textField.get()));
 }
 
-void SuggestionsPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents)
-{
-    if (listIndex != static_cast<unsigned>(-1)) {
-        const WebString& suggestion = getSuggestion(listIndex);
-        setSuggestedValue(suggestion);
-    } else {
-        m_textField->setValue(m_typedFieldValue);
-        if (m_lastFieldValues->contains(m_textField->name()))
-            m_lastFieldValues->set(m_textField->name(), m_typedFieldValue);
-        else
-            m_lastFieldValues->add(m_textField->name(), m_typedFieldValue);
-    }
-}
-
 String SuggestionsPopupMenuClient::itemText(unsigned listIndex) const
 {
     return getSuggestion(listIndex);
@@ -120,8 +106,6 @@ int SuggestionsPopupMenuClient::clientPaddingRight() const
 
 void SuggestionsPopupMenuClient::popupDidHide()
 {
-    m_textField->setValue(m_typedFieldValue);
-    resetLastSuggestion();
     WebViewImpl* webView = getWebView();
     if (webView)
         webView->suggestionsPopupDidHide();
@@ -130,15 +114,6 @@ void SuggestionsPopupMenuClient::popupDidHide()
 void SuggestionsPopupMenuClient::setTextFromItem(unsigned listIndex)
 {
     m_textField->setValue(getSuggestion(listIndex));
-    resetLastSuggestion();
-}
-
-void SuggestionsPopupMenuClient::resetLastSuggestion()
-{
-    if (m_lastFieldValues->contains(m_textField->name()))
-        m_lastFieldValues->set(m_textField->name(), m_textField->value());
-    else
-        m_lastFieldValues->add(m_textField->name(), m_textField->value());
 }
 
 FontSelector* SuggestionsPopupMenuClient::fontSelector() const
@@ -175,15 +150,9 @@ RenderStyle* SuggestionsPopupMenuClient::textFieldStyle() const
 void SuggestionsPopupMenuClient::initialize(HTMLInputElement* textField,
                                             int defaultSuggestionIndex)
 {
-    if (!m_lastFieldValues)
-        m_lastFieldValues.set(new FieldValuesMap);
-
     m_textField = textField;
-    m_typedFieldValue = textField->value();
     m_selectedIndex = defaultSuggestionIndex;
 
-    setInitialSuggestion();
-
     FontDescription fontDescription;
     RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl,
                                             fontDescription);
@@ -201,51 +170,6 @@ void SuggestionsPopupMenuClient::initialize(HTMLInputElement* textField,
                                    textField->renderer()->style()->direction()));
 }
 
-void SuggestionsPopupMenuClient::setInitialSuggestion()
-{
-    if (!getSuggestionsCount() || !m_textField->name().length() || !m_typedFieldValue.length())
-        return;
-
-    int newIndex = m_selectedIndex >= 0 ? m_selectedIndex : 0;
-    const String& suggestion = getSuggestion(newIndex);
-    bool hasPreviousValue = m_lastFieldValues->contains(m_textField->name());
-
-    String prevValue;
-    if (hasPreviousValue)
-        prevValue = m_lastFieldValues->get(m_textField->name());
-
-    if (!hasPreviousValue || m_typedFieldValue.length() > m_lastFieldValues->get(m_textField->name()).length()) {
-        if (suggestion.startsWith(m_typedFieldValue))
-            m_selectedIndex = newIndex;
-
-        int start = 0;
-        String newSuggestion = suggestion;
-        if (suggestion.startsWith(m_typedFieldValue, false)) {
-            newSuggestion = m_typedFieldValue;
-            if (suggestion.length() > m_typedFieldValue.length()) {
-                newSuggestion.append(suggestion.substring(m_typedFieldValue.length(),
-                    suggestion.length() - m_typedFieldValue.length()));
-            }
-            start = m_typedFieldValue.length();
-        }
-
-        m_textField->setSuggestedValue(newSuggestion);
-        m_textField->setSelectionRange(start, newSuggestion.length());
-    }
-
-    if (hasPreviousValue)
-        m_lastFieldValues->set(m_textField->name(), m_typedFieldValue);
-    else
-        m_lastFieldValues->add(m_textField->name(), m_typedFieldValue);
-}
-
-void SuggestionsPopupMenuClient::setSuggestedValue(const WebString& suggestion)
-{
-    m_textField->setSuggestedValue(suggestion);
-    m_textField->setSelectionRange(m_typedFieldValue.length(),
-                                   suggestion.length());
-}
-
 WebViewImpl* SuggestionsPopupMenuClient::getWebView() const
 {
     Frame* frame = m_textField->document()->frame();
diff --git a/WebKit/chromium/src/SuggestionsPopupMenuClient.h b/WebKit/chromium/src/SuggestionsPopupMenuClient.h
index 811eee1..edc4c09 100644
--- a/WebKit/chromium/src/SuggestionsPopupMenuClient.h
+++ b/WebKit/chromium/src/SuggestionsPopupMenuClient.h
@@ -61,7 +61,6 @@ public:
 
     // WebCore::PopupMenuClient methods:
     virtual void valueChanged(unsigned listIndex, bool fireEvents = true);
-    virtual void selectionChanged(unsigned listIndex, bool fireEvents = true);
     virtual WebCore::String itemText(unsigned listIndex) const;
     virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); }
     virtual bool itemIsEnabled(unsigned listIndex) const { return true; }
@@ -90,26 +89,19 @@ public:
 protected:
     void initialize(WebCore::HTMLInputElement* textField,
                     int defaultSuggestionIndex);
-    void setInitialSuggestion();
 
     int getSelectedIndex() const { return m_selectedIndex; }
     void setSelectedIndex(int index) { m_selectedIndex = index; }
 
-    void setSuggestedValue(const WebString& suggestion);
-
     WebViewImpl* getWebView() const;
     WebCore::HTMLInputElement* getTextField() const { return m_textField.get(); }
 
 private:
     WebCore::RenderStyle* textFieldStyle() const;
-    void resetLastSuggestion();
 
     RefPtr<WebCore::HTMLInputElement> m_textField;
     int m_selectedIndex;
-    WebCore::String m_typedFieldValue;
     OwnPtr<WebCore::PopupMenuStyle> m_style;
-    typedef HashMap<WebCore::String, WebCore::String> FieldValuesMap;
-    OwnPtr<FieldValuesMap> m_lastFieldValues;
 };
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list