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..0faaa79eb4ad5664792a2ebc49d8749d3b10408b 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, &document())); |
|
yhirano
2016/02/17 05:23:12
WTF::bind stores an off-heap pointer as is. Should
hayato
2016/02/17 06:07:33
Good point. Done.
Could you check again whether I
|
| + } |
| for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode()) |
| node->setChildNeedsDistributionRecalc(); |
| document().scheduleLayoutTreeUpdateIfNeeded(); |