Changeset 215830 in webkit


Ignore:
Timestamp:
Apr 26, 2017 1:52:15 PM (7 years ago)
Author:
Alan Bujtas
Message:

RTL: recent searches popover is displayed in incorrect location
https://bugs.webkit.org/show_bug.cgi?id=171338
<rdar://problem/31377807>

Reviewed by Dean Jackson.

Source/WebCore:

Compute the absolute coordinates for the popup the same way we do for the select dropdown.

  • rendering/RenderSearchField.cpp:

(WebCore::RenderSearchField::showPopup):

Source/WebKit/mac:

Add RTL support for the pop-under branch.

  • WebCoreSupport/PopupMenuMac.mm:

(PopupMenuMac::show):

Source/WebKit2:

Add RTL support for the pop-under branch.

  • UIProcess/mac/WebPopupMenuProxyMac.mm:

(WebKit::WebPopupMenuProxyMac::showPopupMenu):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r215829 r215830  
     12017-04-26  Zalan Bujtas  <zalan@apple.com>
     2
     3        RTL: recent searches popover is displayed in incorrect location
     4        https://bugs.webkit.org/show_bug.cgi?id=171338
     5        <rdar://problem/31377807>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Compute the absolute coordinates for the popup the same way we do for the select dropdown.
     10
     11        * rendering/RenderSearchField.cpp:
     12        (WebCore::RenderSearchField::showPopup):
     13
    1142017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
    215
  • trunk/Source/WebCore/rendering/RenderSearchField.cpp

    r214173 r215830  
    135135    }
    136136
    137     m_searchPopup->popupMenu()->show(snappedIntRect(absoluteBoundingBoxRect()), &view().frameView(), -1);
     137    FloatPoint absTopLeft = localToAbsolute(FloatPoint(), UseTransforms);
     138    IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
     139    absBounds.setLocation(roundedIntPoint(absTopLeft));
     140    m_searchPopup->popupMenu()->show(absBounds, &view().frameView(), -1);
    138141}
    139142
  • trunk/Source/WebKit/mac/ChangeLog

    r215784 r215830  
     12017-04-26  Zalan Bujtas  <zalan@apple.com>
     2
     3        RTL: recent searches popover is displayed in incorrect location
     4        https://bugs.webkit.org/show_bug.cgi?id=171338
     5        <rdar://problem/31377807>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add RTL support for the pop-under branch.
     10
     11        * WebCoreSupport/PopupMenuMac.mm:
     12        (PopupMenuMac::show):
     13
    1142017-04-25  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm

    r213464 r215830  
    174174            location = NSMakePoint(NSMinX(r) + popOverHorizontalAdjust, NSMaxY(r) - vertOffset);
    175175        else
    176             location = NSMakePoint(NSMinX(r) - popOverHorizontalAdjust, NSMaxY(r) - vertOffset);
     176            location = NSMakePoint(NSMaxX(r) - popOverHorizontalAdjust, NSMaxY(r) - vertOffset);
    177177#else
    178178        location = NSMakePoint(NSMinX(r) + popOverHorizontalAdjust, NSMaxY(r) - vertOffset);
    179179#endif
    180     } else
    181         location = NSMakePoint(NSMinX(r) + popUnderHorizontalAdjust, NSMaxY(r) + popUnderVerticalAdjust);   
    182 
     180    } else {
     181#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     182        if (textDirection == LTR)
     183            location = NSMakePoint(NSMinX(r) + popUnderHorizontalAdjust, NSMaxY(r) + popUnderVerticalAdjust);
     184        else
     185            location = NSMakePoint(NSMaxX(r) - popUnderHorizontalAdjust, NSMaxY(r) + popUnderVerticalAdjust);
     186#else
     187        location = NSMakePoint(NSMinX(r) + popUnderHorizontalAdjust, NSMaxY(r) + popUnderVerticalAdjust);
     188#endif
     189    }
    183190    // Save the current event that triggered the popup, so we can clean up our event
    184191    // state after the NSMenu goes away.
     
    189196
    190197    RetainPtr<NSView> dummyView = adoptNS([[NSView alloc] initWithFrame:r]);
     198    [dummyView.get() setUserInterfaceLayoutDirection:textDirection == LTR ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft];
    191199    [view addSubview:dummyView.get()];
    192200    location = [dummyView convertPoint:location fromView:view];
  • trunk/Source/WebKit2/ChangeLog

    r215816 r215830  
     12017-04-26  Zalan Bujtas  <zalan@apple.com>
     2
     3        RTL: recent searches popover is displayed in incorrect location
     4        https://bugs.webkit.org/show_bug.cgi?id=171338
     5        <rdar://problem/31377807>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Add RTL support for the pop-under branch.
     10
     11        * UIProcess/mac/WebPopupMenuProxyMac.mm:
     12        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
     13
    1142017-04-26  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm

    r208455 r215830  
    139139#endif
    140140
    141     } else
    142         location = NSMakePoint(NSMinX(rect) + popUnderHorizontalAdjust, NSMaxY(rect) + popUnderVerticalAdjust); 
    143 
     141    } else {
     142#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     143        if (textDirection == LTR)
     144            location = NSMakePoint(NSMinX(rect) + popUnderHorizontalAdjust, NSMaxY(rect) + popUnderVerticalAdjust);
     145        else
     146            location = NSMakePoint(NSMaxX(rect) - popUnderHorizontalAdjust, NSMaxY(rect) + popUnderVerticalAdjust);
     147#else
     148        location = NSMakePoint(NSMinX(rect) + popUnderHorizontalAdjust, NSMaxY(rect) + popUnderVerticalAdjust);
     149#endif
     150    }
    144151    RetainPtr<NSView> dummyView = adoptNS([[NSView alloc] initWithFrame:rect]);
    145152    [dummyView.get() setUserInterfaceLayoutDirection:textDirection == LTR ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft];
Note: See TracChangeset for help on using the changeset viewer.