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

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

Issue 1151593005: Mark host for style recalc (and child recalc) whenever adding a ShadowRoot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/dom/shadow/shadow-added-display-none-host-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) 162 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root())
163 root->lazyReattachIfAttached(); 163 root->lazyReattachIfAttached();
164 164
165 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = ShadowRoot::create(shadowHost.do cument(), type); 165 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = ShadowRoot::create(shadowHost.do cument(), type);
166 shadowRoot->setParentOrShadowHostNode(&shadowHost); 166 shadowRoot->setParentOrShadowHostNode(&shadowHost);
167 shadowRoot->setParentTreeScope(shadowHost.treeScope()); 167 shadowRoot->setParentTreeScope(shadowHost.treeScope());
168 m_shadowRoots.push(shadowRoot.get()); 168 m_shadowRoots.push(shadowRoot.get());
169 setNeedsDistributionRecalc(); 169 setNeedsDistributionRecalc();
170 170
171 shadowRoot->insertedInto(&shadowHost); 171 shadowRoot->insertedInto(&shadowHost);
172 shadowHost.setChildNeedsStyleRecalc();
173 shadowHost.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTraci ng::create(StyleChangeReason::Shadow));
174
172 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get()); 175 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get());
173 176
174 return *shadowRoot; 177 return *shadowRoot;
175 } 178 }
176 179
177 #if !ENABLE(OILPAN) 180 #if !ENABLE(OILPAN)
178 void ElementShadow::removeDetachedShadowRoots() 181 void ElementShadow::removeDetachedShadowRoots()
179 { 182 {
180 // Dont protect this ref count. 183 // Dont protect this ref count.
181 Element* shadowHost = host(); 184 Element* shadowHost = host();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 visitor->trace(m_nodeToInsertionPoints); 383 visitor->trace(m_nodeToInsertionPoints);
381 visitor->trace(m_selectFeatures); 384 visitor->trace(m_selectFeatures);
382 // Shadow roots are linked with previous and next pointers which are traced. 385 // Shadow roots are linked with previous and next pointers which are traced.
383 // It is therefore enough to trace one of the shadow roots here and the 386 // It is therefore enough to trace one of the shadow roots here and the
384 // rest will be traced from there. 387 // rest will be traced from there.
385 visitor->trace(m_shadowRoots.head()); 388 visitor->trace(m_shadowRoots.head());
386 #endif 389 #endif
387 } 390 }
388 391
389 } // namespace 392 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/shadow-added-display-none-host-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698