Chromium Code Reviews| Index: Source/core/dom/Node.cpp |
| diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
| index d28320ada6db3218cecfefede5954e802ee22206..4e82e6f80fd9c7cefdf8cb7cdcff6a72bfb27580 100644 |
| --- a/Source/core/dom/Node.cpp |
| +++ b/Source/core/dom/Node.cpp |
| @@ -835,6 +835,25 @@ inline void Node::markAncestorsWithChildNeedsStyleRecalc() |
| { |
| for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRecalc(); p = p->parentOrShadowHostNode()) |
| p->setChildNeedsStyleRecalc(); |
| +} |
| + |
| +inline void Node::markDistributionsWithNeedsStyleRecalc() |
| +{ |
| + for (ShadowRoot* root = containingShadowRoot(); root; root = root->host()->containingShadowRoot()) { |
| + ScopeContentDistribution* distribution = root->scopeDistribution(); |
| + if (!distribution || !distribution->hasInsertionPoint(root)) |
|
esprehn
2013/06/13 02:25:38
hasInsertionPoint is static, this doesn't make sen
|
| + continue; |
| + root->host()->setNeedsStyleRecalc(); |
| + const Vector<RefPtr<InsertionPoint> >& insertionPoints = distribution->ensureInsertionPointList(root); |
| + for (unsigned i = 0; i < insertionPoints.size(); ++i) |
| + insertionPoints[i]->setNeedsStyleRecalc(); |
|
esprehn
2013/06/13 02:25:38
This is much too aggressive. Now if we setNeedsSty
|
| + } |
| +} |
| + |
| +inline void Node::propagateStyleRecalcMarking() |
| +{ |
| + markAncestorsWithChildNeedsStyleRecalc(); |
| + markDistributionsWithNeedsStyleRecalc(); |
| if (document()->childNeedsStyleRecalc()) |
| document()->scheduleStyleRecalc(); |
| @@ -861,7 +880,7 @@ void Node::setNeedsStyleRecalc(StyleChangeType changeType) |
| setStyleChange(changeType); |
| if (existingChangeType == NoStyleChange) |
| - markAncestorsWithChildNeedsStyleRecalc(); |
| + propagateStyleRecalcMarking(); |
| } |
| void Node::lazyAttach() |
| @@ -877,7 +896,7 @@ void Node::lazyAttach() |
| return; |
| } |
| setStyleChange(FullStyleChange); |
| - markAncestorsWithChildNeedsStyleRecalc(); |
| + propagateStyleRecalcMarking(); |
| } |
| bool Node::supportsFocus() const |