summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-inline/parsing
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-inline/parsing')
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-computed.html29
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-invalid.html22
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-valid.html27
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/baseline-shift-computed.html28
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/baseline-shift-invalid.html24
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/baseline-shift-valid.html22
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-computed.html26
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-invalid.html20
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-valid.html25
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/line-height-computed.html36
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/line-height-invalid.html26
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/line-height-valid.html25
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/vertical-align-computed.html37
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/vertical-align-invalid.html31
-rw-r--r--testing/web-platform/tests/css/css-inline/parsing/vertical-align-valid.html31
15 files changed, 409 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-computed.html b/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-computed.html
new file mode 100644
index 0000000000..83137f0564
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-computed.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: getComputedStyle().alignmentBaseline</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#alignment-baseline-property">
+<link rel="help" href="https://www.w3.org/TR/SVG11/text.html#AlignmentBaselineProperty">
+<meta name="assert" content="alignment-baseline 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("alignment-baseline", "baseline");
+test_computed_value("alignment-baseline", "text-bottom");
+test_computed_value("alignment-baseline", "alphabetic");
+test_computed_value("alignment-baseline", "ideographic");
+test_computed_value("alignment-baseline", "middle");
+test_computed_value("alignment-baseline", "central");
+test_computed_value("alignment-baseline", "mathematical");
+test_computed_value("alignment-baseline", "text-top");
+test_computed_value("alignment-baseline", "bottom");
+test_computed_value("alignment-baseline", "center");
+test_computed_value("alignment-baseline", "top");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-invalid.html b/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-invalid.html
new file mode 100644
index 0000000000..62cb70f081
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-invalid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing alignment-baseline with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#alignment-baseline-property">
+<meta name="assert" content="alignment-baseline supports only the grammar 'baseline | text-bottom | alphabetic | ideographic | middle | central | mathematical | text-top | bottom | center | top'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+// alignment-baseline 'auto' was valid in SVG 1.1
+// https://www.w3.org/TR/SVG11/text.html#AlignmentBaselineProperty
+test_invalid_value("alignment-baseline", "auto");
+
+test_invalid_value("alignment-baseline", "none");
+test_invalid_value("alignment-baseline", "baseline text-bottom");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-valid.html b/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-valid.html
new file mode 100644
index 0000000000..3e895d7733
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/alignment-baseline-valid.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing alignment-baseline with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#alignment-baseline-property">
+<meta name="assert" content="alignment-baseline supports the full grammar 'baseline | text-bottom | alphabetic | ideographic | middle | central | mathematical | text-top | bottom | center | top'.">
+<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("alignment-baseline", "baseline");
+test_valid_value("alignment-baseline", "text-bottom");
+test_valid_value("alignment-baseline", "alphabetic");
+test_valid_value("alignment-baseline", "ideographic");
+test_valid_value("alignment-baseline", "middle");
+test_valid_value("alignment-baseline", "central");
+test_valid_value("alignment-baseline", "mathematical");
+test_valid_value("alignment-baseline", "text-top");
+test_valid_value("alignment-baseline", "bottom");
+test_valid_value("alignment-baseline", "center");
+test_valid_value("alignment-baseline", "top");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-computed.html b/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-computed.html
new file mode 100644
index 0000000000..3bef5bae3b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-computed.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: getComputedStyle().baselineShift</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#baseline-shift-property">
+<meta name="assert" content="baseline-shift computed value is the specified keyword or a computed length-percentage value.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+</head>
+<body>
+<div id="target"></div>
+<script>
+test_computed_value("baseline-shift", "-10px");
+test_computed_value("baseline-shift", "20%");
+test_computed_value("baseline-shift", "calc(10px - 0.5em)", "-10px");
+
+test_computed_value("baseline-shift", "sub");
+test_computed_value("baseline-shift", "super");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-invalid.html b/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-invalid.html
new file mode 100644
index 0000000000..1bc395c737
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-invalid.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing baseline-shift with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#baseline-shift-property">
+<meta name="assert" content="baseline-shift supports only the grammar 'length-percentage | sub | super'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+// Valid in SVG 1.1. Accepted by Blink and WebKit.
+// https://github.com/w3c/csswg-drafts/issues/3975
+test_invalid_value("baseline-shift", "5");
+
+test_invalid_value("baseline-shift", "-10px 20%");
+test_invalid_value("baseline-shift", "calc(2em + 3ex), 0");
+test_invalid_value("baseline-shift", "sub super");
+test_invalid_value("baseline-shift", "20px sub");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-valid.html b/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-valid.html
new file mode 100644
index 0000000000..8054ebbb39
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/baseline-shift-valid.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing baseline-shift with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#baseline-shift-property">
+<meta name="assert" content="baseline-shift supports the full grammar 'length-percentage | sub | super'.">
+<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("baseline-shift", "-10px");
+test_valid_value("baseline-shift", "20%");
+test_valid_value("baseline-shift", "calc(2em + 3ex)");
+test_valid_value("baseline-shift", "0", "0px");
+test_valid_value("baseline-shift", "sub");
+test_valid_value("baseline-shift", "super");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-computed.html b/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-computed.html
new file mode 100644
index 0000000000..e844dd71f8
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-computed.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: getComputedStyle().dominantBaseline</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
+<meta name="assert" content="dominant-baseline 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("dominant-baseline", "auto");
+test_computed_value("dominant-baseline", "text-bottom");
+test_computed_value("dominant-baseline", "alphabetic");
+test_computed_value("dominant-baseline", "ideographic");
+test_computed_value("dominant-baseline", "middle");
+test_computed_value("dominant-baseline", "central");
+test_computed_value("dominant-baseline", "mathematical");
+test_computed_value("dominant-baseline", "hanging");
+test_computed_value("dominant-baseline", "text-top");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-invalid.html b/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-invalid.html
new file mode 100644
index 0000000000..2c4b76e026
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-invalid.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing dominant-baseline with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
+<meta name="assert" content="dominant-baseline supports only the grammar 'auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top'.">
+<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("dominant-baseline", "normal");
+test_invalid_value("dominant-baseline", "none");
+test_invalid_value("dominant-baseline", "alphabetic, ideographic");
+test_invalid_value("dominant-baseline", "middle central");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-valid.html b/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-valid.html
new file mode 100644
index 0000000000..1a6c7a400c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/dominant-baseline-valid.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing dominant-baseline with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
+<meta name="assert" content="dominant-baseline supports the full grammar 'auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top'.">
+<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("dominant-baseline", "auto");
+test_valid_value("dominant-baseline", "text-bottom");
+test_valid_value("dominant-baseline", "alphabetic");
+test_valid_value("dominant-baseline", "ideographic");
+test_valid_value("dominant-baseline", "middle");
+test_valid_value("dominant-baseline", "central");
+test_valid_value("dominant-baseline", "mathematical");
+test_valid_value("dominant-baseline", "hanging");
+test_valid_value("dominant-baseline", "text-top");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/line-height-computed.html b/testing/web-platform/tests/css/css-inline/parsing/line-height-computed.html
new file mode 100644
index 0000000000..dff6fc6702
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/line-height-computed.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: getComputedStyle().lineHeight</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#line-height-property">
+<meta name="assert" content="line-height computed value is normal or a length.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<style>
+ #container {
+ font-size: 40px;
+ }
+</style>
+</head>
+<body>
+<div id="container">
+ <div id="target"></div>
+</div>
+<script>
+test_computed_value("line-height", "normal");
+
+test_computed_value("line-height", "0", "0px");
+test_computed_value("line-height", "2", "80px");
+test_computed_value("line-height", "0px");
+test_computed_value("line-height", "10px");
+test_computed_value("line-height", "0%", "0px");
+test_computed_value("line-height", "200%", "80px");
+test_computed_value("line-height", "calc(200% + 10px)", "90px");
+
+test_computed_value('line-height', 'calc(10px - 0.5em)', '0px');
+test_computed_value('line-height', 'calc(10px + 0.5em)', '30px');
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/line-height-invalid.html b/testing/web-platform/tests/css/css-inline/parsing/line-height-invalid.html
new file mode 100644
index 0000000000..e7d4ae6246
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/line-height-invalid.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing line-height with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#line-height-property">
+<meta name="assert" content="line-height supports only the grammar 'normal | <number> | <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("line-height", "auto");
+
+test_invalid_value("line-height", "-2");
+test_invalid_value("line-height", "-10px");
+test_invalid_value("line-height", "-200%");
+
+test_invalid_value("line-height", "2 10px");
+test_invalid_value("line-height", "200% 3");
+test_invalid_value("line-height", "auto 10px");
+test_invalid_value("line-height", "3 auto");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/line-height-valid.html b/testing/web-platform/tests/css/css-inline/parsing/line-height-valid.html
new file mode 100644
index 0000000000..663e2638d8
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/line-height-valid.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing line-height with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-inline-3/#line-height-property">
+<meta name="assert" content="line-height supports the full grammar 'normal | <number> | <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("line-height", "normal");
+
+test_valid_value("line-height", "0");
+test_valid_value("line-height", "2");
+test_valid_value("line-height", "0px");
+test_valid_value("line-height", "10px");
+test_valid_value("line-height", "0%");
+test_valid_value("line-height", "200%");
+test_valid_value("line-height", "calc(200% + 10px)");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/vertical-align-computed.html b/testing/web-platform/tests/css/css-inline/parsing/vertical-align-computed.html
new file mode 100644
index 0000000000..2422508472
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/vertical-align-computed.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: getComputedStyle().verticalAlign</title>
+<link rel="help" href="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align">
+<link rel="help" href="https://drafts.csswg.org/css-inline/#propdef-vertical-align">
+<meta name="assert" content="vertical-align computed value is as specified, with lengths made absolute.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<style>
+ #target {
+ font-size: 40px;
+ }
+</style>
+</head>
+<body>
+<div id="target"></div>
+<script>
+test_computed_value("vertical-align", "baseline");
+test_computed_value("vertical-align", "sub");
+test_computed_value("vertical-align", "super");
+test_computed_value("vertical-align", "top");
+test_computed_value("vertical-align", "text-top");
+test_computed_value("vertical-align", "middle");
+test_computed_value("vertical-align", "bottom");
+test_computed_value("vertical-align", "text-bottom");
+test_computed_value("vertical-align", "-10px");
+test_computed_value("vertical-align", "20%");
+test_computed_value("vertical-align", "calc(20% + 10px)");
+test_computed_value("vertical-align", "calc(10px - 0.5em)", "-10px");
+
+// TODO: Test against the CSS Inline Layout grammar when browsers support it.
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/vertical-align-invalid.html b/testing/web-platform/tests/css/css-inline/parsing/vertical-align-invalid.html
new file mode 100644
index 0000000000..0565eb4a68
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/vertical-align-invalid.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing vertical-align with valid values</title>
+<link rel="help" href="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align">
+<link rel="help" href="https://drafts.csswg.org/css-inline/#propdef-vertical-align">
+<meta name="assert" content="vertical-align only supports the spec 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("vertical-align", "none");
+
+// Two baseline-source values
+test_invalid_value("vertical-align", "first last");
+test_invalid_value("vertical-align", "first, last");
+
+// Two baseline-shift values
+test_invalid_value("vertical-align", "sub super");
+test_invalid_value("vertical-align", "super 10px");
+test_invalid_value("vertical-align", "20% sub");
+
+// Two alignment-baseline values
+test_invalid_value("vertical-align", "baseline middle");
+test_invalid_value("vertical-align", "text-top, bottom");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-inline/parsing/vertical-align-valid.html b/testing/web-platform/tests/css/css-inline/parsing/vertical-align-valid.html
new file mode 100644
index 0000000000..d51c759dcc
--- /dev/null
+++ b/testing/web-platform/tests/css/css-inline/parsing/vertical-align-valid.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Inline Layout: parsing vertical-align with valid values</title>
+<link rel="help" href="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align">
+<link rel="help" href="https://drafts.csswg.org/css-inline/#propdef-vertical-align">
+<meta name="assert" content="vertical-align supports the CSS 2 grammar 'baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <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("vertical-align", "baseline");
+test_valid_value("vertical-align", "sub");
+test_valid_value("vertical-align", "super");
+test_valid_value("vertical-align", "top");
+test_valid_value("vertical-align", "text-top");
+test_valid_value("vertical-align", "middle");
+test_valid_value("vertical-align", "bottom");
+test_valid_value("vertical-align", "text-bottom");
+test_valid_value("vertical-align", "-10px");
+test_valid_value("vertical-align", "20%");
+test_valid_value("vertical-align", "0", "0px");
+test_valid_value("vertical-align", "calc(20% - 10px)");
+
+// TODO: Test against the CSS Inline Layout grammar when browsers support it.
+</script>
+</body>
+</html>