Changeset 99755 in webkit


Ignore:
Timestamp:
Nov 9, 2011 1:18:44 PM (12 years ago)
Author:
andersca@apple.com
Message:

Use contentsToRootView/rootViewToContents when converting between frame coordinate systems
https://bugs.webkit.org/show_bug.cgi?id=71947

Reviewed by Sam Weinig.

This gets rid of a few calls to contentsToWindow and windowToContents.

  • inspector/DOMNodeHighlighter.cpp:
  • page/DragController.cpp:

(WebCore::DragController::startDrag):
(WebCore::DragController::doSystemDrag):

  • page/EventHandler.cpp:

(WebCore::EventHandler::hitTestResultAtPoint):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99754 r99755  
     12011-11-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Use contentsToRootView/rootViewToContents when converting between frame coordinate systems
     4        https://bugs.webkit.org/show_bug.cgi?id=71947
     5
     6        Reviewed by Sam Weinig.
     7
     8        This gets rid of a few calls to contentsToWindow and windowToContents.
     9
     10        * inspector/DOMNodeHighlighter.cpp:
     11        * page/DragController.cpp:
     12        (WebCore::DragController::startDrag):
     13        (WebCore::DragController::doSystemDrag):
     14        * page/EventHandler.cpp:
     15        (WebCore::EventHandler::hitTestResultAtPoint):
     16
    1172011-11-09  Mark Hahnenberg  <mhahnenberg@apple.com>
    218
  • trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp

    r97949 r99755  
    145145inline LayoutSize frameToMainFrameOffset(Frame* frame)
    146146{
    147     LayoutPoint mainFramePoint = frame->page()->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(LayoutPoint()));
     147    LayoutPoint mainFramePoint = frame->page()->mainFrame()->view()->rootViewToContents(frame->view()->contentsToRootView(LayoutPoint()));
    148148    return toLayoutSize(mainFramePoint);
    149149}
  • trunk/Source/WebCore/page/DragController.cpp

    r99539 r99755  
    783783        if (!dragImage) {
    784784            IntRect imageRect = hitTestResult.imageRect();
    785             imageRect.setLocation(m_page->mainFrame()->view()->windowToContents(src->view()->contentsToWindow(imageRect.location())));
     785            imageRect.setLocation(m_page->mainFrame()->view()->rootViewToContents(src->view()->contentsToRootView(imageRect.location())));
    786786            doImageDrag(element, dragOrigin, hitTestResult.imageRect(), clipboard, src, m_dragOffset);
    787787        } else
     
    875875    RefPtr<Frame> frameProtector = m_page->mainFrame();
    876876    RefPtr<FrameView> viewProtector = frameProtector->view();
    877     m_client->startDrag(image, viewProtector->windowToContents(frame->view()->contentsToWindow(dragLoc)),
    878         viewProtector->windowToContents(frame->view()->contentsToWindow(eventPos)), clipboard, frameProtector.get(), forLink);
     877    m_client->startDrag(image, viewProtector->rootViewToContents(frame->view()->contentsToRootView(dragLoc)),
     878        viewProtector->rootViewToContents(frame->view()->contentsToRootView(eventPos)), clipboard, frameProtector.get(), forLink);
    879879
    880880    cleanupAfterSystemDrag();
  • trunk/Source/WebCore/page/EventHandler.cpp

    r99667 r99755  
    976976            FrameView* mainView = mainFrame->view();
    977977            if (resultView && mainView) {
    978                 LayoutPoint windowPoint = resultView->contentsToWindow(result.point());
    979                 LayoutPoint mainFramePoint = mainView->windowToContents(windowPoint);
     978                LayoutPoint mainFramePoint = mainView->rootViewToContents(resultView->contentsToRootView(result.point()));
    980979                result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding);
    981980            }
Note: See TracChangeset for help on using the changeset viewer.