Commit 315e9f13 authored by George Steel's avatar George Steel Committed by Commit Bot

Merge subflags into WebAnimationsAPI flag

Merge CSSAdditiveAnimations and StackedCSSPropertyAnimations into
WebAnimationsAPI flag. These were unlabeled dependencies of
features being added under WebAnimationsAPI but not explicitly listed
and are planned to launch as part of the WebAnimations v1 launch.

Bug: 978551
Change-Id: If49801b1f4e3e76d3de552b53d3a2afe36e8b736
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044540
Commit-Queue: George Steel <gtsteel@chromium.org>
Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740451}
parent 51b20fa3
......@@ -35,9 +35,7 @@ TEST_F(AnimationSimTest, CustomPropertyBaseComputedStyle) {
// animation.
ScopedCSSVariables2ForTest css_variables2(true);
ScopedCSSAdditiveAnimationsForTest css_additive_animation(true);
ScopedStackedCSSPropertyAnimationsForTest stacked_css_property_animation(
true);
ScopedWebAnimationsAPIForTest web_animations(true);
SimRequest main_resource("https://example.com/", "text/html");
LoadURL("https://example.com/");
......
......@@ -124,9 +124,9 @@ void SetKeyframeValue(Element* element,
}
bool ValidatePartialKeyframes(const StringKeyframeVector& keyframes) {
// CSSAdditiveAnimationsEnabled guards both additive animations and allowing
// WebAnimationsAPIEnabled guards both additive animations and allowing
// partial (implicit) keyframes.
if (RuntimeEnabledFeatures::CSSAdditiveAnimationsEnabled())
if (RuntimeEnabledFeatures::WebAnimationsAPIEnabled())
return true;
// An implicit keyframe is inserted in the below cases. Note that the 'first'
......@@ -180,7 +180,7 @@ EffectModel::CompositeOperation ResolveCompositeOperationForKeyframe(
StringKeyframe* keyframe) {
bool additive_composite = composite == EffectModel::kCompositeAdd ||
composite == EffectModel::kCompositeAccumulate;
if (!RuntimeEnabledFeatures::CSSAdditiveAnimationsEnabled() &&
if (!RuntimeEnabledFeatures::WebAnimationsAPIEnabled() &&
keyframe->HasCssProperty() && additive_composite) {
return EffectModel::kCompositeReplace;
}
......@@ -667,7 +667,7 @@ KeyframeEffectModelBase* EffectInput::Convert(
auto* keyframe_effect_model = MakeGarbageCollected<StringKeyframeEffectModel>(
parsed_keyframes, composite, LinearTimingFunction::Shared());
if (!RuntimeEnabledFeatures::CSSAdditiveAnimationsEnabled()) {
if (!RuntimeEnabledFeatures::WebAnimationsAPIEnabled()) {
// This should be enforced by the parsing code.
DCHECK(!HasAdditiveCompositeCSSKeyframe(
keyframe_effect_model->GetPropertySpecificKeyframeGroups()));
......
......@@ -59,7 +59,7 @@ void CopyToActiveInterpolationsMap(
// effect erases everything that came before it, so we must clear the stack
// when that happens.
const bool allow_stacked_effects =
RuntimeEnabledFeatures::StackedCSSPropertyAnimationsEnabled() ||
RuntimeEnabledFeatures::WebAnimationsAPIEnabled() ||
!property.IsCSSProperty() || property.IsPresentationAttribute();
const bool effect_depends_on_underlying_value =
interpolation->IsInvalidatableInterpolation() &&
......
......@@ -326,7 +326,10 @@ TEST_F(AnimationKeyframeEffectV8Test, SpecifiedDurationGetter) {
}
TEST_F(AnimationKeyframeEffectV8Test, SetKeyframesAdditiveCompositeOperation) {
ScopedCSSAdditiveAnimationsForTest css_additive_animation(false);
// AnimationWorklet also needs to be disabled since it depends on
// WebAnimationsAPI and prevents us from turning it off if enabled.
ScopedAnimationWorkletForTest no_animation_worklet(false);
ScopedWebAnimationsAPIForTest no_web_animations(false);
V8TestingScope scope;
ScriptState* script_state = scope.GetScriptState();
ScriptValue js_keyframes = ScriptValue::CreateNull(scope.GetIsolate());
......
......@@ -609,10 +609,6 @@ void Internals::disableCompositedAnimation(Animation* animation) {
animation->DisableCompositedAnimationForTesting();
}
void Internals::disableCSSAdditiveAnimations() {
RuntimeEnabledFeatures::SetCSSAdditiveAnimationsEnabled(false);
}
void Internals::advanceImageAnimation(Element* image,
ExceptionState& exception_state) {
DCHECK(image);
......
......@@ -78,7 +78,6 @@
[RaisesException] void pauseAnimations(double pauseTime);
boolean isCompositedAnimation(Animation animation);
void disableCompositedAnimation(Animation animation);
void disableCSSAdditiveAnimations();
// Advances an animated image. For BitmapImage (e.g., animated gifs) this
// will advance to the next frame. For SVGImage, this will trigger an
......
......@@ -403,11 +403,6 @@
name: "CSS3TextBreakAnywhere",
status: "stable",
},
{
name: "CSSAdditiveAnimations",
depends_on: ["StackedCSSPropertyAnimations"],
status: "experimental",
},
{
name: "CSSCalcAsInt",
status: "test",
......@@ -1624,10 +1619,6 @@
name: "StableBlinkFeatures",
status: "stable",
},
{
name: "StackedCSSPropertyAnimations",
status: "experimental",
},
{
// Enabled when blink::features::kStorageAccessAPI is enabled.
name: "StorageAccessAPI",
......
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="cssTarget" style="color: red;"></div>
<svg>
<rect id="svgTarget" color="red"></rect>
</svg>
<script>
internals.disableCSSAdditiveAnimations();
test(() => {
assert_throws('NotSupportedError', () => {
cssTarget.animate({color: 'green'});
});
var animation = cssTarget.animate([
{color: 'green', composite: 'add'},
{color: 'green', composite: 'add'},
], { fill: 'forwards' });
assert_equals(getComputedStyle(cssTarget).color, 'rgb(0, 128, 0)');
}, 'Precheck that disabling CSS additive animations works.');
test(() => {
var animation = svgTarget.animate({'svg-color': 'green'}, 1);
animation.pause();
animation.currentTime = 0.5;
assert_equals(getComputedStyle(svgTarget).color, 'rgb(128, 64, 0)');
animation.cancel();
}, 'Neutral keyframes supported for SVG presentation attributes.');
test(() => {
var keyframe = {'svg-color': 'green', composite: 'add'};
var animation = svgTarget.animate([keyframe, keyframe], {fill: 'forwards'});
assert_equals(getComputedStyle(svgTarget).color, 'rgb(255, 128, 0)');
animation.cancel();
}, 'Additive keyframes supported for SVG presentation attributes.');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment