| 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..f6e9e524690b758eeca4f983302ccb14e85e6fa3 100644
|
| --- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
|
| @@ -179,12 +179,19 @@ void IntersectionObserver::observe(Element* target, ExceptionState& exceptionSta
|
| return;
|
| }
|
|
|
| + observe(target);
|
| +}
|
| +
|
| +void IntersectionObserver::observe(Element* target)
|
| +{
|
| + if (!m_root)
|
| + return;
|
| +
|
| 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 +229,14 @@ void IntersectionObserver::unobserve(Element* target, ExceptionState& exceptionS
|
| return;
|
| }
|
|
|
| + unobserve(target);
|
| +}
|
| +
|
| +void IntersectionObserver::unobserve(Element* target)
|
| +{
|
| + if (!m_root)
|
| + return;
|
| +
|
| if (!target || !target->intersectionObserverData())
|
| return;
|
| // TODO(szager): unobserve callback
|
| @@ -340,7 +355,6 @@ unsigned IntersectionObserver::firstThresholdGreaterThan(float ratio) const
|
|
|
| void IntersectionObserver::deliver()
|
| {
|
| -
|
| if (m_entries.isEmpty())
|
| return;
|
|
|
|
|