Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1154)

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 1330633003: Intersection Observer first draft Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix segfault on null input. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index d08f93804d0716b7c5c97cfe0d2434f2e04f63d9..0036e3c2307df3145735d3cebf63f5d8076e0e3c 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -2486,6 +2486,10 @@ void LayoutObject::willBeDestroyed()
if (frameView())
setIsSlowRepaintObject(false);
+
+ if (view() && hasIntersectionObserver()) {
ojan 2015/09/21 03:49:09 Ditto nits about curlies here and below
MikeB 2015/09/24 19:04:04 Done.
+ view()->removeIntersectionObserverTarget(this);
+ }
}
void LayoutObject::insertedIntoTree()
@@ -2514,6 +2518,10 @@ void LayoutObject::insertedIntoTree()
if (LayoutFlowThread* flowThread = flowThreadContainingBlock())
flowThread->flowThreadDescendantWasInserted(this);
+
+ if (view() && hasIntersectionObserver()) {
+ view()->addIntersectionObserverTarget(this);
+ }
}
void LayoutObject::willBeRemovedFromTree()
@@ -2543,6 +2551,10 @@ void LayoutObject::willBeRemovedFromTree()
// Update cached boundaries in SVG layoutObjects if a child is removed.
if (parent()->isSVG())
parent()->setNeedsBoundariesUpdate();
+
+ if (view() && hasIntersectionObserver()) {
ojan 2015/09/21 03:49:09 I'm not sure, but I believe this function gets cal
+ view()->removeIntersectionObserverTarget(this);
+ }
}
void LayoutObject::removeFromLayoutFlowThread()

Powered by Google App Engine
This is Rietveld 408576698