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

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp

Issue 1548523002: Use Document, rather than document element, for implicit root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer
Patch Set: Nits, comments, rebaseline Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/IntersectionObserverController.h" 5 #include "core/dom/IntersectionObserverController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (observer->hasEntries()) 66 if (observer->hasEntries())
67 scheduleIntersectionObserverForDelivery(*observer); 67 scheduleIntersectionObserverForDelivery(*observer);
68 } 68 }
69 } 69 }
70 70
71 void IntersectionObserverController::addTrackedObserver(IntersectionObserver& ob server) 71 void IntersectionObserverController::addTrackedObserver(IntersectionObserver& ob server)
72 { 72 {
73 m_trackedIntersectionObservers.add(&observer); 73 m_trackedIntersectionObservers.add(&observer);
74 } 74 }
75 75
76 void IntersectionObserverController::removeTrackedObserversForRoot(const Element & root) 76 void IntersectionObserverController::removeTrackedObserversForRoot(const Node& r oot)
77 { 77 {
78 HeapVector<Member<IntersectionObserver>> toRemove; 78 HeapVector<Member<IntersectionObserver>> toRemove;
79 for (auto& observer : m_trackedIntersectionObservers) { 79 for (auto& observer : m_trackedIntersectionObservers) {
80 if (observer->root() == &root) 80 if (observer->root() == &root)
81 toRemove.append(observer); 81 toRemove.append(observer);
82 } 82 }
83 m_trackedIntersectionObservers.removeAll(toRemove); 83 m_trackedIntersectionObservers.removeAll(toRemove);
84 } 84 }
85 85
86 DEFINE_TRACE(IntersectionObserverController) 86 DEFINE_TRACE(IntersectionObserverController)
87 { 87 {
88 visitor->trace(m_trackedIntersectionObservers); 88 visitor->trace(m_trackedIntersectionObservers);
89 visitor->trace(m_pendingIntersectionObservers); 89 visitor->trace(m_pendingIntersectionObservers);
90 ActiveDOMObject::trace(visitor); 90 ActiveDOMObject::trace(visitor);
91 } 91 }
92 92
93 } // namespace blink 93 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698