Chromium Code Reviews| 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 1a7b4c6f6f23b94ed91a2b847032eb19f0501304..3fcc21ce81f7d60f55f49a00569affaa938a1e9a 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); |
|
ojan
2016/01/12 21:13:48
Do you remember why we decided to expand the rootR
szager1
2016/01/12 21:18:38
I think that bit of spec pre-dated my involvement.
|
| 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); |
| } |
| LayoutPoint scrollPosition(rootElement->document().view()->scrollPosition()); |