Index: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
index 055c6f956ec22224c3c8f142a4fb242a28e23b90..3bb9aed1aa1db7e89140063a78126833707fe813 100644 |
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
@@ -45,6 +45,7 @@ void IntersectionObservation::clipToRoot(LayoutRect& rect) |
if (rootLayoutObject->hasOverflowClip()) { |
LayoutBox* rootLayoutBox = toLayoutBox(rootLayoutObject); |
LayoutRect clipRect(LayoutPoint(), LayoutSize(rootLayoutBox->layer()->size())); |
+ m_observer->applyRootMargin(clipRect); |
rootLayoutBox->flipForWritingMode(rect); |
rect.intersect(clipRect); |
rootLayoutBox->flipForWritingMode(rect); |
@@ -57,12 +58,14 @@ void IntersectionObservation::clipToFrameView(IntersectionGeometry& geometry) |
LayoutObject* rootLayoutObject = m_observer->rootLayoutObject(); |
if (rootElement == rootElement->document().documentElement()) { |
geometry.rootRect = LayoutRect(rootElement->document().view()->visibleContentRect()); |
+ m_observer->applyRootMargin(geometry.rootRect); |
geometry.intersectionRect.intersect(geometry.rootRect); |
} else { |
if (rootLayoutObject->isBox()) |
geometry.rootRect = LayoutRect(toLayoutBox(rootLayoutObject)->absoluteContentBox()); |
else |
geometry.rootRect = LayoutRect(rootLayoutObject->absoluteBoundingBoxRect()); |
+ m_observer->applyRootMargin(geometry.rootRect); |
ojan
2016/01/12 01:08:49
Nit: you are repeating this line in both the if an
szager1
2016/01/12 19:24:43
applyRootMargin has to happen before the call to g
|
} |
LayoutPoint scrollPosition(rootElement->document().view()->scrollPosition()); |