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

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: 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 29 matching lines...) Expand all
40 double timestamp = currentTime(); 40 double timestamp = currentTime();
41 for (auto& observer : m_trackedIntersectionObservers) 41 for (auto& observer : m_trackedIntersectionObservers)
42 observer->computeIntersectionObservations(timestamp); 42 observer->computeIntersectionObservations(timestamp);
43 } 43 }
44 44
45 void IntersectionObserverController::addTrackedObserver(IntersectionObserver& ob server) 45 void IntersectionObserverController::addTrackedObserver(IntersectionObserver& ob server)
46 { 46 {
47 m_trackedIntersectionObservers.add(&observer); 47 m_trackedIntersectionObservers.add(&observer);
48 } 48 }
49 49
50 void IntersectionObserverController::removeTrackedObserversForRoot(const Element & root) 50 void IntersectionObserverController::removeTrackedObserversForRoot(const Node& r oot)
51 { 51 {
52 HeapVector<Member<IntersectionObserver>> toRemove; 52 HeapVector<Member<IntersectionObserver>> toRemove;
53 for (auto& observer : m_trackedIntersectionObservers) { 53 for (auto& observer : m_trackedIntersectionObservers) {
54 if (observer->root() == &root) 54 if (observer->root() == &root)
55 toRemove.append(observer); 55 toRemove.append(observer);
56 } 56 }
57 m_trackedIntersectionObservers.removeAll(toRemove); 57 m_trackedIntersectionObservers.removeAll(toRemove);
58 } 58 }
59 59
60 DEFINE_TRACE(IntersectionObserverController) 60 DEFINE_TRACE(IntersectionObserverController)
61 { 61 {
62 visitor->trace(m_trackedIntersectionObservers); 62 visitor->trace(m_trackedIntersectionObservers);
63 visitor->trace(m_pendingIntersectionObservers); 63 visitor->trace(m_pendingIntersectionObservers);
64 } 64 }
65 65
66 } // namespace blink 66 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698