Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Node.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp |
| index 832a32753ea3be8d7e1d126a70b68b588392669c..f1caf2f053eeafdd9b5f50f2e675ecbc741f5613 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp |
| @@ -44,6 +44,7 @@ |
| #include "core/dom/ElementTraversal.h" |
| #include "core/dom/ExceptionCode.h" |
| #include "core/dom/LayoutTreeBuilderTraversal.h" |
| +#include "core/dom/Microtask.h" |
| #include "core/dom/NodeRareData.h" |
| #include "core/dom/NodeTraversal.h" |
| #include "core/dom/ProcessingInstruction.h" |
| @@ -690,6 +691,11 @@ void Node::markAncestorsWithChildNeedsStyleInvalidation() |
| void Node::markAncestorsWithChildNeedsDistributionRecalc() |
| { |
| ScriptForbiddenScope forbidScriptDuringRawIteration; |
| + if (inDocument() && !document().childNeedsDistributionRecalc()) { |
| + // TODO(hayato): Support a non-document composed tree. |
| + // TODO(hayato): Enqueue a task only if a 'slotchange' event listner is registered in the document composed tree. |
| + Microtask::enqueueMicrotask(WTF::bind(&Document::updateDistribution, PassRefPtrWillBeRawPtr<Document>(&document()))); |
|
esprehn
2016/02/18 17:30:43
this means we force a distribution after every DOM
esprehn
2016/02/18 18:07:37
This is also adding an extra microtask every time
|
| + } |
| for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode()) |
| node->setChildNeedsDistributionRecalc(); |
| document().scheduleLayoutTreeUpdateIfNeeded(); |