Update web-platform-tests to revision 66b4fab488695f98d15ad75b549e302a8d29f865

This commit is contained in:
WPT Sync Bot 2019-08-07 10:23:18 +00:00
parent b6cdf93198
commit b09e82fc9f
161 changed files with 3705 additions and 671 deletions

View file

@ -89,6 +89,11 @@ After your `hosts` file is configured, the servers will be locally accessible at
http://web-platform.test:8000/<br>
https://web-platform.test:8443/ *
To use the web-based runner point your browser to:
http://web-platform.test:8000/tools/runner/index.html <br>
https://web-platform.test:8443/tools/runner/index.html *
\**See [Trusting Root CA](#trusting-root-ca)*
Running Tests Automatically

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=987004">
<meta name="assert" content="The renderer should not crash.">
<div style="width: 100px; overflow: hidden;">
<div style="float: left; width: 100%; height: 20px; background: hotpink;"></div>
<div style="clear: both;">
<span style="position: absolute; width: 10px; height: 10px; background: orange;"></span>
<div style="height: 10px; background: green; overflow: hidden;"></div>
</div>
</div>
<script>
test(() => {
}, 'Test passes if the renderer does not crash.');
</script>

View file

@ -32,6 +32,7 @@ test_invalid_value("grid-auto-columns", "fit-content(1px auto)");
// <track-size>+
test_invalid_value("grid-auto-columns", "2em / 3em");
test_invalid_value("grid-auto-columns", "auto, 10%");
test_invalid_value("grid-auto-rows", "1px [a] 1px");
</script>
</body>
</html>

View file

@ -22,6 +22,7 @@ test_valid_value("grid-auto-columns", "5fr");
test_valid_value("grid-auto-columns", "min-content");
test_valid_value("grid-auto-columns", "max-content");
test_valid_value("grid-auto-columns", "auto");
test_valid_value("grid-auto-columns", "auto /**/", "auto");
// minmax( <inflexible-breadth> , <track-breadth> )
// <inflexible-breadth> = <length-percentage> | min-content | max-content | auto
@ -47,6 +48,8 @@ test_valid_value("grid-auto-columns", "minmax(auto, 0%)");
test_valid_value("grid-auto-columns", "fit-content(0px)");
// <track-size>+
test_valid_value("grid-auto-columns", "auto auto");
test_valid_value("grid-auto-columns", "auto 10px");
test_valid_value("grid-auto-columns", "1px 2px 3px 0px");
test_valid_value("grid-auto-columns", "fit-content(1px) minmax(2px, 3px) 4px");
</script>

View file

@ -31,6 +31,7 @@ test_invalid_value("grid-auto-rows", "fit-content(1px auto)");
// <track-size>+
test_invalid_value("grid-auto-rows", "2em / 3em");
test_invalid_value("grid-auto-rows", "auto, 10%");
test_invalid_value("grid-auto-rows", "1px [a] 1px");
</script>
</body>
</html>

View file

@ -22,6 +22,7 @@ test_valid_value("grid-auto-rows", "5fr");
test_valid_value("grid-auto-rows", "min-content");
test_valid_value("grid-auto-rows", "max-content");
test_valid_value("grid-auto-rows", "auto");
test_valid_value("grid-auto-rows", "auto /**/", "auto");
// minmax( <inflexible-breadth> , <track-breadth> )
// <inflexible-breadth> = <length-percentage> | min-content | max-content | auto
@ -47,6 +48,8 @@ test_valid_value("grid-auto-rows", "minmax(auto, 0%)");
test_valid_value("grid-auto-rows", "fit-content(0px)");
// <track-size>+
test_valid_value("grid-auto-rows", "auto auto");
test_valid_value("grid-auto-rows", "auto 10px");
test_valid_value("grid-auto-rows", "1px 2px 3px 0px");
test_valid_value("grid-auto-rows", "fit-content(1px) minmax(2px, 3px) 4px");
</script>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body>
<canvas id ="canvas" width="200" height="200"></canvas>
<script>
var ctx = document.getElementById('canvas').getContext('2d');
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 50, 50);
ctx.fillRect(100, 0, 50, 50);
</script>
</body>
</html>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
<link rel="match" href="background-repeat-x-ref.html">
<style>
.container {
width: 200px;
height: 200px;
}
#foo {
background: paint(foo) top left/50% 50% repeat-x;
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="foo" class="container"></div>
<script id="code" type="text/worklet">
registerPaint('foo', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 50, 50);
}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>
</body>
</html>

View file

@ -96,6 +96,11 @@ After your `hosts` file is configured, the servers will be locally accessible at
http://web-platform.test:8000/<br>
https://web-platform.test:8443/ *
To use the web-based runner point your browser to:
http://web-platform.test:8000/tools/runner/index.html<br>
https://web-platform.test:8443/tools/runner/index.html *
This server has all the capabilities of the publicly-deployed version--see
[Running the Tests from the Web](from-web).

View file

@ -58,6 +58,8 @@ themselves precede any test type flag, but are otherwise unordered.
context why the test is tentative and what needs to be resolved to make it
non-tentative.
It's preferable that `.window`, `.worker`, and `.any` are immediately followed
by their final `.js` extension.
[server-side substitution]: https://wptserve.readthedocs.io/en/latest/pipes.html#sub
[RFC 2119]: https://tools.ietf.org/html/rfc2119

View file

@ -32,7 +32,8 @@ css/ directory, regardless of where they are in the directory structure.
By default, tests are served over plain HTTP. If a test requires HTTPS
it must be given a filename containing `.https` before the extension,
e.g. `test-secure.https.html`. For more details see the documentation
e.g., `test-secure.https.html`, or be the generated service worker test
of a `.https`-less `.any` test. For more details see the documentation
on [file names][file-name-flags].
#### Support Files

View file

@ -165,7 +165,7 @@ are:
* `window` (default): to be run at <code><var>x</var>.any.html</code>
* `dedicatedworker` (default): to be run at <code><var>x</var>.any.worker.html</code>
* `serviceworker`: to be run at <code><var>x</var>.https.any.serviceworker.html</code>
* `serviceworker`: to be run at <code><var>x</var>.any.serviceworker.html</code> (`.https` is implied)
* `sharedworker`: to be run at <code><var>x</var>.any.sharedworker.html</code>
* `jsshell`: to be run in a JavaScript shell, without access to the DOM
(currently only supported in SpiderMonkey, and skipped in wptrunner)

View file

@ -56,7 +56,6 @@ protected_mime_types = [
"application/gzip",
"application/x-gzip",
"application/x-protobuf",
"application/x-www-form-urlencoded",
"application/zip",
"multipart/byteranges",
"text/event-stream",

View file

@ -0,0 +1 @@
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1 @@
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,8 @@
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
fetch_tests_from_worker(new SharedWorker("resources/nested-worker-success.js"));
</script>

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,8 @@
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
fetch_tests_from_worker(new Worker("resources/nested-worker-success.js"));
</script>

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,18 @@
test(() => {
const sab = new SharedArrayBuffer();
const channel = new MessageChannel();
assert_throws("DataCloneError", () => channel.port1.postMessage(sab));
}, "SharedArrayBuffer over MessageChannel without COOP+COEP");
test(() => {
const sab = new SharedArrayBuffer();
const channel = new BroadcastChannel("Is mir egal");
assert_throws("DataCloneError", () => channel.postMessage(sab));
}, "SharedArrayBuffer over BroadcastChannel without COOP+COEP");
if (self.GLOBAL.isWindow()) {
test(() => {
const sab = new SharedArrayBuffer();
assert_throws("DataCloneError", () => self.postMessage(sab));
}, "SharedArrayBuffer over postMessage() without COOP+COEP");
}

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -1 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: same-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -0,0 +1,2 @@
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Resource-Policy: cross-site

View file

@ -1,9 +1,10 @@
// META: global=!default,dedicatedworker,sharedworker
// META: script=resources/test-incrementer.js
"use strict";
importScripts("/resources/testharness.js");
importScripts("test-incrementer.js");
promise_test(t => {
const worker = new Worker("resources/incrementer-worker.js");
const worker = new Worker("incrementer-worker.js");
return testSharingViaIncrementerScript(t, worker, "parent worker", worker, "sub-worker");
}, "postMessaging to a dedicated sub-worker allows them to see each others' modifications");
done();

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

View file

@ -21,32 +21,32 @@
src: url("/fonts/math/fraction-denominatordisplaystylegapmin5000-rulethickness1000.woff");
}
@font-face {
font-family: denominatordisplaystyleshiftdown6000-rulethickness1000;
src: url("/fonts/math/fraction-denominatordisplaystyleshiftdown6000-rulethickness1000.woff");
font-family: denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000;
src: url("/fonts/math/fraction-denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000.woff");
}
@font-face {
font-family: denominatorgapmin4000-rulethickness1000;
src: url("/fonts/math/fraction-denominatorgapmin4000-rulethickness1000.woff");
}
@font-face {
font-family: denominatorshiftdown3000-rulethickness1000;
src: url("/fonts/math/fraction-denominatorshiftdown3000-rulethickness1000.woff");
font-family: denominatorshiftdown3000-axisheight1000-rulethickness1000;
src: url("/fonts/math/fraction-denominatorshiftdown3000-axisheight1000-rulethickness1000.woff");
}
@font-face {
font-family: numeratordisplaystylegapmin8000-rulethickness1000;
src: url("/fonts/math/fraction-numeratordisplaystylegapmin8000-rulethickness1000.woff");
}
@font-face {
font-family: numeratordisplaystyleshiftup2000-rulethickness1000;
src: url("/fonts/math/fraction-numeratordisplaystyleshiftup2000-rulethickness1000.woff");
font-family: numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000;
src: url("/fonts/math/fraction-numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000.woff");
}
@font-face {
font-family: numeratorgapmin9000-rulethickness1000;
src: url("/fonts/math/fraction-numeratorgapmin9000-rulethickness1000.woff");
}
@font-face {
font-family: numeratorshiftup11000-rulethickness1000;
src: url("/fonts/math/fraction-numeratorshiftup11000-rulethickness1000.woff");
font-family: numeratorshiftup11000-axisheight1000-rulethickness1000;
src: url("/fonts/math/fraction-numeratorshiftup11000-axisheight1000-rulethickness1000.woff");
}
@font-face {
font-family: rulethickness10000;
@ -177,7 +177,7 @@
</p>
<hr/>
<p>
<math display="block" style="font-family: denominatordisplaystyleshiftdown6000-rulethickness1000;">
<math display="block" style="font-family: denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000;">
<mspace id="ref0003" width="3em" height="1em" style="background: green"/>
<mfrac>
<mspace width="3em"/>
@ -198,7 +198,7 @@
</p>
<hr/>
<p>
<math style="font-family: denominatorshiftdown3000-rulethickness1000;">
<math style="font-family: denominatorshiftdown3000-axisheight1000-rulethickness1000;">
<mspace id="ref0005" width="3em" height="1em" style="background: green"/>
<mfrac>
<mspace width="3em"/>
@ -219,7 +219,7 @@
</p>
<hr/>
<p>
<math display="block" style="font-family: numeratordisplaystyleshiftup2000-rulethickness1000;">
<math display="block" style="font-family: numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000;">
<mspace id="ref0007" width="3em"
depth="1em" style="background: green"/>
<mfrac>
@ -241,7 +241,7 @@
</p>
<hr/>
<p>
<math style="font-family: numeratorshiftup11000-rulethickness1000;">
<math style="font-family: numeratorshiftup11000-axisheight1000-rulethickness1000;">
<mspace id="ref0009" width="3em"
depth="1em" style="background: green"/>
<mfrac>

View file

@ -17,12 +17,12 @@
src: url("/fonts/math/stack-axisheight7000.woff");
}
@font-face {
font-family: bottomdisplaystyleshiftdown5000;
src: url("/fonts/math/stack-bottomdisplaystyleshiftdown5000.woff");
font-family: bottomdisplaystyleshiftdown5000-axisheight1000;
src: url("/fonts/math/stack-bottomdisplaystyleshiftdown5000-axisheight1000.woff");
}
@font-face {
font-family: bottomshiftdown6000;
src: url("/fonts/math/stack-bottomshiftdown6000.woff");
font-family: bottomshiftdown6000-axisheight1000;
src: url("/fonts/math/stack-bottomshiftdown6000-axisheight1000.woff");
}
@font-face {
font-family: displaystylegapmin4000;
@ -33,12 +33,12 @@
src: url("/fonts/math/stack-gapmin8000.woff");
}
@font-face {
font-family: topdisplaystyleshiftup3000;
src: url("/fonts/math/stack-topdisplaystyleshiftup3000.woff");
font-family: topdisplaystyleshiftup3000-axisheight1000;
src: url("/fonts/math/stack-topdisplaystyleshiftup3000-axisheight1000.woff");
}
@font-face {
font-family: topshiftup9000;
src: url("/fonts/math/stack-topshiftup9000.woff");
font-family: topshiftup9000-axisheight1000;
src: url("/fonts/math/stack-topshiftup9000-axisheight1000.woff");
}
</style>
<script>
@ -129,7 +129,7 @@
</p>
<hr/>
<p>
<math display="block" style="font-family: bottomdisplaystyleshiftdown5000;">
<math display="block" style="font-family: bottomdisplaystyleshiftdown5000-axisheight1000;">
<mspace id="ref0002" width="3em" height="1em" style="background: green"/>
<mfrac linethickness="0px">
<mspace width="3em"/>
@ -139,7 +139,7 @@
</p>
<hr/>
<p>
<math style="font-family: bottomshiftdown6000;">
<math style="font-family: bottomshiftdown6000-axisheight1000;">
<mspace id="ref0003" width="3em" height="1em" style="background: green"/>
<mfrac linethickness="0px">
<mspace width="3em"/>
@ -167,7 +167,7 @@
</p>
<hr/>
<p>
<math display="block" style="font-family: topdisplaystyleshiftup3000;">
<math display="block" style="font-family: topdisplaystyleshiftup3000-axisheight1000;">
<mspace id="ref0006" width="3em" depth="1em" style="background: green"/>
<mfrac linethickness="0px">
<mspace width="3em" height="1em" id="num0006" style="background: blue"/>
@ -177,7 +177,7 @@
</p>
<hr/>
<p>
<math style="font-family: topshiftup9000;">
<math style="font-family: topshiftup9000-axisheight1000;">
<mspace id="ref0007" width="3em" depth="1em" style="background: green"/>
<mfrac linethickness="0px">
<mspace width="3em" height="1em" id="num0007" style="background: blue"/>

View file

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Elements not participating to the layout of their parent</title>
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#layout-algorithms">
<meta name="assert" content="Verify that display: none and out-of-flow positioned elements do not participate to layout of their parent.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/mathml/support/feature-detection.js"></script>
<script src="/mathml/support/layout-comparison.js"></script>
<script src="/mathml/support/mathml-fragments.js"></script>
<script>
var epsilon = 1;
setup({ explicit_done: true });
window.addEventListener("load", runTests);
function runTests() {
for (tag in MathMLFragments) {
if (!FragmentHelper.isValidChildOfMrow(tag) ||
FragmentHelper.isEmpty(tag))
continue;
// TODO: Add floats too?
["display: none",
"position: absolute",
"position: fixed"
].forEach(style => {
document.body.insertAdjacentHTML("beforeend", `<div style="position: absolute;">\
<div style="display: inline-block"><math>${MathMLFragments[tag]}</math></div>\
<div style="display: inline-block"><math>${MathMLFragments[tag]}</math></div>\
</div>`);
var div = document.body.lastElementChild;
var elementContainer = div.firstElementChild;
var elementContainerWidth = elementContainer.getBoundingClientRect().width;
var element = FragmentHelper.element(elementContainer);
FragmentHelper.forceNonEmptyElement(element);
var allowInvalid = true;
var child = FragmentHelper.appendChild(element, allowInvalid);
child.setAttribute("style", style);
var referenceContainer = div.lastElementChild;
var referenceContainerWidth = referenceContainer.getBoundingClientRect().width;
var reference = FragmentHelper.element(referenceContainer);
FragmentHelper.forceNonEmptyElement(reference);
var epsilon = 1;
test(function() {
// FIXME(fwang): Feature detection should be done per-tag.
assert_true(MathMLFeatureDetection.has_mspace());
assert_approx_equals(elementContainerWidth, referenceContainerWidth, epsilon);
}, `${tag} preferred width calculation is not affected by children with "${style}" style`);
test(function() {
// FIXME(fwang): Feature detection should be done per-tag.
assert_true(MathMLFeatureDetection.has_mspace());
compareLayout(element, reference, epsilon);
}, `${tag} layout is not affected by children with "${style}" style`);
div.style = "display: none;"; // Hide the div after measurement.
});
}
done();
}
</script>
</head>
<body>
<div id="log"></div>
</body>
</html>

View file

@ -37,36 +37,46 @@ function compareSize(element, reference, epsilon) {
}
}
function compareLayout(element, reference, epsilon) {
if (element.children.length != reference.children.length)
throw "Reference should have the same number of children."
function participateToParentLayout(child) {
var style = window.getComputedStyle(child);
return style.getPropertyValue("display") !== "none" &&
style.getPropertyValue("position") !== "absolute" &&
style.getPropertyValue("position") !== "fixed";
}
function childrenParticipatingToLayout(element) {
var children = [];
Array.from(element.children).forEach(child => {
if (participateToParentLayout(child))
children.push(child);
})
return children;
}
function compareLayout(element, reference, epsilon) {
// Compare sizes of elements and children.
var param = getWritingMode(element, reference);
compareSize(element, reference, epsilon);
var elementBox = element.getBoundingClientRect();
var referenceBox = reference.getBoundingClientRect();
for (var i = 0; i < element.children.length; i++) {
var childDisplay = window.
getComputedStyle(element.children[i]).getPropertyValue("display");
var referenceChildDisplay = window.
getComputedStyle(reference.children[i]).getPropertyValue("display");
if (referenceChildDisplay !== childDisplay)
throw "compareLayout: children of reference should have the same display values.";
if (childDisplay === "none")
continue;
compareSize(element.children[i], reference.children[i], epsilon);
var elementChildren = childrenParticipatingToLayout(element);
var referenceChildren = childrenParticipatingToLayout(reference);
if (elementChildren.length != referenceChildren.length)
throw "Reference should have the same number of children participating to layout."
var childBox = element.children[i].getBoundingClientRect();
var referenceChildBox = reference.children[i].getBoundingClientRect();
for (var i = 0; i < elementChildren.length; i++) {
compareSize(elementChildren[i], referenceChildren[i], epsilon);
var childBox = elementChildren[i].getBoundingClientRect();
var referenceChildBox = referenceChildren[i].getBoundingClientRect();
switch(param.mode) {
case "horizontal-tb":
if (!param.rtl)
throw "compareLayout: unexpected writing-mode value";
assert_approx_equals(elementBox.right - childBox.right,
assert_approx_equals(param.rtl ?
elementBox.right - childBox.right :
childBox.left - elementBox.left,
referenceChildBox.left - referenceBox.left,
epsilon,
`inline position (child ${i})`);

View file

@ -138,17 +138,25 @@ var FragmentHelper = {
return fragment.getElementsByClassName('element')[0];
},
forceNonEmptyElement: function(fragment) {
appendChild: function(fragment, allowInvalid) {
var element = this.element(fragment) || fragment;
if (element.firstElementChild)
return element.firstElementChild;
if (element.classList.contains("mathml-container"))
return element.appendChild(this.createElement("mrow"));
if (element.classList.contains("foreign-container")) {
var el = document.createElement("span");
el.textContent = "a";
return element.appendChild(el);
}
throw "Cannot make the element nonempty";
if (element.classList.contains("mathml-container") || allowInvalid) {
var el = this.createElement("mi");
el.textContent = "a";
return element.appendChild(el);
}
throw "Cannot append child to the element";
},
forceNonEmptyElement: function(fragment) {
var element = this.element(fragment) || fragment;
if (element.firstElementChild)
return element.firstElementChild;
return this.appendChild(fragment);
}
}

View file

@ -35,8 +35,8 @@ mathfont.save(f)
v1 = 6 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("fraction-denominatordisplaystyleshiftdown%d-rulethickness%d" % (v1, v2))
f.math.AxisHeight = 0
f = mathfont.create("fraction-denominatordisplaystyleshiftdown%d-axisheight%d-rulethickness%d" % (v1, v2, v2))
f.math.AxisHeight = v2
f.math.FractionDenominatorDisplayStyleGapMin = 0
f.math.FractionDenominatorDisplayStyleShiftDown = v1
f.math.FractionDenominatorGapMin = 0
@ -65,8 +65,8 @@ mathfont.save(f)
v1 = 3 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("fraction-denominatorshiftdown%d-rulethickness%d" % (v1, v2))
f.math.AxisHeight = 0
f = mathfont.create("fraction-denominatorshiftdown%d-axisheight%d-rulethickness%d" % (v1, v2, v2))
f.math.AxisHeight = v2
f.math.FractionDenominatorDisplayStyleGapMin = 0
f.math.FractionDenominatorDisplayStyleShiftDown = 0
f.math.FractionDenominatorGapMin = 0
@ -95,8 +95,8 @@ mathfont.save(f)
v1 = 2 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("fraction-numeratordisplaystyleshiftup%d-rulethickness%d" % (v1, v2))
f.math.AxisHeight = 0
f = mathfont.create("fraction-numeratordisplaystyleshiftup%d-axisheight%d-rulethickness%d" % (v1, v2, v2))
f.math.AxisHeight = v2
f.math.FractionDenominatorDisplayStyleGapMin = 0
f.math.FractionDenominatorDisplayStyleShiftDown = 0
f.math.FractionDenominatorGapMin = 0
@ -125,8 +125,8 @@ mathfont.save(f)
v1 = 11 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("fraction-numeratorshiftup%d-rulethickness%d" % (v1, v2))
f.math.AxisHeight = 0
f = mathfont.create("fraction-numeratorshiftup%d-axisheight%d-rulethickness%d" % (v1, v2, v2))
f.math.AxisHeight = v2
f.math.FractionDenominatorDisplayStyleGapMin = 0
f.math.FractionDenominatorDisplayStyleShiftDown = 0
f.math.FractionDenominatorGapMin = 0

View file

@ -14,10 +14,11 @@ f.math.StackTopDisplayStyleShiftUp = 0
f.math.StackTopShiftUp = 0
mathfont.save(f)
v = 5 * mathfont.em
f = mathfont.create("stack-bottomdisplaystyleshiftdown%d" % v)
f.math.AxisHeight = 0
f.math.StackBottomDisplayStyleShiftDown = v
v1 = 5 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("stack-bottomdisplaystyleshiftdown%d-axisheight%d" % (v1, v2))
f.math.AxisHeight = v2
f.math.StackBottomDisplayStyleShiftDown = v1
f.math.StackBottomShiftDown = 0
f.math.StackDisplayStyleGapMin = 0
f.math.StackGapMin = 0
@ -25,11 +26,12 @@ f.math.StackTopDisplayStyleShiftUp = 0
f.math.StackTopShiftUp = 0
mathfont.save(f)
v = 6 * mathfont.em
f = mathfont.create("stack-bottomshiftdown%d" % v)
f.math.AxisHeight = 0
v1 = 6 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("stack-bottomshiftdown%d-axisheight%d" % (v1, v2))
f.math.AxisHeight = v2
f.math.StackBottomDisplayStyleShiftDown = 0
f.math.StackBottomShiftDown = v
f.math.StackBottomShiftDown = v1
f.math.StackDisplayStyleGapMin = 0
f.math.StackGapMin = 0
f.math.StackTopDisplayStyleShiftUp = 0
@ -58,24 +60,26 @@ f.math.StackTopDisplayStyleShiftUp = 0
f.math.StackTopShiftUp = 0
mathfont.save(f)
v = 3 * mathfont.em
f = mathfont.create("stack-topdisplaystyleshiftup%d" % v)
f.math.AxisHeight = 0
v1 = 3 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("stack-topdisplaystyleshiftup%d-axisheight%d" % (v1, v2))
f.math.AxisHeight = v2
f.math.StackBottomDisplayStyleShiftDown = 0
f.math.StackBottomShiftDown = 0
f.math.StackDisplayStyleGapMin = 0
f.math.StackGapMin = 0
f.math.StackTopDisplayStyleShiftUp = v
f.math.StackTopDisplayStyleShiftUp = v1
f.math.StackTopShiftUp = 0
mathfont.save(f)
v = 9 * mathfont.em
f = mathfont.create("stack-topshiftup%d" % v)
f.math.AxisHeight = 0
v1 = 9 * mathfont.em
v2 = 1 * mathfont.em
f = mathfont.create("stack-topshiftup%d-axisheight%d" % (v1, v2))
f.math.AxisHeight = v2
f.math.StackBottomDisplayStyleShiftDown = 0
f.math.StackBottomShiftDown = 0
f.math.StackDisplayStyleGapMin = 0
f.math.StackGapMin = 0
f.math.StackTopDisplayStyleShiftUp = 0
f.math.StackTopShiftUp = v
f.math.StackTopShiftUp = v1
mathfont.save(f)

View file

@ -27,13 +27,16 @@
var test_pointer_event = setup_pointerevent_test("Event sequence at implicit release on drag", ["touch"]);
var button = document.getElementById("done");
var clickIsReceived = false;
var actions_promise;
on_event(document.getElementById("done"), "click", function() {
test_pointer_event.step(function () {
var expected_events = "pointercancel, lostpointercapture, pointerout, pointerleave";
assert_equals(event_log.join(", "), expected_events);
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_pointer_event.done();
});
});
var target = document.getElementById("target");
@ -55,13 +58,8 @@
});
// Inject touch inputs.
pointerDragInTarget("touch", target, 'right').then(function() {
actions_promise = pointerDragInTarget("touch", target, 'right').then(function() {
return clickInTarget("touch", button);
}).then(function() {
test_pointer_event.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_pointer_event.done();
});
}
</script>

View file

@ -89,6 +89,7 @@
var target0 = document.getElementById("target0");
var test_touchaction = async_test("touch-action attribute test");
var actions_promise;
xScr0 = target0.scrollLeft;
yScr0 = target0.scrollTop;
@ -117,18 +118,17 @@
}
if(xScrollIsReceived && yScrollIsReceived) {
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
}
});
// Inject touch inputs and wait for all the actions finish to end the test.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
test_touchaction.step(function () {
assert_true(xScrollIsReceived && yScrollIsReceived, "x-scroll and y-scroll should be received before the test finishes");
}, "x-scroll and y-scroll should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -87,7 +87,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if touch-action attribute works properly for embedded divs
//
@ -98,7 +98,11 @@
assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
@ -107,15 +111,10 @@
});
// Inject touch inputs.
touchScrollInTarget(scrollTarget, 'down').then(function() {
actions_promise = touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -91,7 +91,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if touch-action attribute works properly for embedded divs
//
@ -102,20 +102,19 @@
assert_not_equals(target0.scrollLeft, 0, "scroll x offset should not be 0 in the end of the test");
assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
// Inject touch inputs.
touchScrollInTarget(scrollTarget, 'down').then(function() {
actions_promise = touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -92,6 +92,7 @@
var target0 = document.getElementById("target0");
var test_touchaction = async_test("touch-action attribute test");
var actions_promise;
xScr0 = target0.scrollLeft;
yScr0 = target0.scrollTop;
@ -117,18 +118,17 @@
}
if(xScrollIsReceived && yScrollIsReceived) {
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
}
});
// Inject touch inputs and wait for all the actions finish to end the test.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
test_touchaction.step(function () {
assert_true(xScrollIsReceived && yScrollIsReceived, "x-scroll and y-scroll should be received before the test finishes");
}, "x-scroll and y-scroll should be received before the test finishes");
test_touchaction.done();
});
}

View file

@ -87,7 +87,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if touch-action attribute works properly for embedded divs
//
@ -98,7 +98,11 @@
assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
@ -107,15 +111,10 @@
});
// Inject touch inputs.
touchScrollInTarget(scrollTarget, 'down').then(function() {
actions_promise = touchScrollInTarget(scrollTarget, 'down').then(function() {
return touchScrollInTarget(scrollTarget, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -87,7 +87,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if "touch-action: none" attribute works properly
//TA: 15.2
@ -97,7 +97,11 @@
assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
@ -106,15 +110,10 @@
});
// Inject touch inputs.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -86,7 +86,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if "touch-action: pan-x" attribute works properly
//TA: 15.3
@ -96,20 +96,19 @@
assert_not_equals(target0.scrollLeft, 0, "scroll x offset should not be 0 in the end of the test");
assert_equals(target0.scrollTop, 0, "scroll y offset should be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
// Inject touch inputs.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -90,7 +90,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if touch-action attribute works properly for embedded divs
//
@ -101,20 +101,19 @@
assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
assert_not_equals(target0.scrollTop, 0, "scroll y offset should not be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
// Inject touch inputs.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -89,6 +89,7 @@
var target0 = document.getElementById("target0");
var test_touchaction = async_test("touch-action attribute test");
var actions_promise;
xScr0 = target0.scrollLeft;
yScr0 = target0.scrollTop;
@ -114,18 +115,17 @@
}
if(xScrollIsReceived && yScrollIsReceived) {
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
}
});
// Inject touch inputs and wait for all the actions finish to end the test.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
test_touchaction.step(function () {
assert_true(xScrollIsReceived && yScrollIsReceived, "x-scroll and y-scroll should be received before the test finishes");
}, "x-scroll and y-scroll should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -87,7 +87,7 @@
function run() {
var target0 = document.getElementById("target0");
var btnComplete = document.getElementById("btnComplete");
var clickIsReceived = false;
var actions_promise;
// Check if "touch-action: pan-y" attribute works properly
//TA: 15.4
@ -97,20 +97,19 @@
assert_equals(target0.scrollLeft, 0, "scroll x offset should be 0 in the end of the test");
assert_not_equals(target0.scrollTop, 0, "scroll y offset should not be 0 in the end of the test");
});
clickIsReceived = true;
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
test_touchaction.done();
});
updateDescriptionComplete();
});
// Inject touch inputs.
touchScrollInTarget(target0, 'down').then(function() {
actions_promise = touchScrollInTarget(target0, 'down').then(function() {
return touchScrollInTarget(target0, 'right');
}).then(function() {
return clickInTarget("touch", btnComplete);
}).then(function() {
test_touchaction.step(function () {
assert_true(clickIsReceived, "click should be received before the test finishes");
}, "click should be received before the test finishes");
test_touchaction.done();
});
}
</script>

View file

@ -38,16 +38,24 @@
</style>
<script>
var expectedPointerId = NaN;
var startSummation = false;
var lastScreenX = 0;
var lastScreenY = 0;
var lastScreenX = null;
var lastScreenY = null;
function resetTestState() {
startSummation = false;
lastScreenX = 0;
lastScreenY = 0;
lastScreenX = null;
lastScreenY = null;
}
var nonPointermoveEventList = [
"pointerover",
"pointerenter",
"pointerdown",
"pointerup",
"pointerout",
"pointerleave",
"gotpointercapture",
"lostpointercapture"];
function injectInput(pointerType) {
var pointerId = pointerType + "Pointer1";
return new test_driver.Actions()
@ -55,7 +63,9 @@
.pointerMove(0, 0, {origin: box1})
.pointerDown()
.pointerMove(20, 30, {origin: box1})
.pointerMove(60, 40, {origin: box1})
.pointerMove(50, 40, {origin: box1})
.pointerMove(80, 30, {origin: box1})
.pointerMove(110, 20, {origin: box1})
.pointerMove(0, 0, {origin: box2})
.pointerUp()
.send();
@ -65,15 +75,31 @@
var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", ALL_POINTERS);
[document, document.getElementById('innerFrame').contentDocument].forEach(function(element) {
nonPointermoveEventList.forEach(function(eventName) {
on_event(element, eventName, function (event) {
if (lastScreenX && lastScreenY) {
test_pointerEvent.step(function() {
assert_equals(event.movementX, 0, "movementX should be 0 for event other than pointermove.");
assert_equals(event.movementY, 0, "movementY should be 0 for event other than pointermove.");
});
// Reset when entering the new frame.
if (event.type == "pointerenter") {
lastScreenX = null;
lastScreenY = null;
}
}
});
});
on_event(element, 'pointermove', function (event) {
if (startSummation) {
test_pointerEvent.step(function() {
test_pointerEvent.step(function() {
if (lastScreenX && lastScreenY) {
assert_equals(event.movementX, event.screenX - lastScreenX, "movementX should be the delta between current event's and last event's screenX");
assert_equals(event.movementY, event.screenY - lastScreenY, "movementY should be the delta between current event's and last event's screenY");
});
lastScreenX = event.screenX;
lastScreenY = event.screenY;
}
}
});
lastScreenX = event.screenX;
lastScreenY = event.screenY;
});
});
on_event(document.querySelector('#box1'), 'pointerdown', function(event) {
@ -81,12 +107,10 @@
test_pointerEvent.step(function() {
assert_equals(event.pointerType, expectedPointerType, "Use the instructed pointer type.");
});
startSummation = true;
lastScreenX = event.screenX;
lastScreenY = event.screenY;
});
on_event(document.querySelector('#box2'), 'pointerup', function(event) {
startSummation = false;
test_pointerEvent.done();
});

View file

@ -0,0 +1,54 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>Test the behavior of one discard applied on another discard</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<animate id="anim" attributeName="visibility" to="visible" begin="0s" end="5s"/>
<rect x="0" y="0" width="50" height="50" fill="rgb(255, 0, 0)">
<set id="set1" attributeName="fill" to="rgb(0, 255, 0)" begin="2s" fill="freeze"/>
<set id="set2" attributeName="fill" to="rgb(0, 0, 255)" begin="3s" fill="freeze"/>
</rect>
<discard id="discard1" xlink:href="#set1" begin="1s"/>
<discard id="discard2" xlink:href="#set2"/>
<discard id="discard3" xlink:href="#discard1"/>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function sample1() {
expectFillColor(rect1, 255, 0, 0);
}
function sample2() {
expectFillColor(rect1, 0, 255, 0);
}
smil_async_test((t) => {
var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
rect1 = rects[0];
const expectedValues = [
// [animationId, time, sampleCallback]
["anim", 0.0, sample1],
["anim", 0.01, sample1],
["anim", 2.0, sample2],
["anim", 2.01, sample2],
["anim", 3.0, sample2],
["anim", 3.01, sample2]
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

View file

@ -0,0 +1,65 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>This test forces use shadow tree recreation while an animating is running</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<rect id="rect" width="10" height="100" fill="red">
<animate id="an1" attributeName="width" fill="freeze" from="10" to="100" begin="0s" dur="4s"/>
</rect>
</defs>
<use xlink:href="#rect"/>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function sample1() {
assert_approx_equals(rect.width.animVal.value, 10, epsilon);
assert_equals(rect.width.baseVal.value, 10);
}
function sample2() {
assert_approx_equals(rect.width.animVal.value, 55, epsilon);
assert_equals(rect.width.baseVal.value, 10);
}
function forceUseShadowTreeRecreation() {
rect.setAttribute("fill", "green");
}
function sample3() {
assert_approx_equals(rect.width.animVal.value, 100, epsilon);
assert_equals(rect.width.baseVal.value, 10);
}
smil_async_test((t) => {
rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample1],
["an1", 1.999, sample2],
["an1", 2.0, forceUseShadowTreeRecreation],
["an1", 2.001, sample2],
["an1", 4.0, sample3],
["an1", 60.0, sample3],
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

View file

@ -0,0 +1,421 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>This checks the effect on multiple animations ending on one target</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Test that the first element can end while others continue without crashing, and the second
can end and remain frozen. Also test that a third element can animate after the second has ended
but that the result is still to return to the second animation's freeze position. -->
<rect x='0' y='0' width='50' height='50' fill='green'>
<animate id="an1" attributeName='x' from='0' to='100' begin='0s' dur='1s' />
<animate id="an2" attributeName='x' from='200' to='250' begin='1.5s' dur='1s' fill='freeze' />
<animate id="an3" attributeName='x' from='50' to='0' begin='2.5s' dur='0.5s' />
</rect>
<!-- Test that a second element can take priority over the first from 0-1s, then
test that the first element can animate for 1s, and finally test that the
second element can once again animate after the first has ended. After all
animations end, test that they are removed and the rect returns to its home. -->
<rect x='200' y='75' width='50' height='50' fill='green'>
<animate id="an4" attributeName='x' from='0' to='10' begin='1s' dur='1s'/>
<animate id="an5" attributeName='x' from='100' to='0' begin='0s' dur='2.5s'/>
</rect>
<!-- Test that a repeating animation can take priority over another animation, and that the
end state is the second animation's freeze value. Also test that, after a pause, a third
animation can take over and have its freeze value satisfied at the end. -->
<rect x='0' y='150' width='50' height='50' fill='green'>
<animate id="an6" attributeName='x' from='200' to='240' begin='0s' dur='2s' fill='freeze'/>
<animate id="an7" attributeName='x' from='0' to='5' begin='1s' dur='0.1s' repeatCount="5" fill='freeze'/>
<animate id="an8" attributeName='x' from='250' to='150' begin='3s' dur='1s' fill='freeze'/>
</rect>
<!-- Test that 4 animations can animate a rect in 20px 'steps' and that correct freeze values are
honored even though the animation elements are specified in non-sequential order. Also test
that two repeating animations (active for only a short duration) only momentarily
affect the overall animation and are correctly removed. -->
<rect x='0' y='225' width='50' height='50' fill='green'>
<animate id="an9" attributeName='x' from='200' to='250' begin='1.6s' dur='0.1s' repeatCount="2" fill='remove'/>
<animate id="anA" attributeName='x' from='160' to='180' begin='3s' dur='0.5s' fill='freeze'/>
<animate id="anB" attributeName='x' from='110' to='130' begin='2s' dur='0.5s' fill='freeze'/>
<animate id="anC" attributeName='x' from='10' to='30' begin='0s' dur='0.5s' fill='freeze'/>
<animate id="anD" attributeName='x' from='60' to='80' begin='1s' dur='0.5s' fill='freeze'/>
<animate id="anE" attributeName='x' from='200' to='250' begin='3.6s' dur='0.1s' repeatCount="2" fill='remove'/>
</rect>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function sample1() {
assert_approx_equals(rect1.x.animVal.value, 0, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 100, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 200, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 10, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample2() {
assert_approx_equals(rect1.x.animVal.value, 50, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 80, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 210, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 30, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample3() {
assert_approx_equals(rect1.x.animVal.value, 50, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 80, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 210, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 30, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample4() {
assert_approx_equals(rect1.x.animVal.value, 50, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 80, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 210, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 30, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample5() {
assert_approx_equals(rect1.x.animVal.value, 100, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 60, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 220, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 30, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample6() {
assert_approx_equals(rect1.x.animVal.value, 0, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 0, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 0, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 60, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample7() {
assert_approx_equals(rect1.x.animVal.value, 0, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 0, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 0, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 60, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample8() {
assert_approx_equals(rect1.x.animVal.value, 0, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 5, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 80, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample9() {
assert_approx_equals(rect1.x.animVal.value, 200, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 5, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 80, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample10() {
assert_approx_equals(rect1.x.animVal.value, 200, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 5, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 80, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample11() {
assert_approx_equals(rect1.x.animVal.value, 225, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 10, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 80, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample12() {
assert_approx_equals(rect1.x.animVal.value, 225, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 20, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 110, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample13() {
assert_approx_equals(rect1.x.animVal.value, 225, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 20, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 110, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample14() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 0, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 130, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample15() {
assert_approx_equals(rect1.x.animVal.value, 50, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 130, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample16() {
assert_approx_equals(rect1.x.animVal.value, 50, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 130, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample17() {
assert_approx_equals(rect1.x.animVal.value, 0, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 5, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 130, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample18() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 250, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 160, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample19() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 250, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 160, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample20() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 200, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 180, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample21() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 200, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 180, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample22() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 150, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 180, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
function sample23() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 200);
assert_approx_equals(rect3.x.animVal.value, 150, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
assert_approx_equals(rect4.x.animVal.value, 180, epsilon);
assert_equals(rect4.x.baseVal.value, 0);
}
smil_async_test((t) => {
var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
rect1 = rects[0];
rect2 = rects[1];
rect3 = rects[2];
rect4 = rects[3];
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample1],
["an1", 0.499, sample2],
["an1", 0.5, sample3],
["an1", 0.501, sample4],
["an1", 0.999, sample5],
["an1", 1.0, sample6],
["an1", 1.001, sample7],
["an1", 1.499, sample8],
["an1", 1.5, sample9],
["an1", 1.501, sample10],
["an1", 1.999, sample11],
["an1", 2.0, sample12],
["an1", 2.001, sample13],
["an1", 2.499, sample14],
["an1", 2.5, sample15],
["an1", 2.501, sample16],
["an1", 2.999, sample17],
["an1", 3.0, sample18],
["an1", 3.001, sample19],
["an1", 3.499, sample20],
["an1", 3.5, sample21],
["an1", 4.0, sample22],
["an1", 9.0, sample23]
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

View file

@ -0,0 +1,149 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>This checks the effect on multiple animations on one target</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x='0' y='0' width='50' height='50' fill='green'>
<animate id="an1" attributeName='x' from='0' to='100' begin='0s' dur='2s' fill='freeze'/>
<animate id="an2" attributeName='x' from='150' to='250' begin='4s' dur='2s' fill='freeze'/>
</rect>
<rect x='0' y='100' width='50' height='50' fill='green'>
<animate id="an3" attributeName='x' from='0' to='100' begin='0s' dur='2s' fill='remove'/>
<animate id="an4" attributeName='x' from='150' to='250' begin='4s' dur='2s' fill='freeze'/>
</rect>
<rect x='0' y='200' width='50' height='50' fill='green'>
<animate id="an5" attributeName='x' from='0' to='100' begin='0s' dur='2s' fill='freeze'/>
<animate id="an6" attributeName='x' from='150' to='250' begin='4s' dur='2s' fill='remove'/>
</rect>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function sample1() {
assert_approx_equals(rect1.x.animVal.value, 0, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 0, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 0, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample2() {
assert_approx_equals(rect1.x.animVal.value, 50, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 50, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 50, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample3() {
assert_approx_equals(rect1.x.animVal.value, 100, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 100, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 100, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample4() {
assert_approx_equals(rect1.x.animVal.value, 100, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 0, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 100, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample5() {
assert_approx_equals(rect1.x.animVal.value, 150, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 150, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 150, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample6() {
assert_approx_equals(rect1.x.animVal.value, 200, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 200, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 200, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample7() {
assert_approx_equals(rect1.x.animVal.value, 250, epsilon);
assert_equals(rect1.x.baseVal.value, 0);
assert_approx_equals(rect2.x.animVal.value, 250, epsilon);
assert_equals(rect2.x.baseVal.value, 0);
assert_approx_equals(rect3.x.animVal.value, 250, epsilon);
assert_equals(rect3.x.baseVal.value, 0);
}
function sample8() {
assert_equals(rect1.x.animVal.value, 250);
assert_equals(rect1.x.baseVal.value, 0);
assert_equals(rect2.x.animVal.value, 250);
assert_equals(rect2.x.baseVal.value, 0);
assert_equals(rect3.x.animVal.value, 100);
assert_equals(rect3.x.baseVal.value, 0);
}
smil_async_test((t) => {
var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
rect1 = rects[0];
rect2 = rects[1];
rect3 = rects[2];
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample1],
["an1", 1.0, sample2],
["an1", 1.999, sample3],
["an1", 2.001, sample4],
["an1", 3.0, sample4],
["an1", 3.999, sample4],
["an1", 4.0, sample5],
["an1", 5.0, sample6],
["an1", 5.999, sample7],
["an1", 6.001, sample8],
["an1", 60.0, sample8]
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

View file

@ -0,0 +1,136 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>This tests additive='sum' support on animate elements with multiple begin times</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
<rect width="100" height="100" fill="green">
<animate id="an1" attributeName="y" attributeType="XML" begin="0s" dur="12s" from="100" to="900" fill="freeze" />
<animate attributeName="x" attributeType="XML" calcMode="discrete" begin="0s; 2s" from="0" to="400" dur="8s" additive="sum" />
</rect>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function checkBaseValues() {
return;
assert_equals(rect.x.baseVal.value, 0);
assert_equals(rect.y.baseVal.value, 0);
}
function sample1() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 100, epsilon);
checkBaseValues();
}
function sample2() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 166.67, epsilon);
checkBaseValues();
}
function sample3() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 366.60, epsilon);
checkBaseValues();
}
function sample4() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 366.73, epsilon);
checkBaseValues();
}
function sample5() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 499.93, epsilon);
checkBaseValues();
}
function sample6() {
assert_equals(rect.x.animVal.value, 400);
assert_approx_equals(rect.y.animVal.value, 500.06, epsilon);
checkBaseValues();
}
function sample7() {
assert_equals(rect.x.animVal.value, 400);
assert_approx_equals(rect.y.animVal.value, 566.67, epsilon);
checkBaseValues();
}
function sample8() {
assert_equals(rect.x.animVal.value, 400);
assert_approx_equals(rect.y.animVal.value, 633.33, epsilon);
checkBaseValues();
}
function sample9() {
assert_equals(rect.x.animVal.value, 400);
assert_approx_equals(rect.y.animVal.value, 700, epsilon);
checkBaseValues();
}
function sample10() {
assert_equals(rect.x.animVal.value, 400);
assert_approx_equals(rect.y.animVal.value, 766.60, epsilon);
checkBaseValues();
}
function sample11() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 766.67, epsilon);
checkBaseValues();
}
function sample12() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 833.33, epsilon);
checkBaseValues();
}
function sample13() {
assert_equals(rect.x.animVal.value, 0);
assert_approx_equals(rect.y.animVal.value, 900, epsilon);
checkBaseValues();
}
smil_async_test((t) => {
rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
// All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample1],
["an1", 1.0, sample2],
["an1", 3.999, sample3],
["an1", 4.001, sample4],
["an1", 5.999, sample5],
["an1", 6.001, sample6],
["an1", 7.0, sample7],
["an1", 7.999, sample8],
["an1", 8.001, sample8],
["an1", 9.0, sample9],
["an1", 9.999, sample10],
["an1", 10.001, sample11],
["an1", 11.0, sample12],
["an1", 11.999, sample13],
["an1", 12.001, sample13],
["an1", 60.0, sample13]
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

View file

@ -0,0 +1,72 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>This by animation for all non-additive property types - should have no effect.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg id="svg" viewBox="0 0 200 200" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="filter">
<feConvolveMatrix id="feConvolveMatrix" kernelMatrix="0 1 0 0 1 0 0 1 0" order="6 6" targetX="5" preserveAlpha="false"/>
</filter>
</defs>
<rect id="rect" y="100" width="100" height="100" fill="black" filter="url(#filter)"/>
<!-- AnimatedBoolean -->
<animate id="an1" xlink:href="#feConvolveMatrix" attributeName="preserveAlpha" begin="0s" dur="4s" by="true" fill="freeze"/>
<!-- AnimatedEnumeration -->
<animate xlink:href="#filter" attributeName="filterUnits" begin="0s" dur="4s" by="userSpaceOnUse" fill="freeze"/>
<!-- AnimatedPreserveAspectRatio -->
<animate xlink:href="#svg" attributeName="preserveAspectRatio" begin="0s" dur="4s" by="xMaxYMax slice" fill="freeze"/>
<!-- AnimatedString -->
<animate xlink:href="#feConvolveMatrix" attributeName="result" begin="0s" dur="4s" by="test" fill="freeze"/>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function sample() {
assert_equals(feConvolveMatrix.preserveAlpha.animVal, false);
assert_equals(filter.filterUnits.animVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
assert_equals(svg.preserveAspectRatio.animVal.align, SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE);
assert_equals(svg.preserveAspectRatio.animVal.meetOrSlice, SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET);
assert_equals(feConvolveMatrix.result.animVal, "");
assert_equals(feConvolveMatrix.preserveAlpha.baseVal, false);
assert_equals(filter.filterUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
assert_equals(svg.preserveAspectRatio.baseVal.align, SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE);
assert_equals(svg.preserveAspectRatio.baseVal.meetOrSlice, SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET);
assert_equals(feConvolveMatrix.result.baseVal, "");
}
smil_async_test((t) => {
filter = rootSVGElement.ownerDocument.getElementsByTagName("filter")[0];
feConvolveMatrix = rootSVGElement.ownerDocument.getElementsByTagName("feConvolveMatrix")[0];
svg = rootSVGElement.ownerDocument.getElementsByTagName("svg")[0];
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample],
["an1", 1.999, sample],
["an1", 2.001, sample],
["an1", 3.999, sample],
["an1", 4.001, sample]
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

View file

@ -0,0 +1,72 @@
<!doctype html>
<html>
<meta charset="utf-8">
<title>This is a from by animation for all non-additive property types - should have no effect.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg id="svg" viewBox="0 0 200 200" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="filter">
<feConvolveMatrix id="feConvolveMatrix" kernelMatrix="0 1 0 0 1 0 0 1 0" order="6 6" targetX="5" preserveAlpha="false"/>
</filter>
</defs>
<rect id="rect" y="100" width="100" height="100" fill="black" filter="url(#filter)"/>
<!-- AnimatedBoolean -->
<animate id="an1" xlink:href="#feConvolveMatrix" attributeName="preserveAlpha" begin="0s" dur="4s" from="false" by="true" fill="freeze"/>
<!-- AnimatedEnumeration -->
<animate xlink:href="#filter" attributeName="filterUnits" begin="0s" dur="4s" from="objectBoundingBox" by="userSpaceOnUse" fill="freeze"/>
<!-- AnimatedPreserveAspectRatio -->
<animate xlink:href="#svg" attributeName="preserveAspectRatio" begin="0s" dur="4s" from="xMaxYMax meet" by="xMaxYMax slice" fill="freeze"/>
<!-- AnimatedString -->
<animate xlink:href="#feConvolveMatrix" attributeName="result" begin="0s" dur="4s" from="foo" by="test" fill="freeze"/>
</svg>
<script>
var rootSVGElement = document.querySelector("svg");
var epsilon = 1.0;
// Setup animation test
function sample() {
assert_equals(feConvolveMatrix.preserveAlpha.animVal, false);
assert_equals(filter.filterUnits.animVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
assert_equals(svg.preserveAspectRatio.animVal.align, SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE);
assert_equals(svg.preserveAspectRatio.animVal.meetOrSlice, SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET);
assert_equals(feConvolveMatrix.result.animVal, "");
assert_equals(feConvolveMatrix.preserveAlpha.baseVal, false);
assert_equals(filter.filterUnits.baseVal, SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
assert_equals(svg.preserveAspectRatio.baseVal.align, SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE);
assert_equals(svg.preserveAspectRatio.baseVal.meetOrSlice, SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET);
assert_equals(feConvolveMatrix.result.baseVal, "");
}
smil_async_test((t) => {
filter = rootSVGElement.ownerDocument.getElementsByTagName("filter")[0];
feConvolveMatrix = rootSVGElement.ownerDocument.getElementsByTagName("feConvolveMatrix")[0];
svg = rootSVGElement.ownerDocument.getElementsByTagName("svg")[0];
const expectedValues = [
// [animationId, time, sampleCallback]
["an1", 0.0, sample],
["an1", 1.999, sample],
["an1", 2.001, sample],
["an1", 3.999, sample],
["an1", 4.001, sample]
];
runAnimationTest(t, expectedValues);
});
window.animationStartsImmediately = true;
</script>

Some files were not shown because too many files have changed in this diff Show more