Changeset 163908 in webkit


Ignore:
Timestamp:
Feb 11, 2014 1:56:24 PM (10 years ago)
Author:
benjamin@webkit.org
Message:

[WK2] Rename screenToWindow to screenToRootView and windowToScreen to rootViewToScreen
https://bugs.webkit.org/show_bug.cgi?id=128575

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-02-11
Reviewed by Darin Adler.

In WebKit2, screenToRootView and rootViewToScreen were named screenToWindow and windowToScreen.
Those names were fine on ports were FrameView correspond to the scrollview, but they do not apply on iOS.

This patch renames screenToWindow and windowToScreen to their more generic WebCore counterpart.

  • UIProcess/API/gtk/PageClientImpl.cpp:

(WebKit::PageClientImpl::screenToRootView):
(WebKit::PageClientImpl::rootViewToScreen):

  • UIProcess/API/gtk/PageClientImpl.h:
  • UIProcess/API/ios/PageClientImplIOS.h:
  • UIProcess/API/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::screenToRootView):
(WebKit::PageClientImpl::rootViewToScreen):

  • UIProcess/API/mac/PageClientImpl.h:
  • UIProcess/API/mac/PageClientImpl.mm:

(WebKit::PageClientImpl::screenToRootView):
(WebKit::PageClientImpl::rootViewToScreen):

  • UIProcess/CoordinatedGraphics/WebView.cpp:

(WebKit::WebView::screenToRootView):
(WebKit::WebView::rootViewToScreen):

  • UIProcess/CoordinatedGraphics/WebView.h:
  • UIProcess/PageClient.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::screenToRootView):
(WebKit::WebPageProxy::rootViewToScreen):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::screenToRootView):
(WebKit::WebChromeClient::rootViewToScreen):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::screenToRootView):
(WebKit::WebPage::rootViewToScreen):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm:

(-[WKAccessibilityWebPageObject _convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):

Location:
trunk/Source/WebKit2
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r163905 r163908  
     12014-02-11  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        [WK2] Rename screenToWindow to screenToRootView and windowToScreen to rootViewToScreen
     4        https://bugs.webkit.org/show_bug.cgi?id=128575
     5
     6        Reviewed by Darin Adler.
     7
     8        In WebKit2, screenToRootView and rootViewToScreen were named screenToWindow and windowToScreen.
     9        Those names were fine on ports were FrameView correspond to the scrollview, but they do not apply on iOS.
     10
     11        This patch renames screenToWindow and windowToScreen to their more generic WebCore counterpart.
     12
     13        * UIProcess/API/gtk/PageClientImpl.cpp:
     14        (WebKit::PageClientImpl::screenToRootView):
     15        (WebKit::PageClientImpl::rootViewToScreen):
     16        * UIProcess/API/gtk/PageClientImpl.h:
     17        * UIProcess/API/ios/PageClientImplIOS.h:
     18        * UIProcess/API/ios/PageClientImplIOS.mm:
     19        (WebKit::PageClientImpl::screenToRootView):
     20        (WebKit::PageClientImpl::rootViewToScreen):
     21        * UIProcess/API/mac/PageClientImpl.h:
     22        * UIProcess/API/mac/PageClientImpl.mm:
     23        (WebKit::PageClientImpl::screenToRootView):
     24        (WebKit::PageClientImpl::rootViewToScreen):
     25        * UIProcess/CoordinatedGraphics/WebView.cpp:
     26        (WebKit::WebView::screenToRootView):
     27        (WebKit::WebView::rootViewToScreen):
     28        * UIProcess/CoordinatedGraphics/WebView.h:
     29        * UIProcess/PageClient.h:
     30        * UIProcess/WebPageProxy.cpp:
     31        (WebKit::WebPageProxy::screenToRootView):
     32        (WebKit::WebPageProxy::rootViewToScreen):
     33        * UIProcess/WebPageProxy.h:
     34        * UIProcess/WebPageProxy.messages.in:
     35        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     36        (WebKit::WebChromeClient::screenToRootView):
     37        (WebKit::WebChromeClient::rootViewToScreen):
     38        * WebProcess/WebPage/WebPage.cpp:
     39        (WebKit::WebPage::screenToRootView):
     40        (WebKit::WebPage::rootViewToScreen):
     41        * WebProcess/WebPage/WebPage.h:
     42        * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm:
     43        (-[WKAccessibilityWebPageObject _convertScreenPointToRootView:]):
     44        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
     45
    1462014-02-11  Andy Estes  <aestes@apple.com>
    247
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp

    r163749 r163908  
    190190}
    191191
    192 IntPoint PageClientImpl::screenToWindow(const IntPoint& point)
     192IntPoint PageClientImpl::screenToRootView(const IntPoint& point)
    193193{
    194194    IntPoint widgetPositionOnScreen = convertWidgetPointToScreenPoint(m_viewWidget, IntPoint());
     
    198198}
    199199
    200 IntRect PageClientImpl::windowToScreen(const IntRect& rect)
     200IntRect PageClientImpl::rootViewToScreen(const IntRect& rect)
    201201{
    202202    return IntRect(convertWidgetPointToScreenPoint(m_viewWidget, rect.location()), rect.size());
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h

    r163749 r163908  
    8585    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override;
    8686    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override;
    87     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) override;
    88     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) override;
     87    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override;
     88    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override;
    8989    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override;
    9090    virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) override;
  • trunk/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h

    r163515 r163908  
    8080    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override;
    8181    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override;
    82     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) override;
    83     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) override;
     82    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override;
     83    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override;
    8484    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override;
    8585#if ENABLE(TOUCH_EVENTS)
  • trunk/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm

    r163839 r163908  
    259259}
    260260
    261 IntPoint PageClientImpl::screenToWindow(const IntPoint& point)
     261IntPoint PageClientImpl::screenToRootView(const IntPoint& point)
    262262{
    263263    return IntPoint([m_view convertPoint:point fromView:nil]);
    264264}
    265265
    266 IntRect PageClientImpl::windowToScreen(const IntRect& rect)
     266IntRect PageClientImpl::rootViewToScreen(const IntRect& rect)
    267267{
    268268    return enclosingIntRect([m_view convertRect:rect toView:nil]);
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h

    r163116 r163908  
    9898    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
    9999    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
    100     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
    101     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
     100    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
     101    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
    102102
    103103    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm

    r163218 r163908  
    362362}
    363363   
    364 IntPoint PageClientImpl::screenToWindow(const IntPoint& point)
     364IntPoint PageClientImpl::screenToRootView(const IntPoint& point)
    365365{
    366366#pragma clang diagnostic push
     
    371371}
    372372   
    373 IntRect PageClientImpl::windowToScreen(const IntRect& rect)
     373IntRect PageClientImpl::rootViewToScreen(const IntRect& rect)
    374374{
    375375    NSRect tempRect = rect;
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp

    r163694 r163908  
    408408}
    409409
    410 IntPoint WebView::screenToWindow(const IntPoint& point)
     410IntPoint WebView::screenToRootView(const IntPoint& point)
    411411{
    412412    notImplemented();
     
    414414}
    415415
    416 IntRect WebView::windowToScreen(const IntRect&)
     416IntRect WebView::rootViewToScreen(const IntRect&)
    417417{
    418418    notImplemented();
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h

    r163164 r163908  
    169169    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override;
    170170    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override;
    171     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) override;
    172     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) override;
     171    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override;
     172    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override;
    173173
    174174    virtual void updateTextInputState() override;
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r163515 r163908  
    193193    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
    194194    virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;
    195     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) = 0;
    196     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) = 0;
     195    virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) = 0;
     196    virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) = 0;
    197197   
    198198    virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r163863 r163908  
    27912791}
    27922792   
    2793 void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
    2794 {
    2795     windowPoint = m_pageClient.screenToWindow(screenPoint);
     2793void WebPageProxy::screenToRootView(const IntPoint& screenPoint, IntPoint& windowPoint)
     2794{
     2795    windowPoint = m_pageClient.screenToRootView(screenPoint);
    27962796}
    27972797   
    2798 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
    2799 {
    2800     result = m_pageClient.windowToScreen(viewRect);
     2798void WebPageProxy::rootViewToScreen(const IntRect& viewRect, IntRect& result)
     2799{
     2800    result = m_pageClient.rootViewToScreen(viewRect);
    28012801}
    28022802   
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r163863 r163908  
    982982    void setWindowFrame(const WebCore::FloatRect&);
    983983    void getWindowFrame(WebCore::FloatRect&);
    984     void screenToWindow(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
    985     void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
     984    void screenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
     985    void rootViewToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
    986986    void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
    987987    void didChangeViewportProperties(const WebCore::ViewportAttributes&);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r163863 r163908  
    6161    SetWindowFrame(WebCore::FloatRect windowFrame)
    6262    GetWindowFrame() -> (WebCore::FloatRect windowFrame)
    63     ScreenToWindow(WebCore::IntPoint screenPoint) -> (WebCore::IntPoint windowPoint)
    64     WindowToScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame)
     63    ScreenToRootView(WebCore::IntPoint screenPoint) -> (WebCore::IntPoint windowPoint)
     64    RootViewToScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame)
    6565    RunBeforeUnloadConfirmPanel(String message, uint64_t frameID) -> (bool shouldClose)
    6666    PageDidScroll()
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r163863 r163908  
    473473IntPoint WebChromeClient::screenToRootView(const IntPoint& point) const
    474474{
    475     return m_page->screenToWindow(point);
     475    return m_page->screenToRootView(point);
    476476}
    477477
    478478IntRect WebChromeClient::rootViewToScreen(const IntRect& rect) const
    479479{
    480     return m_page->windowToScreen(rect);
     480    return m_page->rootViewToScreen(rect);
    481481}
    482482
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r163844 r163908  
    21642164}
    21652165
    2166 IntPoint WebPage::screenToWindow(const IntPoint& point)
     2166IntPoint WebPage::screenToRootView(const IntPoint& point)
    21672167{
    21682168    IntPoint windowPoint;
    2169     sendSync(Messages::WebPageProxy::ScreenToWindow(point), Messages::WebPageProxy::ScreenToWindow::Reply(windowPoint));
     2169    sendSync(Messages::WebPageProxy::ScreenToRootView(point), Messages::WebPageProxy::ScreenToRootView::Reply(windowPoint));
    21702170    return windowPoint;
    21712171}
    21722172   
    2173 IntRect WebPage::windowToScreen(const IntRect& rect)
     2173IntRect WebPage::rootViewToScreen(const IntRect& rect)
    21742174{
    21752175    IntRect screenRect;
    2176     sendSync(Messages::WebPageProxy::WindowToScreen(rect), Messages::WebPageProxy::WindowToScreen::Reply(screenRect));
     2176    sendSync(Messages::WebPageProxy::RootViewToScreen(rect), Messages::WebPageProxy::RootViewToScreen::Reply(screenRect));
    21772177    return screenRect;
    21782178}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r163821 r163908  
    405405#endif // !PLATFORM(IOS)
    406406
    407     WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
    408     WebCore::IntRect windowToScreen(const WebCore::IntRect&);
     407    WebCore::IntPoint screenToRootView(const WebCore::IntPoint&);
     408    WebCore::IntRect rootViewToScreen(const WebCore::IntRect&);
    409409
    410410    PassRefPtr<WebImage> scaledSnapshotWithOptions(const WebCore::IntRect&, double scaleFactor, SnapshotOptions);
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm

    r162929 r163908  
    189189}
    190190
    191 - (NSPoint)_convertScreenPointToWindow:(NSPoint)point
    192 {
    193     return m_page->screenToWindow(IntPoint(point.x, point.y));
     191- (NSPoint)_convertScreenPointToRootView:(NSPoint)point
     192{
     193    return m_page->screenToRootView(IntPoint(point.x, point.y));
    194194}
    195195
     
    199199   
    200200    if ([parameter isKindOfClass:[NSValue class]] && strcmp([(NSValue*)parameter objCType], @encode(NSPoint)) == 0) {
    201         NSPoint point = [self _convertScreenPointToWindow:[(NSValue *)parameter pointValue]];
     201        NSPoint point = [self _convertScreenPointToRootView:[(NSValue *)parameter pointValue]];
    202202        pageOverlayParameter = WKPointCreate(WKPointMake(point.x, point.y));
    203203    }
Note: See TracChangeset for help on using the changeset viewer.