Commit 370b940d authored by andersca@apple.com's avatar andersca@apple.com

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7f2f7e53
2011-11-09 Anders Carlsson <andersca@apple.com>
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):
2011-11-09 Mark Hahnenberg <mhahnenberg@apple.com>
De-virtualize JSObject::getOwnPropertyDescriptor
......
......@@ -144,7 +144,7 @@ void drawHighlightForSVGRenderer(GraphicsContext& context, const Vector<FloatQua
inline LayoutSize frameToMainFrameOffset(Frame* frame)
{
LayoutPoint mainFramePoint = frame->page()->mainFrame()->view()->windowToContents(frame->view()->contentsToWindow(LayoutPoint()));
LayoutPoint mainFramePoint = frame->page()->mainFrame()->view()->rootViewToContents(frame->view()->contentsToRootView(LayoutPoint()));
return toLayoutSize(mainFramePoint);
}
......
......@@ -782,7 +782,7 @@ bool DragController::startDrag(Frame* src, const DragState& state, DragOperation
if (!dragImage) {
IntRect imageRect = hitTestResult.imageRect();
imageRect.setLocation(m_page->mainFrame()->view()->windowToContents(src->view()->contentsToWindow(imageRect.location())));
imageRect.setLocation(m_page->mainFrame()->view()->rootViewToContents(src->view()->contentsToRootView(imageRect.location())));
doImageDrag(element, dragOrigin, hitTestResult.imageRect(), clipboard, src, m_dragOffset);
} else
// DHTML defined drag image
......@@ -874,8 +874,8 @@ void DragController::doSystemDrag(DragImageRef image, const IntPoint& dragLoc, c
// Protect this frame and view, as a load may occur mid drag and attempt to unload this frame
RefPtr<Frame> frameProtector = m_page->mainFrame();
RefPtr<FrameView> viewProtector = frameProtector->view();
m_client->startDrag(image, viewProtector->windowToContents(frame->view()->contentsToWindow(dragLoc)),
viewProtector->windowToContents(frame->view()->contentsToWindow(eventPos)), clipboard, frameProtector.get(), forLink);
m_client->startDrag(image, viewProtector->rootViewToContents(frame->view()->contentsToRootView(dragLoc)),
viewProtector->rootViewToContents(frame->view()->contentsToRootView(eventPos)), clipboard, frameProtector.get(), forLink);
cleanupAfterSystemDrag();
}
......
......@@ -975,8 +975,7 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool
FrameView* resultView = resultFrame->view();
FrameView* mainView = mainFrame->view();
if (resultView && mainView) {
LayoutPoint windowPoint = resultView->contentsToWindow(result.point());
LayoutPoint mainFramePoint = mainView->windowToContents(windowPoint);
LayoutPoint mainFramePoint = mainView->rootViewToContents(resultView->contentsToRootView(result.point()));
result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment