Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
index 80565df0ef762904c649c481e51d244adfde82f2..a276365074fcc62eec7c0a20d231695b47fd1241 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -2468,6 +2468,9 @@ void LayoutObject::willBeDestroyed() |
if (frameView()) |
setIsSlowRepaintObject(false); |
+ |
+ if (view() && hasIntersectionObserver()) |
+ view()->removeIntersectionObserverTarget(this); |
} |
void LayoutObject::insertedIntoTree() |
@@ -2496,6 +2499,9 @@ void LayoutObject::insertedIntoTree() |
if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) |
flowThread->flowThreadDescendantWasInserted(this); |
+ |
+ if (view() && hasIntersectionObserver()) |
+ view()->addIntersectionObserverTarget(this); |
} |
void LayoutObject::willBeRemovedFromTree() |
@@ -2525,6 +2531,9 @@ void LayoutObject::willBeRemovedFromTree() |
// Update cached boundaries in SVG layoutObjects if a child is removed. |
if (parent()->isSVG()) |
parent()->setNeedsBoundariesUpdate(); |
+ |
+ if (view() && hasIntersectionObserver()) |
+ view()->removeIntersectionObserverTarget(this); |
} |
void LayoutObject::removeFromLayoutFlowThread() |