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/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 | 311 |
312 bool IntersectionObserver::hasPercentMargin() const | 312 bool IntersectionObserver::hasPercentMargin() const |
313 { | 313 { |
314 return (m_topMargin.type() == Percent | 314 return (m_topMargin.type() == Percent |
315 || m_rightMargin.type() == Percent | 315 || m_rightMargin.type() == Percent |
316 || m_bottomMargin.type() == Percent | 316 || m_bottomMargin.type() == Percent |
317 || m_leftMargin.type() == Percent); | 317 || m_leftMargin.type() == Percent); |
318 } | 318 } |
319 | 319 |
320 #if ENABLE(OILPAN) | 320 void IntersectionObserver::rootDisappearedCallback(Visitor* visitor, void* self) |
321 void IntersectionObserver::clearWeakMembers(Visitor* visitor) | |
322 { | 321 { |
323 if (Heap::isHeapObjectAlive(m_root)) | 322 IntersectionObserver* observer = static_cast<IntersectionObserver*>(self); |
324 return; | 323 observer->disconnect(); |
325 disconnect(); | |
326 m_root = nullptr; | |
327 } | 324 } |
328 #endif | |
329 | 325 |
330 DEFINE_TRACE(IntersectionObserver) | 326 DEFINE_TRACE(IntersectionObserver) |
331 { | 327 { |
332 #if ENABLE(OILPAN) | 328 #if ENABLE(OILPAN) |
333 visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObs
erver::clearWeakMembers>(this); | 329 visitor->registerWeakMembers(this, m_root.get(), IntersectionObserver::rootD
isappearedCallback); |
334 #endif | 330 #endif |
335 visitor->trace(m_callback); | 331 visitor->trace(m_callback); |
| 332 visitor->trace(m_root); |
336 visitor->trace(m_observations); | 333 visitor->trace(m_observations); |
337 visitor->trace(m_entries); | 334 visitor->trace(m_entries); |
338 } | 335 } |
339 | 336 |
340 } // namespace blink | 337 } // namespace blink |
OLD | NEW |