| 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 b0b42f34f122259d9f5fc04d6fc616a3a6ff49ec..dfab75ba4455b8a2123dc93e6dde922f8d0798ae 100644
|
| --- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
|
| @@ -177,7 +177,11 @@ void IntersectionObserver::observe(Element* target)
|
| if (target->ensureIntersectionObserverData().getObservationFor(*this))
|
| return;
|
|
|
| - bool shouldReportRootBounds = target->document().frame()->securityContext()->getSecurityOrigin()->canAccess(rootNode()->document().frame()->securityContext()->getSecurityOrigin());
|
| + bool shouldReportRootBounds = false;
|
| + LocalFrame* targetFrame = target->document().frame();
|
| + LocalFrame* rootFrame = rootNode()->document().frame();
|
| + if (targetFrame && rootFrame)
|
| + shouldReportRootBounds = targetFrame->securityContext()->getSecurityOrigin()->canAccess(rootFrame->securityContext()->getSecurityOrigin());
|
| IntersectionObservation* observation = new IntersectionObservation(*this, *target, shouldReportRootBounds);
|
| target->ensureIntersectionObserverData().addObservation(*observation);
|
| m_observations.add(observation);
|
|
|