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

Unified Diff: third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.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
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.h ('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
deleted file mode 100644
index 7a3fc71fca48bf3a31def3ec6c7a15d1e32d3011..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "core/dom/NodeIntersectionObserverData.h"
-
-#include "core/dom/Document.h"
-#include "core/dom/IntersectionObservation.h"
-#include "core/dom/IntersectionObserver.h"
-#include "core/dom/IntersectionObserverController.h"
-
-namespace blink {
-
-NodeIntersectionObserverData::NodeIntersectionObserverData() {}
-
-IntersectionObservation* NodeIntersectionObserverData::getObservationFor(
- IntersectionObserver& observer) {
- auto i = m_intersectionObservations.find(&observer);
- if (i == m_intersectionObservations.end())
- return nullptr;
- return i->value;
-}
-
-void NodeIntersectionObserverData::addObservation(
- IntersectionObservation& observation) {
- m_intersectionObservations.add(
- TraceWrapperMember<IntersectionObserver>(this, &observation.observer()),
- &observation);
-}
-
-void NodeIntersectionObserverData::removeObservation(
- IntersectionObserver& observer) {
- m_intersectionObservations.remove(&observer);
-}
-
-void NodeIntersectionObserverData::activateValidIntersectionObservers(
- Node& node) {
- IntersectionObserverController& controller =
- node.document().ensureIntersectionObserverController();
- for (auto& observer : m_intersectionObservers)
- controller.addTrackedObserver(*observer);
-}
-
-void NodeIntersectionObserverData::deactivateAllIntersectionObservers(
- Node& node) {
- node.document()
- .ensureIntersectionObserverController()
- .removeTrackedObserversForRoot(node);
-}
-
-DEFINE_TRACE(NodeIntersectionObserverData) {
- visitor->trace(m_intersectionObservers);
- visitor->trace(m_intersectionObservations);
-}
-
-DEFINE_TRACE_WRAPPERS(NodeIntersectionObserverData) {
- for (auto& entry : m_intersectionObservations) {
- visitor->traceWrappers(entry.key);
- }
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeIntersectionObserverData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698