Commit 5e4847b3 authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

[css-properties-values-api] Don't -webkit-cross-fade <image> values.

It is not spec'ed anywhere that <image> values interpolate in this way.

They should however interpolate as gradients, but we don't have an
InterpolationType for that yet.

R=flackr@chromium.org

Bug: 641877
Change-Id: I1a554d578c505f228f728ad7e09c3d5b4e5117e7
Reviewed-on: https://chromium-review.googlesource.com/1186416Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: Anders Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586267}
parent a852107f
<!DOCTYPE html>
<meta charset="UTF-8">
<style>
.parent {
--image: url('http://parent.png');
}
.target {
--image: url('http://underlying.png');
}
</style>
<body>
<script src="../interpolation/resources/interpolation-test.js"></script>
<script>
CSS.registerProperty({
name: '--image',
syntax: '<image>',
initialValue: "url('http://initial.png')",
inherits: false,
});
assertInterpolation({
property: '--image',
from: neutralKeyframe,
to: "url('http://value.png')",
}, [
{at: -0.3, is: "url('http://underlying.png')"},
{at: 0, is: "(url('http://underlying.png')"},
{at: 0.5, is: "-webkit-cross-fade(url('http://underlying.png'), url('http://value.png'), 0.5)"},
{at: 1, is: "url('http://value.png')"},
{at: 1.5, is: "url('http://value.png')"},
]);
assertInterpolation({
property: '--image',
from: 'initial',
to: "url('http://value.png')",
}, [
{at: -0.3, is: "url('http://initial.png')"},
{at: 0, is: "url('http://initial.png')"},
{at: 0.5, is: "-webkit-cross-fade(url('http://initial.png'), url('http://value.png'), 0.5)"},
{at: 1, is: "url('http://value.png')"},
{at: 1.5, is: "url('http://value.png')"},
]);
assertInterpolation({
property: '--image',
from: 'inherit',
to: "url('http://value.png')",
}, [
{at: -0.3, is: "url('http://parent.png')"},
{at: 0, is: "url('http://parent.png')"},
{at: 0.5, is: "-webkit-cross-fade(url('http://parent.png'), url('http://value.png'), 0.5)"},
{at: 1, is: "url('http://value.png')"},
{at: 1.5, is: "url('http://value.png')"},
]);
assertInterpolation({
property: '--image',
from: 'unset',
to: "url('http://value.png')",
}, [
{at: -0.3, is: "url('http://initial.png')"},
{at: 0, is: "url('http://initial.png')"},
{at: 0.5, is: "-webkit-cross-fade(url('http://initial.png'), url('http://value.png'), 0.5)"},
{at: 1, is: "url('http://value.png')"},
{at: 1.5, is: "url('http://value.png')"},
]);
assertInterpolation({
property: '--image',
from: "url('http://a.png')",
to: "url('http://b.png')",
}, [
{at: -0.3, is: "url('http://a.png')"},
{at: 0, is: "url('http://a.png')"},
{at: 0.5, is: "-webkit-cross-fade(url('http://a.png'), url('http://b.png'), 0.5)"},
{at: 1, is: "url('http://b.png')"},
{at: 1.5, is: "url('http://b.png')"},
]);
</script>
</body>
......@@ -420,8 +420,7 @@ CSSInterpolationTypesMap::CreateInterpolationTypesForCSSSyntax(
property, &registration));
break;
case CSSSyntaxType::kImage:
result.push_back(std::make_unique<CSSImageInterpolationType>(
property, &registration));
// TODO(andruud): Implement smooth interpolation for gradients.
break;
case CSSSyntaxType::kInteger:
result.push_back(std::make_unique<CSSNumberInterpolationType>(
......
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