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

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

Issue 2822113002: Do not set a distribution recalc flag when v1 shadow tree is added (Closed)
Patch Set: try Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/layout-1-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
index a2c05cff244044f07c9bf3b58ac12b99f5800cb4..2b0a30a12be9261bfc90890b0afa95502a129296 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
@@ -28,6 +28,7 @@
#include "core/css/StyleSheetList.h"
#include "core/css/resolver/ScopedStyleResolver.h"
+#include "core/dom/NodeTraversal.h"
#include "core/dom/StyleChangeReason.h"
#include "core/dom/shadow/ElementShadowV0.h"
#include "core/frame/Deprecation.h"
@@ -79,7 +80,12 @@ ShadowRoot& ElementShadow::AddShadowRoot(Element& shadow_host,
shadow_root->SetParentOrShadowHostNode(&shadow_host);
shadow_root->SetParentTreeScope(shadow_host.GetTreeScope());
AppendShadowRoot(*shadow_root);
- SetNeedsDistributionRecalc();
+ if (type == ShadowRootType::V0) {
+ SetNeedsDistributionRecalc();
+ } else {
+ for (Node& child : NodeTraversal::ChildrenOf(shadow_host))
+ child.LazyReattachIfAttached();
+ }
shadow_root->InsertedInto(&shadow_host);
shadow_host.SetChildNeedsStyleRecalc();
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/layout-1-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698