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 void IntersectionObserver::rootDisappearedCallback(Visitor* visitor, void* self) | 320 #if ENABLE(OILPAN) |
| 321 void IntersectionObserver::clearWeakMembers(Visitor* visitor) |
321 { | 322 { |
322 IntersectionObserver* observer = static_cast<IntersectionObserver*>(self); | 323 if (Heap::isHeapObjectAlive(m_root)) |
323 observer->disconnect(); | 324 return; |
| 325 disconnect(); |
| 326 m_root = nullptr; |
324 } | 327 } |
| 328 #endif |
325 | 329 |
326 DEFINE_TRACE(IntersectionObserver) | 330 DEFINE_TRACE(IntersectionObserver) |
327 { | 331 { |
328 #if ENABLE(OILPAN) | 332 #if ENABLE(OILPAN) |
329 visitor->registerWeakMembers(this, m_root.get(), IntersectionObserver::rootD
isappearedCallback); | 333 visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObs
erver::clearWeakMembers>(this); |
330 #endif | 334 #endif |
331 visitor->trace(m_callback); | 335 visitor->trace(m_callback); |
332 visitor->trace(m_root); | |
333 visitor->trace(m_observations); | 336 visitor->trace(m_observations); |
334 visitor->trace(m_entries); | 337 visitor->trace(m_entries); |
335 } | 338 } |
336 | 339 |
337 } // namespace blink | 340 } // namespace blink |
OLD | NEW |