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

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: Fix failures due to information not being retained correctly for detachLayoutTree() in Text::reatta… 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(); 85 shadowHost.setChildNeedsStyleRecalc();
esprehn 2017/02/13 22:19:41 remove this line it doesn't do anything since we d
nainar 2017/02/14 03:42:09 Done.
86 shadowHost.setChildNeedsReattachLayoutTree();
esprehn 2017/02/13 22:19:41 you can remove this one.
nainar 2017/02/14 03:42:09 Done.
86 shadowHost.setNeedsStyleRecalc( 87 shadowHost.setNeedsStyleRecalc(
87 SubtreeStyleChange, 88 SubtreeStyleChange,
88 StyleChangeReasonForTracing::create(StyleChangeReason::Shadow)); 89 StyleChangeReasonForTracing::create(StyleChangeReason::Shadow));
89 90
90 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot); 91 InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot);
91 92
92 return *shadowRoot; 93 return *shadowRoot;
93 } 94 }
94 95
95 void ElementShadow::appendShadowRoot(ShadowRoot& shadowRoot) { 96 void ElementShadow::appendShadowRoot(ShadowRoot& shadowRoot) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 visitor->trace(m_elementShadowV0); 164 visitor->trace(m_elementShadowV0);
164 visitor->trace(m_shadowRoot); 165 visitor->trace(m_shadowRoot);
165 } 166 }
166 167
167 DEFINE_TRACE_WRAPPERS(ElementShadow) { 168 DEFINE_TRACE_WRAPPERS(ElementShadow) {
168 visitor->traceWrappers(m_elementShadowV0); 169 visitor->traceWrappers(m_elementShadowV0);
169 visitor->traceWrappers(m_shadowRoot); 170 visitor->traceWrappers(m_shadowRoot);
170 } 171 }
171 172
172 } // namespace blink 173 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698