Changeset 90119 in webkit
- Timestamp:
- Jun 30, 2011, 7:45:21 AM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90117 r90119 1 2011-06-30 Alexander Pavlov <apavlov@chromium.org> 2 3 Reviewed by Kent Tamura. 4 5 [Chromium] Autofill suggestions appear in upper left corner after input change 6 https://bugs.webkit.org/show_bug.cgi?id=63702 7 8 This change fixes a few popup layout issues, some of which have existed for quite a while: 9 - the absence of the ChromeClientImpl::screenToWindow() implementation (the method used to always return (0, 0)); 10 - the confusion of window and screen coordinates passed into the autofill popup client's setWindowRect() method; 11 - the use of the current frameRect() width as the target element's width (which was wrong when refreshing 12 a popup resized during the initial layout (e.g. made wider than the target element)). 13 14 No new tests, as this is a change to platform-specific widget code. The test case is provided in the bug description. 15 16 * platform/chromium/PopupMenuChromium.cpp: 17 (WebCore::PopupContainer::layoutAndGetRTLOffset): Use original target element width, not frameRect().width(), 18 since the latter gets updated if the popup is not the same width as the target element. 19 (WebCore::PopupContainer::refresh): Restore only the popup bounds rather than its original rectangle, 20 since it sometimes breaks the invalidation region and layout. 21 1 22 2011-06-30 Sheriff Bot <webkit.review.bot@gmail.com> 2 23 -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp
r89916 r90119 469 469 m_listBox->move(kBorderSize, kBorderSize); 470 470 471 // popupWidth is the width of <select> element. Record it before resize frame.472 int popupWidth = frameRect().width();473 471 // Size ourselves to contain listbox + border. 474 472 int listBoxWidth = m_listBox->width() + kBorderSize * 2; … … 477 475 478 476 // Compute the starting x-axis for a normal RTL or right-aligned LTR dropdown. For those, 479 // the right edge of dropdown box should be aligned with the right edge of <select> element box,477 // the right edge of dropdown box should be aligned with the right edge of <select>/<input> element box, 480 478 // and the dropdown box should be expanded to the left if more space is needed. 481 return popupWidth - listBoxWidth; 479 // m_originalFrameRect.width() is the width of the target <select>/<input> element. 480 return m_originalFrameRect.width() - listBoxWidth; 482 481 } 483 482 … … 597 596 598 597 listBox()->setBaseWidth(max(m_originalFrameRect.width() - kBorderSize * 2, 0)); 599 set FrameRect(m_originalFrameRect);598 setBoundsSize(m_originalFrameRect.size()); 600 599 601 600 listBox()->updateFromElement(); -
trunk/Source/WebKit/chromium/ChangeLog
r90101 r90119 1 2011-06-30 Alexander Pavlov <apavlov@chromium.org> 2 3 Reviewed by Kent Tamura. 4 5 [Chromium] Autofill suggestions appear in upper left corner after input change 6 https://bugs.webkit.org/show_bug.cgi?id=63702 7 8 * src/ChromeClientImpl.cpp: 9 (WebKit::ChromeClientImpl::screenToWindow): Implemented. 10 * src/WebViewImpl.cpp: 11 (WebKit::WebViewImpl::refreshAutoFillPopup): Pass screen (not window) coordinates into setWindowRect(). 12 1 13 2011-06-30 Kentaro Hara <haraken@google.com> 2 14 -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r89430 r90119 566 566 } 567 567 568 IntPoint ChromeClientImpl::screenToWindow(const IntPoint&) const 569 { 570 notImplemented(); 571 return IntPoint(); 568 IntPoint ChromeClientImpl::screenToWindow(const IntPoint& point) const 569 { 570 IntPoint windowPoint(point); 571 572 if (m_webView->client()) { 573 WebRect windowRect = m_webView->client()->windowRect(); 574 windowPoint.move(-windowRect.x, -windowRect.y); 575 } 576 577 return windowPoint; 572 578 } 573 579 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r89837 r90119 2362 2362 static_cast<WebPopupMenuImpl*>(m_autoFillPopup->client()); 2363 2363 if (popupMenu) 2364 popupMenu->client()->setWindowRect( newBounds);2364 popupMenu->client()->setWindowRect(m_chromeClientImpl.windowToScreen(newBounds)); 2365 2365 } 2366 2366 }
Note:
See TracChangeset
for help on using the changeset viewer.