| Index: third_party/WebKit/Source/core/frame/FrameView.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| index 143a285cec09eff55cdb35f7bca6233e0eb36fbd..1c409e51aebacd77645f6856f0e5ce2f625c9f0b 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -2687,6 +2687,16 @@ IntRect FrameView::convertToLayoutObject(const LayoutObject& layoutObject, const
|
| return rectInContent;
|
| }
|
|
|
| +FloatRect FrameView::convertFromLayoutObject(const LayoutObject& layoutObject, const FloatRect& layoutObjectRect) const
|
| +{
|
| + FloatRect rect = layoutObject.localToAbsoluteQuad(layoutObjectRect).boundingBox();
|
| +
|
| + // Convert from page ("absolute") to FrameView coordinates.
|
| + rect.moveBy(-scrollPosition());
|
| +
|
| + return rect;
|
| +}
|
| +
|
| IntPoint FrameView::convertFromLayoutObject(const LayoutObject& layoutObject, const IntPoint& layoutObjectPoint) const
|
| {
|
| IntPoint point = roundedIntPoint(layoutObject.localToAbsolute(layoutObjectPoint, UseTransforms));
|
| @@ -2724,6 +2734,24 @@ IntRect FrameView::convertToContainingWidget(const IntRect& localRect) const
|
| return localRect;
|
| }
|
|
|
| +FloatRect FrameView::convertToContainingWidget(const FloatRect& localRect) const
|
| +{
|
| + if (const FrameView* parentView = toFrameView(parent())) {
|
| + // Get our layoutObject in the parent view
|
| + LayoutPart* layoutObject = m_frame->ownerLayoutObject();
|
| + if (!layoutObject)
|
| + return localRect;
|
| +
|
| + FloatRect rect(localRect);
|
| + // Add borders and padding??
|
| + rect.move(layoutObject->borderLeft() + layoutObject->paddingLeft(),
|
| + layoutObject->borderTop() + layoutObject->paddingTop());
|
| + return parentView->convertFromLayoutObject(*layoutObject, rect);
|
| + }
|
| +
|
| + return localRect;
|
| +}
|
| +
|
| IntRect FrameView::convertFromContainingWidget(const IntRect& parentRect) const
|
| {
|
| if (const FrameView* parentView = toFrameView(parent())) {
|
| @@ -3412,11 +3440,21 @@ IntPoint FrameView::contentsToFrame(const IntPoint& pointInContentSpace) const
|
| return pointInContentSpace - scrollOffset();
|
| }
|
|
|
| +FloatPoint FrameView::contentsToFrame(const FloatPoint& pointInContentSpace) const
|
| +{
|
| + return FloatPoint(pointInContentSpace - scrollOffset());
|
| +}
|
| +
|
| IntRect FrameView::contentsToFrame(const IntRect& rectInContentSpace) const
|
| {
|
| return IntRect(contentsToFrame(rectInContentSpace.location()), rectInContentSpace.size());
|
| }
|
|
|
| +FloatRect FrameView::contentsToFrame(const FloatRect& rectInContentSpace) const
|
| +{
|
| + return FloatRect(contentsToFrame(rectInContentSpace.location()), rectInContentSpace.size());
|
| +}
|
| +
|
| FloatPoint FrameView::frameToContents(const FloatPoint& pointInFrame) const
|
| {
|
| return pointInFrame + scrollOffset();
|
| @@ -3482,6 +3520,13 @@ IntRect FrameView::contentsToViewport(const IntRect& rectInContents) const
|
| return m_frame->host()->visualViewport().rootFrameToViewport(rectInRootFrame);
|
| }
|
|
|
| +FloatRect FrameView::contentsToViewport(const FloatRect& rectInContents) const
|
| +{
|
| + FloatRect rectInFrame = contentsToFrame(rectInContents);
|
| + FloatRect rectInRootFrame = convertToRootFrame(rectInFrame);
|
| + return m_frame->host()->visualViewport().rootFrameToViewport(rectInRootFrame);
|
| +}
|
| +
|
| IntPoint FrameView::contentsToViewport(const IntPoint& pointInContents) const
|
| {
|
| IntPoint pointInFrame = contentsToFrame(pointInContents);
|
| @@ -3725,6 +3770,14 @@ IntRect FrameView::convertFromContainingWidgetToScrollbar(const Scrollbar* scrol
|
| return newRect;
|
| }
|
|
|
| +FloatRect FrameView::convertFromScrollbarToContainingWidget(const Scrollbar* scrollbar, const FloatRect& localRect) const
|
| +{
|
| + // Scrollbars won't be transformed within us
|
| + FloatRect newRect = localRect;
|
| + newRect.moveBy(scrollbar->location());
|
| + return newRect;
|
| +}
|
| +
|
| // FIXME: test these on windows
|
| IntPoint FrameView::convertFromScrollbarToContainingWidget(const Scrollbar* scrollbar, const IntPoint& localPoint) const
|
| {
|
|
|