| Index: Source/core/frame/FrameView.cpp | 
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp | 
| index 205b4f3b9877d7573ccc2f6783083c628df5f03a..761de4b8d93e4f6f501c9eff5bcff8ddff377570 100644 | 
| --- a/Source/core/frame/FrameView.cpp | 
| +++ b/Source/core/frame/FrameView.cpp | 
| @@ -1755,7 +1755,7 @@ void FrameView::contentRectangleForPaintInvalidation(const IntRect& rectInConten | 
| return; | 
|  | 
| if (HostWindow* window = hostWindow()) | 
| -        window->invalidateRect(contentsToWindow(paintRect)); | 
| +        window->invalidateRect(contentsToRootFrame(paintRect)); | 
| } | 
|  | 
| void FrameView::contentsResized() | 
| @@ -2179,7 +2179,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; | 
|  | 
| @@ -2209,7 +2209,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()); | 
| } | 
|  | 
| @@ -3654,34 +3654,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 | 
| @@ -3689,7 +3693,14 @@ 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)); | 
| } | 
|  | 
| bool FrameView::containsScrollbarsAvoidingResizer() const | 
| @@ -3731,9 +3742,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); | 
| } | 
|  | 
| @@ -3846,7 +3857,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); | 
| } | 
|  | 
|  |