Chromium Code Reviews| 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..d8403b9aa0a6692d94690f27a478a2bfe6d1deb9 100644 |
| --- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp |
| +++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp |
| @@ -147,10 +147,22 @@ void ShadowRoot::recalcStyle(StyleRecalcChange change) { |
| // There's no style to update so just calling recalcStyle means we're updated. |
| clearNeedsStyleRecalc(); |
| - clearNeedsReattachLayoutTree(); |
| recalcDescendantStyles(change); |
| clearChildNeedsStyleRecalc(); |
| + |
| + if (!host().childNeedsReattachLayoutTree()) |
| + clearNeedsReattachLayoutTree(); |
|
esprehn
2017/02/15 02:01:00
this shouldn't be needed, how do we get here with
nainar
2017/02/15 06:04:46
Given the following test case:
<script>
onload =
|
| +} |
| + |
| +void ShadowRoot::rebuildLayoutTree() { |
| + // ShadowRoot doesn't support custom callbacks. |
| + DCHECK(!hasCustomStyleCallbacks()); |
| + |
| + StyleSharingDepthScope sharingScope(*this); |
| + |
| + clearNeedsReattachLayoutTree(); |
| + rebuildChildrenLayoutTrees(); |
| clearChildNeedsReattachLayoutTree(); |
| } |