| 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/IntersectionObserver.h" | 5 #include "core/dom/IntersectionObserver.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "core/css/parser/CSSParserTokenRange.h" | 8 #include "core/css/parser/CSSParserTokenRange.h" |
| 9 #include "core/css/parser/CSSTokenizer.h" | 9 #include "core/css/parser/CSSTokenizer.h" |
| 10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 DOMHighResTimeStamp timestamp = | 299 DOMHighResTimeStamp timestamp = |
| 300 DOMWindowPerformance::performance(*callbackDOMWindow)->now(); | 300 DOMWindowPerformance::performance(*callbackDOMWindow)->now(); |
| 301 for (auto& observation : m_observations) | 301 for (auto& observation : m_observations) |
| 302 observation->computeIntersectionObservations(timestamp); | 302 observation->computeIntersectionObservations(timestamp); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void IntersectionObserver::disconnect(ExceptionState& exceptionState) { | 305 void IntersectionObserver::disconnect(ExceptionState& exceptionState) { |
| 306 for (auto& observation : m_observations) | 306 for (auto& observation : m_observations) |
| 307 observation->disconnect(); | 307 observation->disconnect(); |
| 308 m_observations.clear(); | 308 m_observations.clear(); |
| 309 m_entries.clear(); |
| 309 } | 310 } |
| 310 | 311 |
| 311 HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords( | 312 HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords( |
| 312 ExceptionState& exceptionState) { | 313 ExceptionState& exceptionState) { |
| 313 HeapVector<Member<IntersectionObserverEntry>> entries; | 314 HeapVector<Member<IntersectionObserverEntry>> entries; |
| 314 entries.swap(m_entries); | 315 entries.swap(m_entries); |
| 315 return entries; | 316 return entries; |
| 316 } | 317 } |
| 317 | 318 |
| 318 static void appendLength(StringBuilder& stringBuilder, const Length& length) { | 319 static void appendLength(StringBuilder& stringBuilder, const Length& length) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 362 |
| 362 DEFINE_TRACE(IntersectionObserver) { | 363 DEFINE_TRACE(IntersectionObserver) { |
| 363 visitor->template registerWeakMembers< | 364 visitor->template registerWeakMembers< |
| 364 IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this); | 365 IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this); |
| 365 visitor->trace(m_callback); | 366 visitor->trace(m_callback); |
| 366 visitor->trace(m_observations); | 367 visitor->trace(m_observations); |
| 367 visitor->trace(m_entries); | 368 visitor->trace(m_entries); |
| 368 } | 369 } |
| 369 | 370 |
| 370 } // namespace blink | 371 } // namespace blink |
| OLD | NEW |