Bug 1675575 [wpt PR 26421] - Missing value default for <animateTransform> 'type' is 'translate', a=testonly

Automatic update from web-platform-tests
Missing value default for <animateTransform> 'type' is 'translate'

Also make sure dynamic changes are reflected earlier by calling
AnimationAttributeChanged() when the parsed attribute value changes.
Previously it would only refresh when moving to the next value range, or
otherwise invalidating animation state.

Fixed: 1145548
Change-Id: I8ff82c02e6bf8e3cb82ef4d21e2381cbc99bcd3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2520783
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824818}

--

wpt-commits: ef0435de07a7035997e1329ab5e3fb60f3f43fcc
wpt-pr: 26421
This commit is contained in:
Fredrik Söderqvist 2020-11-06 17:40:54 +00:00 коммит произвёл moz-wptsync-bot
Родитель 001380b526
Коммит cc1d6953b7
1 изменённых файлов: 62 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,62 @@
<!doctype html>
<title>&lt;animateTransform> 'type' attribute missing/invalid value default</title>
<link rel="help" href="https://svgwg.org/specs/animations/#AnimateTransformElementTypeAttribute">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg height="10">
<rect width="10" height="10" fill="blue">
<animateTransform attributeName="transform" type="translate"
fill="freeze" dur="1s" from="10 0" to="10 0"/>
</rect>
<rect width="10" height="10" fill="blue">
<animateTransform attributeName="transform"
fill="freeze" dur="1s" from="30 0" to="30 0"/>
</rect>
<rect width="10" height="10" fill="blue">
<animateTransform attributeName="transform" type="foo"
fill="freeze" dur="1s" from="50 0" to="50 0"/>
</rect>
<rect width="10" height="10" fill="blue">
<animateTransform attributeName="transform" type="foo"
fill="freeze" dur="1s" from="70 0" to="70 0"/>
</rect>
</svg>
<script>
const animations = document.querySelectorAll('animateTransform');
async_test(t => {
animations[0].addEventListener('beginEvent', t.step_func_done(function() {
let ctm = animations[0].targetElement.getCTM();
assert_equals(ctm.e, 10);
assert_equals(ctm.f, 0);
}));
}, document.title + ', "type" attribute is "translate"');
async_test(t => {
animations[1].addEventListener('beginEvent', t.step_func_done(function() {
let ctm = animations[1].targetElement.getCTM();
assert_equals(ctm.e, 30);
assert_equals(ctm.f, 0);
}));
}, document.title + ', missing "type" attribute');
async_test(t => {
animations[2].addEventListener('beginEvent', t.step_func_done(function() {
let ctm = animations[2].targetElement.getCTM();
assert_equals(ctm.e, 0);
assert_equals(ctm.f, 0);
}));
}, document.title + ', invalid "type" attribute');
async_test(t => {
animations[3].addEventListener('beginEvent', t.step_func(function() {
animations[3].removeAttribute('type');
window.requestAnimationFrame(t.step_func_done(function() {
let ctm = animations[3].targetElement.getCTM();
assert_equals(ctm.e, 70);
assert_equals(ctm.f, 0);
}));
}));
}, document.title + ', removed "type" attribute');
</script>