Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp

Issue 2553343004: IntersectionObserver: use nullptr for implicit root. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
index a179b02e5e7943a5ca4bad7c39a51fc273ca96d3..6effa417267e0b7dccc07f47e5e18038624b8b15 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
@@ -27,10 +27,8 @@ void IntersectionObservation::computeIntersectionObservations(
rootMargin[1] = m_observer->rightMargin();
rootMargin[2] = m_observer->bottomMargin();
rootMargin[3] = m_observer->leftMargin();
- Node* rootNode = m_observer->rootNode();
- IntersectionGeometry geometry(
- rootNode && !rootNode->isDocumentNode() ? toElement(rootNode) : nullptr,
- *target(), rootMargin, m_shouldReportRootBounds);
+ IntersectionGeometry geometry(m_observer->root(), *target(), rootMargin,
+ m_shouldReportRootBounds);
geometry.computeGeometry();
// Some corner cases for threshold index:
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementRareData.h ('k') | third_party/WebKit/Source/core/dom/IntersectionObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698