 Chromium Code Reviews
 Chromium Code Reviews Issue 1330633003:
  Intersection Observer first draft 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 1330633003:
  Intersection Observer first draft 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| 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() |