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

Unified Diff: third_party/WebKit/Source/core/animation/EffectInput.cpp

Issue 2043273002: Defer compositor keyframe snapshots until the next style resolve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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: third_party/WebKit/Source/core/animation/EffectInput.cpp
diff --git a/third_party/WebKit/Source/core/animation/EffectInput.cpp b/third_party/WebKit/Source/core/animation/EffectInput.cpp
index 6370bcee347af06553e312bdf43bcad71badabc4..ea361f44c2209bcdb67e822576a0c47c7bec7a65 100644
--- a/third_party/WebKit/Source/core/animation/EffectInput.cpp
+++ b/third_party/WebKit/Source/core/animation/EffectInput.cpp
@@ -78,32 +78,26 @@ bool getAndCheckOffset(const Dictionary& keyframeDictionary, double& offset, dou
return true;
}
-// Returns true if the property passed in is a compositable property.
-bool setKeyframeValue(Element& element, StringKeyframe& keyframe, const String& property, const String& value)
+void setKeyframeValue(Element& element, StringKeyframe& keyframe, const String& property, const String& value)
{
StyleSheetContents* styleSheetContents = element.document().elementSheet().contents();
CSSPropertyID cssProperty = AnimationInputHelpers::keyframeAttributeToCSSProperty(property, element.document());
if (cssProperty != CSSPropertyInvalid) {
keyframe.setCSSPropertyValue(cssProperty, value, &element, styleSheetContents);
- return CompositorAnimations::isCompositableProperty(cssProperty);
+ return;
}
cssProperty = AnimationInputHelpers::keyframeAttributeToPresentationAttribute(property, element);
if (cssProperty != CSSPropertyInvalid) {
keyframe.setPresentationAttributeValue(cssProperty, value, &element, styleSheetContents);
- return false;
+ return;
}
const QualifiedName* svgAttribute = AnimationInputHelpers::keyframeAttributeToSVGAttribute(property, element);
if (svgAttribute)
keyframe.setSVGAttributeValue(*svgAttribute, value);
- return false;
}
-EffectModel* createEffectModelFromKeyframes(Element& element, const StringKeyframeVector& keyframes, bool encounteredCompositableProperty, ExceptionState& exceptionState)
+EffectModel* createEffectModelFromKeyframes(Element& element, const StringKeyframeVector& keyframes, ExceptionState& exceptionState)
{
- // TODO(alancutter): Remove this once composited animations no longer depend on AnimatableValues.
- if (encounteredCompositableProperty && element.inActiveDocument())
- element.document().updateStyleAndLayoutTreeForNode(&element);
-
StringKeyframeEffectModel* keyframeEffectModel = StringKeyframeEffectModel::create(keyframes, LinearTimingFunction::shared());
if (!RuntimeEnabledFeatures::cssAdditiveAnimationsEnabled()) {
for (const auto& keyframeGroup : keyframeEffectModel->getPropertySpecificKeyframeGroups()) {
@@ -123,7 +117,6 @@ EffectModel* createEffectModelFromKeyframes(Element& element, const StringKeyfra
}
}
}
- keyframeEffectModel->forceConversionsToAnimatableValues(element, element.computedStyle());
ASSERT(!exceptionState.hadException());
return keyframeEffectModel;
@@ -173,7 +166,6 @@ EffectModel* EffectInput::convertArrayForm(Element& element, const Vector<Dictio
{
StringKeyframeVector keyframes;
double lastOffset = 0;
- bool encounteredCompositableProperty = false;
for (const Dictionary& keyframeDictionary : keyframeDictionaries) {
RefPtr<StringKeyframe> keyframe = StringKeyframe::create();
@@ -221,20 +213,19 @@ EffectModel* EffectInput::convertArrayForm(Element& element, const Vector<Dictio
String value;
DictionaryHelper::get(keyframeDictionary, property, value);
- encounteredCompositableProperty |= setKeyframeValue(element, *keyframe.get(), property, value);
+ setKeyframeValue(element, *keyframe.get(), property, value);
}
keyframes.append(keyframe);
}
ASSERT(!exceptionState.hadException());
- return createEffectModelFromKeyframes(element, keyframes, encounteredCompositableProperty, exceptionState);
+ return createEffectModelFromKeyframes(element, keyframes, exceptionState);
}
EffectModel* EffectInput::convertObjectForm(Element& element, const Dictionary& keyframeDictionary, ExceptionState& exceptionState)
{
StringKeyframeVector keyframes;
- bool encounteredCompositableProperty = false;
String timingFunctionString;
RefPtr<TimingFunction> timingFunction = nullptr;
@@ -288,7 +279,7 @@ EffectModel* EffectInput::convertObjectForm(Element& element, const Dictionary&
keyframe->setComposite(EffectModel::CompositeAdd);
// TODO(alancutter): Support "accumulate" keyframe composition.
- encounteredCompositableProperty |= setKeyframeValue(element, *keyframe.get(), property, values[i]);
+ setKeyframeValue(element, *keyframe.get(), property, values[i]);
keyframes.append(keyframe);
}
}
@@ -297,7 +288,7 @@ EffectModel* EffectInput::convertObjectForm(Element& element, const Dictionary&
ASSERT(!exceptionState.hadException());
- return createEffectModelFromKeyframes(element, keyframes, encounteredCompositableProperty, exceptionState);
+ return createEffectModelFromKeyframes(element, keyframes, exceptionState);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698