Changeset 77370 in webkit
- Timestamp:
- Feb 2, 2011 12:50:41 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r77369 r77370 1 2011-02-02 Naoki Takano <takano.naoki@gmail.com> 2 3 Reviewed by Kent Tamura. 4 5 Fix popup menu RTL bug introduced by Changeset 75982. 6 https://bugs.webkit.org/show_bug.cgi?id=53567 7 8 PopupMenuChromium::layout() calculates X position according to RTL or not. So Change the X position calculation in layoutAndCalculateWidgetRect(). 9 10 No new tests. However we can check manually with select_dropdown_box_alignment.html, autofill_alignment.html, select_alignment.html, select_dropdown_box_alignment.html, autofill-popup-width-and-item-direction.html 11 12 * platform/chromium/PopupMenuChromium.cpp: 13 (WebCore::PopupContainer::layoutAndCalculateWidgetRect): Fix calculation of x position, because layout() considers RTL. And change the parameter from both X and Y positions to only Y position. 14 (WebCore::PopupContainer::showPopup): Change the passing parameter. 15 (WebCore::PopupContainer::refresh): Change the passing parameter. 16 * platform/chromium/PopupMenuChromium.h: Change the parameter declaration. 17 1 18 2011-02-02 Alejandro G. Castro <alex@igalia.com> 2 19 -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp
r77062 r77370 330 330 } 331 331 332 IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, const IntPoint& popupInitialCoordinate)332 IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, int popupInitialY) 333 333 { 334 334 // Reset the max height to its default value, it will be recomputed below … … 350 350 // instead. 351 351 FloatRect screen = screenAvailableRect(m_frameView.get()); 352 widgetRect = chromeClient->windowToScreen(IntRect(popupInitialCoordinate, targetSize)); 352 // Use this::x() for location because RTL position is considered 353 // in layout(). 354 widgetRect = chromeClient->windowToScreen(IntRect(x(), popupInitialY, targetSize.width(), targetSize.height())); 353 355 if (widgetRect.bottom() > static_cast<int>(screen.bottom())) { 354 356 if (widgetRect.y() - widgetRect.height() - targetControlHeight > 0) { … … 383 385 if (chromeClient) { 384 386 IntRect popupRect = frameRect(); 385 chromeClient->popupOpened(this, layoutAndCalculateWidgetRect(popupRect.height(), popupRect. location()), false);387 chromeClient->popupOpened(this, layoutAndCalculateWidgetRect(popupRect.height(), popupRect.y()), false); 386 388 m_popupOpen = true; 387 389 } … … 581 583 // Store the original height to check if we need to request the location. 582 584 int originalHeight = height(); 583 IntRect widgetRect = layoutAndCalculateWidgetRect(targetControlRect.height(), location );585 IntRect widgetRect = layoutAndCalculateWidgetRect(targetControlRect.height(), location.y()); 584 586 if (originalHeight != widgetRect.height()) 585 587 setFrameRect(widgetRect); -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h
r75982 r77370 195 195 196 196 // Layout and calculate popup widget size and location and returns it as IntRect. 197 IntRect layoutAndCalculateWidgetRect(int targetControlHeight, const IntPoint& popupInitialCoordinate);197 IntRect layoutAndCalculateWidgetRect(int targetControlHeight, int popupInitialY); 198 198 199 199 // Returns the ChromeClient of the page this popup is associated with.
Note: See TracChangeset
for help on using the changeset viewer.