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

@ -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');