diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-ui/parsing | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-ui/parsing')
35 files changed, 880 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-ui/parsing/box-sizing-computed.html b/testing/web-platform/tests/css/css-ui/parsing/box-sizing-computed.html new file mode 100644 index 0000000000..9b7f1d1c42 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/box-sizing-computed.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().boxSizing</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#box-sizing"> +<meta name="assert" content="box-sizing 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> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("box-sizing", "content-box"); +test_computed_value("box-sizing", "border-box"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/box-sizing-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/box-sizing-invalid.html new file mode 100644 index 0000000000..984475450a --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/box-sizing-invalid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing box-sizing with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#box-sizing"> +<meta name="assert" content="box-sizing supports only the grammar 'content-box | border-box'."> +<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("box-sizing", "auto"); +test_invalid_value("box-sizing", "content-box border-box"); +test_invalid_value("box-sizing", "fill-box"); +test_invalid_value("box-sizing", "margin-box"); +test_invalid_value("box-sizing", "padding-box"); +test_invalid_value("box-sizing", "view-box"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/box-sizing-valid.html b/testing/web-platform/tests/css/css-ui/parsing/box-sizing-valid.html new file mode 100644 index 0000000000..3dfa4f9794 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/box-sizing-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing box-sizing with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#box-sizing"> +<meta name="assert" content="box-sizing supports the full grammar 'content-box | border-box'."> +<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("box-sizing", "content-box"); +test_valid_value("box-sizing", "border-box"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/caret-color-computed.html b/testing/web-platform/tests/css/css-ui/parsing/caret-color-computed.html new file mode 100644 index 0000000000..0428c783f5 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/caret-color-computed.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().caretColor</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#caret-color"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<style> + #target { + color: blue; + } +</style> +</head> +<body> +<div id="target"></div> +<script> +'use strict'; +const currentColor = "rgb(0, 0, 255)"; +test_computed_value("caret-color", "auto", currentColor); +test_computed_value("caret-color", "currentColor", currentColor); +test_computed_value("caret-color", "red", "rgb(255, 0, 0)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/caret-color-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/caret-color-invalid.html new file mode 100644 index 0000000000..a59b01ec2b --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/caret-color-invalid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing caret-color with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#caret-color"> +<meta name="assert" content="caret-color supports only the grammar 'auto | <color>'."> +<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("caret-color", "none"); +test_invalid_value("caret-color", "invert"); +test_invalid_value("caret-color", "50%"); +test_invalid_value("caret-color", "red green"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/caret-color-valid.html b/testing/web-platform/tests/css/css-ui/parsing/caret-color-valid.html new file mode 100644 index 0000000000..dd35cf8e90 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/caret-color-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing caret-color with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#caret-color"> +<meta name="assert" content="caret-color supports the full grammar 'auto | <color>'."> +<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("caret-color", "auto"); +test_valid_value("caret-color", "rgba(10, 20, 30, 0.4)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/cursor-computed.html b/testing/web-platform/tests/css/css-ui/parsing/cursor-computed.html new file mode 100644 index 0000000000..76b3201016 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/cursor-computed.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().cursor</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#cursor"> +<meta name="assert" content="cursor computed value is as specified for keywords."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("cursor", "auto"); +test_computed_value("cursor", "default"); +test_computed_value("cursor", "none"); +test_computed_value("cursor", "context-menu"); +test_computed_value("cursor", "help"); +test_computed_value("cursor", "pointer"); +test_computed_value("cursor", "progress"); +test_computed_value("cursor", "wait"); +test_computed_value("cursor", "cell"); +test_computed_value("cursor", "crosshair"); +test_computed_value("cursor", "text"); +test_computed_value("cursor", "vertical-text"); +test_computed_value("cursor", "alias"); +test_computed_value("cursor", "copy"); +test_computed_value("cursor", "move"); +test_computed_value("cursor", "no-drop"); +test_computed_value("cursor", "not-allowed"); +test_computed_value("cursor", "grab"); +test_computed_value("cursor", "grabbing"); +test_computed_value("cursor", "e-resize"); +test_computed_value("cursor", "n-resize"); +test_computed_value("cursor", "ne-resize"); +test_computed_value("cursor", "nw-resize"); +test_computed_value("cursor", "s-resize"); +test_computed_value("cursor", "se-resize"); +test_computed_value("cursor", "sw-resize"); +test_computed_value("cursor", "w-resize"); +test_computed_value("cursor", "ew-resize"); +test_computed_value("cursor", "ns-resize"); +test_computed_value("cursor", "nesw-resize"); +test_computed_value("cursor", "nwse-resize"); +test_computed_value("cursor", "col-resize"); +test_computed_value("cursor", "row-resize"); +test_computed_value("cursor", "all-scroll"); +test_computed_value("cursor", "zoom-in"); +test_computed_value("cursor", "zoom-out"); + +// Not yet tested: // [ [<url> [<x> <y>]?,]* +// "relative URLs converted to absolute" +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/cursor-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/cursor-invalid.html new file mode 100644 index 0000000000..b7928c85d3 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/cursor-invalid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing cursor with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#cursor"> +<meta name="assert" content="cursor supports only the grammar."> +<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("cursor", "en-resize"); +test_invalid_value("cursor", 'url("https://example.com/") alias'); +test_invalid_value("cursor", '1 2 url("https://example.com/"), copy'); +test_invalid_value("cursor", 'url("https://example.com/"), url("https://example.com/") 3, move'); + +test_invalid_value("cursor", 'url("https://example.com/") 1px 2px, copy'); +test_invalid_value("cursor", 'url("https://example.com/"), url("https://example.com/") 3% 4%, move'); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/cursor-valid.html b/testing/web-platform/tests/css/css-ui/parsing/cursor-valid.html new file mode 100644 index 0000000000..8b3c478391 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/cursor-valid.html @@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing cursor with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-4/#cursor"> +<meta name="assert" content="cursor supports the full required grammar."> +<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("cursor", "auto"); +test_valid_value("cursor", "default"); +test_valid_value("cursor", "none"); +test_valid_value("cursor", "context-menu"); +test_valid_value("cursor", "help"); +test_valid_value("cursor", "pointer"); +test_valid_value("cursor", "progress"); +test_valid_value("cursor", "wait"); +test_valid_value("cursor", "cell"); +test_valid_value("cursor", "crosshair"); +test_valid_value("cursor", "text"); +test_valid_value("cursor", "vertical-text"); +test_valid_value("cursor", "alias"); +test_valid_value("cursor", "copy"); +test_valid_value("cursor", "move"); +test_valid_value("cursor", "no-drop"); +test_valid_value("cursor", "not-allowed"); +test_valid_value("cursor", "grab"); +test_valid_value("cursor", "grabbing"); +test_valid_value("cursor", "e-resize"); +test_valid_value("cursor", "n-resize"); +test_valid_value("cursor", "ne-resize"); +test_valid_value("cursor", "nw-resize"); +test_valid_value("cursor", "s-resize"); +test_valid_value("cursor", "se-resize"); +test_valid_value("cursor", "sw-resize"); +test_valid_value("cursor", "w-resize"); +test_valid_value("cursor", "ew-resize"); +test_valid_value("cursor", "ns-resize"); +test_valid_value("cursor", "nesw-resize"); +test_valid_value("cursor", "nwse-resize"); +test_valid_value("cursor", "col-resize"); +test_valid_value("cursor", "row-resize"); +test_valid_value("cursor", "all-scroll"); +test_valid_value("cursor", "zoom-in"); +test_valid_value("cursor", "zoom-out"); + +test_valid_value("cursor", 'url("https://example.com/"), alias', ['url("https://example.com/"), alias', 'url(https://example.com/), alias']); +test_valid_value("cursor", 'url("https://example.com/") 1 calc(2 + 0), copy', ['url("https://example.com/") 1 calc(2), copy', 'url("https://example.com/") 1 2, copy', 'url(https://example.com/) 1 2, copy']); +test_valid_value("cursor", 'url("https://example.com/"), url("https://example.com/") 3 -4, move', ['url("https://example.com/"), url("https://example.com/") 3 -4, move', 'url(https://example.com/), url(https://example.com/) 3 -4, move']); +test_valid_value("cursor", 'url("https://example.com/") 5 6, grab', ['url("https://example.com/") 5 6, grab', 'url(https://example.com/) 5 6, grab']); + +test_valid_value("cursor", 'image-set("https://example.com/" 1x) 5 6, grab', ['image-set("https://example.com/" 1x) 5 6, grab', 'image-set("https://example.com/" 1x) 5 6, grab']); +test_valid_value("cursor", 'image-set("https://example.com/" 1x, "https://example.com/highres" 2x) 5 6, grab', ['image-set("https://example.com/" 1x, "https://example.com/highres" 2x) 5 6, grab', 'image-set("https://example.com/" 1x, "https://example.com/highres" 2x) 5 6, grab']); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-color-computed.html b/testing/web-platform/tests/css/css-ui/parsing/outline-color-computed.html new file mode 100644 index 0000000000..b9aab1d230 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-color-computed.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().outlineColor</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-color"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<style> + #target { + color: blue; + } +</style> +</head> +<body> +<div id="target"></div> +<script> +'use strict'; +const currentColor = "rgb(0, 0, 255)"; +test_computed_value("outline-color", "currentColor", currentColor); +test_computed_value("outline-color", "red", "rgb(255, 0, 0)"); + +test(() => { + const target = document.getElementById('target'); + target.style.outlineColor = 'invert'; + if (target.style.outlineColor === 'invert') + assert_equals(getComputedStyle(target).outlineColor, 'invert'); +}, 'invert, if supported, computes to invert'); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-color-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-color-invalid.html new file mode 100644 index 0000000000..2b910e8030 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-color-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline-color with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-color"> +<meta name="assert" content="outline-color supports only the grammar '<color> | invert'."> +<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("outline-color", "auto"); +test_invalid_value("outline-color", "none"); +test_invalid_value("outline-color", "50%"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-color-valid-mandatory.html b/testing/web-platform/tests/css/css-ui/parsing/outline-color-valid-mandatory.html new file mode 100644 index 0000000000..2af0665824 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-color-valid-mandatory.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline-color with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-color"> +<meta name="assert" content="outline-color supports '<color>'."> +<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("outline-color", "rgba(10, 20, 30, 0.4)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-color-valid-optional.html b/testing/web-platform/tests/css/css-ui/parsing/outline-color-valid-optional.html new file mode 100644 index 0000000000..7993299098 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-color-valid-optional.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline-color with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-color"> +<meta name="assert" content="outline-color supports 'invert'."> +<meta name="flags" content="may"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +// Conformant UAs may ignore the invert value on platforms that do not support color inversion of the pixels on the screen. +test_valid_value("outline-color", "invert"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-invalid.html new file mode 100644 index 0000000000..c43cc3c643 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline"> +<meta name="assert" content="outline supports only the grammar '<outline-color> || <outline> || <outline>'."> +<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("outline", "invert solid rgba(10, 20, 30, 0.4)"); +test_invalid_value("outline", "double invert groove"); +test_invalid_value("outline", "thin outset thick"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-offset-computed.html b/testing/web-platform/tests/css/css-ui/parsing/outline-offset-computed.html new file mode 100644 index 0000000000..39da9f7349 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-offset-computed.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().outlineOffset</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-offset"> +<meta name="assert" content="outline-offset computed value is absolute length."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<style> + #target { + font-size: 40px; + } +</style> +<div id="target"></div> +<script> +test_computed_value("outline-offset", "2.5px"); +test_computed_value("outline-offset", "10px"); +test_computed_value("outline-offset", "0.5em", "20px"); +test_computed_value("outline-offset", "calc(10px + 0.5em)", "30px"); +test_computed_value("outline-offset", "calc(10px - 0.5em)", "-10px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-offset-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-offset-invalid.html new file mode 100644 index 0000000000..3ff26e35ae --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-offset-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline-offset with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-offset"> +<meta name="assert" content="outline-offset supports only the grammar '<length>'."> +<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("outline-offset", "auto"); +test_invalid_value("outline-offset", "1%"); +test_invalid_value("outline-offset", "2px 3px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-offset-valid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-offset-valid.html new file mode 100644 index 0000000000..75fc7e60bd --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-offset-valid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline-offset with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-offset"> +<meta name="assert" content="outline-offset supports the full grammar '<length>'."> +<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("outline-offset", "0", "0px"); +test_valid_value("outline-offset", "1px"); +test_valid_value("outline-offset", "2em"); +test_valid_value("outline-offset", "calc(3rem + 4vw)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-shorthand.html b/testing/web-platform/tests/css/css-ui/parsing/outline-shorthand.html new file mode 100644 index 0000000000..01239e199e --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-shorthand.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: outline sets longhands</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline"> +<link rel="help" href="https://drafts.csswg.org/cssom/#serializing-css-values"> +<meta name="assert" content="outline supports the full grammar '<outline-color> || <outline> || <outline>'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/shorthand-testcommon.js"></script> +</head> +<body> +<script> +test_shorthand_value('outline', '3px ridge blue', { + 'outline-color': 'blue', + 'outline-style': 'ridge', + 'outline-width': '3px' +}); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-style-computed.html b/testing/web-platform/tests/css/css-ui/parsing/outline-style-computed.html new file mode 100644 index 0000000000..3824b8d598 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-style-computed.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().outlineStyle</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-style"> +<meta name="assert" content="outline-style 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> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("outline-style", "auto"); + +test_computed_value("outline-style", "none"); +test_computed_value("outline-style", "dotted"); +test_computed_value("outline-style", "dashed"); +test_computed_value("outline-style", "solid"); +test_computed_value("outline-style", "double"); +test_computed_value("outline-style", "groove"); +test_computed_value("outline-style", "ridge"); +test_computed_value("outline-style", "inset"); +test_computed_value("outline-style", "outset"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-style-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-style-invalid.html new file mode 100644 index 0000000000..a659b68a55 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-style-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing outline-style with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui/#outline-style"> +<meta name="assert" content="outline-style supports only the grammar 'auto | <outline-line-style>'."> +<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("outline-style", "hidden"); +test_invalid_value("outline-style", "dotted dashed"); +test_invalid_value("outline-style", "solid double groove ridge"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-style-valid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-style-valid.html new file mode 100644 index 0000000000..dcaa2d5e7d --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-style-valid.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing outline-style with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui/#outline-style"> +<meta name="assert" content="outline-style supports the full grammar 'auto | <outline-line-style>'."> +<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("outline-style", "auto"); + +test_valid_value("outline-style", "none"); +test_valid_value("outline-style", "dotted"); +test_valid_value("outline-style", "dashed"); +test_valid_value("outline-style", "solid"); +test_valid_value("outline-style", "double"); +test_valid_value("outline-style", "groove"); +test_valid_value("outline-style", "ridge"); +test_valid_value("outline-style", "inset"); +test_valid_value("outline-style", "outset"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-valid-mandatory.html b/testing/web-platform/tests/css/css-ui/parsing/outline-valid-mandatory.html new file mode 100644 index 0000000000..3c79f52712 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-valid-mandatory.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline"> +<link rel="help" href="https://drafts.csswg.org/cssom/#serializing-css-values"> +<meta name="assert" content="outline supports the full grammar '<outline-color> || <outline> || <outline>'."> +<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("outline", "rgba(10, 20, 30, 0.4)"); + +test_valid_value("outline", "auto"); +test_valid_value("outline", "none", ["none", "medium"]); // Edge serializes as "invert" +test_valid_value("outline", "dotted"); +test_valid_value("outline", "dashed"); +test_valid_value("outline", "solid"); +test_valid_value("outline", "double"); +test_valid_value("outline", "groove"); +test_valid_value("outline", "ridge"); +test_valid_value("outline", "inset"); +test_valid_value("outline", "outset"); + +test_valid_value("outline", "0", "0px"); +test_valid_value("outline", "1px"); +test_valid_value("outline", "calc(2em + 3ex)"); +test_valid_value("outline", "thin"); +test_valid_value("outline", "medium", ["none", "medium"]); // Edge serializes as "invert" +test_valid_value("outline", "thick"); + +test_valid_value("outline", "dashed thin"); +test_valid_value("outline", "medium rgba(10, 20, 30, 0.4)", ["rgba(10, 20, 30, 0.4) medium", "rgba(10, 20, 30, 0.4)"]); + +test_valid_value("outline", "3px ridge rgba(10, 20, 30, 0.4)", "rgba(10, 20, 30, 0.4) ridge 3px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-valid-optional.html b/testing/web-platform/tests/css/css-ui/parsing/outline-valid-optional.html new file mode 100644 index 0000000000..8150ffa208 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-valid-optional.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing outline with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline"> +<link rel="help" href="https://drafts.csswg.org/cssom/#serializing-css-values"> +<meta name="assert" content="outline supports the full grammar '<outline-color> || <outline> || <outline>'."> +<meta name="assert" content="outline serializes in canonical order, with shortest possible serialization."> +<meta name="flags" content="may"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +// Conformant UAs may ignore the invert value on platforms that do not support color inversion of the pixels on the screen. +test_valid_value("outline", "invert"); +test_valid_value("outline", "invert dotted 1px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-width-computed.html b/testing/web-platform/tests/css/css-ui/parsing/outline-width-computed.html new file mode 100644 index 0000000000..ecb719bd75 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-width-computed.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().outlineWidth</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-width"> +<meta name="assert" content="outline-width computed value is absolute length, 0 if the outline style is none."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<style> + #target { + font-size: 40px; + + border-style: dotted; /* Avoid border-*-width computed style 0 */ + border-top-width: thin; + border-right-width: medium; + border-bottom-width: thick; + + outline-style: dotted; /* Avoid outline-width computed style 0 */ + } +</style> +<div id="target"></div> +<script> +test_computed_value("outline-width", "2.5px", "2px"); +test_computed_value("outline-width", "10px"); +test_computed_value("outline-width", "0.5em", "20px"); +test_computed_value("outline-width", "calc(10px + 0.5em)", "30px"); +test_computed_value("outline-width", "calc(10px - 0.5em)", "0px"); + +test_computed_value("outline-width", "thin", getComputedStyle(target).borderTopWidth); +test_computed_value("outline-width", "medium", getComputedStyle(target).borderRightWidth); +test_computed_value("outline-width", "thick", getComputedStyle(target).borderBottomWidth); + +test(() => { + target.style['outline-width'] = '10px'; + target.style['outline-style'] = 'none'; + assert_equals(getComputedStyle(target)['outline-width'], '0px'); + target.style['outline-style'] = ''; +}, 'outline-width is 0 when outline-style is none'); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-width-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-width-invalid.html new file mode 100644 index 0000000000..6008fffd94 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-width-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing outline-width with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui/#outline-width"> +<meta name="assert" content="outline-width supports only the grammar '<border-width>'."> +<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("outline-width", "auto"); +test_invalid_value("outline-width", "1%"); +test_invalid_value("outline-width", "thin medium thick medium thin"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/outline-width-valid.html b/testing/web-platform/tests/css/css-ui/parsing/outline-width-valid.html new file mode 100644 index 0000000000..2415e005de --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/outline-width-valid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing outline-width with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui/#outline-width"> +<meta name="assert" content="outline-width supports the full grammar '<border-width>'."> +<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("outline-width", "0", "0px"); +test_valid_value("outline-width", "1px"); +test_valid_value("outline-width", "2em"); +test_valid_value("outline-width", "calc(2em + 3ex)"); +test_valid_value("outline-width", "thin"); +test_valid_value("outline-width", "medium"); +test_valid_value("outline-width", "thick"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/resize-computed.html b/testing/web-platform/tests/css/css-ui/parsing/resize-computed.html new file mode 100644 index 0000000000..c4111f7aeb --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/resize-computed.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().resize</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#resize"> +<meta name="assert" content="resize 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> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("resize", "none"); +test_computed_value("resize", "both"); +test_computed_value("resize", "horizontal"); +test_computed_value("resize", "vertical"); +test_pseudo_computed_value("::before", "resize", "both"); +test_pseudo_computed_value("::after", "resize", "vertical"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/resize-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/resize-invalid.html new file mode 100644 index 0000000000..7f9698f7aa --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/resize-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing resize with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#resize"> +<meta name="assert" content="resize supports only the grammar 'none | both | horizontal | vertical'."> +<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("resize", "auto"); +test_invalid_value("resize", "horizontal vertical"); +test_invalid_value("resize", "both 0"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/resize-valid.html b/testing/web-platform/tests/css/css-ui/parsing/resize-valid.html new file mode 100644 index 0000000000..d50df443e0 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/resize-valid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing resize with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#resize"> +<meta name="assert" content="resize supports the full grammar 'none | both | horizontal | vertical'."> +<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("resize", "none"); +test_valid_value("resize", "both"); +test_valid_value("resize", "horizontal"); +test_valid_value("resize", "vertical"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/text-overflow-computed.html b/testing/web-platform/tests/css/css-ui/parsing/text-overflow-computed.html new file mode 100644 index 0000000000..701506e617 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/text-overflow-computed.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: getComputedStyle().textOverflow</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#text-overflow"> +<meta name="assert" content="text-overflow 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> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("text-overflow", "clip"); +test_computed_value("text-overflow", "ellipsis"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/text-overflow-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/text-overflow-invalid.html new file mode 100644 index 0000000000..aa4169c146 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/text-overflow-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing text-overflow with invalid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#text-overflow"> +<meta name="assert" content="text-overflow supports only the grammar 'clip | ellipsis'."> +<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("text-overflow", "auto"); +test_invalid_value("text-overflow", "clip ellipsis clip"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/text-overflow-valid.html b/testing/web-platform/tests/css/css-ui/parsing/text-overflow-valid.html new file mode 100644 index 0000000000..5d40b6839d --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/text-overflow-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 3: parsing text-overflow with valid values</title> +<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-ui-3/#text-overflow"> +<meta name="assert" content="text-overflow supports the full grammar 'clip | ellipsis'."> +<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("text-overflow", "clip"); +test_valid_value("text-overflow", "ellipsis"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/user-select-computed.html b/testing/web-platform/tests/css/css-ui/parsing/user-select-computed.html new file mode 100644 index 0000000000..ef8691a076 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/user-select-computed.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: getComputedStyle().userSelect</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-4/#content-selection"> +<meta name="assert" content="user-select 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> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("user-select", "auto"); +test_computed_value("user-select", "text"); +test_computed_value("user-select", "none"); +test_computed_value("user-select", "contain"); +test_computed_value("user-select", "all"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/user-select-invalid.html b/testing/web-platform/tests/css/css-ui/parsing/user-select-invalid.html new file mode 100644 index 0000000000..7fe7feeca8 --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/user-select-invalid.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing user-select with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-4/#content-selection"> +<meta name="assert" content="user-select supports only the grammar 'auto | text | none | contain | all'."> +<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("user-select", "visible"); +test_invalid_value("user-select", "text contain"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-ui/parsing/user-select-valid.html b/testing/web-platform/tests/css/css-ui/parsing/user-select-valid.html new file mode 100644 index 0000000000..e78ac7ce2b --- /dev/null +++ b/testing/web-platform/tests/css/css-ui/parsing/user-select-valid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS UI Level 4: parsing user-select with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-4/#content-selection"> +<meta name="assert" content="user-select supports the full grammar 'auto | text | none | contain | all'."> +<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("user-select", "auto"); +test_valid_value("user-select", "text"); +test_valid_value("user-select", "none"); +test_valid_value("user-select", "contain"); +test_valid_value("user-select", "all"); +</script> +</body> +</html> |