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

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

Issue 1672273002: Enforce containing block requirement for IntersectionObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: nits Created 4 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/Source/core/dom/IntersectionObserver.cpp ('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/NodeIntersectionObserverData.cpp
diff --git a/third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.cpp b/third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.cpp
index ec0a62499a864848122fbeacab9f4a143b679283..b52afc0ec8528bf136ac8e6f09e20b5a616e095e 100644
--- a/third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.cpp
+++ b/third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.cpp
@@ -46,26 +46,13 @@ void NodeIntersectionObserverData::removeObservation(IntersectionObserver& obser
void NodeIntersectionObserverData::activateValidIntersectionObservers(Node& node)
{
IntersectionObserverController& controller = node.document().ensureIntersectionObserverController();
- // Activate observers for which node is root.
- for (auto& observer : m_intersectionObservers) {
+ for (auto& observer : m_intersectionObservers)
controller.addTrackedObserver(*observer);
- observer->setActive(true);
- }
- // A document can be root, but not target.
- if (node.isDocumentNode())
- return;
- // Active observers for which node is target.
- for (auto& observation : m_intersectionObservations)
- observation.value->setActive(observation.key->isDescendantOfRoot(&toElement(node)));
}
void NodeIntersectionObserverData::deactivateAllIntersectionObservers(Node& node)
{
node.document().ensureIntersectionObserverController().removeTrackedObserversForRoot(node);
- for (auto& observer : m_intersectionObservers)
- observer->setActive(false);
- for (auto& observation : m_intersectionObservations)
- observation.value->setActive(false);
}
#if !ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698