Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 196943029: Web Animations API: Load resources referenced in element.animate() (reland) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/StyleResourceLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 10638405cd9184128caf9fe31269b5eb60ab9511..38ddd9503f8b6bc0aaacdf79797a3640be4116f5 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();
@@ -809,6 +814,7 @@ PassRefPtrWillBeRawPtr<KeyframeEffectModel> StyleResolver::createKeyframeEffectM
keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create(id, *state.style()).get());
}
}
+
return KeyframeEffectModel::create(keyframes);
}
@@ -956,9 +962,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();
@@ -1086,6 +1090,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);
}
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);
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/css/resolver/StyleResourceLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698