2011-04-07 Naoki Takano <takano.naoki@gmail.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 01:18:59 +0000 (01:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2011 01:18:59 +0000 (01:18 +0000)
        Reviewed by Adam Barth.

        [Chromium] Fix relocation problem of popup window which introduces autofill popup sometimes moves to screen's top left corner.
        https://bugs.webkit.org/show_bug.cgi?id=57911
        http://code.google.com/p/chromium/issues/detail?id=78073

        Manual test added: manual-tests/autofill-popup-location.html

        Originally only height is checked so that it introduces the bug.
        So I changed it to check both width and height as size.

        * manual-tests/autofill-popup-location.html: Added.
        * platform/chromium/PopupMenuChromium.cpp:
        (WebCore::PopupContainer::refresh): Check window size between original and new before calling setFrameRect().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83237 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/manual-tests/autofill-popup-location.html [new file with mode: 0644]
Source/WebCore/platform/chromium/PopupMenuChromium.cpp

index 660c226..3ad6947 100644 (file)
@@ -1,3 +1,20 @@
+2011-04-07  Naoki Takano  <takano.naoki@gmail.com>
+
+        Reviewed by Adam Barth.
+
+        [Chromium] Fix relocation problem of popup window which introduces autofill popup sometimes moves to screen's top left corner.
+        https://bugs.webkit.org/show_bug.cgi?id=57911
+        http://code.google.com/p/chromium/issues/detail?id=78073
+
+        Manual test added: manual-tests/autofill-popup-location.html
+
+        Originally only height is checked so that it introduces the bug.
+        So I changed it to check both width and height as size.
+
+        * manual-tests/autofill-popup-location.html: Added.
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::refresh): Check window size between original and new before calling setFrameRect().
+
 2011-04-07  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/Source/WebCore/manual-tests/autofill-popup-location.html b/Source/WebCore/manual-tests/autofill-popup-location.html
new file mode 100644 (file)
index 0000000..5e28a15
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+  <head>
+    <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8">
+    <title>
+      Test autofill popup window shows at the correct location.
+    </title>
+  </head>
+  <body>
+    <h3>Test autofill popup window shows at the correct location.</h3>
+    <ol>
+      <li> Enter 'Always show bookmarks bar' in the following text input area.</li>
+      <li> Enter 'Test' in the text input area.</li>
+      <li> Press 'a' and make sure 'Always show bookmarks bar' is shown in autofill popup window.</li>
+      <li> Select all with pressing Ctrl-a.</li>
+      <li> Press 't' and make sure 'Test' is shown and the popup window location is correct.</li>
+    </ol>
+    <br>
+    <form><input name=q autofocus></form>
+  </body>
+</html> 
index e83ebe4..af97ecf 100644 (file)
@@ -571,10 +571,10 @@ void PopupContainer::refresh(const IntRect& targetControlRect)
     location.move(0, targetControlRect.height());
 
     listBox()->updateFromElement();
-    // Store the original height to check if we need to request the location.
-    int originalHeight = height();
+    // Store the original size to check if we need to request the location.
+    IntSize originalSize = size();
     IntRect widgetRect = layoutAndCalculateWidgetRect(targetControlRect.height(), location);
-    if (originalHeight != widgetRect.height())
+    if (originalSize != widgetRect.size())
         setFrameRect(widgetRect);
 
     invalidate();