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

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

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 } else if (type == ShadowRootType::Open || type == ShadowRootType::Closed) { 164 } else if (type == ShadowRootType::Open || type == ShadowRootType::Closed) {
165 shadowHost.willAddFirstAuthorShadowRoot(); 165 shadowHost.willAddFirstAuthorShadowRoot();
166 } 166 }
167 167
168 for (ShadowRoot* root = m_shadowRoots.head(); root; root = root->olderShadow Root()) 168 for (ShadowRoot* root = m_shadowRoots.head(); root; root = root->olderShadow Root())
169 root->lazyReattachIfAttached(); 169 root->lazyReattachIfAttached();
170 170
171 ShadowRoot* shadowRoot = ShadowRoot::create(shadowHost.document(), type); 171 ShadowRoot* shadowRoot = ShadowRoot::create(shadowHost.document(), type);
172 shadowRoot->setParentOrShadowHostNode(&shadowHost); 172 shadowRoot->setParentOrShadowHostNode(&shadowHost);
173 shadowRoot->setParentTreeScope(shadowHost.treeScope()); 173 shadowRoot->setParentTreeScope(shadowHost.treeScopeOrDocument());
174 m_shadowRoots.push(shadowRoot); 174 m_shadowRoots.push(shadowRoot);
175 setNeedsDistributionRecalc(); 175 setNeedsDistributionRecalc();
176 176
177 shadowRoot->insertedInto(&shadowHost); 177 shadowRoot->insertedInto(&shadowHost);
178 shadowHost.setChildNeedsStyleRecalc(); 178 shadowHost.setChildNeedsStyleRecalc();
179 shadowHost.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTraci ng::create(StyleChangeReason::Shadow)); 179 shadowHost.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTraci ng::create(StyleChangeReason::Shadow));
180 180
181 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot); 181 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot);
182 182
183 return *shadowRoot; 183 return *shadowRoot;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 visitor->trace(m_nodeToInsertionPoints); 405 visitor->trace(m_nodeToInsertionPoints);
406 visitor->trace(m_selectFeatures); 406 visitor->trace(m_selectFeatures);
407 // Shadow roots are linked with previous and next pointers which are traced. 407 // Shadow roots are linked with previous and next pointers which are traced.
408 // It is therefore enough to trace one of the shadow roots here and the 408 // It is therefore enough to trace one of the shadow roots here and the
409 // rest will be traced from there. 409 // rest will be traced from there.
410 visitor->trace(m_shadowRoots.head()); 410 visitor->trace(m_shadowRoots.head());
411 visitor->trace(m_slotAssignment); 411 visitor->trace(m_slotAssignment);
412 } 412 }
413 413
414 } // namespace blink 414 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698