Changeset 77370 in webkit


Ignore:
Timestamp:
Feb 2, 2011 12:50:41 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-02 Naoki Takano <takano.naoki@gmail.com>

Reviewed by Kent Tamura.

Fix popup menu RTL bug introduced by Changeset 75982.
https://bugs.webkit.org/show_bug.cgi?id=53567

PopupMenuChromium::layout() calculates X position according to RTL or not. So Change the X position calculation in layoutAndCalculateWidgetRect().

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

  • platform/chromium/PopupMenuChromium.cpp: (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. (WebCore::PopupContainer::showPopup): Change the passing parameter. (WebCore::PopupContainer::refresh): Change the passing parameter.
  • platform/chromium/PopupMenuChromium.h: Change the parameter declaration.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r77369 r77370  
     12011-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
    1182011-02-02  Alejandro G. Castro  <alex@igalia.com>
    219
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp

    r77062 r77370  
    330330}
    331331
    332 IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, const IntPoint& popupInitialCoordinate)
     332IntRect PopupContainer::layoutAndCalculateWidgetRect(int targetControlHeight, int popupInitialY)
    333333{
    334334    // Reset the max height to its default value, it will be recomputed below
     
    350350        // instead.
    351351        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()));
    353355        if (widgetRect.bottom() > static_cast<int>(screen.bottom())) {
    354356            if (widgetRect.y() - widgetRect.height() - targetControlHeight > 0) {
     
    383385    if (chromeClient) {
    384386        IntRect popupRect = frameRect();
    385         chromeClient->popupOpened(this, layoutAndCalculateWidgetRect(popupRect.height(), popupRect.location()), false);
     387        chromeClient->popupOpened(this, layoutAndCalculateWidgetRect(popupRect.height(), popupRect.y()), false);
    386388        m_popupOpen = true;
    387389    }
     
    581583    // Store the original height to check if we need to request the location.
    582584    int originalHeight = height();
    583     IntRect widgetRect = layoutAndCalculateWidgetRect(targetControlRect.height(), location);
     585    IntRect widgetRect = layoutAndCalculateWidgetRect(targetControlRect.height(), location.y());
    584586    if (originalHeight != widgetRect.height())
    585587        setFrameRect(widgetRect);
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h

    r75982 r77370  
    195195
    196196    // 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);
    198198
    199199    // Returns the ChromeClient of the page this popup is associated with.
Note: See TracChangeset for help on using the changeset viewer.