Update web-platform-tests to revision 36acf7a01cb8ffbbafbd578229c5ad3fde2e47cc

This commit is contained in:
WPT Sync Bot 2019-07-11 10:25:27 +00:00
parent 305312e93b
commit 4499a0fbb6
151 changed files with 4858 additions and 2407 deletions

View file

@ -61,6 +61,14 @@ promise_test(async t => {
assert_equals(comparableOutput, comparableInput);
}, 'Verify write and read clipboard [image/png Blob]');
promise_test(async t => {
const invalidPngBlob = new Blob(['this text is not a valid png image'],
{type: "image/png"});
const clipboardItemInput = new ClipboardItem({'image/png' : invalidPngBlob});
await promise_rejects(t, "DataError",
navigator.clipboard.write([clipboardItemInput]));
}, 'Verify write error on malformed data [image/png ClipboardItem]');
</script>
<p>
Note: This is a manual test because it writes/reads to the shared system

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-content with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-content">
<meta name="assert" content="align-content supports only the grammar 'normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("align-content", "auto");
test_invalid_value("align-content", "baseline last");
test_invalid_value("align-content", "center baseline");
test_invalid_value("align-content", "first");
test_invalid_value("align-content", "flex-start flex-end");
test_invalid_value("align-content", "last");
test_invalid_value("align-content", "left");
test_invalid_value("align-content", "legacy center");
test_invalid_value("align-content", "legacy left");
test_invalid_value("align-content", "legacy");
test_invalid_value("align-content", "normal baseline");
test_invalid_value("align-content", "right legacy");
test_invalid_value("align-content", "safe self-end");
test_invalid_value("align-content", "safe");
test_invalid_value("align-content", "self-end unsafe");
test_invalid_value("align-content", "self-start");
test_invalid_value("align-content", "start safe");
test_invalid_value("align-content", "unsafe right");
test_invalid_value("align-content", "unsafe");
</script>
</body>
</html>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-content with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-content">
<meta name="assert" content="align-content supports the full grammar 'normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("align-content", "normal");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("align-content", "baseline");
test_valid_value("align-content", "first baseline", "baseline");
test_valid_value("align-content", "last baseline");
// <content-distribution> = space-between | space-around | space-evenly | stretch
test_valid_value("align-content", "space-between");
test_valid_value("align-content", "space-around");
test_valid_value("align-content", "space-evenly");
test_valid_value("align-content", "stretch");
// <overflow-position>? <content-position>
// <overflow-position> = unsafe | safe
// <content-position> = center | start | end | flex-start | flex-end
test_valid_value("align-content", "center");
test_valid_value("align-content", "start");
test_valid_value("align-content", "end");
test_valid_value("align-content", "flex-start");
test_valid_value("align-content", "flex-end");
test_valid_value("align-content", "unsafe end");
test_valid_value("align-content", "safe flex-start");
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-items with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items">
<meta name="assert" content="align-items supports only the grammar 'normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("align-items", "auto");
test_invalid_value("align-items", "baseline last");
test_invalid_value("align-items", "center baseline");
test_invalid_value("align-items", "first");
test_invalid_value("align-items", "flex-start flex-end");
test_invalid_value("align-items", "last");
test_invalid_value("align-items", "left");
test_invalid_value("align-items", "legacy center");
test_invalid_value("align-items", "legacy left");
test_invalid_value("align-items", "legacy");
test_invalid_value("align-items", "normal baseline");
test_invalid_value("align-items", "right legacy");
test_invalid_value("align-items", "safe");
test_invalid_value("align-items", "self-end unsafe");
test_invalid_value("align-items", "space-around");
test_invalid_value("align-items", "space-between");
test_invalid_value("align-items", "space-evenly");
test_invalid_value("align-items", "start safe");
test_invalid_value("align-items", "unsafe right");
test_invalid_value("align-items", "unsafe");
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-items with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-items">
<meta name="assert" content="align-items supports the full grammar 'normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("align-items", "normal");
test_valid_value("align-items", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("align-items", "baseline");
test_valid_value("align-items", "first baseline", "baseline");
test_valid_value("align-items", "last baseline");
// <overflow-position>? <self-position>
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("align-items", "center");
test_valid_value("align-items", "start");
test_valid_value("align-items", "end");
test_valid_value("align-items", "self-start");
test_valid_value("align-items", "self-end");
test_valid_value("align-items", "flex-start");
test_valid_value("align-items", "flex-end");
test_valid_value("align-items", "unsafe center");
test_valid_value("align-items", "safe self-end");
</script>
</body>
</html>

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-self with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<meta name="assert" content="align-self supports only the grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("align-self", "baseline last");
test_invalid_value("align-self", "center baseline");
test_invalid_value("align-self", "first");
test_invalid_value("align-self", "flex-start flex-end");
test_invalid_value("align-self", "last");
test_invalid_value("align-self", "left");
test_invalid_value("align-self", "legacy center");
test_invalid_value("align-self", "legacy left");
test_invalid_value("align-self", "legacy");
test_invalid_value("align-self", "normal baseline");
test_invalid_value("align-self", "right legacy");
test_invalid_value("align-self", "safe");
test_invalid_value("align-self", "self-end unsafe");
test_invalid_value("align-self", "space-around");
test_invalid_value("align-self", "space-between");
test_invalid_value("align-self", "space-evenly");
test_invalid_value("align-self", "start safe");
test_invalid_value("align-self", "unsafe right");
test_invalid_value("align-self", "unsafe");
</script>
</body>
</html>

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing align-self with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self">
<meta name="assert" content="align-self supports the full grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("align-self", "auto");
test_valid_value("align-self", "normal");
test_valid_value("align-self", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("align-self", "baseline");
test_valid_value("align-self", "first baseline", "baseline");
test_valid_value("align-self", "last baseline");
// <overflow-position>? <self-position>
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("align-self", "center");
test_valid_value("align-self", "start");
test_valid_value("align-self", "end");
test_valid_value("align-self", "self-start");
test_valid_value("align-self", "self-end");
test_valid_value("align-self", "flex-start");
test_valid_value("align-self", "flex-end");
test_valid_value("align-self", "unsafe center");
test_valid_value("align-self", "safe self-end");
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-content with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-content">
<meta name="assert" content="justify-content supports only the grammar 'normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("justify-content", "auto");
test_invalid_value("justify-content", "baseline last");
test_invalid_value("justify-content", "baseline");
test_invalid_value("justify-content", "center baseline");
test_invalid_value("justify-content", "first baseline");
test_invalid_value("justify-content", "first");
test_invalid_value("justify-content", "flex-start flex-end");
test_invalid_value("justify-content", "last baseline");
test_invalid_value("justify-content", "last");
test_invalid_value("justify-content", "legacy center");
test_invalid_value("justify-content", "legacy left");
test_invalid_value("justify-content", "legacy");
test_invalid_value("justify-content", "normal baseline");
test_invalid_value("justify-content", "right legacy");
test_invalid_value("justify-content", "safe self-end");
test_invalid_value("justify-content", "safe");
test_invalid_value("justify-content", "self-end unsafe");
test_invalid_value("justify-content", "self-start");
test_invalid_value("justify-content", "start safe");
test_invalid_value("justify-content", "unsafe");
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-content with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-content">
<meta name="assert" content="justify-content supports the full grammar 'normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("justify-content", "normal");
// <content-distribution> = space-between | space-around | space-evenly | stretch
test_valid_value("justify-content", "space-between");
test_valid_value("justify-content", "space-around");
test_valid_value("justify-content", "space-evenly");
test_valid_value("justify-content", "stretch");
// <overflow-position>? [ <content-position> | left | right ]
// <overflow-position> = unsafe | safe
// <content-position> = center | start | end | flex-start | flex-end
test_valid_value("justify-content", "center");
test_valid_value("justify-content", "start");
test_valid_value("justify-content", "end");
test_valid_value("justify-content", "flex-start");
test_valid_value("justify-content", "flex-end");
test_valid_value("justify-content", "unsafe end");
test_valid_value("justify-content", "safe flex-start");
test_valid_value("justify-content", "left");
test_valid_value("justify-content", "unsafe right");
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-items with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-items">
<meta name="assert" content="justify-items supports only the grammar 'normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("justify-items", "auto");
test_invalid_value("justify-items", "baseline last");
test_invalid_value("justify-items", "center baseline");
test_invalid_value("justify-items", "first");
test_invalid_value("justify-items", "flex-start flex-end");
test_invalid_value("justify-items", "last");
test_invalid_value("justify-items", "normal baseline");
test_invalid_value("justify-items", "safe");
test_invalid_value("justify-items", "self-end unsafe");
test_invalid_value("justify-items", "space-around");
test_invalid_value("justify-items", "space-between");
test_invalid_value("justify-items", "space-evenly");
test_invalid_value("justify-items", "start safe");
test_invalid_value("justify-items", "unsafe");
</script>
</body>
</html>

View file

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-items with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-items">
<meta name="assert" content="justify-items supports the full grammar 'normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("justify-items", "normal");
test_valid_value("justify-items", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("justify-items", "baseline");
test_valid_value("justify-items", "first baseline", "baseline");
test_valid_value("justify-items", "last baseline");
// <overflow-position>? [ <self-position> | left | right ]
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("justify-items", "center");
test_valid_value("justify-items", "start");
test_valid_value("justify-items", "end");
test_valid_value("justify-items", "self-start");
test_valid_value("justify-items", "self-end");
test_valid_value("justify-items", "flex-start");
test_valid_value("justify-items", "flex-end");
test_valid_value("justify-items", "unsafe center");
test_valid_value("justify-items", "safe self-end");
test_valid_value("justify-items", "right");
test_valid_value("justify-items", "safe left");
// legacy | legacy && [ left | right | center ]
test_valid_value("justify-items", "legacy");
test_valid_value("justify-items", "left legacy", "legacy left");
test_valid_value("justify-items", "right legacy", "legacy right");
test_valid_value("justify-items", "center legacy", "legacy center");
</script>
</body>
</html>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-self with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-self">
<meta name="assert" content="justify-self supports only the grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("justify-self", "baseline last");
test_invalid_value("justify-self", "center baseline");
test_invalid_value("justify-self", "first");
test_invalid_value("justify-self", "flex-start flex-end");
test_invalid_value("justify-self", "last");
test_invalid_value("justify-self", "legacy center");
test_invalid_value("justify-self", "legacy left");
test_invalid_value("justify-self", "legacy");
test_invalid_value("justify-self", "normal baseline");
test_invalid_value("justify-self", "right legacy");
test_invalid_value("justify-self", "safe");
test_invalid_value("justify-self", "self-end unsafe");
test_invalid_value("justify-self", "space-around");
test_invalid_value("justify-self", "space-between");
test_invalid_value("justify-self", "space-evenly");
test_invalid_value("justify-self", "start safe");
test_invalid_value("justify-self", "unsafe");
</script>
</body>
</html>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Box Alignment Level 3: parsing justify-self with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-justify-3/#propdef-justify-self">
<meta name="assert" content="justify-self supports the full grammar 'auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("justify-self", "auto");
test_valid_value("justify-self", "normal");
test_valid_value("justify-self", "stretch");
// <baseline-position> = [ first | last ]? baseline
test_valid_value("justify-self", "baseline");
test_valid_value("justify-self", "first baseline", "baseline");
test_valid_value("justify-self", "last baseline");
// <overflow-position>? [ <self-position> | left | right ]
// <overflow-position> = unsafe | safe
// <self-position> = center | start | end | self-start | self-end | flex-start | flex-end
test_valid_value("justify-self", "center");
test_valid_value("justify-self", "start");
test_valid_value("justify-self", "end");
test_valid_value("justify-self", "self-start");
test_valid_value("justify-self", "self-end");
test_valid_value("justify-self", "flex-start");
test_valid_value("justify-self", "flex-end");
test_valid_value("justify-self", "unsafe center");
test_valid_value("justify-self", "safe self-end");
test_valid_value("justify-self", "left");
test_valid_value("justify-self", "unsafe right");
</script>
</body>
</html>

View file

@ -12,7 +12,6 @@
<script src="/css/support/inheritance-testcommon.js"></script>
<style>
#box {
font: initial;
font-size: medium;
}
</style>
@ -25,10 +24,9 @@
<script>
'use strict';
const box = document.getElementById('box');
const initialFontFamily = getComputedStyle(box).fontFamily;
const mediumFontSize = getComputedStyle(box).fontSize;
assert_inherited('font-family', initialFontFamily, '"Not Initial!"');
assert_inherited('font-family', null, '"Not Initial!"'); // Initial value depends on user agent.
assert_inherited('font-feature-settings', 'normal', '"smcp", "swsh" 2');
assert_inherited('font-kerning', 'auto', 'none');
assert_inherited('font-size', mediumFontSize /* medium */, '123px');

View file

@ -0,0 +1,49 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test flow-relative versions of overscroll-behavior properties</title>
<link rel="author" title="Majid Valipour">
<link rel="help" href="https://drafts.csswg.org/css-overscroll-behavior-1/#overscroll-behavior-longhands-logical">
<link rel="help" href="https://drafts.csswg.org/css-logical/#box">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
div {
overscroll-behavior-block: contain;
overscroll-behavior-inline: none;
}
#horizontal {
writing-mode: horizontal-tb;
}
#vertical {
writing-mode: vertical-rl;
}
#horizontalreversed {
writing-mode: horizontal-tb;
direction: rtl;
}
</style>
<body>
<div id="horizontal"></div>
<div id="vertical"></div>
<div id="horizontalreversed"></div>
</body>
<script>
test(function() {
var element = document.getElementById("horizontal");
assert_equals(getComputedStyle(element).overscrollBehaviorX, "none");
assert_equals(getComputedStyle(element).overscrollBehaviorY, "contain");
}, "Logical overscroll-behavior maps correctly when element has horizontal-tb writing mode");
test(function() {
var element = document.getElementById("vertical");
assert_equals(getComputedStyle(element).overscrollBehaviorX, "contain");
assert_equals(getComputedStyle(element).overscrollBehaviorY, "none");
}, "Logical overscroll-behavior maps correctly when element has vertical-rl writing mode");
test(function() {
var element = document.getElementById("horizontalreversed");
assert_equals(getComputedStyle(element).overscrollBehaviorX, "none");
assert_equals(getComputedStyle(element).overscrollBehaviorY, "contain");
}, "Logical overscroll-behavior maps correctly when element has horizontal-tb writing mode and is not affected by rtl direction");
</script>

View file

@ -6,6 +6,8 @@
<link rel="help" href="https://drafts.csswg.org/css-overscroll-behavior/#overscroll-behavior-properties">
<meta name="assert" content="overscroll-behavior-x computed value is as specified.">
<meta name="assert" content="overscroll-behavior-y computed value is as specified.">
<meta name="assert" content="overscroll-behavior-inline computed value is as specified.">
<meta name="assert" content="overscroll-behavior-block computed value is as specified.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
@ -14,7 +16,7 @@
<div id="target"></div>
<script>
'use strict';
for (let property of ["overscroll-behavior-x", "overscroll-behavior-y"]) {
for (let property of ["overscroll-behavior-x", "overscroll-behavior-y", "overscroll-behavior-inline", "overscroll-behavior-block"]) {
test_computed_value(property, "contain");
test_computed_value(property, "none");
test_computed_value(property, "auto");

View file

@ -18,7 +18,7 @@ test_invalid_value("overscroll-behavior", "0");
test_invalid_value("overscroll-behavior", "contain contain contain");
for (let property of ["overscroll-behavior-x", "overscroll-behavior-y"]) {
for (let property of ["overscroll-behavior-x", "overscroll-behavior-y", "overscroll-behavior-inline", "overscroll-behavior-block"]) {
test_invalid_value(property, "normal");
test_invalid_value(property, "0");
test_invalid_value(property, "contain contain");

View file

@ -26,7 +26,7 @@ test_valid_value("overscroll-behavior", "none none", "none");
test_valid_value("overscroll-behavior", "auto auto", "auto");
for (let property of ["overscroll-behavior-x", "overscroll-behavior-y"]) {
for (let property of ["overscroll-behavior-x", "overscroll-behavior-y", "overscroll-behavior-inline", "overscroll-behavior-block"]) {
test_valid_value(property, "contain");
test_valid_value(property, "none");
test_valid_value(property, "auto");

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<link rel="help" href="https://crbug.com/982403" />
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Tests the static position of an inline-level absolute-positioned element." />
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="overflow: hidden;">
<div style="float: left; width: 100px; height: 50px; background: green;"></div>
<div style="clear: both; width: 100px; height: 50px; background: red;">
<div style="position: absolute; display: inline; width: 100px; height: 50px; background: green;"></div>
</div>
</div>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<link rel="help" href="https://crbug.com/982403" />
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Tests the static position of an inline-level absolute-positioned element." />
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="overflow: hidden;">
<div style="float: left; width: 100px; height: 50px; background: green;"></div>
<div style="clear: both; width: 100px; height: 50px; background: red;">
<div></div>
<div style="position: absolute; display: inline; width: 100px; height: 50px; background: green;"></div>
</div>
</div>

View file

@ -6,7 +6,6 @@
<style>
body {
margin: 0px;
overflow: scroll;
scroll-snap-type: both mandatory;
}
#content {
@ -22,6 +21,7 @@ body {
width: 400px;
height: 400px;
background-color: lightblue;
overflow: hidden;
scroll-snap-align: start;
}
#i1 {
@ -74,10 +74,13 @@ button.onclick = function() {
if (!scrolled_x || !scrolled_y)
return;
assert_equals(window.scrollX, target.offsetLeft,
"window.scrollX should be at snapped position.");
assert_equals(window.scrollY, target.offsetTop,
"window.scrollY should be at snapped position.");
snap_test.step(() => {
assert_equals(window.scrollX, target.offsetLeft,
"window.scrollX should be at snapped position.");
assert_equals(window.scrollY, target.offsetTop,
"window.scrollY should be at snapped position.");
});
// To make the test result visible.
var content = document.getElementById("content");
body.removeChild(content);

View file

@ -0,0 +1,36 @@
<!doctype html>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-position-3/#def-cb">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<link rel="bookmark" href="https://crbug.com/977507" />
<meta name="flags" content="" />
<meta name="assert" content="Abspos table works when it is dynamically added" />
<style>
table {
border-spacing: 0px;
}
td {
padding: 0px;
}
.outerTable {
height: 100px;
width: 100px;
position: relative;
}
.innerTable {
position: absolute;
top: 0px;
width: 100px;
height: 100%;
color: green;
background: green;
}
</style>
<p>Test passes if there is a filled green square.</p>
<table class=outerTable>
<td id=outerCell></td>
</table>
<script>
outerCell.innerHTML = "<table class=innerTable><td>some text</td></table>";
</script>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Non-reference case for text-underline-offset</title>
<style>
#text{
border: black dashed;
overflow-y: auto;
height: 5em;
width: 20em;
font: 20px/1 Ahem;
color: transparent;
text-decoration: red underline;
text-decoration-skip-ink: none;
}
</style>
</head>
<body>
<div>Test fails if there is a red line or scrollbar in the dashed area</div>
<div id="text">XXXXXXX</div>
</body>
</html>

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Reference case for text-underline-offset</title>
<style>
#text{
border: black dashed;
height: 5em;
width: 20em;
font: 20px/1 Ahem;
color: transparent;
}
</style>
</head>
<body>
<div>Test fails if there is a red line or scrollbar in the dashed area</div>
<div id="text">XXXXXXX</div>
</body>
</html>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Reference case for text-underline-offset</title>
<style>
span{
font: 20px/1 Ahem;
color: transparent;
writing-mode: vertical-lr;
text-decoration: green underline;
text-decoration-skip-ink: none;
text-underline-offset: 0;
}
</style>
</head>
<body>
<div>Test passes if the underline is vertical and close to the word left</div>
<div>left<span>XXXXX</span></div>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Reference case for text-underline-offset</title>
<style>
div{
font: 20px/1 Ahem;
margin-left: 5em;
}
#text{
color: transparent;
writing-mode: sideways-lr;
text-decoration: green underline;
text-decoration-skip-ink: none;
text-underline-offset: 0;
margin-left: 5em;
}
</style>
</head>
<body>
<p>Test passes if the underline is further to the right of the text</p>
<div>
<p>XXXX</p>
<span id="text">XXXXX</span>
</div>
</body>
</html>

View file

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test case for text-underline-offset</title>
<meta name="assert" content="text-underline-offset should influence the placement of the underline">
<link rel="author" title="Charlie Marlow" href="mailto:cmarlow@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset">
<link rel="match" href="reference/text-underline-offset-scroll-001-ref.html">
<link rel="mismatch" href="reference/text-underline-offset-scroll-001-notref.html">
<style>
/*
* Testing to make sure that positioning the underline
* outside of the scrollframe does not create scrollable
* overflow and is not visible outside of the div
*/
#scroll{
border: black dashed;
overflow-y: auto;
height: 5em;
width: 20em;
font: 20px/1 Ahem;
}
#text{
color: transparent;
text-decoration: red underline;
text-decoration-skip-ink: none;
text-underline-offset: 5em;
}
</style>
</head>
<body>
<div>Test fails if there is a red line or scrollbar in the dashed area</div>
<div id="scroll"><span id="text">XXXXXXX</span></div>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test case for text-underline-offset</title>
<meta name="assert" content="text-underline-offset should influence the placement of the underline">
<link rel="author" title="Charlie Marlow" href="mailto:cmarlow@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset">
<link rel="match" href="reference/text-underline-offset-vertical-001-ref.html">
<style>
span{
margin-left: 5em;
font: 20px/1 Ahem;
color: transparent;
writing-mode: vertical-lr;
text-decoration: green underline;
text-decoration-skip-ink: none;
text-underline-offset: 5em;
}
</style>
</head>
<body>
<div>Test passes if the underline is vertical and close to the word left</div>
<div>left<span>XXXXX</span></div>
</body>
</html>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test case for text-underline-offset</title>
<meta name="assert" content="text-underline-offset should influence the placement of the underline">
<link rel="author" title="Charlie Marlow" href="mailto:cmarlow@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset">
<link rel="match" href="reference/text-underline-offset-vertical-002-ref.html">
<style>
div{
font: 20px/1 Ahem;
margin-left: 5em;
}
#text{
color: transparent;
writing-mode: sideways-lr;
text-decoration: green underline;
text-decoration-skip-ink: none;
text-underline-offset: 5em;
}
</style>
</head>
<body>
<p>Test passes if the underline is further to the right of the text</p>
<div>
<p>XXXX</p>
<span id="text">XXXXX</span>
</div>
</body>
</html>

View file

@ -33,7 +33,8 @@ function assert_initial(property, initial) {
* value.
*/
function assert_inherited(property, initial, other) {
assert_initial(property, initial);
if (initial)
assert_initial(property, initial);
test(() => {
const container = document.getElementById('container');

View file

@ -1,54 +0,0 @@
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Element Timing: observe elements from same-origin iframes</title>
<body>
<style>
body {
margin: 0;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test((t) => {
if (!window.PerformanceElementTiming) {
assert_unreached("PerformanceElementTiming is not implemented");
}
let beforeRender;
let img;
const img_src = 'http://{{domains[www]}}:{{ports[http][1]}}/element-timing/'
+ 'resources/TAOImage.py?tao=wildcard';
const observer = new PerformanceObserver(
t.step_func_done((entryList) => {
assert_equals(entryList.getEntries().length, 1);
const entry = entryList.getEntries()[0];
checkElement(entry, img_src, 'my_image', 'my_id', beforeRender, img);
// Assume viewport has size at least 20, so the element is fully visible.
checkRect(entry, [0, 20, 0, 20]);
checkNaturalSize(entry, 20, 20);
})
);
observer.observe({entryTypes: ['element']});
// We add the image during onload to be sure that the observer is registered
// in time for it to observe the element timing.
// TODO(npm): change observer to use buffered flag.
window.onload = t.step_func(() => {
img = document.createElement('img');
img.src = img_src;
img.setAttribute('elementtiming', 'my_image');
img.setAttribute('id', 'my_id');
img.onload = t.step_func(() => {
// After a short delay, assume that the entry was not dispatched.
t.step_timeout(() => {
assert_unreached("Should have received an entry!");
t.done();
}, 100);
});
document.body.appendChild(img);
beforeRender = performance.now();
});
}, 'Cross-origin element with wildcard TAO is observed.');
</script>
</body>

View file

@ -0,0 +1,56 @@
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Element Timing: observe cross origin images with various Timing-Allow-Origin headers</title>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/element-timing-helpers.js"></script>
<script>
async_test(t => {
if (!window.PerformanceElementTiming) {
assert_unreached("PerformanceElementTiming is not implemented");
}
const beforeRender = performance.now();
const remote_img = 'http://{{domains[www]}}:{{ports[http][1]}}/element-timing/resources/TAOImage.py?'
+ 'origin=' + window.location.origin +'&tao=';
const valid_tao = ['wildcard', 'origin', 'multi', 'multi_wildcard', 'match_origin', 'match_wildcard'];
function addImage(tao) {
const img = document.createElement('img');
img.src = remote_img + tao;
img.setAttribute('elementtiming', tao);
img.id = 'id_' + tao;
document.body.appendChild(img);
}
valid_tao.forEach(tao => {
addImage(tao);
});
const invalid_tao = ['null', 'space', 'uppercase'];
invalid_tao.forEach(tao => {
addImage(tao);
});
let img_count = 0;
const total_images = valid_tao.length + invalid_tao.length;
new PerformanceObserver(
t.step_func(entryList => {
entryList.getEntries().forEach(entry => {
img_count++;
const tao = entry.identifier;
const img = document.getElementById('id_' + tao);
if (valid_tao.includes(tao)) {
checkElement(entry, remote_img + tao, tao, 'id_' + tao, beforeRender, img);
} else if (invalid_tao.includes(tao)) {
assert_equals(entry.startTime, 0, 'Entry with tao=' + tao + ' must have a startTime of 0');
checkElement(entry, remote_img + tao, tao, 'id_' + tao, 0, img);
}
else {
assert_unreached('Should be in one of valid_tao OR invalid_tao');
}
checkNaturalSize(entry, 20, 20);
if (img_count == total_images)
t.done();
});
})
).observe({type: 'element', buffered: true});
}, 'Cross-origin elements with valid TAO have correct startTime, with invalid TAO have startTime set to 0.');
</script>
</body>

View file

@ -1,7 +1,7 @@
import os
def main(request, response):
origin = request.GET.first('origin', '');
origin = request.GET.first('origin')
if origin:
response.headers.set('Access-Control-Allow-Origin', origin)

View file

@ -1,6 +0,0 @@
[
{
"id": "event-definitions-0",
"original_id": "event-definitions-0"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "event-definition",
"original_id": "event-definition"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "security-location",
"original_id": "security-location"
}
]

View file

@ -1,10 +0,0 @@
[
{
"id": "supporting-offline-caching-for-legacy-applications",
"original_id": "supporting-offline-caching-for-legacy-applications"
},
{
"id": "appcacheevents",
"original_id": "appcacheevents"
}
]

View file

@ -1,14 +0,0 @@
[
{
"id": "some-sample-manifests",
"original_id": "some-sample-manifests"
},
{
"id": "writing-cache-manifests",
"original_id": "writing-cache-manifests"
},
{
"id": "parsing-cache-manifests",
"original_id": "parsing-cache-manifests"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "navigating-auxiliary-browsing-contexts-in-the-dom",
"original_id": "navigating-auxiliary-browsing-contexts-in-the-dom"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "navigating-nested-browsing-contexts-in-the-dom",
"original_id": "navigating-nested-browsing-contexts-in-the-dom"
}
]

View file

@ -1,48 +0,0 @@
[
{
"id": "kinds-of-content",
"original_id": "kinds-of-content",
"children": [
{
"id": "metadata-content",
"original_id": "metadata-content"
},
{
"id": "flow-content",
"original_id": "flow-content"
},
{
"id": "sectioning-content",
"original_id": "sectioning-content"
},
{
"id": "heading-content",
"original_id": "heading-content"
},
{
"id": "phrasing-content",
"original_id": "phrasing-content"
},
{
"id": "embedded-content",
"original_id": "embedded-content"
},
{
"id": "interactive-content",
"original_id": "interactive-content"
},
{
"id": "palpable-content",
"original_id": "palpable-content"
}
]
},
{
"id": "transparent-content-models",
"original_id": "transparent-content-models"
},
{
"id": "paragraphs",
"original_id": "paragraphs"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "attributes",
"original_id": "attributes"
}
]

View file

@ -1,38 +0,0 @@
[
{
"id": "the-id-attribute",
"original_id": "the-id-attribute"
},
{
"id": "the-title-attribute",
"original_id": "the-title-attribute"
},
{
"id": "the-lang-and-xml-lang-attributes",
"original_id": "the-lang-and-xml:lang-attributes"
},
{
"id": "the-translate-attribute",
"original_id": "the-translate-attribute"
},
{
"id": "the-xml-base-attribute-xml-only",
"original_id": "the-xml:base-attribute-(xml-only)"
},
{
"id": "the-dir-attribute",
"original_id": "the-dir-attribute"
},
{
"id": "classes",
"original_id": "classes"
},
{
"id": "the-style-attribute",
"original_id": "the-style-attribute"
},
{
"id": "embedding-custom-non-visible-data-with-the-data-attributes",
"original_id": "embedding-custom-non-visible-data-with-the-data-*-attributes"
}
]

View file

@ -1,18 +0,0 @@
[
{
"id": "aria-role-attribute",
"original_id": "aria-role-attribute"
},
{
"id": "state-and-property-attributes",
"original_id": "state-and-property-attributes"
},
{
"id": "sec-strong-native-semantics",
"original_id": "sec-strong-native-semantics"
},
{
"id": "sec-implicit-aria-semantics",
"original_id": "sec-implicit-aria-semantics"
}
]

View file

@ -1,14 +0,0 @@
[
{
"id": "htmlallcollection",
"original_id": "htmlallcollection"
},
{
"id": "htmlformcontrolscollection",
"original_id": "htmlformcontrolscollection"
},
{
"id": "htmloptionscollection",
"original_id": "htmloptionscollection"
}
]

View file

@ -1,42 +0,0 @@
[
{
"id": "months",
"original_id": "months"
},
{
"id": "dates",
"original_id": "dates"
},
{
"id": "yearless-dates",
"original_id": "yearless-dates"
},
{
"id": "times",
"original_id": "times"
},
{
"id": "local-dates-and-times",
"original_id": "local-dates-and-times"
},
{
"id": "time-zones",
"original_id": "time-zones"
},
{
"id": "global-dates-and-times",
"original_id": "global-dates-and-times"
},
{
"id": "weeks",
"original_id": "weeks"
},
{
"id": "durations",
"original_id": "durations"
},
{
"id": "vaguer-moments-in-time",
"original_id": "vaguer-moments-in-time"
}
]

View file

@ -1,26 +0,0 @@
[
{
"id": "signed-integers",
"original_id": "signed-integers"
},
{
"id": "non-negative-integers",
"original_id": "non-negative-integers"
},
{
"id": "floating-point-numbers",
"original_id": "floating-point-numbers"
},
{
"id": "percentages-and-dimensions",
"original_id": "percentages-and-dimensions"
},
{
"id": "lists-of-integers",
"original_id": "lists-of-integers"
},
{
"id": "lists-of-dimensions",
"original_id": "lists-of-dimensions"
}
]

View file

@ -33,6 +33,7 @@ const valid_values = [
[ "1007", "1007px" ],
[ " 00523 ", "523px" ],
[ "200.25", "200.25px" ],
[ "200.7", "200.7px" ],
[ "200.", "200px" ],
[ "+200", "200px" ],
[ "200in", "200px" ],
@ -99,39 +100,60 @@ function newImageInput() {
* Array of tests. Each test consists of the following information:
*
* 1) An element creation function.
* 2) The name of the attribute to set (and CSS property to get).
* 3) A boolean indicating whether 0 is a valid value for the dimension
* 2) The name of the attribute to set
* 3) The name of the CSS property to get.
* 4) A boolean indicating whether 0 is a valid value for the dimension
* attribute.
*/
const tests = [
[ newElem("hr"), "width", true ],
[ newElem("iframe"), "width", true ],
[ newElem("iframe"), "height", true ],
[ newImageInput(), "width", true ],
[ newImageInput(), "height", true ],
[ newElem("marquee"), "width", true ],
[ newElem("marquee"), "height", true ],
[ newElem("video"), "width", true ],
[ newElem("video"), "height", true ],
[ newElem("object"), "width", true ],
[ newElem("object"), "height", true ],
[ newElem("embed"), "width", true ],
[ newElem("embed"), "height", true ],
[ newElem("img"), "width", true ],
[ newElem("img"), "height", true ],
[ newElem("td"), "width", false ],
[ newElem("td"), "height", false ],
[ newElem("hr"), "width", "width", true ],
[ newElem("iframe"), "width", "width", true ],
[ newElem("iframe"), "height", "height", true ],
[ newImageInput(), "width", "width", true ],
[ newImageInput(), "height", "height", true ],
[ newElem("marquee"), "width", "width", true ],
[ newElem("marquee"), "height", "height", true ],
[ newElem("video"), "width", "width", true ],
[ newElem("video"), "height", "height", true ],
[ newElem("object"), "width", "width", true ],
[ newElem("object"), "height", "height", true ],
[ newElem("embed"), "width", "width", true ],
[ newElem("embed"), "height", "height", true ],
[ newElem("img"), "width", "width", true ],
[ newElem("img"), "height", "height", true ],
[ newElem("td"), "width", "width", false ],
[ newElem("td"), "height", "height", false ],
// https://github.com/whatwg/html/issues/4715 tracks the fact that for
// <table width> and <table height> the "0 is valid" boolean should probably
// be true.
[ newElem("table"), "width", false ],
[ newElem("table"), "height", false ],
[ newElem("table"), "width", "width", false ],
[ newElem("table"), "height", "height", false ],
// https://github.com/whatwg/html/issues/4716 tracks the fact that for the
// <tr height> case that "0 is valid" boolean should probably be true.
[ newElem("tr"), "height", false ],
[ newElem("tr"), "height", "height", false ],
// https://github.com/whatwg/html/issues/4717 tracks the fact that for the
// <col width> case that "0 is valid" boolean should probably be true.
[ newElem("col"), "width", false ],
[ newElem("col"), "width", "width", false ],
[ newElem("embed"), "hspace", "marginLeft", true ],
[ newElem("embed"), "hspace", "marginRight", true ],
[ newElem("embed"), "vspace", "marginTop", true ],
[ newElem("embed"), "vspace", "marginBottom", true ],
[ newElem("img"), "hspace", "marginLeft", true ],
[ newElem("img"), "hspace", "marginRight", true ],
[ newElem("img"), "vspace", "marginTop", true ],
[ newElem("img"), "vspace", "marginBottom", true ],
[ newElem("object"), "hspace", "marginLeft", true ],
[ newElem("object"), "hspace", "marginRight", true ],
[ newElem("object"), "vspace", "marginTop", true ],
[ newElem("object"), "vspace", "marginBottom", true ],
[ newImageInput(), "hspace", "marginLeft", true ],
[ newImageInput(), "hspace", "marginRight", true ],
[ newImageInput(), "vspace", "marginTop", true ],
[ newImageInput(), "vspace", "marginBottom", true ],
[ newElem("marquee"), "hspace", "marginLeft", true ],
[ newElem("marquee"), "hspace", "marginRight", true ],
[ newElem("marquee"), "vspace", "marginTop", true ],
[ newElem("marquee"), "vspace", "marginBottom", true ],
];
@ -141,7 +163,7 @@ function style(element) {
const container = document.getElementById("container");
for (let [ctor, attr, zero_allowed] of tests) {
for (let [ctor, attr, prop, zero_allowed] of tests) {
let valid, invalid;
if (zero_allowed) {
valid = valid_values_with_0;
@ -157,13 +179,13 @@ for (let [ctor, attr, zero_allowed] of tests) {
elem.setAttribute(attr, value);
assert_equals(elem.getAttribute(attr), value);
container.appendChild(elem);
assert_equals(style(elem)[attr], result);
}, `<${elem.localName} ${attr}="${value}"> mapping`);
assert_equals(style(elem)[prop], result);
}, `<${elem.localName} ${attr}="${value}"> mapping to ${prop}`);
}
let default_elem = ctor();
container.appendChild(default_elem);
let defaultVal = style(default_elem)[attr];
let defaultVal = style(default_elem)[prop];
default_elem.remove();
for (let value of invalid) {
let elem = ctor();
@ -172,8 +194,8 @@ for (let [ctor, attr, zero_allowed] of tests) {
elem.setAttribute(attr, value);
assert_equals(elem.getAttribute(attr), value);
container.appendChild(elem);
assert_equals(style(elem)[attr], defaultVal);
}, `<${elem.localName} ${attr}="${value}"> mapping`);
assert_equals(style(elem)[prop], defaultVal);
}, `<${elem.localName} ${attr}="${value}"> mapping to ${prop}`);
}
}
</script>

View file

@ -1,11 +1,18 @@
<!doctype html>
<meta charset=utf-8>
<!-- Creating iframes is slow in browsers -->
<meta name=timeout content=long>
<title>Test handling of attributes that map to pixel length properties</title>
<link rel="help"
href="https://html.spec.whatwg.org/multipage/rendering.html#maps-to-the-pixel-length-property">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<body>
<div id="container" style="display: none">
<img id="defaultImg">
<object id="defaultObject"></object>
<input type="image" id="defaultInput"></input>
</div>
<script>
/*
* This test tests
@ -69,13 +76,53 @@ const tests = [
[ createFrame, "marginwidth", "marginRight", document.body ],
[ createFrame, "marginheight", "marginTop", document.body ],
[ createFrame, "marginheight", "marginBottom", document.body ],
[ createBody, "marginwidth", "marginLeft", document.body ],
[ createBody, "marginwidth", "marginRight", document.body ],
[ createBody, "leftmargin", "marginLeft", document.body ],
[ createBody, "rightmargin", "marginRight", document.body ],
[ createBody, "marginheight", "marginTop", document.body ],
[ createBody, "marginheight", "marginBottom", document.body ],
[ createBody, "topmargin", "marginTop", document.body ],
[ createBody, "bottommargin", "marginBottom", document.body ],
[ newElem("img"), "border", "borderTopWidth", defaultImg ],
[ newElem("img"), "border", "borderRightWidth", defaultImg ],
[ newElem("img"), "border", "borderBottomWidth", defaultImg ],
[ newElem("img"), "border", "borderLeftWidth", defaultImg ],
[ newElem("object"), "border", "borderTopWidth", defaultObject ],
[ newElem("object"), "border", "borderRightWidth", defaultObject ],
[ newElem("object"), "border", "borderBottomWidth", defaultObject ],
[ newElem("object"), "border", "borderLeftWidth", defaultObject ],
[ newImageInput, "border", "borderTopWidth", defaultInput ],
[ newImageInput, "border", "borderRightWidth", defaultInput ],
[ newImageInput, "border", "borderBottomWidth", defaultInput ],
[ newImageInput, "border", "borderLeftWidth", defaultInput ],
];
function newElem(name) {
return () => {
var elem = document.createElement(name);
document.getElementById("container").appendChild(elem);
return [ elem, elem, () => elem.remove() ];
}
}
function newImageInput() {
var elem = document.createElement("input");
elem.type = "image";
document.getElementById("container").appendChild(elem);
return [ elem, elem, () => elem.remove() ];
}
function createIframe() {
let ifr = document.createElement("iframe");
document.body.appendChild(ifr);
return [ ifr, ifr.contentDocument.body, () => ifr.remove() ];
}
function createBody() {
let ifr = document.createElement("iframe");
document.body.appendChild(ifr);
return [ ifr.contentDocument.body, ifr.contentDocument.body, () => ifr.remove() ];
}
function createFrame() {

View file

@ -0,0 +1,91 @@
<!doctype html>
<meta charset=utf-8>
<title>Test handling of attributes that should not be mapped into style, but
incorrectly were in some browsers</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<body>
<div id="container" style="display: none"></div>
<iframe></iframe>
<script>
/*
* We wand to test both quirks and standards mode. We can use the fact that
* our document is in standards mode and the about:blank iframe we have is in
* quirks mode.
*/
test(() => {
assert_equals(document.compatMode, "CSS1Compat")
}, "We should be in standards mode");
const container = document.getElementById("container");
const frameDoc = document.querySelector("iframe").contentDocument;
test(() => {
assert_equals(frameDoc.compatMode, "BackCompat")
}, "Subframe should be in quirks mode");
const frameContainer = frameDoc.createElement("div");
frameContainer.style.display = "none";
frameDoc.body.appendChild(frameContainer);
function newElem(name) {
return (parent) =>
parent.appendChild(parent.ownerDocument.createElement(name));
}
/*
* Array of tests. Each test consists of the following information:
*
* 1) An element creation function, which takes a parent element as an
* argument.
* 2) The name of the attribute to set
* 3) The name of the CSS property to get.
*/
const tests = [
[ newElem("table"), "hspace", "marginLeft" ],
[ newElem("table"), "hspace", "marginRight" ],
[ newElem("table"), "vspace", "marginTop" ],
[ newElem("table"), "vspace", "marginBottom" ],
[ newElem("embed"), "border", "borderTopWidth" ],
[ newElem("embed"), "border", "borderRightWidth" ],
[ newElem("embed"), "border", "borderBottomWidth" ],
[ newElem("embed"), "border", "borderLeftWidth" ],
[ newElem("iframe"), "border", "borderTopWidth" ],
[ newElem("iframe"), "border", "borderRightWidth" ],
[ newElem("iframe"), "border", "borderBottomWidth" ],
[ newElem("iframe"), "border", "borderLeftWidth" ],
[ newElem("marquee"), "border", "borderTopWidth" ],
[ newElem("marquee"), "border", "borderRightWidth" ],
[ newElem("marquee"), "border", "borderBottomWidth" ],
[ newElem("marquee"), "border", "borderLeftWidth" ],
// Non-image input
[ newElem("input"), "border", "borderTopWidth" ],
[ newElem("input"), "border", "borderRightWidth" ],
[ newElem("input"), "border", "borderBottomWidth" ],
[ newElem("input"), "border", "borderLeftWidth" ],
[ newElem("input"), "width", "width" ],
[ newElem("input"), "height", "height" ],
[ newElem("input"), "hspace", "marginLeft" ],
[ newElem("input"), "hspace", "marginRight" ],
[ newElem("input"), "vspace", "marginTop" ],
[ newElem("input"), "vspace", "marginBottom" ],
];
function style(element) {
return element.ownerDocument.defaultView.getComputedStyle(element);
}
for (let [ctor, attr, prop] of tests) {
for (let parent of [container, frameContainer]) {
let elem = ctor(parent);
test(function() {
let default_elem = ctor(parent);
this.add_cleanup(() => {
elem.remove();
default_elem.remove();
});
elem.setAttribute(attr, "200");
assert_equals(elem.getAttribute(attr), "200");
assert_equals(style(elem)[prop], style(default_elem)[prop]);
}, `<${elem.localName} ${attr}> should not be mapped to style ${prop} in ${parent.ownerDocument.compatMode} mode`);
}
}
</script>

View file

@ -1,22 +0,0 @@
[
{
"id": "standard-metadata-names",
"original_id": "standard-metadata-names"
},
{
"id": "other-metadata-names",
"original_id": "other-metadata-names"
},
{
"id": "pragma-directives",
"original_id": "pragma-directives"
},
{
"id": "other-pragma-directives",
"original_id": "other-pragma-directives"
},
{
"id": "charset",
"original_id": "charset"
}
]

View file

@ -1,10 +0,0 @@
[
{
"id": "authoring",
"original_id": "authoring"
},
{
"id": "image-map-processing-model",
"original_id": "image-map-processing-model"
}
]

View file

@ -1,132 +0,0 @@
[
{
"id": "error-codes",
"original_id": "error-codes"
},
{
"id": "location-of-the-media-resource",
"original_id": "location-of-the-media-resource"
},
{
"id": "mime-types",
"original_id": "mime-types"
},
{
"id": "network-states",
"original_id": "network-states"
},
{
"id": "loading-the-media-resource",
"original_id": "loading-the-media-resource"
},
{
"id": "offsets-into-the-media-resource",
"original_id": "offsets-into-the-media-resource"
},
{
"id": "ready-states",
"original_id": "ready-states"
},
{
"id": "playing-the-media-resource",
"original_id": "playing-the-media-resource"
},
{
"id": "seeking",
"original_id": "seeking"
},
{
"id": "media-resources-with-multiple-media-tracks",
"original_id": "media-resources-with-multiple-media-tracks",
"children": [
{
"id": "audiotracklist-and-videotracklist-objects",
"original_id": "audiotracklist-and-videotracklist-objects"
},
{
"id": "selecting-specific-audio-and-video-tracks-declaratively",
"original_id": "selecting-specific-audio-and-video-tracks-declaratively"
}
]
},
{
"id": "synchronising-multiple-media-elements",
"original_id": "synchronising-multiple-media-elements",
"children": [
{
"id": "introduction-0",
"original_id": "introduction-0"
},
{
"id": "media-controllers",
"original_id": "media-controllers"
},
{
"id": "assigning-a-media-controller-declaratively",
"original_id": "assigning-a-media-controller-declaratively"
}
]
},
{
"id": "timed-text-tracks",
"original_id": "timed-text-tracks",
"children": [
{
"id": "text-track-model",
"original_id": "text-track-model"
},
{
"id": "sourcing-in-band-text-tracks",
"original_id": "sourcing-in-band-text-tracks"
},
{
"id": "sourcing-out-of-band-text-tracks",
"original_id": "sourcing-out-of-band-text-tracks"
},
{
"id": "guidelines-for-exposing-cues-in-various-formats-as-text-track-cues",
"original_id": "guidelines-for-exposing-cues-in-various-formats-as-text-track-cues"
},
{
"id": "text-track-api",
"original_id": "text-track-api"
},
{
"id": "text-tracks-describing-chapters",
"original_id": "text-tracks-describing-chapters"
},
{
"id": "cue-events",
"original_id": "cue-events"
}
]
},
{
"id": "user-interface",
"original_id": "user-interface"
},
{
"id": "time-ranges",
"original_id": "time-ranges"
},
{
"id": "event-definitions",
"original_id": "event-definitions"
},
{
"id": "mediaevents",
"original_id": "mediaevents"
},
{
"id": "security-and-privacy-considerations",
"original_id": "security-and-privacy-considerations"
},
{
"id": "best-practices-for-authors-using-media-elements",
"original_id": "best-practices-for-authors-using-media-elements"
},
{
"id": "best-practices-for-implementors-of-media-elements",
"original_id": "best-practices-for-implementors-of-media-elements"
}
]

View file

@ -1,10 +0,0 @@
[
{
"id": "color-spaces-and-color-correction",
"original_id": "color-spaces-and-color-correction"
},
{
"id": "security-with-canvas-elements",
"original_id": "security-with-canvas-elements"
}
]

View file

@ -1,60 +0,0 @@
[
{
"id": "alt",
"original_id": "alt",
"children": [
{
"id": "general-guidelines",
"original_id": "general-guidelines"
},
{
"id": "a-link-or-button-containing-nothing-but-the-image",
"original_id": "a-link-or-button-containing-nothing-but-the-image"
},
{
"id": "a-phrase-or-paragraph-with-an-alternative-graphical-representation-charts-diagrams-graphs-maps-illustrations",
"original_id": "a-phrase-or-paragraph-with-an-alternative-graphical-representation:-charts,-diagrams,-graphs,-maps,-illustrations"
},
{
"id": "a-short-phrase-or-label-with-an-alternative-graphical-representation-icons-logos",
"original_id": "a-short-phrase-or-label-with-an-alternative-graphical-representation:-icons,-logos"
},
{
"id": "text-that-has-been-rendered-to-a-graphic-for-typographical-effect",
"original_id": "text-that-has-been-rendered-to-a-graphic-for-typographical-effect"
},
{
"id": "a-graphical-representation-of-some-of-the-surrounding-text",
"original_id": "a-graphical-representation-of-some-of-the-surrounding-text"
},
{
"id": "a-purely-decorative-image-that-doesn-t-add-any-information",
"original_id": "a-purely-decorative-image-that-doesn't-add-any-information"
},
{
"id": "a-group-of-images-that-form-a-single-larger-picture-with-no-links",
"original_id": "a-group-of-images-that-form-a-single-larger-picture-with-no-links"
},
{
"id": "a-group-of-images-that-form-a-single-larger-picture-with-links",
"original_id": "a-group-of-images-that-form-a-single-larger-picture-with-links"
},
{
"id": "a-key-part-of-the-content",
"original_id": "a-key-part-of-the-content"
},
{
"id": "an-image-not-intended-for-the-user",
"original_id": "an-image-not-intended-for-the-user"
},
{
"id": "guidance-for-markup-generators",
"original_id": "guidance-for-markup-generators"
},
{
"id": "guidance-for-conformance-checkers",
"original_id": "guidance-for-conformance-checkers"
}
]
}
]

View file

@ -1,38 +0,0 @@
[
{
"id": "naming-form-controls-the-name-attribute",
"original_id": "naming-form-controls:-the-name-attribute"
},
{
"id": "submitting-element-directionality-the-dirname-attribute",
"original_id": "submitting-element-directionality:-the-dirname-attribute"
},
{
"id": "limiting-user-input-length-the-maxlength-attribute",
"original_id": "limiting-user-input-length:-the-maxlength-attribute"
},
{
"id": "enabling-and-disabling-form-controls-the-disabled-attribute",
"original_id": "enabling-and-disabling-form-controls:-the-disabled-attribute"
},
{
"id": "form-submission",
"original_id": "form-submission"
},
{
"id": "autofocusing-a-form-control-the-autofocus-attribute",
"original_id": "autofocusing-a-form-control:-the-autofocus-attribute"
},
{
"id": "input-modalities-the-enterkeyhint-attribute",
"original_id": "input-modalities:-the-enterkeyhint-attribute"
},
{
"id": "input-modalities-the-inputmode-attribute",
"original_id": "input-modalities:-the-inputmode-attribute"
},
{
"id": "autofilling-form-controls-the-autocomplete-attribute",
"original_id": "autofilling-form-controls:-the-autocomplete-attribute"
}
]

View file

@ -1,18 +0,0 @@
[
{
"id": "definitions",
"original_id": "definitions"
},
{
"id": "constraint-validation",
"original_id": "constraint-validation"
},
{
"id": "the-constraint-validation-api",
"original_id": "the-constraint-validation-api"
},
{
"id": "security-forms",
"original_id": "security-forms"
}
]

View file

@ -1,14 +0,0 @@
[
{
"id": "a-form-control-s-value",
"original_id": "a-form-control's-value"
},
{
"id": "mutability",
"original_id": "mutability"
},
{
"id": "association-of-controls-and-forms",
"original_id": "association-of-controls-and-forms"
}
]

View file

@ -1,30 +0,0 @@
[
{
"id": "introduction-2",
"original_id": "introduction-2"
},
{
"id": "implicit-submission",
"original_id": "implicit-submission"
},
{
"id": "form-submission-algorithm",
"original_id": "form-submission-algorithm"
},
{
"id": "constructing-form-data-set",
"original_id": "constructing-form-data-set"
},
{
"id": "url-encoded-form-data",
"original_id": "url-encoded-form-data"
},
{
"id": "multipart-form-data",
"original_id": "multipart-form-data"
},
{
"id": "plain-text-form-data",
"original_id": "plain-text-form-data"
}
]

View file

@ -1,34 +0,0 @@
[
{
"id": "writing-a-form-s-user-interface",
"original_id": "writing-a-form's-user-interface"
},
{
"id": "implementing-the-server-side-processing-for-a-form",
"original_id": "implementing-the-server-side-processing-for-a-form"
},
{
"id": "configuring-a-form-to-communicate-with-a-server",
"original_id": "configuring-a-form-to-communicate-with-a-server"
},
{
"id": "client-side-form-validation",
"original_id": "client-side-form-validation"
},
{
"id": "enabling-client-side-automatic-filling-of-form-controls",
"original_id": "enabling-client-side-automatic-filling-of-form-controls"
},
{
"id": "improving-the-user-experience-on-mobile-devices",
"original_id": "improving-the-user-experience-on-mobile-devices"
},
{
"id": "the-difference-between-the-field-type-the-autofill-field-name-and-the-input-modality",
"original_id": "the-difference-between-the-field-type,-the-autofill-field-name,-and-the-input-modality"
},
{
"id": "input-author-notes",
"original_id": "input-author-notes"
}
]

View file

@ -1,154 +0,0 @@
[
{
"id": "states-of-the-type-attribute",
"original_id": "states-of-the-type-attribute",
"children": [
{
"id": "hidden-state-type-hidden",
"original_id": "hidden-state-(type=hidden)"
},
{
"id": "text-type-text-state-and-search-state-type-search",
"original_id": "text-(type=text)-state-and-search-state-(type=search)"
},
{
"id": "telephone-state-type-tel",
"original_id": "telephone-state-(type=tel)"
},
{
"id": "url-state-type-url",
"original_id": "url-state-(type=url)"
},
{
"id": "e-mail-state-type-email",
"original_id": "e-mail-state-(type=email)"
},
{
"id": "password-state-type-password",
"original_id": "password-state-(type=password)"
},
{
"id": "date-and-time-state-type-datetime",
"original_id": "date-and-time-state-(type=datetime)"
},
{
"id": "date-state-type-date",
"original_id": "date-state-(type=date)"
},
{
"id": "month-state-type-month",
"original_id": "month-state-(type=month)"
},
{
"id": "week-state-type-week",
"original_id": "week-state-(type=week)"
},
{
"id": "time-state-type-time",
"original_id": "time-state-(type=time)"
},
{
"id": "local-date-and-time-state-type-datetime-local",
"original_id": "local-date-and-time-state-(type=datetime-local)"
},
{
"id": "number-state-type-number",
"original_id": "number-state-(type=number)"
},
{
"id": "range-state-type-range",
"original_id": "range-state-(type=range)"
},
{
"id": "color-state-type-color",
"original_id": "color-state-(type=color)"
},
{
"id": "checkbox-state-type-checkbox",
"original_id": "checkbox-state-(type=checkbox)"
},
{
"id": "radio-button-state-type-radio",
"original_id": "radio-button-state-(type=radio)"
},
{
"id": "file-upload-state-type-file",
"original_id": "file-upload-state-(type=file)"
},
{
"id": "submit-button-state-type-submit",
"original_id": "submit-button-state-(type=submit)"
},
{
"id": "image-button-state-type-image",
"original_id": "image-button-state-(type=image)"
},
{
"id": "reset-button-state-type-reset",
"original_id": "reset-button-state-(type=reset)"
},
{
"id": "button-state-type-button",
"original_id": "button-state-(type=button)"
}
]
},
{
"id": "input-impl-notes",
"original_id": "input-impl-notes"
},
{
"id": "common-input-element-attributes",
"original_id": "common-input-element-attributes",
"children": [
{
"id": "the-maxlength-attribute",
"original_id": "the-maxlength-attribute"
},
{
"id": "the-size-attribute",
"original_id": "the-size-attribute"
},
{
"id": "the-readonly-attribute",
"original_id": "the-readonly-attribute"
},
{
"id": "the-required-attribute",
"original_id": "the-required-attribute"
},
{
"id": "the-multiple-attribute",
"original_id": "the-multiple-attribute"
},
{
"id": "the-pattern-attribute",
"original_id": "the-pattern-attribute"
},
{
"id": "the-min-and-max-attributes",
"original_id": "the-min-and-max-attributes"
},
{
"id": "the-step-attribute",
"original_id": "the-step-attribute"
},
{
"id": "the-list-attribute",
"original_id": "the-list-attribute"
},
{
"id": "the-placeholder-attribute",
"original_id": "the-placeholder-attribute"
}
]
},
{
"id": "common-input-element-apis",
"original_id": "common-input-element-apis"
},
{
"id": "common-event-behaviors",
"original_id": "common-event-behaviors"
}
]

View file

@ -1,38 +0,0 @@
[
{
"id": "using-the-a-element-to-define-a-command",
"original_id": "using-the-a-element-to-define-a-command"
},
{
"id": "using-the-button-element-to-define-a-command",
"original_id": "using-the-button-element-to-define-a-command"
},
{
"id": "using-the-input-element-to-define-a-command",
"original_id": "using-the-input-element-to-define-a-command"
},
{
"id": "using-the-option-element-to-define-a-command",
"original_id": "using-the-option-element-to-define-a-command"
},
{
"id": "using-the-command-element-to-define-a-command",
"original_id": "using-the-command-element-to-define-a-command"
},
{
"id": "using-the-command-attribute-on-command-elements-to-define-a-command-indirectly",
"original_id": "using-the-command-attribute-on-command-elements-to-define-a-command-indirectly"
},
{
"id": "using-the-accesskey-attribute-on-a-label-element-to-define-a-command",
"original_id": "using-the-accesskey-attribute-on-a-label-element-to-define-a-command"
},
{
"id": "using-the-accesskey-attribute-on-a-legend-element-to-define-a-command",
"original_id": "using-the-accesskey-attribute-on-a-legend-element-to-define-a-command"
},
{
"id": "using-the-accesskey-attribute-to-define-a-command-on-other-elements",
"original_id": "using-the-accesskey-attribute-to-define-a-command-on-other-elements"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "anchor-points",
"original_id": "anchor-points"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "hyperlink-auditing",
"original_id": "hyperlink-auditing"
}
]

View file

@ -1,68 +0,0 @@
[
{
"id": "rel-alternate",
"original_id": "rel-alternate"
},
{
"id": "link-type-author",
"original_id": "link-type-author"
},
{
"id": "link-type-bookmark",
"original_id": "link-type-bookmark"
},
{
"id": "link-type-help",
"original_id": "link-type-help"
},
{
"id": "rel-icon",
"original_id": "rel-icon"
},
{
"id": "link-type-license",
"original_id": "link-type-license"
},
{
"id": "link-type-nofollow",
"original_id": "link-type-nofollow"
},
{
"id": "link-type-noreferrer",
"original_id": "link-type-noreferrer"
},
{
"id": "link-type-prefetch",
"original_id": "link-type-prefetch"
},
{
"id": "link-type-search",
"original_id": "link-type-search"
},
{
"id": "link-type-stylesheet",
"original_id": "link-type-stylesheet"
},
{
"id": "link-type-tag",
"original_id": "link-type-tag"
},
{
"id": "sequential-link-types",
"original_id": "sequential-link-types",
"children": [
{
"id": "link-type-next",
"original_id": "link-type-next"
},
{
"id": "link-type-prev",
"original_id": "link-type-prev"
}
]
},
{
"id": "other-link-types",
"original_id": "other-link-types"
}
]

View file

@ -1,18 +0,0 @@
[
{
"id": "scriptinglanguages",
"original_id": "scriptingLanguages"
},
{
"id": "restrictions-for-contents-of-script-elements",
"original_id": "restrictions-for-contents-of-script-elements"
},
{
"id": "inline-documentation-for-external-scripts",
"original_id": "inline-documentation-for-external-scripts"
},
{
"id": "scripttagxslt",
"original_id": "scriptTagXSLT"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "outlines",
"original_id": "outlines"
}
]

View file

@ -1,10 +0,0 @@
[
{
"id": "forming-a-table",
"original_id": "forming-a-table"
},
{
"id": "header-and-data-cell-semantics",
"original_id": "header-and-data-cell-semantics"
}
]

View file

@ -1,10 +0,0 @@
[
{
"id": "table-descriptions-techniques",
"original_id": "table-descriptions-techniques"
},
{
"id": "table-layout-techniques",
"original_id": "table-layout-techniques"
}
]

View file

@ -1,490 +0,0 @@
[
{
"id": "overview-of-the-parsing-model",
"original_id": "overview-of-the-parsing-model"
},
{
"id": "the-input-byte-stream",
"original_id": "the-input-byte-stream",
"children": [
{
"id": "determining-the-character-encoding",
"original_id": "determining-the-character-encoding"
},
{
"id": "character-encodings-0",
"original_id": "character-encodings-0"
},
{
"id": "changing-the-encoding-while-parsing",
"original_id": "changing-the-encoding-while-parsing"
},
{
"id": "preprocessing-the-input-stream",
"original_id": "preprocessing-the-input-stream"
}
]
},
{
"id": "parse-state",
"original_id": "parse-state",
"children": [
{
"id": "the-insertion-mode",
"original_id": "the-insertion-mode"
},
{
"id": "the-stack-of-open-elements",
"original_id": "the-stack-of-open-elements"
},
{
"id": "the-list-of-active-formatting-elements",
"original_id": "the-list-of-active-formatting-elements"
},
{
"id": "the-element-pointers",
"original_id": "the-element-pointers"
},
{
"id": "other-parsing-state-flags",
"original_id": "other-parsing-state-flags"
}
]
},
{
"id": "tokenization",
"original_id": "tokenization",
"children": [
{
"id": "data-state",
"original_id": "data-state"
},
{
"id": "character-reference-in-data-state",
"original_id": "character-reference-in-data-state"
},
{
"id": "rcdata-state",
"original_id": "rcdata-state"
},
{
"id": "character-reference-in-rcdata-state",
"original_id": "character-reference-in-rcdata-state"
},
{
"id": "rawtext-state",
"original_id": "rawtext-state"
},
{
"id": "script-data-state",
"original_id": "script-data-state"
},
{
"id": "plaintext-state",
"original_id": "plaintext-state"
},
{
"id": "tag-open-state",
"original_id": "tag-open-state"
},
{
"id": "end-tag-open-state",
"original_id": "end-tag-open-state"
},
{
"id": "tag-name-state",
"original_id": "tag-name-state"
},
{
"id": "rcdata-less-than-sign-state",
"original_id": "rcdata-less-than-sign-state"
},
{
"id": "rcdata-end-tag-open-state",
"original_id": "rcdata-end-tag-open-state"
},
{
"id": "rcdata-end-tag-name-state",
"original_id": "rcdata-end-tag-name-state"
},
{
"id": "rawtext-less-than-sign-state",
"original_id": "rawtext-less-than-sign-state"
},
{
"id": "rawtext-end-tag-open-state",
"original_id": "rawtext-end-tag-open-state"
},
{
"id": "rawtext-end-tag-name-state",
"original_id": "rawtext-end-tag-name-state"
},
{
"id": "script-data-less-than-sign-state",
"original_id": "script-data-less-than-sign-state"
},
{
"id": "script-data-end-tag-open-state",
"original_id": "script-data-end-tag-open-state"
},
{
"id": "script-data-end-tag-name-state",
"original_id": "script-data-end-tag-name-state"
},
{
"id": "script-data-escape-start-state",
"original_id": "script-data-escape-start-state"
},
{
"id": "script-data-escape-start-dash-state",
"original_id": "script-data-escape-start-dash-state"
},
{
"id": "script-data-escaped-state",
"original_id": "script-data-escaped-state"
},
{
"id": "script-data-escaped-dash-state",
"original_id": "script-data-escaped-dash-state"
},
{
"id": "script-data-escaped-dash-dash-state",
"original_id": "script-data-escaped-dash-dash-state"
},
{
"id": "script-data-escaped-less-than-sign-state",
"original_id": "script-data-escaped-less-than-sign-state"
},
{
"id": "script-data-escaped-end-tag-open-state",
"original_id": "script-data-escaped-end-tag-open-state"
},
{
"id": "script-data-escaped-end-tag-name-state",
"original_id": "script-data-escaped-end-tag-name-state"
},
{
"id": "script-data-double-escape-start-state",
"original_id": "script-data-double-escape-start-state"
},
{
"id": "script-data-double-escaped-state",
"original_id": "script-data-double-escaped-state"
},
{
"id": "script-data-double-escaped-dash-state",
"original_id": "script-data-double-escaped-dash-state"
},
{
"id": "script-data-double-escaped-dash-dash-state",
"original_id": "script-data-double-escaped-dash-dash-state"
},
{
"id": "script-data-double-escaped-less-than-sign-state",
"original_id": "script-data-double-escaped-less-than-sign-state"
},
{
"id": "script-data-double-escape-end-state",
"original_id": "script-data-double-escape-end-state"
},
{
"id": "before-attribute-name-state",
"original_id": "before-attribute-name-state"
},
{
"id": "attribute-name-state",
"original_id": "attribute-name-state"
},
{
"id": "after-attribute-name-state",
"original_id": "after-attribute-name-state"
},
{
"id": "before-attribute-value-state",
"original_id": "before-attribute-value-state"
},
{
"id": "attribute-value-double-quoted-state",
"original_id": "attribute-value-(double-quoted)-state"
},
{
"id": "attribute-value-single-quoted-state",
"original_id": "attribute-value-(single-quoted)-state"
},
{
"id": "attribute-value-unquoted-state",
"original_id": "attribute-value-(unquoted)-state"
},
{
"id": "character-reference-in-attribute-value-state",
"original_id": "character-reference-in-attribute-value-state"
},
{
"id": "after-attribute-value-quoted-state",
"original_id": "after-attribute-value-(quoted)-state"
},
{
"id": "self-closing-start-tag-state",
"original_id": "self-closing-start-tag-state"
},
{
"id": "bogus-comment-state",
"original_id": "bogus-comment-state"
},
{
"id": "markup-declaration-open-state",
"original_id": "markup-declaration-open-state"
},
{
"id": "comment-start-state",
"original_id": "comment-start-state"
},
{
"id": "comment-start-dash-state",
"original_id": "comment-start-dash-state"
},
{
"id": "comment-state",
"original_id": "comment-state"
},
{
"id": "comment-end-dash-state",
"original_id": "comment-end-dash-state"
},
{
"id": "comment-end-state",
"original_id": "comment-end-state"
},
{
"id": "comment-end-bang-state",
"original_id": "comment-end-bang-state"
},
{
"id": "doctype-state",
"original_id": "doctype-state"
},
{
"id": "before-doctype-name-state",
"original_id": "before-doctype-name-state"
},
{
"id": "doctype-name-state",
"original_id": "doctype-name-state"
},
{
"id": "after-doctype-name-state",
"original_id": "after-doctype-name-state"
},
{
"id": "after-doctype-public-keyword-state",
"original_id": "after-doctype-public-keyword-state"
},
{
"id": "before-doctype-public-identifier-state",
"original_id": "before-doctype-public-identifier-state"
},
{
"id": "doctype-public-identifier-double-quoted-state",
"original_id": "doctype-public-identifier-(double-quoted)-state"
},
{
"id": "doctype-public-identifier-single-quoted-state",
"original_id": "doctype-public-identifier-(single-quoted)-state"
},
{
"id": "after-doctype-public-identifier-state",
"original_id": "after-doctype-public-identifier-state"
},
{
"id": "between-doctype-public-and-system-identifiers-state",
"original_id": "between-doctype-public-and-system-identifiers-state"
},
{
"id": "after-doctype-system-keyword-state",
"original_id": "after-doctype-system-keyword-state"
},
{
"id": "before-doctype-system-identifier-state",
"original_id": "before-doctype-system-identifier-state"
},
{
"id": "doctype-system-identifier-double-quoted-state",
"original_id": "doctype-system-identifier-(double-quoted)-state"
},
{
"id": "doctype-system-identifier-single-quoted-state",
"original_id": "doctype-system-identifier-(single-quoted)-state"
},
{
"id": "after-doctype-system-identifier-state",
"original_id": "after-doctype-system-identifier-state"
},
{
"id": "bogus-doctype-state",
"original_id": "bogus-doctype-state"
},
{
"id": "cdata-section-state",
"original_id": "cdata-section-state"
},
{
"id": "tokenizing-character-references",
"original_id": "tokenizing-character-references"
}
]
},
{
"id": "tree-construction",
"original_id": "tree-construction",
"children": [
{
"id": "creating-and-inserting-elements",
"original_id": "creating-and-inserting-elements"
},
{
"id": "closing-elements-that-have-implied-end-tags",
"original_id": "closing-elements-that-have-implied-end-tags"
},
{
"id": "foster-parenting",
"original_id": "foster-parenting"
},
{
"id": "parsing-main-inhtml",
"original_id": "parsing-main-inhtml",
"children": [
{
"id": "the-initial-insertion-mode",
"original_id": "the-initial-insertion-mode"
},
{
"id": "the-before-html-insertion-mode",
"original_id": "the-before-html-insertion-mode"
},
{
"id": "the-before-head-insertion-mode",
"original_id": "the-before-head-insertion-mode"
},
{
"id": "parsing-main-inhead",
"original_id": "parsing-main-inhead"
},
{
"id": "parsing-main-inheadnoscript",
"original_id": "parsing-main-inheadnoscript"
},
{
"id": "the-after-head-insertion-mode",
"original_id": "the-after-head-insertion-mode"
},
{
"id": "parsing-main-inbody",
"original_id": "parsing-main-inbody"
},
{
"id": "parsing-main-incdata",
"original_id": "parsing-main-incdata"
},
{
"id": "parsing-main-intable",
"original_id": "parsing-main-intable"
},
{
"id": "parsing-main-intabletext",
"original_id": "parsing-main-intabletext"
},
{
"id": "parsing-main-incaption",
"original_id": "parsing-main-incaption"
},
{
"id": "parsing-main-incolgroup",
"original_id": "parsing-main-incolgroup"
},
{
"id": "parsing-main-intbody",
"original_id": "parsing-main-intbody"
},
{
"id": "parsing-main-intr",
"original_id": "parsing-main-intr"
},
{
"id": "parsing-main-intd",
"original_id": "parsing-main-intd"
},
{
"id": "parsing-main-inselect",
"original_id": "parsing-main-inselect"
},
{
"id": "parsing-main-inselectintable",
"original_id": "parsing-main-inselectintable"
},
{
"id": "parsing-main-afterbody",
"original_id": "parsing-main-afterbody"
},
{
"id": "parsing-main-inframeset",
"original_id": "parsing-main-inframeset"
},
{
"id": "parsing-main-afterframeset",
"original_id": "parsing-main-afterframeset"
},
{
"id": "the-after-after-body-insertion-mode",
"original_id": "the-after-after-body-insertion-mode"
},
{
"id": "the-after-after-frameset-insertion-mode",
"original_id": "the-after-after-frameset-insertion-mode"
}
]
},
{
"id": "parsing-main-inforeign",
"original_id": "parsing-main-inforeign"
}
]
},
{
"id": "the-end",
"original_id": "the-end"
},
{
"id": "coercing-an-html-dom-into-an-infoset",
"original_id": "coercing-an-html-dom-into-an-infoset"
},
{
"id": "an-introduction-to-error-handling-and-strange-cases-in-the-parser",
"original_id": "an-introduction-to-error-handling-and-strange-cases-in-the-parser",
"children": [
{
"id": "misnested-tags-b-i-b-i",
"original_id": "misnested-tags:-b-i-/b-/i"
},
{
"id": "misnested-tags-b-p-b-p",
"original_id": "misnested-tags:-b-p-/b-/p"
},
{
"id": "unexpected-markup-in-tables",
"original_id": "unexpected-markup-in-tables"
},
{
"id": "scripts-that-modify-the-page-as-it-is-being-parsed",
"original_id": "scripts-that-modify-the-page-as-it-is-being-parsed"
},
{
"id": "the-execution-of-scripts-that-are-moving-across-multiple-documents",
"original_id": "the-execution-of-scripts-that-are-moving-across-multiple-documents"
},
{
"id": "unclosed-formatting-elements",
"original_id": "unclosed-formatting-elements"
}
]
}
]

View file

@ -1,26 +0,0 @@
[
{
"id": "start-tags",
"original_id": "start-tags"
},
{
"id": "end-tags",
"original_id": "end-tags"
},
{
"id": "attributes-0",
"original_id": "attributes-0"
},
{
"id": "optional-tags",
"original_id": "optional-tags"
},
{
"id": "element-restrictions",
"original_id": "element-restrictions"
},
{
"id": "cdata-rcdata-restrictions",
"original_id": "cdata-rcdata-restrictions"
}
]

View file

@ -1,6 +0,0 @@
[
{
"id": "newlines",
"original_id": "newlines"
}
]

View file

@ -1,14 +0,0 @@
[
{
"id": "definitions-1",
"original_id": "definitions-1"
},
{
"id": "processing-model-3",
"original_id": "processing-model-3"
},
{
"id": "generic-task-sources",
"original_id": "generic-task-sources"
}
]

View file

@ -1,18 +0,0 @@
[
{
"id": "event-handler-attributes",
"original_id": "event-handler-attributes"
},
{
"id": "event-handlers-on-elements-document-objects-and-window-objects",
"original_id": "event-handlers-on-elements,-document-objects,-and-window-objects"
},
{
"id": "event-firing",
"original_id": "event-firing"
},
{
"id": "events-and-the-window-object",
"original_id": "events-and-the-window-object"
}
]

View file

@ -1,28 +0,0 @@
[
{
"id": "definitions-0",
"original_id": "definitions-0"
},
{
"id": "calling-scripts",
"original_id": "calling-scripts"
},
{
"id": "creating-scripts",
"original_id": "creating-scripts"
},
{
"id": "killing-scripts",
"original_id": "killing-scripts"
},
{
"id": "runtime-script-errors",
"original_id": "runtime-script-errors",
"children": [
{
"id": "runtime-script-errors-in-documents",
"original_id": "runtime-script-errors-in-documents"
}
]
}
]

View file

@ -1,13 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>[[CanBlock]] in a dedicated worker agent</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dedicated-worker-agent">
<link rel="help" href="https://tc39.github.io/ecma262/#sec-agentcansuspend">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
fetch_tests_from_worker(new Worker("worker-that-requires-success.js"));
</script>

View file

@ -1,14 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>[[CanBlock]] in a service worker agent</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#service-worker-agent">
<link rel="help" href="https://tc39.github.io/ecma262/#sec-agentcansuspend">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script>
"use strict";
service_worker_test("worker-that-requires-failure.js", "Service worker test setup");
</script>

View file

@ -1,13 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>[[CanBlock]] in a shared worker agent</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#shared-worker-agent">
<link rel="help" href="https://tc39.github.io/ecma262/#sec-agentcansuspend">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
fetch_tests_from_worker(new SharedWorker("worker-that-requires-success.js"));
</script>

View file

@ -1,21 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>[[CanBlock]] in a similar-origin window agent</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#similar-origin-window-agent">
<link rel="help" href="https://tc39.github.io/ecma262/#sec-agentcansuspend">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
const sab = new SharedArrayBuffer(16);
const ta = new Int32Array(sab);
assert_throws(new TypeError(), () => {
Atomics.wait(ta, 0, 0, 10);
}, "Atomics.wait must throw in a window context");
done();
</script>

View file

@ -1,5 +1,4 @@
"use strict";
importScripts("/resources/testharness.js");
// META: global=!default,window,serviceworker
test(() => {
const sab = new SharedArrayBuffer(16);
@ -9,5 +8,3 @@ test(() => {
Atomics.wait(ta, 0, 0, 10);
});
}, `[[CanBlock]] in a ${self.constructor.name}`);
done();

View file

@ -1,5 +1,4 @@
"use strict";
importScripts("/resources/testharness.js");
// META: global=!default,dedicatedworker,sharedworker
test(() => {
const sab = new SharedArrayBuffer(16);
@ -7,5 +6,3 @@ test(() => {
assert_equals(Atomics.wait(ta, 0, 0, 10), "timed-out");
}, `[[CanBlock]] in a ${self.constructor.name}`);
done();

View file

@ -1,22 +0,0 @@
[
{
"id": "client-identification",
"original_id": "client-identification"
},
{
"id": "custom-handlers",
"original_id": "custom-handlers"
},
{
"id": "security-and-privacy",
"original_id": "security-and-privacy"
},
{
"id": "sample-handler-impl",
"original_id": "sample-handler-impl"
},
{
"id": "manually-releasing-the-storage-mutex",
"original_id": "manually-releasing-the-storage-mutex"
}
]

View file

@ -34,7 +34,7 @@ let frame_content = "data:text/html;utf8,<body>" +
"};" +
"let observer = new PerformanceObserver(observe);" +
"observer.observe({ entryTypes: ['resource'] });" +
"fetch(url);" +
"fetch(url).then(r => r.text());" +
"</" + "script></body>";
document.getElementById("frameContext").src = frame_content;
</script>

View file

@ -34,7 +34,7 @@ let frame_content = "data:text/html;utf8,<body>" +
"};" +
"let observer = new PerformanceObserver(observe);" +
"observer.observe({ entryTypes: ['resource'] });" +
"fetch(url);" +
"fetch(url).then(r => r.text());" +
"</" + "script></body>";
document.getElementById("frameContext").src = frame_content;
</script>

View file

@ -12,7 +12,7 @@
<script>
let eventFired = false;
let loadRandomResource = () => {
return fetch(window.location.href + "?" + Math.random());
return fetch(window.location.href + "?" + Math.random()).then(r => r.text());
}
setup(() => {

View file

@ -23,7 +23,7 @@
}
let observer = new PerformanceObserver(observe);
observer.observe({ entryTypes: ["resource"] });
fetch(url);
fetch(url).then(r => r.text());
</script>
</body>
</html>

View file

@ -3,6 +3,19 @@
// This polyfill library implements the WebXR Test API as specified here:
// https://github.com/immersive-web/webxr-test-api
let default_standing = new gfx.mojom.Transform();
default_standing.matrix = [1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 1.65, 0, 1];
const default_stage_parameters = {
standingTransform: default_standing,
sizeX: 0,
sizeZ: 0,
bounds: null
};
class ChromeXRTest {
constructor() {
this.mockVRService_ = new MockVRService(mojo.frameInterfaces);
@ -69,6 +82,17 @@ class MockVRService {
this.runtimes_ = [];
}
removeRuntime(device) {
let index = this.runtimes_.indexOf(device);
if (index >= 0) {
this.runtimes_.splice(index, 1);
if (this.client_) {
console.error("Notifying client");
this.client_.onDeviceChanged();
}
}
}
// VRService implementation.
requestDevice() {
if (this.runtimes_.length > 0) {
@ -147,6 +171,8 @@ class MockRuntime {
this.pose_ = null;
this.next_frame_id_ = 0;
this.bounds_ = null;
this.send_pose_reset_ = false;
this.service_ = service;
@ -168,10 +194,27 @@ class MockRuntime {
this.setViewerOrigin(fakeDeviceInit.viewerOrigin);
}
if (fakeDeviceInit.localToFloorLevelTransform != null) {
this.setLocalToFloorLevelTransform(fakeDeviceInit.localToFloorLevelTransform);
}
// This appropriately handles if the coordinates are null
this.setBoundsGeometry(fakeDeviceInit.boundsCoordinates);
this.setViews(fakeDeviceInit.views);
}
// Test API methods.
disconnect() {
this.service_.removeRuntime(this);
this.presentation_provider_.Close();
if (this.sessionClient_.ptr.isBound()) {
this.sessionClient_.ptr.reset();
}
return Promise.resolve();
}
setViews(views) {
if (views) {
let changed = false;
@ -210,7 +253,91 @@ class MockRuntime {
this.pose_ = null;
}
simulateVisibilityChange(visibilityState) {
// TODO(https://crbug.com/982099): Chrome currently does not have a way for
// devices to bubble up any form of visibilityChange.
}
setBoundsGeometry(bounds) {
if (bounds == null) {
this.bounds_ = null;
} else if (bounds.length < 3) {
throw new Error("Bounds must have a length of at least 3");
} else {
this.bounds_ = bounds;
}
// We can only set bounds if we have stageParameters set; otherwise, we
// don't know the transform from local space to bounds space.
// We'll cache the bounds so that they can be set in the future if the
// floorLevel transform is set, but we won't update them just yet.
if (this.displayInfo_.stageParameters) {
this.displayInfo_.stageParameters.bounds = this.bounds_;
if (this.sessionClient_.ptr.isBound()) {
this.sessionClient_.onChanged(this.displayInfo_);
}
}
}
setLocalToFloorLevelTransform(transform) {
if (!this.displayInfo_.stageParameters) {
this.displayInfo_.stageParameters = default_stage_parameters;
this.displayInfo_.stageParameters.bounds = this.bounds_;
}
this.displayInfo_.stageParameters.standingTransform = new gfx.mojom.Transform();
this.displayInfo_.stageParameters.standingTransform.matrix =
this.getMatrixFromTransform(transform);
if (this.sessionClient_.ptr.isBound()) {
this.sessionClient_.onChanged(this.displayInfo_);
}
}
clearLocalToFloorLevelTransform() {
if (this.displayInfo_.stageParameters) {
this.displayInfo_.stageParameters = null;
if (this.sessionClient_.ptr.isBound()) {
this.sessionClient_.onChanged(this.displayInfo_);
}
}
}
simulateResetPose() {
this.send_pose_reset_ = true;
}
// Helper methods
getMatrixFromTransform(transform) {
let x = transform.orientation[0];
let y = transform.orientation[1];
let z = transform.orientation[2];
let w = transform.orientation[3];
let m11 = 1.0 - 2.0 * (y * y + z * z);
let m21 = 2.0 * (x * y + z * w);
let m31 = 2.0 * (x * z - y * w);
let m12 = 2.0 * (x * y - z * w);
let m22 = 1.0 - 2.0 * (x * x + z * z);
let m32 = 2.0 * (y * z + x * w);
let m13 = 2.0 * (x * z + y * w);
let m23 = 2.0 * (y * z - x * w);
let m33 = 1.0 - 2.0 * (x * x + y * y);
let m14 = transform.position[0];
let m24 = transform.position[1];
let m34 = transform.position[2];
// Column-major linearized order is expected.
return [m11, m21, m31, 0,
m12, m22, m32, 0,
m13, m23, m33, 0,
m14, m24, m34, 1];
}
getNonImmersiveDisplayInfo() {
let displayInfo = this.getImmersiveDisplayInfo();
@ -297,6 +424,8 @@ class MockRuntime {
getFrameData() {
if (this.pose_) {
this.pose_.poseIndex++;
this.pose_.poseReset = this.send_pose_reset_;
this.send_pose_reset_ = false;
}
// Convert current document time to monotonic time.
@ -429,6 +558,11 @@ class MockXRPresentationProvider {
this.submitFrameClient_.onSubmitFrameTransferred(true);
this.submitFrameClient_.onSubmitFrameRendered();
}
// Utility methods
Close() {
this.binding_.close();
}
}
// This is a temporary workaround for the fact that spinning up webxr before

View file

@ -0,0 +1,105 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Toast: action tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<main></main>
<script type="module">
import { testActionToast, testToastElement, assertActionButtonOnToast } from './resources/helpers.js';
import { showToast } from 'std:elements/toast';
testActionToast((toast) => {
assert_equals(toast.action.textContent, 'action');
}, 'the action element gets properly captured with this.action');
testActionToast((toast) => {
toast.innerHTML = `<button slot='action'>new action</button>`
assert_equals(toast.action.textContent, 'new action');
}, 'changing the action button changes this.action');
testToastElement((toast) => {
assert_equals(toast.action, null);
}, 'the action property of a toast without an action is null');
testToastElement((toast) => {
toast.innerHTML = `<button slot="action" id="first">first</button>
<button slot="action" id="second">second</button>`;
assert_equals(toast.action, toast.querySelector('#first'));
}, 'toast action returns the first item with the action slot');
test(() => {
const toast = showToast('Message', {action: 'action'});
const actionButton = toast.querySelector('button');
assertActionButtonOnToast(actionButton, toast);
}, 'passing an action via showToast creates a button');
test(() => {
const actionMarkup = '<b>strong text</b>';
const toast = showToast('Message', {action: actionMarkup});
const actionButton = toast.querySelector('button');
assert_equals(actionButton.textContent, actionMarkup);
assert_equals(toast.querySelector('b'), null);
}, 'passing markup to the action option represents as text');
test(() => {
const toast = document.createElement('std-toast');
toast.textContent = 'Message';
toast.show({action: 'action'});
const actionButton = toast.querySelector('button');
assert_equals(actionButton, null);
}, 'passing action option to show does not create a button');
test(() => {
const toast = showToast('Message', {action: null});
const actionButton = toast.querySelector('button');
assertActionButtonOnToast(actionButton, toast);
assert_equals(actionButton.textContent, 'null');
}, 'passing non-string (null) as action option stringifies it and creates an action button');
test(() => {
const toast = showToast('Message', {action: false});
const actionButton = toast.querySelector('button');
assertActionButtonOnToast(actionButton, toast);
assert_equals(actionButton.textContent, 'false');
}, 'passing non-string (false) as action option stringifies it and creates an action button');
test(() => {
const toast = showToast('Message', {action: 0});
const actionButton = toast.querySelector('button');
assertActionButtonOnToast(actionButton, toast);
assert_equals(actionButton.textContent, '0');
}, 'passing non-string (0) as action option stringifies it and creates an action button');
test(() => {
const toast = showToast('Message', {action: 1});
const actionButton = toast.querySelector('button');
assertActionButtonOnToast(actionButton, toast);
assert_equals(actionButton.textContent, '1');
}, 'passing non-string (1) as action option stringifies it and creates an action button');
test(() => {
const toast = showToast('Message', {action: {field: 'value'}});
const actionButton = toast.querySelector('button');
assertActionButtonOnToast(actionButton, toast);
assert_equals(actionButton.textContent, '[object Object]');
}, 'passing non-string ({field: value}) as action option stringifies it and creates an action button');
test(() => {
const toast = showToast('Message', {});
const actionButton = toast.querySelector('button');
assert_equals(actionButton, null);
}, 'passing non-string (undefined) as action option does not create an action button');
</script>

View file

@ -115,7 +115,7 @@ testToastElementAsync((t, toast) => {
}, 'toggling open attribute does not start timeout');
testToastElement((toast) => {
const permitted_properties = ['constructor', 'show', 'hide', 'toggle', 'open'];
const permitted_properties = ['constructor', 'show', 'hide', 'toggle', 'open', 'action'];
assert_array_equals(permitted_properties.sort(), Object.getOwnPropertyNames(toast.__proto__).sort());
}, 'toast only exposes certain properties');
</script>

View file

@ -1,6 +1,6 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Toast: Event tests</title>
<title>Toast: event (open) tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@ -13,9 +13,7 @@ import { testToastElement, EventCollector } from './resources/helpers.js';
testToastElement((toast) => {
const counter = new EventCollector();
toast.addEventListener('show', (e) => {
counter.getCallback()(e);
});
toast.addEventListener('show', counter.getCallback());
toast.open = true;
assert_equals(counter.getCount(), 1);

View file

@ -1,6 +1,6 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Toast: Event tests</title>
<title>Toast: event (show/hide) tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="timeout" content="long">
<title>Toast: showToast tests</title>
<title>Toast: option tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

View file

@ -53,6 +53,12 @@ export const assertToastNotShown = (toast) => {
assert_false(toast.open);
};
export const assertActionButtonOnToast = (action, toast) => {
assert_equals(toast.action, action);
assert_equals(action.getAttribute('slot'), 'action');
assert_equals(action, toast.querySelector('button'));
};
export class EventCollector {
events = [];

View file

@ -20,7 +20,7 @@ content_types = utils.invert_dict({
"text/css": ["css"],
"text/event-stream": ["event_stream"],
"text/html": ["htm", "html"],
"text/javascript": ["js"],
"text/javascript": ["js", "mjs"],
"text/plain": ["txt", "md"],
"text/vtt": ["vtt"],
"video/mp4": ["mp4", "m4v"],

View file

@ -96,10 +96,16 @@
test(function() {
this.add_cleanup(cleanupPerformanceTimeline);
assert_throws(new TypeError(), function() {
self.performance.measure("wrongUsage2", {'start': 2}, 12);
self.performance.measure("optionsAndNumberEnd", {'start': 2}, 12);
}, "measure should throw a TypeError when passed an options object and an end time");
assert_throws(new TypeError(), function() {
self.performance.measure("wrongUsage3", {'start': 2}, 'mark1');
self.performance.measure("optionsAndMarkEnd", {'start': 2}, 'mark1');
}, "measure should throw a TypeError when passed an options object and an end mark");
assert_throws(new TypeError(), function() {
self.performance.measure("negativeStartInOptions", {'start': -1});
}, "measure cannot have a negative time stamp.");
assert_throws(new TypeError(), function() {
self.performance.measure("negativeEndInOptions", {'end': -1});
}, "measure cannot have a negative time stamp for end.");
}, "measure should throw a TypeError when passed an invalid argument combination");
</script>

View file

@ -133,7 +133,7 @@
// Task: verify if the method chaining actually works.
audit.define('verification', (task, should) => {
// We pick the lowest sample rate allowed to run the test efficiently.
let context = new OfflineAudioContext(1, 128, 3000);
let context = new OfflineAudioContext(1, 128, 8000);
let constantBuffer = createConstantBuffer(context, 1, 1.0);

View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html class="a">
<head>
<title>MediaStreamAudioSourceNode</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body class="a">
<div id="log"></div>
<script>
setup({explicit_done: true});
// Wait until the DOM is ready to be able to get a reference to the canvas
// element.
window.addEventListener("load", function() {
const ac = new AudioContext();
const emptyStream = new MediaStream();
test(function() {
assert_throws(
"InvalidStateError",
function() {
ac.createMediaStreamSource(emptyStream);
},
`A MediaStreamAudioSourceNode can only be constructed via the factory
method with a MediaStream that has at least one track of kind "audio"`
);
}, "MediaStreamAudioSourceNode created with factory method and MediaStream with no tracks");
test(function() {
assert_throws(
"InvalidStateError",
function() {
new MediaStreamAudioSourceNode(ac, { mediaStream: emptyStream });
},
`A MediaStreamAudioSourceNode can only be constructed via the constructor
with a MediaStream that has at least one track of kind "audio"`
);
}, "MediaStreamAudioSourceNode created with constructor and MediaStream with no tracks");
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
const videoOnlyStream = canvas.captureStream();
test(function() {
assert_throws(
"InvalidStateError",
function() {
ac.createMediaStreamSource(videoOnlyStream);
},
`A MediaStreamAudioSourceNode can only be constructed via the factory with a
MediaStream that has at least one track of kind "audio"`
);
}, `MediaStreamAudioSourceNode created with the factory method and MediaStream with only a video track`);
test(function() {
assert_throws(
"InvalidStateError",
function() {
new MediaStreamAudioSourceNode(ac, {
mediaStream: videoOnlyStream,
});
},
`A MediaStreamAudioSourceNode can only be constructed via the factory with a
MediaStream that has at least one track of kind "audio"`
);
}, `MediaStreamAudioSourceNode created with constructor and MediaStream with only a video track`);
done();
});
</script>
</body>
<canvas></canvas>
</html>

View file

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html class="a">
<head>
<title>MediaStreamAudioSourceNode</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body class="a">
<div id="log"></div>
<script>
function binIndexForFrequency(frequency, analyser) {
return (
1 +
Math.round(
(frequency * analyser.fftSize) / analyser.context.sampleRate
)
);
}
const t = async_test(
"MediaStreamAudioSourceNode captures the right track."
);
const ac = new AudioContext();
// Test that the right track is captured. Set up a MediaStream that has two
// tracks, one with a tone at 100Hz and one with a tone at 1000Hz.
const dest0 = ac.createMediaStreamDestination();
const dest1 = ac.createMediaStreamDestination();
const osc0 = ac.createOscillator();
const osc1 = ac.createOscillator();
osc0.frequency.value = 100;
osc1.frequency.value = 1000;
osc0.connect(dest0);
osc1.connect(dest1);
osc0.start(0);
osc1.start(0);
const track0 = dest0.stream.getAudioTracks()[0];
const track0id = track0.id;
const track1 = dest1.stream.getAudioTracks()[0];
const track1id = track1.id;
let ids = [track0id, track1id];
ids.sort();
let targetFrequency;
let otherFrequency;
if (ids[0] == track0id) {
targetFrequency = 100;
otherFrequency = 1000;
} else {
targetFrequency = 1000;
otherFrequency = 100;
}
let twoTrackMediaStream = new MediaStream();
twoTrackMediaStream.addTrack(track0);
twoTrackMediaStream.addTrack(track1);
const twoTrackSource = ac.createMediaStreamSource(twoTrackMediaStream);
const analyser = ac.createAnalyser();
twoTrackSource.connect(analyser);
const indexToCheckForHighEnergy = binIndexForFrequency(
targetFrequency,
analyser
);
const indexToCheckForLowEnergy = binIndexForFrequency(
otherFrequency,
analyser
);
let frequencyData = new Float32Array(1024);
let checkCount = 0;
let numberOfRemovals = 0;
let stopped = false;
function analyse() {
analyser.getFloatFrequencyData(frequencyData);
// there should be high energy in the right bin, higher than 40dbfs because
// it's supposed to be a sine wave at 0dbfs
if (frequencyData[indexToCheckForHighEnergy] > -40 && !stopped) {
assert_true(true, "Correct track routed to the AudioContext.");
checkCount++;
}
if (stopped && frequencyData[indexToCheckForHighEnergy] < -40) {
assert_true(
true,
`After stopping the track, low energy is found in the
same bin`
);
checkCount++;
}
// Don't assert(false) immediately here if the bin is still higher than
// -40db the analyzer node has a window and it's expecte that it takes some
// time for the volume of this bin to decrease. Similarly, -50 may seem
// quite high but is also a product of windowing.
if (frequencyData[indexToCheckForLowEnergy] < -50) {
assert_true(true, "Correct track routed to the AudioContext.");
} else {
assert_true(
false,
"Other track seem to be routed to the AudioContext?"
);
}
if (checkCount > 5 && checkCount < 20) {
twoTrackMediaStream.getAudioTracks().forEach(track => {
if (track.id == ids[0]) {
numberOfRemovals++;
window.removedTrack = track;
twoTrackMediaStream.removeTrack(track);
}
});
assert_true(
numberOfRemovals == 1,
`The mediastreamtrack can only be
removed once from the mediastream`
);
} else if (checkCount >= 20 && checkCount < 30) {
window.removedTrack.stop();
stopped = true;
} else if (checkCount >= 30) {
assert_true(
numberOfRemovals == 1,
`After removing the track from the
mediastream, it's still routed to the graph.`
);
// After some time, consider that it worked.
t.done();
return;
}
t.step_timeout(analyse, 100);
}
t.step_timeout(analyse, 100);
</script>
</body>
</html>

View file

@ -52,6 +52,8 @@ def test_get_current_url_file_protocol(session, server_config):
session.url = url
response = get_current_url(session)
if response.status == 200 and response.body['value'].endswith('/'):
url += '/'
assert_success(response, url)

View file

@ -75,15 +75,15 @@ def test_out_of_bounds(session, rect):
def test_width_height_floats(session):
response = set_window_rect(session, {"width": 500.5, "height": 420})
response = set_window_rect(session, {"width": 750.5, "height": 700})
value = assert_success(response)
assert value["width"] == 500
assert value["height"] == 420
assert value["width"] == 750
assert value["height"] == 700
response = set_window_rect(session, {"width": 500, "height": 450.5})
response = set_window_rect(session, {"width": 750, "height": 700.5})
value = assert_success(response)
assert value["width"] == 500
assert value["height"] == 450
assert value["width"] == 750
assert value["height"] == 700
def test_x_y_floats(session):
@ -147,10 +147,10 @@ def test_restore_from_minimized(session):
session.window.minimize()
assert document_hidden(session)
response = set_window_rect(session, {"width": 450, "height": 450})
response = set_window_rect(session, {"width": 750, "height": 700})
value = assert_success(response)
assert value["width"] == 450
assert value["height"] == 450
assert value["width"] == 750
assert value["height"] == 700
assert not document_hidden(session)
@ -160,10 +160,10 @@ def test_restore_from_maximized(session):
session.window.maximize()
assert session.window.size != original_size
response = set_window_rect(session, {"width": 400, "height": 400})
response = set_window_rect(session, {"width": 750, "height": 700})
value = assert_success(response)
assert value["width"] == 400
assert value["height"] == 400
assert value["width"] == 750
assert value["height"] == 700
def test_height_width(session):

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