Index: third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp |
diff --git a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp |
index c72f2a0cdc84b8557a6fa137266e55be6b0c5142..486415f6b8166c83431360a58105c7d9c459865c 100644 |
--- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp |
+++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp |
@@ -147,10 +147,24 @@ void ShadowRoot::recalcStyle(StyleRecalcChange change) { |
// There's no style to update so just calling recalcStyle means we're updated. |
clearNeedsStyleRecalc(); |
- clearNeedsReattachLayoutTree(); |
recalcDescendantStyles(change); |
clearChildNeedsStyleRecalc(); |
+ // Currently only the NeedsReattachLayoutTree flag is set on the ShadowRoot. |
+ // Need to tell the ancestor nodes that this one needs reattach as well |
+ // otherwise we will never rebuild the LayoutTree. |
+ setNeedsReattachLayoutTree(); |
+} |
+ |
+void ShadowRoot::rebuildLayoutTree() { |
+ DCHECK(!needsStyleRecalc()); |
+ // ShadowRoot doesn't support custom callbacks. |
+ DCHECK(!hasCustomStyleCallbacks()); |
+ |
+ StyleSharingDepthScope sharingScope(*this); |
+ |
+ clearNeedsReattachLayoutTree(); |
+ rebuildChildrenLayoutTrees(); |
clearChildNeedsReattachLayoutTree(); |
} |