Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 { 189 {
190 if (!target || !target->intersectionObserverData()) 190 if (!target || !target->intersectionObserverData())
191 return; 191 return;
192 // TODO(szager): unobserve callback 192 // TODO(szager): unobserve callback
193 if (IntersectionObservation* observation = target->intersectionObserverData( )->getObservationFor(*this)) 193 if (IntersectionObservation* observation = target->intersectionObserverData( )->getObservationFor(*this))
194 observation->disconnect(); 194 observation->disconnect();
195 } 195 }
196 196
197 void IntersectionObserver::computeIntersectionObservations() 197 void IntersectionObserver::computeIntersectionObservations()
198 { 198 {
199 if (!m_root || !m_root->inDocument()) 199 if (!m_root || !m_root->inShadowIncludingDocument())
200 return; 200 return;
201 Document* callbackDocument = toDocument(m_callback->getExecutionContext()); 201 Document* callbackDocument = toDocument(m_callback->getExecutionContext());
202 if (!callbackDocument) 202 if (!callbackDocument)
203 return; 203 return;
204 LocalDOMWindow* callbackDOMWindow = callbackDocument->domWindow(); 204 LocalDOMWindow* callbackDOMWindow = callbackDocument->domWindow();
205 if (!callbackDOMWindow) 205 if (!callbackDOMWindow)
206 return; 206 return;
207 DOMHighResTimeStamp timestamp = DOMWindowPerformance::performance(*callbackD OMWindow)->now(); 207 DOMHighResTimeStamp timestamp = DOMWindowPerformance::performance(*callbackD OMWindow)->now();
208 for (auto& observation : m_observations) 208 for (auto& observation : m_observations)
209 observation->computeIntersectionObservations(timestamp); 209 observation->computeIntersectionObservations(timestamp);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 DEFINE_TRACE(IntersectionObserver) 309 DEFINE_TRACE(IntersectionObserver)
310 { 310 {
311 visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObs erver::clearWeakMembers>(this); 311 visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObs erver::clearWeakMembers>(this);
312 visitor->trace(m_callback); 312 visitor->trace(m_callback);
313 visitor->trace(m_observations); 313 visitor->trace(m_observations);
314 visitor->trace(m_entries); 314 visitor->trace(m_entries);
315 } 315 }
316 316
317 } // namespace blink 317 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698