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

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

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: Clean up all the asserts Created 3 years, 10 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 m_elementShadowV0 = ElementShadowV0::create(*this); 75 m_elementShadowV0 = ElementShadowV0::create(*this);
76 } 76 }
77 77
78 ShadowRoot* shadowRoot = ShadowRoot::create(shadowHost.document(), type); 78 ShadowRoot* shadowRoot = ShadowRoot::create(shadowHost.document(), type);
79 shadowRoot->setParentOrShadowHostNode(&shadowHost); 79 shadowRoot->setParentOrShadowHostNode(&shadowHost);
80 shadowRoot->setParentTreeScope(shadowHost.treeScope()); 80 shadowRoot->setParentTreeScope(shadowHost.treeScope());
81 appendShadowRoot(*shadowRoot); 81 appendShadowRoot(*shadowRoot);
82 setNeedsDistributionRecalc(); 82 setNeedsDistributionRecalc();
83 83
84 shadowRoot->insertedInto(&shadowHost); 84 shadowRoot->insertedInto(&shadowHost);
85 shadowHost.setChildNeedsStyleRecalc();
esprehn 2017/02/16 21:24:33 I think we probably want to leave this, while tech
nainar 2017/02/16 22:26:09 Sure :)
86 shadowHost.setNeedsStyleRecalc( 85 shadowHost.setNeedsStyleRecalc(
87 SubtreeStyleChange, 86 SubtreeStyleChange,
88 StyleChangeReasonForTracing::create(StyleChangeReason::Shadow)); 87 StyleChangeReasonForTracing::create(StyleChangeReason::Shadow));
88 shadowRoot->setNeedsReattachLayoutTree();
89 89
90 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot); 90 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot);
91 91
92 return *shadowRoot; 92 return *shadowRoot;
93 } 93 }
94 94
95 void ElementShadow::appendShadowRoot(ShadowRoot& shadowRoot) { 95 void ElementShadow::appendShadowRoot(ShadowRoot& shadowRoot) {
96 if (!m_shadowRoot) { 96 if (!m_shadowRoot) {
97 m_shadowRoot = &shadowRoot; 97 m_shadowRoot = &shadowRoot;
98 return; 98 return;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 visitor->trace(m_elementShadowV0); 163 visitor->trace(m_elementShadowV0);
164 visitor->trace(m_shadowRoot); 164 visitor->trace(m_shadowRoot);
165 } 165 }
166 166
167 DEFINE_TRACE_WRAPPERS(ElementShadow) { 167 DEFINE_TRACE_WRAPPERS(ElementShadow) {
168 visitor->traceWrappers(m_elementShadowV0); 168 visitor->traceWrappers(m_elementShadowV0);
169 visitor->traceWrappers(m_shadowRoot); 169 visitor->traceWrappers(m_shadowRoot);
170 } 170 }
171 171
172 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698