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

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

Issue 2298933003: [IntersectionObserver] Enable observations across shadow DOM roots. (Closed)
Patch Set: Created 4 years, 4 months 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
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/shadow-content-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9cee27481920c954a429a4630b7aa65ac108cd3c..1970c981dc1e8de5d0fe50185daa80c0d5569d65 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -249,7 +249,7 @@ void IntersectionObserver::observe(Element* target, ExceptionState& exceptionSta
if (target->document() == rootNode()->document()) {
shouldReportRootBounds = true;
- isDOMDescendant = target->isDescendantOf(rootNode());
+ isDOMDescendant = rootNode()->isShadowIncludingInclusiveAncestorOf(target);
} else if (targetFrame && rootFrame) {
shouldReportRootBounds = targetFrame->securityContext()->getSecurityOrigin()->canAccess(rootFrame->securityContext()->getSecurityOrigin());
isDOMDescendant = (targetFrame->tree().top() == rootFrame);
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/shadow-content-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698