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

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

Issue 292173009: Web Animations - responsive interpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@0519_MySeparation
Patch Set: applyAndSnapshotAnimatableValue Created 6 years, 7 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
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 67a7eb1662c837d93419ca41b0a44c690b868be1..664efcd06d2a58afb340a18760aa79b3a11c0394 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -752,14 +752,19 @@ PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const
// This function is used by the WebAnimations JavaScript API method animate().
// FIXME: Remove this when animate() switches away from resolution-dependent parsing.
-PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnapshot(Element& element, CSSPropertyID property, CSSValue* value)
+PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::applyAndSnapshotAnimatableValue(Element& element, CSSPropertyID property, CSSValue& value, RenderStyle* mutableStyle)
{
- // We use a fresh RenderStyle here because certain values (eg. background-position) won't always completely replace the previously applied property.
- RefPtr<RenderStyle> style = element.renderStyle() ? RenderStyle::clone(element.renderStyle()) : RenderStyle::create();
+ RefPtr<RenderStyle> style;
+ if (mutableStyle)
+ style = mutableStyle;
+ else if (element.renderStyle())
+ style = RenderStyle::clone(element.renderStyle());
+ else
+ style = RenderStyle::create();
shans 2014/05/26 03:31:01 This looks like a recipe for introducing bugs in t
alancutter (OOO until 2018) 2014/05/26 05:22:41 Perhaps the style parameter should be non-optional
StyleResolverState state(element.document(), &element);
state.setStyle(style.get());
state.fontBuilder().initForStyleResolve(state.document(), state.style(), state.useSVGZoomRules());
- StyleBuilder::applyProperty(property, state, value);
+ StyleBuilder::applyProperty(property, state, &value);
return CSSAnimatableValueFactory::create(property, *style);
}

Powered by Google App Engine
This is Rietveld 408576698