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

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

Issue 2708243002: [IntersectionObserver] Get rid of spurious console warning. (Closed)
Patch Set: Remove unused variable Created 3 years, 10 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/containing-block-warning-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 85dc34831757df6dfc68c3aa100ba96d0073f147..913662e99f0a8fac218b1e2a6bc110f15c901fa4 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -242,35 +242,21 @@ void IntersectionObserver::observe(Element* target,
if (target->ensureIntersectionObserverData().getObservationFor(*this))
return;
- bool isDOMDescendant = true;
- bool shouldReportRootBounds = false;
+ bool shouldReportRootBounds = true;
if (rootIsImplicit()) {
Frame* rootFrame = targetFrame->tree().top();
DCHECK(rootFrame);
- if (rootFrame == targetFrame) {
- shouldReportRootBounds = true;
- } else {
+ if (rootFrame != targetFrame) {
shouldReportRootBounds =
targetFrame->securityContext()->getSecurityOrigin()->canAccess(
rootFrame->securityContext()->getSecurityOrigin());
}
- } else {
- shouldReportRootBounds = true;
- isDOMDescendant = root()->isShadowIncludingInclusiveAncestorOf(target);
}
IntersectionObservation* observation =
new IntersectionObservation(*this, *target, shouldReportRootBounds);
target->ensureIntersectionObserverData().addObservation(*observation);
m_observations.add(observation);
-
- if (!isDOMDescendant) {
- root()->document().addConsoleMessage(
- ConsoleMessage::create(JSMessageSource, WarningMessageLevel,
- "IntersectionObserver.observe(target): target "
- "element is not a descendant of root."));
- }
-
if (FrameView* frameView = targetFrame->view())
frameView->scheduleAnimation();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/intersection-observer/containing-block-warning-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698