OLD | NEW |
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/NodeIntersectionObserverData.h" | 5 #include "core/dom/NodeIntersectionObserverData.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/IntersectionObservation.h" | 8 #include "core/dom/IntersectionObservation.h" |
9 #include "core/dom/IntersectionObserver.h" | 9 #include "core/dom/IntersectionObserver.h" |
10 #include "core/dom/IntersectionObserverController.h" | 10 #include "core/dom/IntersectionObserverController.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 NodeIntersectionObserverData::NodeIntersectionObserverData() { } | 14 NodeIntersectionObserverData::NodeIntersectionObserverData() { } |
15 | 15 |
16 NodeIntersectionObserverData::~NodeIntersectionObserverData() { } | |
17 | |
18 IntersectionObservation* NodeIntersectionObserverData::getObservationFor(Interse
ctionObserver& observer) | 16 IntersectionObservation* NodeIntersectionObserverData::getObservationFor(Interse
ctionObserver& observer) |
19 { | 17 { |
20 auto i = m_intersectionObservations.find(&observer); | 18 auto i = m_intersectionObservations.find(&observer); |
21 if (i == m_intersectionObservations.end()) | 19 if (i == m_intersectionObservations.end()) |
22 return nullptr; | 20 return nullptr; |
23 return i->value; | 21 return i->value; |
24 } | 22 } |
25 | 23 |
26 void NodeIntersectionObserverData::addObservation(IntersectionObservation& obser
vation) | 24 void NodeIntersectionObserverData::addObservation(IntersectionObservation& obser
vation) |
27 { | 25 { |
(...skipping 17 matching lines...) Expand all Loading... |
45 node.document().ensureIntersectionObserverController().removeTrackedObserver
sForRoot(node); | 43 node.document().ensureIntersectionObserverController().removeTrackedObserver
sForRoot(node); |
46 } | 44 } |
47 | 45 |
48 DEFINE_TRACE(NodeIntersectionObserverData) | 46 DEFINE_TRACE(NodeIntersectionObserverData) |
49 { | 47 { |
50 visitor->trace(m_intersectionObservers); | 48 visitor->trace(m_intersectionObservers); |
51 visitor->trace(m_intersectionObservations); | 49 visitor->trace(m_intersectionObservations); |
52 } | 50 } |
53 | 51 |
54 } // namespace blink | 52 } // namespace blink |
OLD | NEW |