mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
Update web-platform-tests to revision 86e157b387e63ba586d8ad51d2fcd5690626f5ad
This commit is contained in:
parent
bc82521eb7
commit
b642b70974
54 changed files with 728 additions and 480 deletions
|
@ -74,7 +74,7 @@ backgroundFetchTest(async (test, backgroundFetch) => {
|
|||
// Skip `downloaded`, as the transfer may have started already.
|
||||
|
||||
const {type, results} = await getMessageFromServiceWorker();
|
||||
assert_equals('backgroundfetched', type);
|
||||
assert_equals('backgroundfetchsuccess', type);
|
||||
assert_equals(results.length, 1);
|
||||
|
||||
assert_true(results[0].url.includes('resources/feature-name.txt'));
|
||||
|
|
|
@ -2,7 +2,7 @@ importScripts('sw-helpers.js');
|
|||
|
||||
async function updateUI(event) {
|
||||
let updateParams = [];
|
||||
switch (event.id) {
|
||||
switch (event.registration.id) {
|
||||
case 'update-once':
|
||||
updateParams = [{title: 'Title1'}];
|
||||
break;
|
||||
|
@ -16,7 +16,7 @@ async function updateUI(event) {
|
|||
.catch(e => e.message);
|
||||
}
|
||||
|
||||
self.addEventListener('backgroundfetched', event => {
|
||||
self.addEventListener('backgroundfetchsuccess', event => {
|
||||
event.waitUntil(updateUI(event)
|
||||
.then(update => sendMessageToDocument({ type: event.type, update })))
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
importScripts('sw-helpers.js');
|
||||
|
||||
async function getFetchResult(settledFetch) {
|
||||
|
@ -11,7 +12,7 @@ async function getFetchResult(settledFetch) {
|
|||
};
|
||||
}
|
||||
|
||||
self.addEventListener('backgroundfetched', event => {
|
||||
self.addEventListener('backgroundfetchsuccess', event => {
|
||||
event.waitUntil(
|
||||
event.fetches.values()
|
||||
.then(fetches => Promise.all(fetches.map(fetch => getFetchResult(fetch))))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// META: script=resources/utils.js
|
||||
'use strict';
|
||||
|
||||
// Covers functionality provided by BackgroundFetchUpdateEvent.updateUI().
|
||||
// Covers functionality provided by BackgroundFetchUpdateUIEvent.updateUI().
|
||||
//
|
||||
// https://wicg.github.io/background-fetch/#backgroundfetchupdateuievent
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
.then(t.step_func(e => {
|
||||
assert_equals(e.blockedURI, "inline");
|
||||
assert_equals(e.lineNumber, 131);
|
||||
assert_equals(e.columnNumber, 4);
|
||||
assert_in_array(e.columnNumber, [4, 59]);
|
||||
assert_equals(e.target, document, "Elements created in this document, but pushed into a same-origin frame trigger on that frame's document, not on this frame's document.");
|
||||
return watcher.wait_for('securitypolicyviolation');
|
||||
}))
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
|
||||
<meta name=flags content="">
|
||||
<meta name=assert content="size containment does not apply to non atomic inlines">
|
||||
<link rel="match" href="../reference/pass_if_pass_below.html">
|
||||
<link rel="match" href="reference/pass_if_pass_below_clipped.html">
|
||||
<link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-size">
|
||||
|
||||
<style>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
|
||||
<meta name=flags content="">
|
||||
<meta name=assert content="size containment does not to apply ruby-base, which is an internal ruby element">
|
||||
<link rel="match" href="../reference/pass_if_pass_below.html">
|
||||
<link rel="match" href="reference/pass_if_pass_below_clipped.html">
|
||||
<link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-size">
|
||||
<link rel=help href="https://drafts.csswg.org/css-display-3/#internal-ruby-element">
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
|
||||
<meta name=flags content="">
|
||||
<meta name=assert content="size containment does not to apply ruby-base-container, which is an internal ruby element">
|
||||
<link rel="match" href="../reference/pass_if_pass_below.html">
|
||||
<link rel="match" href="reference/pass_if_pass_below_clipped.html">
|
||||
<link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-size">
|
||||
<link rel=help href="https://drafts.csswg.org/css-display-3/#internal-ruby-element">
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<title>CSS Containment Test: Size containment on table-cell</title>
|
||||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size">
|
||||
<link rel="match" href="../reference/pass_if_pass_below.html">
|
||||
<link rel="match" href="reference/pass_if_pass_below_clipped.html">
|
||||
<meta name=assert content="Size containment doesn't apply to table-cell elements.">
|
||||
<style>
|
||||
div {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<title>CSS Containment Test: Size containment on table</title>
|
||||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size">
|
||||
<link rel="match" href="../reference/pass_if_pass_below.html">
|
||||
<link rel="match" href="reference/pass_if_pass_below_clipped.html">
|
||||
<meta name=assert content="Size containment doesn't apply to table elements.">
|
||||
<style>
|
||||
div {
|
||||
|
|
|
@ -19,7 +19,7 @@ div::before, span::before {
|
|||
div::after {
|
||||
content: close-quote;
|
||||
}
|
||||
div {
|
||||
span {
|
||||
contain: style;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -19,10 +19,10 @@ div::before {
|
|||
div::after, span::after {
|
||||
content: close-quote;
|
||||
}
|
||||
div {
|
||||
span {
|
||||
contain: style;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Test passes if the text below is "A9Z" (not including the quotation marks).<p>
|
||||
<p>Test passes if the text below is "AZZ" (not including the quotation marks).<p>
|
||||
<div><span></span></div>
|
||||
|
|
|
@ -23,7 +23,7 @@ span::before {
|
|||
div::after {
|
||||
content: close-quote;
|
||||
}
|
||||
div {
|
||||
span {
|
||||
contain: style;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -23,7 +23,7 @@ span::after {
|
|||
div::after {
|
||||
content: close-quote;
|
||||
}
|
||||
div {
|
||||
span {
|
||||
contain: style;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -9,6 +9,9 @@ rtc {
|
|||
display: ruby-text-container;
|
||||
font-size: 1rem;
|
||||
}
|
||||
div {
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test passes if you can see the word PASS below.
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Reference rendering - passes if there is the word "PASS" below</title>
|
||||
<style>
|
||||
div { overflow: hidden; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if there is the word "PASS" below.</p>
|
||||
<div>PASS</div>
|
||||
</body>
|
||||
</html>
|
250
tests/wpt/web-platform-tests/css/css-logical/animation-004.html
Normal file
250
tests/wpt/web-platform-tests/css/css-logical/animation-004.html
Normal file
|
@ -0,0 +1,250 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Animating CSS logical properties using CSS Transitions</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-logical/#box">
|
||||
<meta name="assert" content="The specified values of these properties are separate from the specified values of the parallel physical properties, but the flow-relative and physical properties share computed values.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../css-animations/support/testcommon.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
const testEl = document.getElementById("test");
|
||||
|
||||
function makeDeclaration(object = {}) {
|
||||
return Object.entries(object).map(([prop, val]) => prop + ": " + val).join("; ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a CSS transition in testEl. By default, the transition will affect the properies
|
||||
* specified in finalStyles, be linear, last 10 seconds and start halfway, but this can be
|
||||
* overridden in baseStyles.
|
||||
*
|
||||
* @param t The testharness.js Test object.
|
||||
* @param baseStyles A dictionary object with property names and values to set on the
|
||||
* element before starting the transition.
|
||||
* @param finalStyles A dictionary object with property names and values towards which
|
||||
* the element will transition.
|
||||
*/
|
||||
function transition(t, baseStyles, finalStyles) {
|
||||
// Clear styles from previous test.
|
||||
testEl.style.cssText = "";
|
||||
testEl.className = "";
|
||||
getComputedStyle(testEl).height;
|
||||
|
||||
// Set base styles
|
||||
const defaultTransition = {
|
||||
"transition-property": Object.keys(finalStyles).join(", "),
|
||||
"transition-timing-function": "linear",
|
||||
"transition-duration": "10s",
|
||||
"transition-delay": "-5s",
|
||||
};
|
||||
addStyle(t, {
|
||||
"#test": makeDeclaration(Object.assign(defaultTransition, baseStyles)),
|
||||
"#test.transition": makeDeclaration(finalStyles),
|
||||
});
|
||||
getComputedStyle(testEl).height;
|
||||
|
||||
// Start the transition
|
||||
testEl.className = "transition";
|
||||
}
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"block-size": "0px",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).height, '50px');
|
||||
}, 'Logical properties can be transitioned');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"block-size": "0px",
|
||||
"writing-mode": "vertical-rl",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).width, '50px');
|
||||
assert_equals(getComputedStyle(testEl).height, '0px');
|
||||
}, 'Logical properties in transitions respect the writing-mode');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"margin-inline-start": "0px",
|
||||
"direction": "rtl",
|
||||
}, {
|
||||
"margin-inline-start": "100px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).marginLeft, '0px');
|
||||
assert_equals(getComputedStyle(testEl).marginRight, '50px');
|
||||
}, 'Logical properties in transitions respect the direction');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"block-size": "0px",
|
||||
"height": "200px",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
"height": "300px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).height, '250px');
|
||||
}, 'Declaration order is respected within declaration blocks');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"transition-timing-function": "step-start",
|
||||
}, {
|
||||
"margin-top": "200px",
|
||||
"margin-block-start": "100px"
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).marginTop, '100px');
|
||||
}, 'Logical properties are able to override physical properties in declaration blocks');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"transition-timing-function": "step-start",
|
||||
}, {
|
||||
"margin-inline": "200px",
|
||||
"margin-inline-start": "0px",
|
||||
"margin-inline-start": "100px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).marginLeft, '100px');
|
||||
}, 'Declaration order is respected amongst logical properties within declaration blocks');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"block-size": "200px",
|
||||
}, {
|
||||
"height": "300px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).height, '250px');
|
||||
}, 'Physical properties and logical properties can be mixed');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"height": "100px",
|
||||
"block-size": "200px",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
"height": "300px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).height, '250px');
|
||||
}, 'Declaration order is respected on each keyframe individually');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"width": "0px",
|
||||
"height": "0px",
|
||||
"block-size": "0px",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).width, '0px');
|
||||
assert_equals(getComputedStyle(testEl).height, '50px');
|
||||
|
||||
testEl.style.writingMode = 'vertical-rl';
|
||||
assert_equals(getComputedStyle(testEl).width, '50px');
|
||||
assert_equals(getComputedStyle(testEl).height, '0px');
|
||||
}, 'Transitions update when the writing-mode is changed');
|
||||
|
||||
promise_test(async t => {
|
||||
transition(t, {
|
||||
"transition-delay": "-9.9s",
|
||||
"width": "0px",
|
||||
"height": "0px",
|
||||
"block-size": "0px",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
});
|
||||
const watcher = new EventWatcher(t, testEl, [ 'transitionend' ]);
|
||||
await watcher.wait_for('transitionend');
|
||||
|
||||
assert_equals(getComputedStyle(testEl).width, '0px');
|
||||
assert_equals(getComputedStyle(testEl).height, '100px');
|
||||
|
||||
testEl.style.transition = 'none';
|
||||
testEl.style.writingMode = 'vertical-rl';
|
||||
assert_equals(getComputedStyle(testEl).width, '100px');
|
||||
assert_equals(getComputedStyle(testEl).height, '0px');
|
||||
}, 'Filling transitions update when the writing-mode is changed');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"width": "0px",
|
||||
"height": "0px",
|
||||
}, {
|
||||
"block-size": "100px",
|
||||
"height": "200px",
|
||||
});
|
||||
|
||||
// Initially we are interpolating the height from 0 to 200px
|
||||
assert_equals(getComputedStyle(testEl).width, '0px');
|
||||
assert_equals(getComputedStyle(testEl).height, '100px');
|
||||
|
||||
// But once we change the writing-mode, we will be interpolating *both*
|
||||
// the height (from 0px to 200px) *and* the width (from 0px to 100px).
|
||||
testEl.style.writingMode = 'vertical-rl';
|
||||
assert_equals(getComputedStyle(testEl).width, '50px');
|
||||
assert_equals(getComputedStyle(testEl).height, '100px');
|
||||
}, 'The number of interpolating properties can be increased when the'
|
||||
+ ' writing-mode is changed');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"width": "100px",
|
||||
"height": "100px",
|
||||
}, {
|
||||
"width": "500px",
|
||||
"block-size": "200px",
|
||||
});
|
||||
|
||||
// Initially we are interpolating the width (100px -> 500px) and the height
|
||||
// (100px -> 200px).
|
||||
assert_equals(getComputedStyle(testEl).width, '300px');
|
||||
assert_equals(getComputedStyle(testEl).height, '150px');
|
||||
|
||||
// Once we change the writing-mode, we will be interpolating *only* the
|
||||
// width (300px -> 200px).
|
||||
testEl.style.writingMode = 'vertical-rl';
|
||||
assert_equals(getComputedStyle(testEl).width, '250px');
|
||||
assert_equals(getComputedStyle(testEl).height, '100px');
|
||||
}, 'The number of interpolating properties can be decreased when the'
|
||||
+ ' writing-mode is changed');
|
||||
|
||||
test(t => {
|
||||
addStyle(t, { ':root': '--writingMode: horizontal-tb' });
|
||||
transition(t, {
|
||||
"width": "0px",
|
||||
"height": "0px",
|
||||
"writing-mode": "var(--writingMode)",
|
||||
"block-size": "0px",
|
||||
}, {
|
||||
"block-size": "100px"
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).width, '0px');
|
||||
assert_equals(getComputedStyle(testEl).height, '50px');
|
||||
|
||||
testEl.style.setProperty('--writingMode', 'vertical-rl');
|
||||
assert_equals(getComputedStyle(testEl).width, '50px');
|
||||
assert_equals(getComputedStyle(testEl).height, '0px');
|
||||
}, 'Transitions update when the writing-mode is changed through a CSS variable');
|
||||
|
||||
test(t => {
|
||||
transition(t, {
|
||||
"margin-inline-start": "0px",
|
||||
}, {
|
||||
"margin-inline-start": "100px",
|
||||
});
|
||||
assert_equals(getComputedStyle(testEl).marginLeft, '50px');
|
||||
assert_equals(getComputedStyle(testEl).marginRight, '0px');
|
||||
|
||||
testEl.style.direction = 'rtl';
|
||||
assert_equals(getComputedStyle(testEl).marginLeft, '0px');
|
||||
assert_equals(getComputedStyle(testEl).marginRight, '50px');
|
||||
}, 'Transitions update when the direction is changed');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Custom elements: Range APIs should invoke constructor in tree order</title>
|
||||
<meta name="author" title="Edgar Chen" href="mailto:echen@mozilla.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element">
|
||||
<link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
|
||||
<line rel="help" href="https://dom.spec.whatwg.org/#concept-range-extract">
|
||||
<line rel="help" href="https://dom.spec.whatwg.org/#concept-range-clone">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
|
||||
<c-e data-index="root">
|
||||
<c-e data-index="root-0">
|
||||
<c-e data-index="root-0-0">
|
||||
<c-e data-index="root-0-0-0"></c-e>
|
||||
<span id="start"></span>
|
||||
</c-e>
|
||||
</c-e>
|
||||
<c-e data-index="root-1"></c-e>
|
||||
<span id="end"></span>
|
||||
</c-e>
|
||||
|
||||
<script>
|
||||
|
||||
var logs = [];
|
||||
class CE extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
logs.push(this.dataset.index);
|
||||
}
|
||||
}
|
||||
customElements.define('c-e', CE);
|
||||
|
||||
function getRange() {
|
||||
const range = new Range();
|
||||
range.setStart(document.getElementById('start'), 0);
|
||||
range.setEnd(document.getElementById('end'), 0);
|
||||
return range;
|
||||
}
|
||||
|
||||
test(function () {
|
||||
// Clear log for testing.
|
||||
logs = [];
|
||||
getRange().cloneContents();
|
||||
assert_array_equals(logs, ['root-0', 'root-0-0', 'root-1']);
|
||||
}, 'Range.cloneContents should invoke constructor in tree order');
|
||||
|
||||
test(function () {
|
||||
// Clear log for testing.
|
||||
logs = [];
|
||||
getRange().extractContents();
|
||||
assert_array_equals(logs, ['root-0', 'root-0-0']);
|
||||
}, 'Range.extractContents should invoke constructor in tree order');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -604,7 +604,7 @@ test(function() {
|
|||
test(function() {
|
||||
var el = document.createElement("div");
|
||||
var other = document.createElement("div");
|
||||
attr = document.createAttribute("foo");
|
||||
var attr = document.createAttribute("foo");
|
||||
assert_equals(el.setAttributeNode(attr), null);
|
||||
assert_equals(attr.ownerElement, el);
|
||||
assert_throws("INUSE_ATTRIBUTE_ERR",
|
||||
|
@ -614,7 +614,7 @@ test(function() {
|
|||
|
||||
test(function() {
|
||||
var el = document.createElement("div");
|
||||
attr = document.createAttribute("foo");
|
||||
var attr = document.createAttribute("foo");
|
||||
assert_equals(el.setAttributeNode(attr), null);
|
||||
el.setAttribute("bar", "qux");
|
||||
assert_equals(el.setAttributeNode(attr), attr);
|
||||
|
|
|
@ -30,4 +30,13 @@ test(() => {
|
|||
test(() => {
|
||||
assert_equals(self.getComputedStyle(document.getElementsByTagName("applet")[0], "").cssFloat, "none");
|
||||
}, "applet is not styled")
|
||||
|
||||
// removed in https://github.com/whatwg/html/commit/e383ae23776362cafb2fb4bbba70c8c9080d4b0f
|
||||
test(() => {
|
||||
assert_false("HTMLTableDataCellElement" in window);
|
||||
}, "HTMLTableDataCellElement interface is removed")
|
||||
|
||||
test(() => {
|
||||
assert_false("HTMLTableHeaderCellElement" in window);
|
||||
}, "HTMLTableHeaderCellElement interface is removed")
|
||||
</script>
|
||||
|
|
|
@ -114,12 +114,15 @@ test(() => {
|
|||
test(() => {
|
||||
const select = document.getElementById("select-same-object-change");
|
||||
const before = select.selectedOptions;
|
||||
assert_equals(before.length, 3);
|
||||
|
||||
select.selectedOptions[1].selected = false;
|
||||
|
||||
const after = select.selectedOptions;
|
||||
|
||||
assert_equals(before, after);
|
||||
assert_equals(before.length, 2);
|
||||
assert_equals(after.length, 2);
|
||||
|
||||
}, ".selectedOptions should return the same object after selection changes - [SameObject]");
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Encoding specified in the "charset" attribute should have precedence over "content" attribute.</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" charset="iso-8859-15">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inhead">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
test(function () {
|
||||
assert_equals(document.characterSet, "ISO-8859-15");
|
||||
}, "Encoding specified in the 'charset' attribute should have precedence over 'content' attribute.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -673,11 +673,16 @@ SVGScriptElement includes SVGURIReference;
|
|||
[Exposed=Window]
|
||||
interface SVGAElement : SVGGraphicsElement {
|
||||
[SameObject] readonly attribute SVGAnimatedString target;
|
||||
[SameObject] readonly attribute SVGAnimatedString download;
|
||||
[SameObject] readonly attribute SVGAnimatedString rel;
|
||||
[SameObject] readonly attribute SVGAnimatedString relList;
|
||||
[SameObject] readonly attribute SVGAnimatedString hreflang;
|
||||
[SameObject] readonly attribute SVGAnimatedString type;
|
||||
attribute DOMString download;
|
||||
attribute USVString ping;
|
||||
attribute DOMString rel;
|
||||
[SameObject, PutsForward=value] readonly attribute DOMTokenList relList;
|
||||
attribute DOMString hreflang;
|
||||
attribute DOMString type;
|
||||
|
||||
attribute DOMString text;
|
||||
|
||||
attribute DOMString referrerPolicy;
|
||||
};
|
||||
|
||||
SVGAElement includes SVGURIReference;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// GENERATED CONTENT - DO NOT EDIT
|
||||
// Content of this file was automatically extracted from the
|
||||
// "Background Fetch" spec.
|
||||
// See: https://wicg.github.io/background-fetch/
|
||||
// Content was automatically extracted by Reffy into reffy-reports
|
||||
// (https://github.com/tidoust/reffy-reports)
|
||||
// Source: Background Fetch (https://wicg.github.io/background-fetch/)
|
||||
|
||||
partial interface ServiceWorkerGlobalScope {
|
||||
attribute EventHandler onbackgroundfetched;
|
||||
attribute EventHandler onbackgroundfetchsuccess;
|
||||
attribute EventHandler onbackgroundfetchfail;
|
||||
attribute EventHandler onbackgroundfetchabort;
|
||||
attribute EventHandler onbackgroundfetchclick;
|
||||
|
@ -22,9 +22,12 @@ interface BackgroundFetchManager {
|
|||
// TODO: in future this should become an async iterator for BackgroundFetchRegistration objects
|
||||
};
|
||||
|
||||
dictionary BackgroundFetchOptions {
|
||||
dictionary BackgroundFetchUIOptions {
|
||||
sequence<IconDefinition> icons = [];
|
||||
DOMString title = "";
|
||||
};
|
||||
|
||||
dictionary BackgroundFetchOptions : BackgroundFetchUIOptions {
|
||||
unsigned long long downloadTotal = 0;
|
||||
};
|
||||
|
||||
|
@ -43,73 +46,50 @@ interface BackgroundFetchRegistration : EventTarget {
|
|||
readonly attribute unsigned long long uploaded;
|
||||
readonly attribute unsigned long long downloadTotal;
|
||||
readonly attribute unsigned long long downloaded;
|
||||
readonly attribute BackgroundFetchActiveFetches activeFetches;
|
||||
readonly attribute BackgroundFetchState state;
|
||||
readonly attribute BackgroundFetchFailureReason failureReason;
|
||||
|
||||
attribute EventHandler onprogress;
|
||||
|
||||
Promise<boolean> abort();
|
||||
Promise<BackgroundFetchRecord> match(RequestInfo request, optional CacheQueryOptions options);
|
||||
Promise<sequence<BackgroundFetchRecord>> matchAll(optional RequestInfo request, optional CacheQueryOptions options);
|
||||
};
|
||||
|
||||
enum BackgroundFetchState { "pending", "success", "failure" };
|
||||
|
||||
enum BackgroundFetchFailureReason {
|
||||
"",
|
||||
// The operation was aborted by the user, or abort() was called.
|
||||
"aborted",
|
||||
// A response had a not-ok-status.
|
||||
"bad-status",
|
||||
// A fetch failed for other reasons, e.g. CORS, MIX, an invalid partial response,
|
||||
// or a general network failure for a fetch that cannot be retried.
|
||||
"fetch-error",
|
||||
// Storage quota was reached during the operation.
|
||||
"quota-exceeded",
|
||||
// The provided downloadTotal was exceeded.
|
||||
"total-download-exceeded"
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface BackgroundFetchActiveFetches {
|
||||
Promise<BackgroundFetchActiveFetch> match(RequestInfo request, optional CacheQueryOptions options);
|
||||
Promise<sequence<BackgroundFetchActiveFetch>> matchAll(RequestInfo request, optional CacheQueryOptions options);
|
||||
Promise<sequence<BackgroundFetchActiveFetch>> values();
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface BackgroundFetchActiveFetch : BackgroundFetchFetch {
|
||||
readonly attribute Promise<Response> responseReady;
|
||||
// In future this will include a fetch observer
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface BackgroundFetchFetch {
|
||||
interface BackgroundFetchRecord {
|
||||
readonly attribute Request request;
|
||||
readonly attribute Promise<Response> responseReady;
|
||||
// TODO: In future this will include a fetch observer
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, BackgroundFetchEventInit init), Exposed=ServiceWorker]
|
||||
interface BackgroundFetchEvent : ExtendableEvent {
|
||||
readonly attribute DOMString id;
|
||||
readonly attribute BackgroundFetchRegistration registration;
|
||||
};
|
||||
|
||||
dictionary BackgroundFetchEventInit : ExtendableEventInit {
|
||||
required DOMString id;
|
||||
required BackgroundFetchRegistration registration;
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, BackgroundFetchSettledEventInit init), Exposed=ServiceWorker]
|
||||
interface BackgroundFetchSettledEvent : BackgroundFetchEvent {
|
||||
readonly attribute BackgroundFetchSettledFetches fetches;
|
||||
[Constructor(DOMString type, BackgroundFetchEventInit init), Exposed=ServiceWorker]
|
||||
interface BackgroundFetchUpdateUIEvent : BackgroundFetchEvent {
|
||||
Promise<void> updateUI(optional BackgroundFetchUIOptions options);
|
||||
};
|
||||
|
||||
dictionary BackgroundFetchSettledEventInit : BackgroundFetchEventInit {
|
||||
required BackgroundFetchSettledFetches fetches;
|
||||
};
|
||||
|
||||
[Exposed=ServiceWorker]
|
||||
interface BackgroundFetchSettledFetches {
|
||||
Promise<BackgroundFetchSettledFetch> match(RequestInfo request, optional CacheQueryOptions options);
|
||||
Promise<sequence<BackgroundFetchSettledFetch>> matchAll(RequestInfo request, optional CacheQueryOptions options);
|
||||
Promise<sequence<BackgroundFetchSettledFetch>> values();
|
||||
};
|
||||
|
||||
[Exposed=ServiceWorker]
|
||||
interface BackgroundFetchSettledFetch : BackgroundFetchFetch {
|
||||
readonly attribute Response? response;
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, BackgroundFetchSettledEventInit init), Exposed=ServiceWorker]
|
||||
interface BackgroundFetchUpdateEvent : BackgroundFetchSettledEvent {
|
||||
Promise<void> updateUI(DOMString title);
|
||||
};
|
||||
|
||||
[Constructor(DOMString type, BackgroundFetchClickEventInit init), Exposed=ServiceWorker]
|
||||
interface BackgroundFetchClickEvent : BackgroundFetchEvent {
|
||||
readonly attribute BackgroundFetchState state;
|
||||
};
|
||||
|
||||
dictionary BackgroundFetchClickEventInit : BackgroundFetchEventInit {
|
||||
required BackgroundFetchState state;
|
||||
};
|
||||
|
||||
enum BackgroundFetchState { "pending", "succeeded", "failed" };
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// GENERATED CONTENT - DO NOT EDIT
|
||||
// Content of this file was automatically extracted from the
|
||||
// "CSS Painting API Level 1" spec.
|
||||
// See: https://drafts.css-houdini.org/css-paint-api-1/
|
||||
// Content was automatically extracted by Reffy into reffy-reports
|
||||
// (https://github.com/tidoust/reffy-reports)
|
||||
// Source: CSS Painting API Level 1 (https://drafts.css-houdini.org/css-paint-api-1/)
|
||||
|
||||
partial interface CSS {
|
||||
partial namespace CSS {
|
||||
[SameObject] readonly attribute Worklet paintWorklet;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// GENERATED CONTENT - DO NOT EDIT
|
||||
// Content of this file was automatically extracted from the
|
||||
// "WebRTC 1.0: Real-time Communication Between Browsers" spec.
|
||||
// See: https://w3c.github.io/webrtc-pc/
|
||||
// Content was automatically extracted by Reffy into reffy-reports
|
||||
// (https://github.com/tidoust/reffy-reports)
|
||||
// Source: WebRTC 1.0: Real-time Communication Between Browsers (https://w3c.github.io/webrtc-pc/)
|
||||
|
||||
dictionary RTCConfiguration {
|
||||
sequence<RTCIceServer> iceServers;
|
||||
|
@ -105,7 +105,7 @@ interface RTCPeerConnection : EventTarget {
|
|||
readonly attribute RTCSessionDescription? remoteDescription;
|
||||
readonly attribute RTCSessionDescription? currentRemoteDescription;
|
||||
readonly attribute RTCSessionDescription? pendingRemoteDescription;
|
||||
Promise<void> addIceCandidate((RTCIceCandidateInit or RTCIceCandidate) candidate);
|
||||
Promise<void> addIceCandidate(RTCIceCandidateInit candidate);
|
||||
readonly attribute RTCSignalingState signalingState;
|
||||
readonly attribute RTCIceGatheringState iceGatheringState;
|
||||
readonly attribute RTCIceConnectionState iceConnectionState;
|
||||
|
@ -129,7 +129,7 @@ partial interface RTCPeerConnection {
|
|||
Promise<void> setLocalDescription(RTCSessionDescriptionInit description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
Promise<void> createAnswer(RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
Promise<void> setRemoteDescription(RTCSessionDescriptionInit description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
Promise<void> addIceCandidate((RTCIceCandidateInit or RTCIceCandidate) candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
Promise<void> addIceCandidate(RTCIceCandidateInit candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
|
||||
};
|
||||
|
||||
callback RTCPeerConnectionErrorCallback = void (DOMException error);
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Navigation Timing 2 IDL tests</title>
|
||||
<link rel="author" title="Google" href="http://www.google.com/" />
|
||||
<link rel="help" href="http://www.w3.org/TR/navigation-timing-2/#sec-PerformanceNavigationTiming"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/WebIDLParser.js"></script>
|
||||
<script src="/resources/idlharness.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<pre id='untested_idl' style='display:none'>
|
||||
|
||||
interface PerformanceResourceTiming : PerformanceEntry {
|
||||
readonly attribute DOMString initiatorType;
|
||||
readonly attribute DOMHighResTimeStamp workerStart;
|
||||
readonly attribute DOMHighResTimeStamp redirectStart;
|
||||
readonly attribute DOMHighResTimeStamp redirectEnd;
|
||||
readonly attribute DOMHighResTimeStamp fetchStart;
|
||||
readonly attribute DOMHighResTimeStamp domainLookupStart;
|
||||
readonly attribute DOMHighResTimeStamp domainLookupEnd;
|
||||
readonly attribute DOMHighResTimeStamp connectStart;
|
||||
readonly attribute DOMHighResTimeStamp connectEnd;
|
||||
readonly attribute DOMHighResTimeStamp secureConnectionStart;
|
||||
readonly attribute DOMHighResTimeStamp requestStart;
|
||||
readonly attribute DOMHighResTimeStamp responseStart;
|
||||
readonly attribute DOMHighResTimeStamp responseEnd;
|
||||
[MeasureAs=PerformanceResourceTimingSizes] readonly attribute unsigned long long transferSize;
|
||||
[MeasureAs=PerformanceResourceTimingSizes] readonly attribute unsigned long long encodedBodySize;
|
||||
[MeasureAs=PerformanceResourceTimingSizes] readonly attribute unsigned long long decodedBodySize;
|
||||
};
|
||||
interface PerformanceEntry {};
|
||||
</pre>
|
||||
|
||||
<pre id='idl'>
|
||||
enum NavigationType {
|
||||
"navigate",
|
||||
"reload",
|
||||
"back_forward",
|
||||
"prerender"
|
||||
};
|
||||
|
||||
interface PerformanceNavigationTiming : PerformanceResourceTiming {
|
||||
readonly attribute DOMHighResTimeStamp unloadEventStart;
|
||||
readonly attribute DOMHighResTimeStamp unloadEventEnd;
|
||||
readonly attribute DOMHighResTimeStamp domInteractive;
|
||||
readonly attribute DOMHighResTimeStamp domContentLoadedEventStart;
|
||||
readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd;
|
||||
readonly attribute DOMHighResTimeStamp domComplete;
|
||||
readonly attribute DOMHighResTimeStamp loadEventStart;
|
||||
readonly attribute DOMHighResTimeStamp loadEventEnd;
|
||||
readonly attribute NavigationType type;
|
||||
readonly attribute unsigned short redirectCount;
|
||||
[Default] object toJSON();
|
||||
};
|
||||
</pre>
|
||||
|
||||
<script>
|
||||
function test_idl() {
|
||||
var idl_array = new IdlArray();
|
||||
|
||||
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
|
||||
idl_array.add_idls(document.getElementById("idl").textContent);
|
||||
|
||||
idl_array.test();
|
||||
}
|
||||
test_idl();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -11,12 +11,12 @@ const elements = [
|
|||
'svg',
|
||||
'g',
|
||||
'defs',
|
||||
'Desc',
|
||||
'desc',
|
||||
'title',
|
||||
'symbol',
|
||||
'use',
|
||||
'image',
|
||||
'Switch',
|
||||
'switch',
|
||||
'style',
|
||||
'path',
|
||||
'rect',
|
||||
|
@ -49,8 +49,7 @@ const elements = [
|
|||
'animate',
|
||||
'set',
|
||||
'animateMotion',
|
||||
'mPath',
|
||||
'animateColor',
|
||||
'mpath',
|
||||
'animateColor',
|
||||
'animateTransform',
|
||||
'font',
|
||||
|
@ -127,12 +126,12 @@ idl_test(
|
|||
SVGSVGElement: ['objects.svg'],
|
||||
SVGGElement: ['objects.g'],
|
||||
SVGDefsElement: ['objects.defs'],
|
||||
SVGDescElement: ['objects.Desc'],
|
||||
SVGDescElement: ['objects.desc'],
|
||||
SVGTitleElement: ['objects.title'],
|
||||
SVGSymbolElement: ['objects.symbol'],
|
||||
SVGUseElement: ['objects.use'],
|
||||
SVGImageElement: ['objects.image'],
|
||||
SVGSwitchElement: ['objects.Switch'],
|
||||
SVGSwitchElement: ['objects.switch'],
|
||||
SVGStyleElement: ['objects.style'],
|
||||
SVGPoint: ['objects.svg.createSVGPoint()'],
|
||||
SVGPointList: ['objects.polygon.points'],
|
||||
|
@ -193,7 +192,7 @@ idl_test(
|
|||
SVGAnimateElement: ['objects.animate'],
|
||||
SVGSetElement: ['objects.set'],
|
||||
SVGAnimateMotionElement: ['objects.animateMotion'],
|
||||
SVGMPathElement: ['objects.mPath'],
|
||||
SVGMPathElement: ['objects.mpath'],
|
||||
SVGAnimateColorElement: ['objects.animateColor'],
|
||||
SVGAnimateTransformElement: ['objects.animateTransform'],
|
||||
SVGFontElement: ['objects.font'],
|
||||
|
|
|
@ -51,11 +51,11 @@
|
|||
<use xlink:href="#path"/>
|
||||
</g>
|
||||
<g transform="translate(240,220)">
|
||||
<use xlink:href="#path"/>
|
||||
<use xlink:href="#path" style="marker:none"/>
|
||||
<use xlink:href="#path" style="stroke:none"/>
|
||||
</g>
|
||||
<g transform="translate(360,220)">
|
||||
<use xlink:href="#path"/>
|
||||
<use xlink:href="#path" style="stroke:none"/>
|
||||
<use xlink:href="#path" style="marker:none"/>
|
||||
</g>
|
||||
<g transform="translate(120,320)">
|
||||
|
@ -63,10 +63,10 @@
|
|||
</g>
|
||||
<g transform="translate(240,320)">
|
||||
<use xlink:href="#path"/>
|
||||
<use xlink:href="#path" style="stroke:none"/>
|
||||
<use xlink:href="#path" style="stroke:none;marker:none"/>
|
||||
</g>
|
||||
<g transform="translate(360,320)">
|
||||
<use xlink:href="#path"/>
|
||||
<use xlink:href="#path" style="stroke:none"/>
|
||||
<use xlink:href="#path" style="marker:none"/>
|
||||
</g>
|
||||
</g>
|
||||
|
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
@ -1,7 +1,7 @@
|
|||
from setuptools import setup
|
||||
|
||||
PACKAGE_VERSION = '2.0'
|
||||
deps = ["six>=1.8"]
|
||||
deps = ["six>=1.8", "h2==3.0.1"]
|
||||
|
||||
setup(name='wptserve',
|
||||
version=PACKAGE_VERSION,
|
||||
|
|
20
tests/wpt/web-platform-tests/uievents/idlharness.window.js
Normal file
20
tests/wpt/web-platform-tests/uievents/idlharness.window.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
|
||||
'use strict';
|
||||
|
||||
idl_test(
|
||||
['uievents'],
|
||||
['dom'],
|
||||
idl_array => {
|
||||
idl_array.add_objects({
|
||||
FocusEvent: ['new FocusEvent("event")'],
|
||||
MouseEvent: ['new MouseEvent("event")'],
|
||||
WheelEvent: ['new WheelEvent("event")'],
|
||||
KeyboardEvent: ['new KeyboardEvent("event")'],
|
||||
CompositionEvent: ['new CompositionEvent("event")'],
|
||||
UIEvent: ['new UIEvent("event")'],
|
||||
InputEvent: ['new InputEvent("event")'],
|
||||
});
|
||||
}
|
||||
);
|
|
@ -1,48 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>UI Events IDL tests</title>
|
||||
<meta name=timeout content=long>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/resources/WebIDLParser.js></script>
|
||||
<script src=/resources/idlharness.js></script>
|
||||
|
||||
<h1>UI Events IDL tests</h1>
|
||||
<div id=log></div>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
function doTest([dom, uievents]) {
|
||||
var idlArray = new IdlArray();
|
||||
idlArray.add_untested_idls(dom);
|
||||
idlArray.add_idls(uievents);
|
||||
|
||||
idlArray.add_objects({
|
||||
FocusEvent: ['new FocusEvent("event")'],
|
||||
MouseEvent: ['new MouseEvent("event")'],
|
||||
WheelEvent: ['new WheelEvent("event")'],
|
||||
KeyboardEvent: ['new KeyboardEvent("event")'],
|
||||
CompositionEvent: ['new CompositionEvent("event")'],
|
||||
UIEvent: ['new UIEvent("event")'],
|
||||
InputEvent: ['new InputEvent("event")'],
|
||||
});
|
||||
idlArray.test();
|
||||
};
|
||||
|
||||
function fetchData(url) {
|
||||
return fetch(url).then((response) => response.text());
|
||||
}
|
||||
|
||||
function waitForLoad() {
|
||||
return new Promise(function(resolve) {
|
||||
addEventListener("load", resolve);
|
||||
});
|
||||
}
|
||||
|
||||
promise_test(function() {
|
||||
return Promise.all([fetchData("/interfaces/dom.idl"),
|
||||
fetchData("/interfaces/uievents.idl")])
|
||||
.then(doTest);
|
||||
}, "Test driver");
|
||||
|
||||
</script>
|
|
@ -1,23 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>IDL harness tests for Vibration API</title>
|
||||
<body>
|
||||
<h1>Description</h1>
|
||||
<p>
|
||||
This test validates the IDL defined by the Vibration API.
|
||||
</p>
|
||||
<p>
|
||||
This test uses <a href="/resources/idlharness.js">idlharness.js</a>
|
||||
</p>
|
||||
<div id="log"></div>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/resources/WebIDLParser.js></script>
|
||||
<script src=/resources/idlharness.js></script>
|
||||
<script>
|
||||
var idl_array = new IdlArray();
|
||||
idl_array.add_untested_idls("interface Navigator {};");
|
||||
idl_array.add_idls("partial interface Navigator { boolean vibrate ((unsigned long or sequence<unsigned long>) pattern);};");
|
||||
idl_array.add_objects({Navigator: ['navigator']});
|
||||
idl_array.test();
|
||||
</script>
|
12
tests/wpt/web-platform-tests/vibration/idlharness.window.js
Normal file
12
tests/wpt/web-platform-tests/vibration/idlharness.window.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
|
||||
'use strict';
|
||||
|
||||
idl_test(
|
||||
['vibration'],
|
||||
['html'],
|
||||
idl_array => {
|
||||
idl_array.add_objects({Navigator: ['navigator']});
|
||||
}
|
||||
);
|
|
@ -0,0 +1,104 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test that DelayNode output channelCount matches that of the delayed input</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
// See https://github.com/WebAudio/web-audio-api/issues/25
|
||||
|
||||
// sampleRate is a power of two so that delay times are exact in base-2
|
||||
// floating point arithmetic.
|
||||
const SAMPLE_RATE = 32768;
|
||||
// Arbitrary delay time in frames (but this is assumed a multiple of block
|
||||
// size below):
|
||||
const DELAY_FRAMES = 3 * 128;
|
||||
// Implementations may apply interpolation to input samples, which can spread
|
||||
// the effect of input with larger channel counts over neighbouring blocks.
|
||||
// This test ignores enough neighbouring blocks to ignore the effects of
|
||||
// filter radius of up to this number of frames:
|
||||
const INTERPOLATION_GRACE = 128;
|
||||
// Number of frames of DelayNode output that are known to be stereo:
|
||||
const STEREO_FRAMES = 128;
|
||||
// The delay will be increased at this frame to switch DelayNode output back
|
||||
// to mono.
|
||||
const MONO_OUTPUT_START_FRAME =
|
||||
DELAY_FRAMES + INTERPOLATION_GRACE + STEREO_FRAMES;
|
||||
// Number of frames of output that are known to be mono after the known stereo
|
||||
// and interpolation grace.
|
||||
const MONO_FRAMES = 128;
|
||||
// Total length allows for interpolation after effects of stereo input are
|
||||
// finished and one block to test return to mono output:
|
||||
const TOTAL_LENGTH =
|
||||
MONO_OUTPUT_START_FRAME + INTERPOLATION_GRACE + MONO_FRAMES;
|
||||
// maxDelayTime, is a multiple of block size, because the Gecko implementation
|
||||
// once had a bug with delayTime = maxDelayTime in this situation:
|
||||
const MAX_DELAY_FRAMES = TOTAL_LENGTH + INTERPOLATION_GRACE;
|
||||
|
||||
promise_test(() => {
|
||||
let context = new OfflineAudioContext({numberOfChannels: 1,
|
||||
length: TOTAL_LENGTH,
|
||||
sampleRate: SAMPLE_RATE});
|
||||
|
||||
// Only channel 1 of the splitter is connected to the destination.
|
||||
let splitter = new ChannelSplitterNode(context, {numberOfOutputs: 2});
|
||||
splitter.connect(context.destination, 1);
|
||||
|
||||
// A gain node has channelCountMode "max" and channelInterpretation
|
||||
// "speakers", and so will up-mix a mono input when there is stereo input.
|
||||
let gain = new GainNode(context);
|
||||
gain.connect(splitter);
|
||||
|
||||
// The delay node initially outputs a single channel of silence, when it
|
||||
// does not have enough signal in its history to output what it has
|
||||
// previously received. After the delay period, it will then output the
|
||||
// stereo signal it received.
|
||||
let delay =
|
||||
new DelayNode(context,
|
||||
{maxDelayTime: MAX_DELAY_FRAMES / context.sampleRate,
|
||||
delayTime: DELAY_FRAMES / context.sampleRate});
|
||||
// Schedule an increase in the delay to return to mono silent output from
|
||||
// the unfilled portion of the DelayNode's buffer.
|
||||
delay.delayTime.setValueAtTime(MAX_DELAY_FRAMES / context.sampleRate,
|
||||
MONO_OUTPUT_START_FRAME / context.sampleRate);
|
||||
delay.connect(gain);
|
||||
|
||||
let stereoMerger = new ChannelMergerNode(context, {numberOfInputs: 2});
|
||||
stereoMerger.connect(delay);
|
||||
|
||||
let leftOffset = 0.125;
|
||||
let rightOffset = 0.5;
|
||||
let leftSource = new ConstantSourceNode(context, {offset: leftOffset});
|
||||
let rightSource = new ConstantSourceNode(context, {offset: rightOffset});
|
||||
leftSource.start();
|
||||
rightSource.start();
|
||||
leftSource.connect(stereoMerger, 0, 0);
|
||||
rightSource.connect(stereoMerger, 0, 1);
|
||||
// Connect a mono source directly to the gain, so that even stereo silence
|
||||
// will be detected in channel 1 of the gain output because it will cause
|
||||
// the mono source to be up-mixed.
|
||||
let monoOffset = 0.25
|
||||
let monoSource = new ConstantSourceNode(context, {offset: monoOffset});
|
||||
monoSource.start();
|
||||
monoSource.connect(gain);
|
||||
|
||||
return context.startRendering().
|
||||
then((buffer) => {
|
||||
let output = buffer.getChannelData(0);
|
||||
|
||||
function assert_samples_equal(startIndex, length, expected, description)
|
||||
{
|
||||
for (let i = startIndex; i < startIndex + length; ++i) {
|
||||
assert_equals(output[i], expected, description + ` at ${i}`);
|
||||
}
|
||||
}
|
||||
|
||||
assert_samples_equal(0, DELAY_FRAMES - INTERPOLATION_GRACE,
|
||||
0, "Initial mono");
|
||||
assert_samples_equal(DELAY_FRAMES + INTERPOLATION_GRACE, STEREO_FRAMES,
|
||||
monoOffset + rightOffset, "Stereo");
|
||||
assert_samples_equal(MONO_OUTPUT_START_FRAME + INTERPOLATION_GRACE,
|
||||
MONO_FRAMES,
|
||||
0, "Final mono");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
15
tests/wpt/web-platform-tests/webvtt/api/idlharness.window.js
Normal file
15
tests/wpt/web-platform-tests/webvtt/api/idlharness.window.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
|
||||
'use strict';
|
||||
|
||||
idl_test(
|
||||
['webvtt'],
|
||||
['html', 'dom'],
|
||||
idl_array => {
|
||||
idl_array.add_objects({
|
||||
VTTCue: ['new VTTCue(0, 0, "")'],
|
||||
VTTRegion: ['new VTTRegion()'],
|
||||
});
|
||||
}
|
||||
);
|
|
@ -1,138 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>WebVTT IDL tests</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=/resources/WebIDLParser.js></script>
|
||||
<script src=/resources/idlharness.js></script>
|
||||
|
||||
<h1>WebVTT IDL tests</h1>
|
||||
<div id=log></div>
|
||||
|
||||
<script type=text/plain id=untested>
|
||||
// HTML
|
||||
interface TextTrackCue : EventTarget {
|
||||
readonly attribute TextTrack? track;
|
||||
|
||||
attribute DOMString id;
|
||||
attribute double startTime;
|
||||
attribute double endTime;
|
||||
attribute boolean pauseOnExit;
|
||||
|
||||
attribute EventHandler onenter;
|
||||
attribute EventHandler onexit;
|
||||
};
|
||||
|
||||
[TreatNonObjectAsNull]
|
||||
callback EventHandlerNonNull = any (Event event);
|
||||
typedef EventHandlerNonNull? EventHandler;
|
||||
|
||||
// DOM
|
||||
[Exposed=(Window,Worker)]
|
||||
interface EventTarget {
|
||||
void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options);
|
||||
void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options);
|
||||
boolean dispatchEvent(Event event);
|
||||
};
|
||||
|
||||
callback interface EventListener {
|
||||
void handleEvent(Event event);
|
||||
};
|
||||
|
||||
dictionary EventListenerOptions {
|
||||
boolean capture = false;
|
||||
};
|
||||
|
||||
dictionary AddEventListenerOptions : EventListenerOptions {
|
||||
boolean passive = false;
|
||||
boolean once = false;
|
||||
};
|
||||
|
||||
[Constructor,
|
||||
Exposed=Window]
|
||||
interface DocumentFragment : Node {
|
||||
};
|
||||
|
||||
[Exposed=Window]
|
||||
interface Node : EventTarget {
|
||||
const unsigned short ELEMENT_NODE = 1;
|
||||
const unsigned short ATTRIBUTE_NODE = 2;
|
||||
const unsigned short TEXT_NODE = 3;
|
||||
const unsigned short CDATA_SECTION_NODE = 4;
|
||||
const unsigned short ENTITY_REFERENCE_NODE = 5; // historical
|
||||
const unsigned short ENTITY_NODE = 6; // historical
|
||||
const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
|
||||
const unsigned short COMMENT_NODE = 8;
|
||||
const unsigned short DOCUMENT_NODE = 9;
|
||||
const unsigned short DOCUMENT_TYPE_NODE = 10;
|
||||
const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
|
||||
const unsigned short NOTATION_NODE = 12; // historical
|
||||
readonly attribute unsigned short nodeType;
|
||||
readonly attribute DOMString nodeName;
|
||||
|
||||
readonly attribute USVString baseURI;
|
||||
|
||||
readonly attribute boolean isConnected;
|
||||
readonly attribute Document? ownerDocument;
|
||||
Node getRootNode(optional GetRootNodeOptions options);
|
||||
readonly attribute Node? parentNode;
|
||||
readonly attribute Element? parentElement;
|
||||
boolean hasChildNodes();
|
||||
[SameObject] readonly attribute NodeList childNodes;
|
||||
readonly attribute Node? firstChild;
|
||||
readonly attribute Node? lastChild;
|
||||
readonly attribute Node? previousSibling;
|
||||
readonly attribute Node? nextSibling;
|
||||
|
||||
[CEReactions] attribute DOMString? nodeValue;
|
||||
[CEReactions] attribute DOMString? textContent;
|
||||
[CEReactions] void normalize();
|
||||
|
||||
[CEReactions, NewObject] Node cloneNode(optional boolean deep = false);
|
||||
boolean isEqualNode(Node? otherNode);
|
||||
boolean isSameNode(Node? otherNode); // historical alias of ===
|
||||
|
||||
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
|
||||
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
|
||||
const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
|
||||
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
|
||||
unsigned short compareDocumentPosition(Node other);
|
||||
boolean contains(Node? other);
|
||||
|
||||
DOMString? lookupPrefix(DOMString? namespace);
|
||||
DOMString? lookupNamespaceURI(DOMString? prefix);
|
||||
boolean isDefaultNamespace(DOMString? namespace);
|
||||
|
||||
[CEReactions] Node insertBefore(Node node, Node? child);
|
||||
[CEReactions] Node appendChild(Node node);
|
||||
[CEReactions] Node replaceChild(Node node, Node child);
|
||||
[CEReactions] Node removeChild(Node child);
|
||||
};
|
||||
|
||||
dictionary GetRootNodeOptions {
|
||||
boolean composed = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
// https://w3c.github.io/webvtt/
|
||||
|
||||
promise_test(async () => {
|
||||
const webvttIDL = await fetch('/interfaces/webvtt.idl').then(response =>
|
||||
response.text(),
|
||||
);
|
||||
var idlArray = new IdlArray();
|
||||
idlArray.add_untested_idls(document.getElementById('untested').textContent);
|
||||
idlArray.add_idls(webvttIDL);
|
||||
idlArray.add_objects({
|
||||
VTTCue: ['new VTTCue(0, 0, "")'],
|
||||
VTTRegion: ['new VTTRegion()'],
|
||||
});
|
||||
idlArray.test();
|
||||
done();
|
||||
}, 'webvtt interfaces.');
|
||||
</script>
|
|
@ -5,7 +5,7 @@ async_test(t => {
|
|||
let secondTime = false;
|
||||
client.onload = t.step_func(() => {
|
||||
if(!secondTime) {
|
||||
assert_equals(client.responseText, "\uFFFD");
|
||||
assert_equals(client.responseText, "\uFFFD\uFFFD");
|
||||
secondTime = true;
|
||||
client.open("GET", testURL);
|
||||
client.send();
|
||||
|
@ -32,7 +32,7 @@ async_test(t => {
|
|||
async_test(t => {
|
||||
const client = new XMLHttpRequest();
|
||||
client.onload = t.step_func_done(() => {
|
||||
assert_equals(client.responseText, "\uFFFD")
|
||||
assert_equals(client.responseText, "\uFFFD\uFFFD")
|
||||
});
|
||||
client.open("GET", testURL);
|
||||
client.overrideMimeType("text/plain;charset=342");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue