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 42d01f256c5a85a3e908a1d9ac81bc219c6f3fcd..38905570b2b3727166341b684d23e7dde99c4415 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -52,6 +52,8 @@ |
#include "core/frame/Location.h" |
#include "core/frame/PageScaleConstraintsSet.h" |
#include "core/frame/PerformanceMonitor.h" |
+#include "core/frame/RemoteFrame.h" |
+#include "core/frame/RemoteFrameView.h" |
#include "core/frame/Settings.h" |
#include "core/frame/VisualViewport.h" |
#include "core/html/HTMLFrameElement.h" |
@@ -194,7 +196,8 @@ FrameView::FrameView(LocalFrame& frame) |
m_scrollbarManager(*this), |
m_needsScrollbarsUpdate(false), |
m_suppressAdjustViewSize(false), |
- m_allowsLayoutInvalidationAfterLayoutClean(true) { |
+ m_allowsLayoutInvalidationAfterLayoutClean(true), |
+ m_remoteViewportIntersection(0, 0, 0, 0) { |
init(); |
} |
@@ -4679,4 +4682,39 @@ int FrameView::initialViewportHeight() const { |
return m_initialViewportSize.height(); |
} |
+void FrameView::setViewportIntersectionFromParent( |
+ const IntRect& viewportIntersection) { |
+ if (m_remoteViewportIntersection != viewportIntersection) { |
+ m_remoteViewportIntersection = viewportIntersection; |
+ scheduleAnimation(); |
+ } |
+} |
+ |
+IntRect FrameView::remoteViewportIntersection() { |
+ IntRect intersection(m_remoteViewportIntersection); |
+ intersection.move(scrollOffsetInt()); |
+ return intersection; |
+} |
+ |
+void FrameView::mapQuadToAncestorFrameIncludingScrollOffset( |
+ LayoutRect& rect, |
+ const LayoutObject* descendant, |
+ const LayoutView* ancestor, |
+ MapCoordinatesFlags mode) { |
+ FloatQuad mappedQuad = descendant->localToAncestorQuad( |
+ FloatQuad(FloatRect(rect)), ancestor, mode); |
+ rect = LayoutRect(mappedQuad.boundingBox()); |
+ |
+ // localToAncestorQuad accounts for scroll offset if it encounters a remote |
+ // frame in the ancestor chain, otherwise it needs to be added explicitly. |
+ if (frame().localFrameRoot() == frame().tree().top() || |
+ (ancestor && ancestor->frame() != frame().tree().top())) { |
szager1
2016/12/16 03:42:34
I think the 'ancestor->frame() != frame().tree().t
kenrb
2016/12/16 16:17:35
I think that situation is covered, because this ev
|
+ FrameView* ancestorView = |
+ (ancestor ? ancestor->frameView() |
+ : toLocalFrame(frame().tree().top())->view()); |
+ LayoutSize scrollPosition = LayoutSize(ancestorView->getScrollOffset()); |
+ rect.move(-scrollPosition); |
+ } |
+} |
+ |
} // namespace blink |