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