Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
| index 26fe2ecfdbbe9437d9efcd4d505b9d13e67f5e28..8c531ddca8329a0e2141f4239e9adc5d8eea95d8 100644 |
| --- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
| @@ -179,12 +179,18 @@ void IntersectionObserver::observe(Element* target, ExceptionState& exceptionSta |
| return; |
| } |
| + observe(target); |
|
szager1
2016/06/10 21:07:17
Infinite recursion.
szager1
2016/06/10 21:09:23
Oh never mind, I see what you did here. I would p
|
| +} |
| + |
| +void IntersectionObserver::observe(Element* target) |
| +{ |
| + DCHECK(m_root); |
| + |
| if (!target || m_root.get() == target) |
| return; |
| if (target->ensureIntersectionObserverData().getObservationFor(*this)) |
| return; |
| - |
| bool shouldReportRootBounds = false; |
| bool isDOMDescendant = false; |
| LocalFrame* targetFrame = target->document().frame(); |
| @@ -222,6 +228,13 @@ void IntersectionObserver::unobserve(Element* target, ExceptionState& exceptionS |
| return; |
| } |
| + unobserve(target); |
|
szager1
2016/06/10 21:07:49
Infinite recursion.
szager1
2016/06/10 21:09:23
Same comment.
|
| +} |
| + |
| +void IntersectionObserver::unobserve(Element* target) |
| +{ |
| + DCHECK(m_root); |
| + |
| if (!target || !target->intersectionObserverData()) |
| return; |
| // TODO(szager): unobserve callback |
| @@ -340,7 +353,6 @@ unsigned IntersectionObserver::firstThresholdGreaterThan(float ratio) const |
| void IntersectionObserver::deliver() |
| { |
| - |
| if (m_entries.isEmpty()) |
| return; |