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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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/IntersectionObservation.h" 5 #include "core/dom/IntersectionObservation.h"
6 6
7 #include "core/dom/ElementRareData.h" 7 #include "core/dom/ElementRareData.h"
8 #include "core/dom/IntersectionObserver.h" 8 #include "core/dom/IntersectionObserver.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 bool IntersectionObservation::computeGeometry(IntersectionGeometry& geometry) co nst 140 bool IntersectionObservation::computeGeometry(IntersectionGeometry& geometry) co nst
141 { 141 {
142 // In the first few lines here, before initializeGeometry is called, "return true" 142 // In the first few lines here, before initializeGeometry is called, "return true"
143 // effectively means "if the previous observed state was that root and targe t were 143 // effectively means "if the previous observed state was that root and targe t were
144 // intersecting, then generate a notification indicating that they are no lo nger 144 // intersecting, then generate a notification indicating that they are no lo nger
145 // intersecting." This happens, for example, when root or target is removed from the 145 // intersecting." This happens, for example, when root or target is removed from the
146 // DOM tree and not reinserted before the next frame is generated. 146 // DOM tree and not reinserted before the next frame is generated.
147 Element* targetElement = target(); 147 Element* targetElement = target();
148 if (!targetElement) 148 if (!targetElement)
149 return false; 149 return false;
150 if (!targetElement->inShadowIncludingDocument()) 150 if (!targetElement->isConnected())
151 return true; 151 return true;
152 DCHECK(m_observer); 152 DCHECK(m_observer);
153 Element* rootElement = m_observer->root(); 153 Element* rootElement = m_observer->root();
154 if (rootElement && !rootElement->inShadowIncludingDocument()) 154 if (rootElement && !rootElement->isConnected())
155 return true; 155 return true;
156 156
157 LayoutObject* rootLayoutObject = m_observer->rootLayoutObject(); 157 LayoutObject* rootLayoutObject = m_observer->rootLayoutObject();
158 if (!rootLayoutObject || !rootLayoutObject->isBoxModelObject()) 158 if (!rootLayoutObject || !rootLayoutObject->isBoxModelObject())
159 return false; 159 return false;
160 // TODO(szager): Support SVG 160 // TODO(szager): Support SVG
161 LayoutObject* targetLayoutObject = targetElement->layoutObject(); 161 LayoutObject* targetLayoutObject = targetElement->layoutObject();
162 if (!targetLayoutObject) 162 if (!targetLayoutObject)
163 return false; 163 return false;
164 if (!targetLayoutObject->isBoxModelObject() && !targetLayoutObject->isText() ) 164 if (!targetLayoutObject->isBoxModelObject() && !targetLayoutObject->isText() )
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 m_observer.clear(); 243 m_observer.clear();
244 } 244 }
245 245
246 DEFINE_TRACE(IntersectionObservation) 246 DEFINE_TRACE(IntersectionObservation)
247 { 247 {
248 visitor->trace(m_observer); 248 visitor->trace(m_observer);
249 visitor->trace(m_target); 249 visitor->trace(m_target);
250 } 250 }
251 251
252 } // namespace blink 252 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Fullscreen.cpp ('k') | third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698