Title: [114513] trunk/Source
Revision
114513
Author
[email protected]
Date
2012-04-18 09:25:40 -0700 (Wed, 18 Apr 2012)

Log Message

[Chromium] REGRESSION: Popup shrinks because of autocomplete
https://bugs.webkit.org/show_bug.cgi?id=84139
http://code.google.com/p/chromium/issues/detail?id=123432

Source/WebCore:

Do not update the window rect on the wrong client but instead return the popup widget's
new screen coordinates from the refresh() method.

Reviewed by Kent Tamura.

* platform/chromium/PopupContainer.cpp:
(WebCore::PopupContainer::refresh):
* platform/chromium/PopupContainer.h:
(PopupContainer):

Source/WebKit/chromium:

Do not use the PopupContainer's frameRect() to update the popup client's window rect,
since PopupContainer is always positioned at (0, 0) inside the client's window rect,
and the latter one is positioned relative to the screen origin.

Reviewed by Kent Tamura.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::refreshAutofillPopup):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114512 => 114513)


--- trunk/Source/WebCore/ChangeLog	2012-04-18 16:20:01 UTC (rev 114512)
+++ trunk/Source/WebCore/ChangeLog	2012-04-18 16:25:40 UTC (rev 114513)
@@ -1,3 +1,19 @@
+2012-04-18  Alexander Pavlov  <[email protected]>
+
+        [Chromium] REGRESSION: Popup shrinks because of autocomplete
+        https://bugs.webkit.org/show_bug.cgi?id=84139
+        http://code.google.com/p/chromium/issues/detail?id=123432
+
+        Do not update the window rect on the wrong client but instead return the popup widget's
+        new screen coordinates from the refresh() method.
+
+        Reviewed by Kent Tamura.
+
+        * platform/chromium/PopupContainer.cpp:
+        (WebCore::PopupContainer::refresh):
+        * platform/chromium/PopupContainer.h:
+        (PopupContainer):
+
 2012-04-18  Simon Fraser  <[email protected]>
 
         ASSERT when a layer with a foreground layer is in 'paint into ancestor' mode

Modified: trunk/Source/WebCore/platform/chromium/PopupContainer.cpp (114512 => 114513)


--- trunk/Source/WebCore/platform/chromium/PopupContainer.cpp	2012-04-18 16:20:01 UTC (rev 114512)
+++ trunk/Source/WebCore/platform/chromium/PopupContainer.cpp	2012-04-18 16:25:40 UTC (rev 114513)
@@ -407,7 +407,7 @@
     showPopup(v);
 }
 
-void PopupContainer::refresh(const IntRect& targetControlRect)
+IntRect PopupContainer::refresh(const IntRect& targetControlRect)
 {
     listBox()->setBaseWidth(max(m_originalFrameRect.width() - kBorderSize * 2, 0));
     listBox()->updateFromElement();
@@ -423,14 +423,9 @@
     if (size() != widgetRectInScreen.size())
         resize(widgetRectInScreen.size());
 
-    ChromeClientChromium* chromeClient = chromeClientChromium();
-    if (chromeClient) {
-        // Update the WebWidget location (which is relative to the screen origin).
-        if (widgetRectInScreen != chromeClient->windowRect())
-            chromeClient->setWindowRect(widgetRectInScreen);
-    }
-
     invalidate();
+
+    return widgetRectInScreen;
 }
 
 inline bool PopupContainer::isRTL() const

Modified: trunk/Source/WebCore/platform/chromium/PopupContainer.h (114512 => 114513)


--- trunk/Source/WebCore/platform/chromium/PopupContainer.h	2012-04-18 16:20:01 UTC (rev 114512)
+++ trunk/Source/WebCore/platform/chromium/PopupContainer.h	2012-04-18 16:25:40 UTC (rev 114513)
@@ -99,7 +99,7 @@
     int selectedIndex() const;
 
     // Refresh the popup values from the PopupMenuClient.
-    void refresh(const IntRect& targetControlRect);
+    IntRect refresh(const IntRect& targetControlRect);
 
     // The menu per-item data.
     const WTF::Vector<PopupItem*>& popupData() const;

Modified: trunk/Source/WebKit/chromium/ChangeLog (114512 => 114513)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-18 16:20:01 UTC (rev 114512)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-18 16:25:40 UTC (rev 114513)
@@ -1,3 +1,18 @@
+2012-04-18  Alexander Pavlov  <[email protected]>
+
+        [Chromium] REGRESSION: Popup shrinks because of autocomplete
+        https://bugs.webkit.org/show_bug.cgi?id=84139
+        http://code.google.com/p/chromium/issues/detail?id=123432
+
+        Do not use the PopupContainer's frameRect() to update the popup client's window rect,
+        since PopupContainer is always positioned at (0, 0) inside the client's window rect,
+        and the latter one is positioned relative to the screen origin.
+
+        Reviewed by Kent Tamura.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::refreshAutofillPopup):
+
 2012-04-17  Rafael Weinstein  <[email protected]>
 
         [MutationObservers] enable V8RecursionScope debug ASSERT()

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (114512 => 114513)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-04-18 16:20:01 UTC (rev 114512)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-04-18 16:25:40 UTC (rev 114513)
@@ -3064,16 +3064,11 @@
         return;
     }
 
-    IntRect oldBounds = m_autofillPopup->frameRect();
-    m_autofillPopup->refresh(focusedWebCoreNode()->getPixelSnappedRect());
-    IntRect newBounds = m_autofillPopup->frameRect();
+    WebRect newWidgetRect = m_autofillPopup->refresh(focusedWebCoreNode()->getPixelSnappedRect());
     // Let's resize the backing window if necessary.
-    if (oldBounds != newBounds) {
-        WebPopupMenuImpl* popupMenu =
-            static_cast<WebPopupMenuImpl*>(m_autofillPopup->client());
-        if (popupMenu)
-            popupMenu->client()->setWindowRect(m_chromeClientImpl.rootViewToScreen(newBounds));
-    }
+    WebPopupMenuImpl* popupMenu = static_cast<WebPopupMenuImpl*>(m_autofillPopup->client());
+    if (popupMenu && popupMenu->client()->windowRect() != newWidgetRect)
+        popupMenu->client()->setWindowRect(newWidgetRect);
 }
 
 Node* WebViewImpl::focusedWebCoreNode()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to