| Index: Source/core/frame/FrameView.cpp
|
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
|
| index 5e5dec17c7a50c6311f9784132550648da083be3..a8894dd67a14912a215afe55fcaf90428f6f6369 100644
|
| --- a/Source/core/frame/FrameView.cpp
|
| +++ b/Source/core/frame/FrameView.cpp
|
| @@ -1726,7 +1726,7 @@ void FrameView::contentRectangleForPaintInvalidation(const IntRect& rectInConten
|
| return;
|
|
|
| if (HostWindow* window = hostWindow())
|
| - window->invalidateRect(contentsToWindow(paintRect));
|
| + window->invalidateRect(contentsToRootFrame(paintRect));
|
| }
|
|
|
| void FrameView::contentsResized()
|
| @@ -2150,7 +2150,7 @@ IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
|
| ASSERT(m_frame->view() == this);
|
|
|
| // Set our clip rect to be our contents.
|
| - IntRect clipRect = contentsToWindow(visibleContentRect(scrollbarInclusion));
|
| + IntRect clipRect = contentsToRootFrame(visibleContentRect(scrollbarInclusion));
|
| if (!m_frame->deprecatedLocalOwner())
|
| return clipRect;
|
|
|
| @@ -2180,7 +2180,7 @@ IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
|
| DisableCompositingQueryAsserts disabler;
|
|
|
| // Apply the clip from the layer.
|
| - IntRect clipRect = contentsToWindow(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
|
| + IntRect clipRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
|
| return intersection(clipRect, windowClipRect());
|
| }
|
|
|
| @@ -3625,34 +3625,38 @@ IntRect FrameView::contentsToRootFrame(const IntRect& contentsRect) const
|
| return convertToContainingWindow(rectInFrame);
|
| }
|
|
|
| -IntPoint FrameView::windowToContents(const IntPoint& windowPoint) const
|
| +FloatPoint FrameView::rootFrameToContents(const FloatPoint& windowPoint) const
|
| {
|
| - IntPoint framePoint = convertFromContainingWindow(windowPoint);
|
| + FloatPoint framePoint = convertFromContainingWindow(windowPoint);
|
| return frameToContents(framePoint);
|
| }
|
|
|
| -FloatPoint FrameView::windowToContents(const FloatPoint& windowPoint) const
|
| +IntRect FrameView::viewportToContents(const IntRect& rectInViewport) const
|
| {
|
| - FloatPoint framePoint = convertFromContainingWindow(windowPoint);
|
| - return frameToContents(framePoint);
|
| + IntRect rectInRootFrame = page()->frameHost().pinchViewport().viewportToRootFrame(rectInViewport);
|
| + IntRect frameRect = convertFromContainingWindow(rectInRootFrame);
|
| + return frameToContents(frameRect);
|
| }
|
|
|
| -IntPoint FrameView::contentsToWindow(const IntPoint& contentsPoint) const
|
| +IntPoint FrameView::viewportToContents(const IntPoint& pointInViewport) const
|
| {
|
| - IntPoint framePoint = contentsToFrame(contentsPoint);
|
| - return convertToContainingWindow(framePoint);
|
| + IntPoint pointInRootFrame = page()->frameHost().pinchViewport().viewportToRootFrame(pointInViewport);
|
| + IntPoint pointInFrame = convertFromContainingWindow(pointInRootFrame);
|
| + return frameToContents(pointInFrame);
|
| }
|
|
|
| -IntRect FrameView::windowToContents(const IntRect& windowRect) const
|
| +IntRect FrameView::contentsToViewport(const IntRect& rectInContents) const
|
| {
|
| - IntRect rectInFrame = convertFromContainingWindow(windowRect);
|
| - return frameToContents(rectInFrame);
|
| + IntRect rectInFrame = contentsToFrame(rectInContents);
|
| + IntRect rectInRootFrame = convertToContainingWindow(rectInFrame);
|
| + return page()->frameHost().pinchViewport().rootFrameToViewport(rectInRootFrame);
|
| }
|
|
|
| -IntRect FrameView::contentsToWindow(const IntRect& contentsRect) const
|
| +IntPoint FrameView::contentsToViewport(const IntPoint& pointInContents) const
|
| {
|
| - IntRect rectInFrame = contentsToFrame(contentsRect);
|
| - return convertToContainingWindow(rectInFrame);
|
| + IntPoint pointInFrame = contentsToFrame(pointInContents);
|
| + IntPoint pointInRootFrame = convertToContainingWindow(pointInFrame);
|
| + return page()->frameHost().pinchViewport().rootFrameToViewport(pointInRootFrame);
|
| }
|
|
|
| IntRect FrameView::contentsToScreen(const IntRect& rect) const
|
| @@ -3660,7 +3664,21 @@ IntRect FrameView::contentsToScreen(const IntRect& rect) const
|
| HostWindow* window = hostWindow();
|
| if (!window)
|
| return IntRect();
|
| - return window->viewportToScreen(contentsToWindow(rect));
|
| + return window->viewportToScreen(contentsToViewport(rect));
|
| +}
|
| +
|
| +IntRect FrameView::soonToBeRemovedContentsToUnscaledViewport(const IntRect& rectInContents) const
|
| +{
|
| + IntRect rectInFrame = contentsToFrame(rectInContents);
|
| + IntRect rectInRootFrame = convertToContainingWindow(rectInFrame);
|
| + return enclosingIntRect(page()->frameHost().pinchViewport().mainViewToViewportCSSPixels(rectInRootFrame));
|
| +}
|
| +
|
| +IntPoint FrameView::soonToBeRemovedUnscaledViewportToContents(const IntPoint& pointInViewport) const
|
| +{
|
| + IntPoint pointInRootFrame = flooredIntPoint(page()->frameHost().pinchViewport().viewportCSSPixelsToRootFrame(pointInViewport));
|
| + IntPoint pointInThisFrame = convertFromContainingWindow(pointInRootFrame);
|
| + return frameToContents(pointInThisFrame);
|
| }
|
|
|
| bool FrameView::containsScrollbarsAvoidingResizer() const
|
| @@ -3702,9 +3720,9 @@ void FrameView::setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppres
|
| }
|
| }
|
|
|
| -Scrollbar* FrameView::scrollbarAtWindowPoint(const IntPoint& windowPoint)
|
| +Scrollbar* FrameView::scrollbarAtRootFramePoint(const IntPoint& pointInRootFrame)
|
| {
|
| - IntPoint pointInFrame = convertFromContainingWindow(windowPoint);
|
| + IntPoint pointInFrame = convertFromContainingWindow(pointInRootFrame);
|
| return scrollbarAtFramePoint(pointInFrame);
|
| }
|
|
|
| @@ -3817,7 +3835,7 @@ void FrameView::paintPanScrollIcon(GraphicsContext* context)
|
| DEFINE_STATIC_REF(Image, panScrollIcon, (Image::loadPlatformResource("panIcon")));
|
| IntPoint iconGCPoint = m_panScrollIconPoint;
|
| if (parent())
|
| - iconGCPoint = toFrameView(parent())->windowToContents(iconGCPoint);
|
| + iconGCPoint = toFrameView(parent())->rootFrameToContents(iconGCPoint);
|
| context->drawImage(panScrollIcon, iconGCPoint);
|
| }
|
|
|
|
|