diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 660c22679e4f078a03a2a1141175f86619d6384e..3ad69478e1b645f593265119c688a5c56aa9efab 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,20 @@ +2011-04-07 Naoki Takano + + 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 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 index 0000000000000000000000000000000000000000..5e28a15ea3c527e2ac6700afc27cedacd8b1b3e1 --- /dev/null +++ b/Source/WebCore/manual-tests/autofill-popup-location.html @@ -0,0 +1,20 @@ + + + + + Test autofill popup window shows at the correct location. + + + +

Test autofill popup window shows at the correct location.

+
    +
  1. Enter 'Always show bookmarks bar' in the following text input area.
  2. +
  3. Enter 'Test' in the text input area.
  4. +
  5. Press 'a' and make sure 'Always show bookmarks bar' is shown in autofill popup window.
  6. +
  7. Select all with pressing Ctrl-a.
  8. +
  9. Press 't' and make sure 'Test' is shown and the popup window location is correct.
  10. +
+
+
+ + diff --git a/Source/WebCore/platform/chromium/PopupMenuChromium.cpp b/Source/WebCore/platform/chromium/PopupMenuChromium.cpp index e83ebe4c22dd3295d5b8b54543879e763b2ea341..af97ecf4cec220951cf4ef4031fc5eb8ae86449a 100644 --- a/Source/WebCore/platform/chromium/PopupMenuChromium.cpp +++ b/Source/WebCore/platform/chromium/PopupMenuChromium.cpp @@ -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();