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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 m_bottomMargin = rootMargin[2]; | 145 m_bottomMargin = rootMargin[2]; |
146 m_leftMargin = rootMargin[3]; | 146 m_leftMargin = rootMargin[3]; |
147 break; | 147 break; |
148 default: | 148 default: |
149 ASSERT_NOT_REACHED(); | 149 ASSERT_NOT_REACHED(); |
150 break; | 150 break; |
151 } | 151 } |
152 root.document().ensureIntersectionObserverController().addTrackedObserver(*t
his); | 152 root.document().ensureIntersectionObserverController().addTrackedObserver(*t
his); |
153 } | 153 } |
154 | 154 |
| 155 IntersectionObserver::~IntersectionObserver() |
| 156 { |
| 157 } |
| 158 |
155 LayoutObject* IntersectionObserver::rootLayoutObject() const | 159 LayoutObject* IntersectionObserver::rootLayoutObject() const |
156 { | 160 { |
157 Node* rootNode = root(); | 161 Node* rootNode = root(); |
158 if (rootNode->isDocumentNode()) | 162 if (rootNode->isDocumentNode()) |
159 return toDocument(rootNode)->layoutView(); | 163 return toDocument(rootNode)->layoutView(); |
160 return toElement(rootNode)->layoutObject(); | 164 return toElement(rootNode)->layoutObject(); |
161 } | 165 } |
162 | 166 |
163 bool IntersectionObserver::isDescendantOfRoot(const Element* target) const | 167 bool IntersectionObserver::isDescendantOfRoot(const Element* target) const |
164 { | 168 { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 347 |
344 DEFINE_TRACE(IntersectionObserver) | 348 DEFINE_TRACE(IntersectionObserver) |
345 { | 349 { |
346 visitor->trace(m_callback); | 350 visitor->trace(m_callback); |
347 visitor->trace(m_root); | 351 visitor->trace(m_root); |
348 visitor->trace(m_observations); | 352 visitor->trace(m_observations); |
349 visitor->trace(m_entries); | 353 visitor->trace(m_entries); |
350 } | 354 } |
351 | 355 |
352 } // namespace blink | 356 } // namespace blink |
OLD | NEW |