summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-position/parsing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-position/parsing
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.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-position/parsing')
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/bottom-computed.html28
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/bottom-invalid.html20
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/bottom-valid.html21
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/inset-computed.html42
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/inset-invalid.html42
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/inset-valid.html62
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/left-computed.html28
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/left-invalid.html20
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/left-valid.html21
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/position-computed.html22
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/position-invalid.html18
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/position-valid.html21
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/right-computed.html28
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/right-invalid.html20
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/right-valid.html21
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/top-computed.html28
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/top-invalid.html20
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/top-valid.html21
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/z-index-computed.html20
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/z-index-invalid.html20
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/z-index-positioned-computed.html25
-rw-r--r--testing/web-platform/tests/css/css-position/parsing/z-index-valid.html21
22 files changed, 569 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-position/parsing/bottom-computed.html b/testing/web-platform/tests/css/css-position/parsing/bottom-computed.html
new file mode 100644
index 0000000000..baeef5daa5
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/bottom-computed.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().bottom</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-bottom">
+<meta name="assert" content="bottom lengths are made absolute.">
+<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>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+<script>
+test_computed_value("bottom", "auto");
+
+test_computed_value("bottom", "calc(10px + 0.5em)", "30px");
+test_computed_value("bottom", "calc(10px - 0.5em)", "-10px");
+test_computed_value("bottom", "-40%");
+test_computed_value("bottom", "calc(50% + 60px)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/bottom-invalid.html b/testing/web-platform/tests/css/css-position/parsing/bottom-invalid.html
new file mode 100644
index 0000000000..6ed6fdd6d4
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/bottom-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing bottom with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-bottom">
+<meta name="assert" content="bottom supports only the grammar 'auto | <length-percentage>'.">
+<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("bottom", "min-content");
+
+test_invalid_value("bottom", "60");
+test_invalid_value("bottom", "10px 20%");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/bottom-valid.html b/testing/web-platform/tests/css/css-position/parsing/bottom-valid.html
new file mode 100644
index 0000000000..7a20bd722b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/bottom-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing bottom with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-bottom">
+<meta name="assert" content="bottom supports the full grammar 'auto | <length-percentage>'.">
+<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("bottom", "auto");
+
+test_valid_value("bottom", "-10px");
+test_valid_value("bottom", "-20%");
+test_valid_value("bottom", "calc(2em + 3ex)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/inset-computed.html b/testing/web-platform/tests/css/css-position/parsing/inset-computed.html
new file mode 100644
index 0000000000..2a52785e32
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/inset-computed.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module: getComputedStyle() for inset properties</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#insets">
+<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>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+<script>
+ const values = [
+ // [input, serialized(optional)]
+ ["auto"],
+ ["calc(10px + 0.5em)", "30px"],
+ ["calc(10px - 0.5em)", "-10px"],
+ ["-40%"],
+ ["calc(50% + 60px)"]
+ ];
+ function test_inset_longhand(longhand_property) {
+ for (let value of values) {
+ if (value[1] === undefined)
+ test_computed_value(longhand_property, value[0]);
+ else
+ test_computed_value(longhand_property, value[0], value[1]);
+ }
+ }
+
+ test_inset_longhand("inset-block-start");
+ test_inset_longhand("inset-block-end");
+ test_inset_longhand("inset-inline-start");
+ test_inset_longhand("inset-inline-end");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/inset-invalid.html b/testing/web-platform/tests/css/css-position/parsing/inset-invalid.html
new file mode 100644
index 0000000000..a96d625382
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/inset-invalid.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module: parsing inset with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#insets">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+ const single_values = [
+ "0deg",
+ "calc(20deg)",
+ "10"
+ ];
+ const double_values = [
+ "inherit auto",
+ "inherit inherit"
+ ];
+ function test_inset_longhand(longhand_property) {
+ for (let value of single_values)
+ test_invalid_value(longhand_property, value);
+ }
+ function test_inset_shorthand(shorthand_property) {
+ for (let value of single_values)
+ test_invalid_value(shorthand_property, value);
+ for (let value of double_values)
+ test_invalid_value(shorthand_property, value);
+ }
+
+ test_inset_longhand("inset-block-start");
+ test_inset_longhand("inset-block-end");
+ test_inset_longhand("inset-inline-start");
+ test_inset_longhand("inset-inline-end");
+
+ test_inset_shorthand("inset-block");
+ test_inset_shorthand("inset-inline");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/inset-valid.html b/testing/web-platform/tests/css/css-position/parsing/inset-valid.html
new file mode 100644
index 0000000000..0faab98737
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/inset-valid.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module: parsing inset with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#insets">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+ const single_values = [
+ // [input, serialized(optional)]
+ ["0", "0px"],
+ ["auto"],
+ ["10%"],
+ ["1rem"],
+ ["-10px"],
+ ["-20%"],
+ ["calc(2em + 3ex)"],
+ ];
+ const double_values = [
+ // [input, serialized(optional)]
+ ["auto auto", "auto"],
+ ["100px 100px", "100px"],
+ ["10% -5px"],
+ ["1rem calc(0px)"]
+ ];
+ function test_inset_longhand(longhand_property) {
+ for (let value of single_values) {
+ if (value[1] === undefined)
+ test_valid_value(longhand_property, value[0]);
+ else
+ test_valid_value(longhand_property, value[0], value[1]);
+ }
+ }
+ function test_inset_shorthand(shorthand_property) {
+ for (let value of single_values) {
+ if (value[1] === undefined)
+ test_valid_value(shorthand_property, value[0]);
+ else
+ test_valid_value(shorthand_property, value[0], value[1]);
+ }
+ for (let value of double_values) {
+ if (value[1] === undefined)
+ test_valid_value(shorthand_property, value[0]);
+ else
+ test_valid_value(shorthand_property, value[0], value[1]);
+ }
+ }
+
+ test_inset_longhand("inset-block-start");
+ test_inset_longhand("inset-block-end");
+ test_inset_longhand("inset-inline-start");
+ test_inset_longhand("inset-inline-end");
+
+ test_inset_shorthand("inset-block");
+ test_inset_shorthand("inset-inline");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/left-computed.html b/testing/web-platform/tests/css/css-position/parsing/left-computed.html
new file mode 100644
index 0000000000..9c8430ab10
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/left-computed.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().left</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-left">
+<meta name="assert" content="left lengths are made absolute.">
+<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>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+<script>
+test_computed_value("left", "auto");
+
+test_computed_value("left", "calc(10px + 0.5em)", "30px");
+test_computed_value("left", "calc(10px - 0.5em)", "-10px");
+test_computed_value("left", "-40%");
+test_computed_value("left", "calc(50% + 60px)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/left-invalid.html b/testing/web-platform/tests/css/css-position/parsing/left-invalid.html
new file mode 100644
index 0000000000..d4308e400d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/left-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing left with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-left">
+<meta name="assert" content="left supports only the grammar 'auto | <length-percentage>'.">
+<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("left", "min-content");
+
+test_invalid_value("left", "60");
+test_invalid_value("left", "10px 20%");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/left-valid.html b/testing/web-platform/tests/css/css-position/parsing/left-valid.html
new file mode 100644
index 0000000000..2d5e364aa9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/left-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing left with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-left">
+<meta name="assert" content="left supports the full grammar 'auto | <length-percentage>'.">
+<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("left", "auto");
+
+test_valid_value("left", "-10px");
+test_valid_value("left", "-20%");
+test_valid_value("left", "calc(2em + 3ex)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/position-computed.html b/testing/web-platform/tests/css/css-position/parsing/position-computed.html
new file mode 100644
index 0000000000..50badd3c15
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/position-computed.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().position</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-position">
+<meta name="assert" content="position 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("position", "static");
+test_computed_value("position", "relative");
+test_computed_value("position", "absolute");
+test_computed_value("position", "sticky");
+test_computed_value("position", "fixed");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/position-invalid.html b/testing/web-platform/tests/css/css-position/parsing/position-invalid.html
new file mode 100644
index 0000000000..441cb036d1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/position-invalid.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing position with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-position">
+<meta name="assert" content="position supports only the grammar 'static | relative | absolute | sticky | fixed'.">
+<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("position", "auto");
+test_invalid_value("position", "static relative");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/position-valid.html b/testing/web-platform/tests/css/css-position/parsing/position-valid.html
new file mode 100644
index 0000000000..67e08bfc8b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/position-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing position with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-position">
+<meta name="assert" content="position supports the full grammar 'static | relative | absolute | sticky | fixed'.">
+<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("position", "static");
+test_valid_value("position", "relative");
+test_valid_value("position", "absolute");
+test_valid_value("position", "sticky");
+test_valid_value("position", "fixed");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/right-computed.html b/testing/web-platform/tests/css/css-position/parsing/right-computed.html
new file mode 100644
index 0000000000..29034c14e1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/right-computed.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().right</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-right">
+<meta name="assert" content="right lengths are made absolute.">
+<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>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+<script>
+test_computed_value("right", "auto");
+
+test_computed_value("right", "calc(10px + 0.5em)", "30px");
+test_computed_value("right", "calc(10px - 0.5em)", "-10px");
+test_computed_value("right", "-40%");
+test_computed_value("right", "calc(50% + 60px)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/right-invalid.html b/testing/web-platform/tests/css/css-position/parsing/right-invalid.html
new file mode 100644
index 0000000000..23be4a0ced
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/right-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing right with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-right">
+<meta name="assert" content="right supports only the grammar 'auto | <length-percentage>'.">
+<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("right", "min-content");
+
+test_invalid_value("right", "60");
+test_invalid_value("right", "10px 20%");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/right-valid.html b/testing/web-platform/tests/css/css-position/parsing/right-valid.html
new file mode 100644
index 0000000000..5ddaa4d5f9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/right-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing right with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-right">
+<meta name="assert" content="right supports the full grammar 'auto | <length-percentage>'.">
+<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("right", "auto");
+
+test_valid_value("right", "-10px");
+test_valid_value("right", "-20%");
+test_valid_value("right", "calc(2em + 3ex)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/top-computed.html b/testing/web-platform/tests/css/css-position/parsing/top-computed.html
new file mode 100644
index 0000000000..faf89495ad
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/top-computed.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().top</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-top">
+<meta name="assert" content="top lengths are made absolute.">
+<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>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+<script>
+test_computed_value("top", "auto");
+
+test_computed_value("top", "calc(10px + 0.5em)", "30px");
+test_computed_value("top", "calc(10px - 0.5em)", "-10px");
+test_computed_value("top", "-40%");
+test_computed_value("top", "calc(50% + 60px)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/top-invalid.html b/testing/web-platform/tests/css/css-position/parsing/top-invalid.html
new file mode 100644
index 0000000000..47907fea9f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/top-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing top with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-top">
+<meta name="assert" content="top supports only the grammar 'auto | <length-percentage>'.">
+<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("top", "min-content");
+
+test_invalid_value("top", "60");
+test_invalid_value("top", "10px 20%");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/top-valid.html b/testing/web-platform/tests/css/css-position/parsing/top-valid.html
new file mode 100644
index 0000000000..212daaf162
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/top-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing top with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-top">
+<meta name="assert" content="top supports the full grammar 'auto | <length-percentage>'.">
+<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("top", "auto");
+
+test_valid_value("top", "-10px");
+test_valid_value("top", "-20%");
+test_valid_value("top", "calc(2em + 3ex)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/z-index-computed.html b/testing/web-platform/tests/css/css-position/parsing/z-index-computed.html
new file mode 100644
index 0000000000..3c53f94417
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/z-index-computed.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().zIndex</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-z-index">
+<meta name="assert" content="z-index computed value is the keyword auto or an integer.">
+<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("z-index", "auto");
+test_computed_value("z-index", "-1");
+test_computed_value("z-index", "calc(3 - 2)", "1");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/z-index-invalid.html b/testing/web-platform/tests/css/css-position/parsing/z-index-invalid.html
new file mode 100644
index 0000000000..d89720ab14
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/z-index-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing z-index with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-z-index">
+<meta name="assert" content="z-index supports only the grammar 'auto | <integer>'.">
+<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("z-index", "none");
+test_invalid_value("z-index", "10px");
+test_invalid_value("z-index", "0.5");
+test_invalid_value("z-index", "auto 123");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/z-index-positioned-computed.html b/testing/web-platform/tests/css/css-position/parsing/z-index-positioned-computed.html
new file mode 100644
index 0000000000..6f19f36f89
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/z-index-positioned-computed.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: getComputedStyle().zIndex</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-z-index">
+<meta name="assert" content="z-index computed value is the keyword auto or an integer.">
+<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>
+<style>
+ #target {
+ position: absolute;
+ }
+</style>
+<script>
+test_computed_value("z-index", "auto");
+test_computed_value("z-index", "-1");
+test_computed_value("z-index", "calc(3 - 2)", "1");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-position/parsing/z-index-valid.html b/testing/web-platform/tests/css/css-position/parsing/z-index-valid.html
new file mode 100644
index 0000000000..3d1ffa0150
--- /dev/null
+++ b/testing/web-platform/tests/css/css-position/parsing/z-index-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Positioned Layout Module Level 3: parsing z-index with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-position/#propdef-z-index">
+<meta name="assert" content="z-index supports the full grammar 'auto | <integer>'.">
+<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("z-index", "auto");
+
+test_valid_value("z-index", "-789");
+test_valid_value("z-index", "0");
+test_valid_value("z-index", "123");
+</script>
+</body>
+</html>