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 eade5171943781f148713d6be880359e56c06682..838f8cf59f95e7ccbfe92a3858f9c4a7c4971ad0 100644 |
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
@@ -220,17 +220,12 @@ bool IntersectionObserver::rootIsValid() const { |
} |
Document& IntersectionObserver::trackingDocument() const { |
- Document* document = nullptr; |
if (rootIsImplicit()) { |
DCHECK(m_callback->getExecutionContext()); |
- document = toDocument(m_callback->getExecutionContext()); |
- } else { |
- DCHECK(root()); |
- document = &root()->document(); |
+ return *toDocument(m_callback->getExecutionContext()); |
} |
- DCHECK(document); |
- DCHECK(document->frame()); |
- return *document->frame()->localFrameRoot()->document(); |
+ DCHECK(root()); |
+ return root()->document(); |
} |
void IntersectionObserver::observe(Element* target, |