Chromium Code Reviews| Index: Source/core/css/resolver/StyleResolver.cpp |
| diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp |
| index 7e1c31e0da08dd383102ea50b86456382287758f..1d9400695a121a2b7a7681cc5389b71e06b49586 100644 |
| --- a/Source/core/css/resolver/StyleResolver.cpp |
| +++ b/Source/core/css/resolver/StyleResolver.cpp |
| @@ -629,6 +629,13 @@ static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt |
| features.addAttributeInASelector(contentAttrValues[i]); |
| } |
| +// Start loading resources referenced by this style. |
| +void StyleResolver::loadPendingResources(StyleResolverState& state) |
| +{ |
| + m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources()); |
| + document().styleEngine()->fontSelector()->loadPendingFonts(); |
| +} |
| + |
| PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, StyleSharingBehavior sharingBehavior, |
| RuleMatchingBehavior matchingBehavior) |
| { |
| @@ -783,9 +790,7 @@ PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const |
| // go ahead and update it a second time. |
| updateFont(state); |
| - // Start loading resources referenced by this style. |
| - m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources()); |
| - document().styleEngine()->fontSelector()->loadPendingFonts(); |
| + loadPendingResources(state); |
| didAccess(); |
| @@ -808,6 +813,7 @@ PassRefPtrWillBeRawPtr<KeyframeEffectModel> StyleResolver::createKeyframeEffectM |
| keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create(id, *state.style()).get()); |
| } |
| } |
| + |
| return KeyframeEffectModel::create(keyframes); |
| } |
| @@ -955,9 +961,7 @@ PassRefPtr<RenderStyle> StyleResolver::styleForPage(int pageIndex) |
| addContentAttrValuesToFeatures(state.contentAttrValues(), m_features); |
| - // Start loading resources referenced by this style. |
| - m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources()); |
| - document().styleEngine()->fontSelector()->loadPendingFonts(); |
| + loadPendingResources(state); |
| didAccess(); |
| @@ -1085,6 +1089,9 @@ void StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element* |
| RenderStyle* style = state.style(); |
| if (style->hasAutoZIndex() && (style->opacity() < 1.0f || style->hasTransform())) |
| style->setZIndex(0); |
| + |
| + // Start loading resources used by animations. |
| + loadPendingResources(state); |
|
esprehn
2014/03/18 02:58:56
The callers of this should do this? It seems like
alancutter (OOO until 2018)
2014/03/18 03:54:31
I put it inside applyAnimatedProperties() to match
|
| } |
| template <StyleResolver::StyleApplicationPass pass> |
| @@ -1329,9 +1336,7 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc |
| applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUserRule, matchResult.ranges.lastUserRule, applyInheritedOnly); |
| applyMatchedProperties<LowPriorityProperties>(state, matchResult, true, matchResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); |
| - // Start loading resources referenced by this style. |
| - m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources()); |
| - document().styleEngine()->fontSelector()->loadPendingFonts(); |
| + loadPendingResources(state); |
| if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCacheable(element, state.style(), state.parentStyle())) { |
| INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheAdded); |