Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index e3199112cca649bf8ae7e40a0ba871602fad2a2f..7f144d93b546cbd40144fe65999061faf261709f 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -1528,7 +1528,7 @@ PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToSho |
| bool Document::shouldCallRecalcStyleForDocument() |
| { |
| - return needsStyleRecalc() || childNeedsStyleRecalc() || childNeedsDistributionRecalc() || !m_useElementsNeedingUpdate.isEmpty(); |
| + return needsStyleRecalc() || childNeedsStyleRecalc() || childNeedsDistributionRecalc() || !m_useElementsNeedingUpdate.isEmpty() || childNeedsStyleInvalidation(); |
| } |
| void Document::scheduleStyleRecalc() |
| @@ -1570,6 +1570,21 @@ void Document::updateDistributionIfNeeded() |
| recalcDistribution(); |
| } |
| +void Document::updateStyleInvalidationIfNeeded() |
| +{ |
| + if (!childNeedsStyleInvalidation()) |
| + return; |
| + TRACE_EVENT0("webkit", "Document::computeNeedsStyleRecalcState"); |
| + if (!styleResolver()) { |
| + clearChildNeedsStyleInvalidation(); |
|
ojan
2014/01/29 00:50:07
I think we still need to do the style invalidation
chrishtr
2014/01/29 01:56:42
The style invalidation data structure lives in the
ojan
2014/01/29 02:00:25
I see. Yeah, it seems like we have to block turnin
chrishtr
2014/01/29 02:02:32
Yes. My plan is to try to land the change that rem
|
| + return; |
| + } |
| + |
| + // FIXME: the style resolver can be deleted at present. Either resolve |
| + // crbug.com/335964 or move the invalidation data elsewhere. |
|
ojan
2014/01/29 00:50:07
You can use use ensureStyleResolver(). I don't see
chrishtr
2014/01/29 01:56:42
See above.
|
| + styleResolver()->ensureRuleFeatureSet().computeStyleInvalidation(*this); |
| +} |
| + |
| void Document::updateDistributionForNodeIfNeeded(Node* node) |
| { |
| if (node->inDocument()) { |
| @@ -1658,6 +1673,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change) |
| } |
| } |
| +// FIXME: need a better name than recalcStyle. It's performing style invalidation, style recalc, and distribution. |
| void Document::recalcStyle(StyleRecalcChange change) |
| { |
| // we should not enter style recalc while painting |
| @@ -1677,6 +1693,7 @@ void Document::recalcStyle(StyleRecalcChange change) |
| updateDistributionIfNeeded(); |
| updateUseShadowTrees(); |
| + updateStyleInvalidationIfNeeded(); |
| if (m_evaluateMediaQueriesOnStyleRecalc) { |
| m_evaluateMediaQueriesOnStyleRecalc = false; |
| @@ -1779,7 +1796,7 @@ void Document::updateStyleForNodeIfNeeded(Node* node) |
| // the path from 'node' to the root needs style recalc. |
| // Global needed. |
| - bool needsRecalc = needsStyleRecalc() || childNeedsDistributionRecalc() || !m_useElementsNeedingUpdate.isEmpty(); |
| + bool needsRecalc = needsStyleRecalc() || childNeedsDistributionRecalc() || !m_useElementsNeedingUpdate.isEmpty() || childNeedsStyleInvalidation(); |
| // On the path. |
| for (Node* ancestor = node; ancestor && !needsRecalc; ancestor = ancestor->parentOrShadowHostNode()) |