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 c9c04457e5ea67c7f176de9f8542466870e0c392..3cb835cb6681cc96dcf31ff6ac946856eb311a10 100644 |
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp |
@@ -64,7 +64,8 @@ void IntersectionObservation::clipToRoot(IntersectionGeometry& geometry) const { |
LayoutObject* targetLayoutObject = target()->layoutObject(); |
geometry.doesIntersect = targetLayoutObject->mapToVisualRectInAncestorSpace( |
- rootLayoutObject, geometry.intersectionRect, EdgeInclusive); |
+ toLayoutBox(m_observer->rootLayoutObjectForIntersection()), |
+ geometry.intersectionRect, EdgeInclusive); |
if (rootLayoutObject->hasOverflowClip()) |
geometry.intersectionRect.move(-rootLayoutObject->scrolledContentOffset()); |
@@ -131,8 +132,10 @@ static bool isContainingBlockChainDescendant(LayoutObject* descendant, |
LocalFrame* ancestorFrame = ancestor->document().frame(); |
LocalFrame* descendantFrame = descendant->document().frame(); |
- if (ancestor->isLayoutView()) |
- return descendantFrame && descendantFrame->tree().top() == ancestorFrame; |
+ if (ancestor->isLayoutView()) { |
+ return descendantFrame && |
+ descendantFrame->localFrameRoot() == ancestorFrame; |
+ } |
if (ancestorFrame != descendantFrame) |
return false; |