| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 if (root) | 204 if (root) |
| 205 root->ensureIntersectionObserverData().addObserver(*this); | 205 root->ensureIntersectionObserverData().addObserver(*this); |
| 206 trackingDocument().ensureIntersectionObserverController().addTrackedObserver( | 206 trackingDocument().ensureIntersectionObserverController().addTrackedObserver( |
| 207 *this); | 207 *this); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void IntersectionObserver::clearWeakMembers(Visitor* visitor) { | 210 void IntersectionObserver::clearWeakMembers(Visitor* visitor) { |
| 211 if (ThreadHeap::isHeapObjectAlive(root())) | 211 if (ThreadHeap::isHeapObjectAlive(root())) |
| 212 return; | 212 return; |
| 213 IgnorableExceptionState exceptionState; | 213 DummyExceptionStateForTesting exceptionState; |
| 214 disconnect(exceptionState); | 214 disconnect(exceptionState); |
| 215 m_root = nullptr; | 215 m_root = nullptr; |
| 216 } | 216 } |
| 217 | 217 |
| 218 bool IntersectionObserver::rootIsValid() const { | 218 bool IntersectionObserver::rootIsValid() const { |
| 219 return rootIsImplicit() || root(); | 219 return rootIsImplicit() || root(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 Document& IntersectionObserver::trackingDocument() const { | 222 Document& IntersectionObserver::trackingDocument() const { |
| 223 Document* document = nullptr; | 223 Document* document = nullptr; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 DEFINE_TRACE(IntersectionObserver) { | 408 DEFINE_TRACE(IntersectionObserver) { |
| 409 visitor->template registerWeakMembers< | 409 visitor->template registerWeakMembers< |
| 410 IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this); | 410 IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this); |
| 411 visitor->trace(m_callback); | 411 visitor->trace(m_callback); |
| 412 visitor->trace(m_observations); | 412 visitor->trace(m_observations); |
| 413 visitor->trace(m_entries); | 413 visitor->trace(m_entries); |
| 414 } | 414 } |
| 415 | 415 |
| 416 } // namespace blink | 416 } // namespace blink |
| OLD | NEW |