diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-text/parsing | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-text/parsing')
82 files changed, 2139 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-text/parsing/hanging-punctuation-invalid.html b/testing/web-platform/tests/css/css-text/parsing/hanging-punctuation-invalid.html new file mode 100644 index 0000000000..50ed22f1b7 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hanging-punctuation-invalid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing hanging-punctuation with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hanging-punctuation"> +<meta name="assert" content="hanging-punctuation supports only the grammar 'none | [ first || [ force-end | allow-end ] || last ]'."> +<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("hanging-punctuation", "none first"); +test_invalid_value("hanging-punctuation", "last none"); +test_invalid_value("hanging-punctuation", "first first"); +test_invalid_value("hanging-punctuation", "force-end allow-end"); +test_invalid_value("hanging-punctuation", "allow-end last force-end"); +test_invalid_value("hanging-punctuation", "first allow-end last allow-end"); +test_invalid_value("hanging-punctuation", "last force-end last"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hanging-punctuation-valid.html b/testing/web-platform/tests/css/css-text/parsing/hanging-punctuation-valid.html new file mode 100644 index 0000000000..3523a791b8 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hanging-punctuation-valid.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing hanging-punctuation with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hanging-punctuation"> +<meta name="assert" content="hanging-punctuation supports the full grammar 'none | [ first || [ force-end | allow-end ] || last ]'."> +<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("hanging-punctuation", "none"); + +test_valid_value("hanging-punctuation", "first"); +test_valid_value("hanging-punctuation", "force-end"); +test_valid_value("hanging-punctuation", "allow-end"); +test_valid_value("hanging-punctuation", "last"); + +test_valid_value("hanging-punctuation", "first force-end"); +test_valid_value("hanging-punctuation", "first last"); +test_valid_value("hanging-punctuation", "allow-end first"); +test_valid_value("hanging-punctuation", "force-end last"); +test_valid_value("hanging-punctuation", "last first"); +test_valid_value("hanging-punctuation", "last allow-end"); + +test_valid_value("hanging-punctuation", "first allow-end last"); +test_valid_value("hanging-punctuation", "first last force-end"); +test_valid_value("hanging-punctuation", "force-end first last"); +test_valid_value("hanging-punctuation", "allow-end last first"); +test_valid_value("hanging-punctuation", "last first force-end"); +test_valid_value("hanging-punctuation", "last allow-end first"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-computed.html b/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-computed.html new file mode 100644 index 0000000000..9b8d96cdb9 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-computed.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().hyphenateCharacter</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character"> +<meta name="assert" content="hyphenate-character 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("hyphenate-character", "auto"); +test_computed_value("hyphenate-character", "\"=\""); +test_computed_value("hyphenate-character", "\"/-/\""); +test_computed_value("hyphenate-character", "\"\\1400\"", "\"᐀\""); +test_computed_value("hyphenate-character", "\"\""); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-invalid.html b/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-invalid.html new file mode 100644 index 0000000000..29351085bb --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-invalid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing hyphenate-character with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character"> +<meta name="assert" content="hyphenate-character supports only the grammar 'auto | <string>'."> +<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("hyphenate-character", "normal"); +test_invalid_value("hyphenate-character", "manual"); +test_invalid_value("hyphenate-character", "none"); +test_invalid_value("hyphenate-character", "auto auto"); +test_invalid_value("hyphenate-character", "\"-\" \"=\""); +test_invalid_value("hyphenate-character", "1400"); +test_invalid_value("hyphenate-character", "U+1400"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-valid.html b/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-valid.html new file mode 100644 index 0000000000..cef80e1c0a --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphenate-character-valid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing hyphenate-character with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#hyphenate-character"> +<meta name="assert" content="hyphens supports the full grammar 'auto | <string>'."> +<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("hyphenate-character", "auto"); +test_valid_value("hyphenate-character", "\"=\""); +test_valid_value("hyphenate-character", "\"/-/\""); +test_valid_value("hyphenate-character", "\"\\1400\"", "\"᐀\""); +test_valid_value("hyphenate-character", "\"\""); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-computed.html b/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-computed.html new file mode 100644 index 0000000000..bc265c8e81 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-computed.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>CSS Text: hyphenate-limit-chars with computed values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-hyphenate-limit-chars"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<div id="target"></div> +<script> +test_computed_value("hyphenate-character", "auto"); +test_computed_value("hyphenate-limit-chars", "auto auto", "auto"); +test_computed_value("hyphenate-limit-chars", "auto auto auto", "auto"); +test_computed_value("hyphenate-limit-chars", "5"); +test_computed_value("hyphenate-limit-chars", "5 2"); +test_computed_value("hyphenate-limit-chars", "5 2 3"); +test_computed_value("hyphenate-limit-chars", "5 2 calc(3.1)", "5 2 3"); +test_computed_value("hyphenate-limit-chars", "auto 2"); +test_computed_value("hyphenate-limit-chars", "auto 2 auto", "auto 2"); +test_computed_value("hyphenate-limit-chars", "auto auto 2"); +</script> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-invalid.html b/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-invalid.html new file mode 100644 index 0000000000..5a25f747df --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-invalid.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<title>CSS Text: parsing hyphenate-limit-chars with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-hyphenate-limit-chars"> +<meta name="assert" content="hyphenate-character supports only the grammar '[ auto | <integer> ]{1,3}'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> +test_invalid_value("hyphenate-limit-chars", "normal"); +test_invalid_value("hyphenate-limit-chars", "1 normal"); +test_invalid_value("hyphenate-limit-chars", "none"); +test_invalid_value("hyphenate-limit-chars", "1 none"); +test_invalid_value("hyphenate-limit-chars", "1.2"); +test_invalid_value("hyphenate-limit-chars", "1 1.2"); +test_invalid_value("hyphenate-limit-chars", "1 2 1.2"); +test_invalid_value("hyphenate-limit-chars", "1 2 3 4"); +</script> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-valid.html b/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-valid.html new file mode 100644 index 0000000000..2f10e33f1d --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphenate-limit-chars-valid.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<title>CSS Text: parsing hyphenate-limit-chars with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-hyphenate-limit-chars"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> +test_valid_value("hyphenate-limit-chars", "auto"); +test_valid_value("hyphenate-limit-chars", "auto auto"); +test_valid_value("hyphenate-limit-chars", "auto auto auto"); +test_valid_value("hyphenate-limit-chars", "5"); +test_valid_value("hyphenate-limit-chars", "5 2"); +test_valid_value("hyphenate-limit-chars", "5 2 3"); +test_valid_value("hyphenate-limit-chars", "auto 2"); +test_valid_value("hyphenate-limit-chars", "auto 2 auto"); +test_valid_value("hyphenate-limit-chars", "auto auto 2"); +</script> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphens-computed.html b/testing/web-platform/tests/css/css-text/parsing/hyphens-computed.html new file mode 100644 index 0000000000..094e47dab5 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphens-computed.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().hyphens</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hyphens"> +<meta name="assert" content="hyphens computed value is specified keyword."> +<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("hyphens", "none"); +test_computed_value("hyphens", "manual"); +test_computed_value("hyphens", "auto"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphens-invalid.html b/testing/web-platform/tests/css/css-text/parsing/hyphens-invalid.html new file mode 100644 index 0000000000..521600f713 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphens-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing hyphens with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hyphens"> +<meta name="assert" content="hyphens supports only the grammar 'none | manual | auto'."> +<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("hyphens", "normal"); +test_invalid_value("hyphens", "none manual"); +test_invalid_value("hyphens", "auto auto"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/hyphens-valid.html b/testing/web-platform/tests/css/css-text/parsing/hyphens-valid.html new file mode 100644 index 0000000000..0ad72094c7 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/hyphens-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing hyphens with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hyphens"> +<meta name="assert" content="hyphens supports the full grammar 'none | manual | auto'."> +<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("hyphens", "none"); +test_valid_value("hyphens", "manual"); +test_valid_value("hyphens", "auto"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/letter-spacing-computed.html b/testing/web-platform/tests/css/css-text/parsing/letter-spacing-computed.html new file mode 100644 index 0000000000..45417d1b4a --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/letter-spacing-computed.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().letterSpacing</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing"> +<meta name="assert" content="letter-spacing computed value is an absolute length."> +<meta name="assert" content="'normal' computes to zero, but the resolved value of 0px is 'normal', so that's the value that is observed."> +<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("letter-spacing", "normal"); +test_computed_value("letter-spacing", "0px", "normal"); + +test_computed_value("letter-spacing", "10px"); +test_computed_value("letter-spacing", "-20px"); +test_computed_value("letter-spacing", "calc(10px - 0.5em)", "-10px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/letter-spacing-invalid.html b/testing/web-platform/tests/css/css-text/parsing/letter-spacing-invalid.html new file mode 100644 index 0000000000..e9ad4e56a5 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/letter-spacing-invalid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing letter-spacing with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing"> +<meta name="assert" content="letter-spacing supports only the grammar 'normal | <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("letter-spacing", "auto"); +test_invalid_value("letter-spacing", "20"); +test_invalid_value("letter-spacing", "30%"); +test_invalid_value("letter-spacing", "calc(40% + 50px)"); + +test_invalid_value("letter-spacing", "normal 10px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/letter-spacing-valid.html b/testing/web-platform/tests/css/css-text/parsing/letter-spacing-valid.html new file mode 100644 index 0000000000..740d1fc398 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/letter-spacing-valid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing letter-spacing with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing"> +<meta name="assert" content="letter-spacing supports the full grammar 'normal | <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("letter-spacing", "normal"); + +test_valid_value("letter-spacing", "0", "0px"); +test_valid_value("letter-spacing", "-10px"); +test_valid_value("letter-spacing", "calc(2em + 3ex)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/line-break-computed.html b/testing/web-platform/tests/css/css-text/parsing/line-break-computed.html new file mode 100644 index 0000000000..268f4b8e2e --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/line-break-computed.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().lineBreak</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-line-break"> +<meta name="assert" content="line-break computed value is specified keyword."> +<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("line-break", "auto"); +test_computed_value("line-break", "loose"); +test_computed_value("line-break", "normal"); +test_computed_value("line-break", "strict"); +test_computed_value("line-break", "anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/line-break-invalid.html b/testing/web-platform/tests/css/css-text/parsing/line-break-invalid.html new file mode 100644 index 0000000000..aca1664936 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/line-break-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing line-break with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-line-break"> +<meta name="assert" content="line-break supports only the grammar 'auto | loose | normal | strict | anywhere'."> +<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-break", "none"); +test_invalid_value("line-break", "auto loose"); +test_invalid_value("line-break", "strict normal"); +test_invalid_value("line-break", "anywhere anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/line-break-valid.html b/testing/web-platform/tests/css/css-text/parsing/line-break-valid.html new file mode 100644 index 0000000000..caaae9a5a0 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/line-break-valid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing line-break with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-line-break"> +<meta name="assert" content="line-break supports the full grammar 'auto | loose | normal | strict | anywhere'."> +<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-break", "auto"); +test_valid_value("line-break", "loose"); +test_valid_value("line-break", "normal"); +test_valid_value("line-break", "strict"); +test_valid_value("line-break", "anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-computed.html b/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-computed.html new file mode 100644 index 0000000000..5cc8b831a8 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-computed.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().overflowWrap</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-overflow-wrap"> +<meta name="assert" content="overflow-wrap computed value is specified keyword."> +<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("overflow-wrap", "normal"); +test_computed_value("overflow-wrap", "break-word"); +test_computed_value("overflow-wrap", "anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-invalid.html b/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-invalid.html new file mode 100644 index 0000000000..1a467d5f18 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing overflow-wrap with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-overflow-wrap"> +<meta name="assert" content="overflow-wrap supports only the grammar 'normal | break-word | anywhere'."> +<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("overflow-wrap", "auto"); +test_invalid_value("overflow-wrap", "normal break-word"); +test_invalid_value("overflow-wrap", "anywhere anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-valid.html b/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-valid.html new file mode 100644 index 0000000000..8ab907c570 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/overflow-wrap-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing overflow-wrap with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-overflow-wrap"> +<meta name="assert" content="overflow-wrap supports the full grammar 'normal | break-word | anywhere'."> +<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("overflow-wrap", "normal"); +test_valid_value("overflow-wrap", "break-word"); +test_valid_value("overflow-wrap", "anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/tab-size-computed.html b/testing/web-platform/tests/css/css-text/parsing/tab-size-computed.html new file mode 100644 index 0000000000..54d59bb6c0 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/tab-size-computed.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().tabSize</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-tab-size"> +<meta name="assert" content="tab-size computed value is the specified number or an absolute length."> +<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("tab-size", "0"); +test_computed_value("tab-size", "16"); +test_computed_value("tab-size", "4"); +test_computed_value("tab-size", "2.5"); + +test_computed_value("tab-size", "0px"); +test_computed_value("tab-size", "10px"); +test_computed_value("tab-size", "calc(10px + 0.5em)", "30px"); +test_computed_value("tab-size", "calc(10px - 0.5em)", "0px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/tab-size-invalid.html b/testing/web-platform/tests/css/css-text/parsing/tab-size-invalid.html new file mode 100644 index 0000000000..c95c0462f2 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/tab-size-invalid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing tab-size with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-tab-size"> +<meta name="assert" content="tab-size supports only the grammar '<number> | <length>'."> +<meta name="assert" content="Negative tab-size values are not allowed."> +<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("tab-size", "-10px"); +test_invalid_value("tab-size", "-20"); +test_invalid_value("tab-size", "30%"); +test_invalid_value("tab-size", "calc(40% + 50px)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/tab-size-valid.html b/testing/web-platform/tests/css/css-text/parsing/tab-size-valid.html new file mode 100644 index 0000000000..ced5a36609 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/tab-size-valid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing tab-size with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-tab-size"> +<meta name="assert" content="tab-size supports the full grammar '<number> | <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("tab-size", "0"); +test_valid_value("tab-size", "2.5"); + +test_valid_value("tab-size", "0px"); +test_valid_value("tab-size", "10px"); +test_valid_value("tab-size", "calc(2em + 3ex)"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-all-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-align-all-invalid.html new file mode 100644 index 0000000000..70cbadf588 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-all-invalid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-align-all with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-all"> +<meta name="assert" content="text-align-all supports only the grammar 'start | end | left | right | center | justify | match-parent'."> +<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-align-all", "auto"); +test_invalid_value("text-align-all", "start end"); +test_invalid_value("text-align-all", "left right"); +test_invalid_value("text-align-all", "center justify"); +test_invalid_value("text-align-all", "match-parent match-parent"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-all-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-align-all-valid.html new file mode 100644 index 0000000000..f65b15afde --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-all-valid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-align-all with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-all"> +<meta name="assert" content="text-align-all supports the full grammar 'start | end | left | right | center | justify | match-parent'."> +<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-align-all", "start"); +test_valid_value("text-align-all", "end"); +test_valid_value("text-align-all", "left"); +test_valid_value("text-align-all", "right"); +test_valid_value("text-align-all", "center"); +test_valid_value("text-align-all", "justify"); +test_valid_value("text-align-all", "match-parent"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-align-computed.html new file mode 100644 index 0000000000..30c231be66 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-computed.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: getComputedStyle().textAlign</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align"> +<meta name="assert" content="text-align 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> +<style> + #container { + text-align: center; + } +</style> +</head> +<body> +<div id="container"> + <div id="target"></div> +</div> +<script> +test_computed_value("text-align", "start"); +test_computed_value("text-align", "end"); +test_computed_value("text-align", "left"); +test_computed_value("text-align", "right"); +test_computed_value("text-align", "center"); +test_computed_value("text-align", "justify"); +test_computed_value("text-align", "match-parent", "center"); + +// TODO: Test justify-all +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-align-invalid.html new file mode 100644 index 0000000000..38a56d914c --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-invalid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-align with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align"> +<meta name="assert" content="text-align supports only the grammar 'start | end | left | right | center | justify | match-parent | justify-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("text-align", "auto"); +test_invalid_value("text-align", "start end"); +test_invalid_value("text-align", "left right"); +test_invalid_value("text-align", "center justify"); +test_invalid_value("text-align", "justify-all match-parent"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-last-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-align-last-computed.html new file mode 100644 index 0000000000..3e8d0f52d0 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-last-computed.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textAlignLast</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-last"> +<meta name="assert" content="text-align-last computed value is specified keyword."> +<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-align-last", "auto"); +test_computed_value("text-align-last", "start"); +test_computed_value("text-align-last", "end"); +test_computed_value("text-align-last", "left"); +test_computed_value("text-align-last", "right"); +test_computed_value("text-align-last", "center"); +test_computed_value("text-align-last", "justify"); +test_computed_value("text-align-last", "match-parent"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-last-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-align-last-invalid.html new file mode 100644 index 0000000000..c16e9a6c13 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-last-invalid.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-align-last with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-last"> +<meta name="assert" content="text-align-last supports only the grammar 'auto | start | end | left | right | center | justify | match-parent'."> +<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-align-last", "none"); +test_invalid_value("text-align-last", "auto start"); +test_invalid_value("text-align-last", "end left"); +test_invalid_value("text-align-last", "right center"); +test_invalid_value("text-align-last", "justify match-parent"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-last-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-align-last-valid.html new file mode 100644 index 0000000000..c64e7d8a39 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-last-valid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-align-last with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-last"> +<meta name="assert" content="text-align-last supports the full grammar 'auto | start | end | left | right | center | justify | match-parent'."> +<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-align-last", "auto"); +test_valid_value("text-align-last", "start"); +test_valid_value("text-align-last", "end"); +test_valid_value("text-align-last", "left"); +test_valid_value("text-align-last", "right"); +test_valid_value("text-align-last", "center"); +test_valid_value("text-align-last", "justify"); +test_valid_value("text-align-last", "match-parent"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-align-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-align-valid.html new file mode 100644 index 0000000000..e67f4f6f16 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-align-valid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-align with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align"> +<meta name="assert" content="text-align supports the full grammar 'start | end | left | right | center | justify | match-parent | justify-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("text-align", "start"); +test_valid_value("text-align", "end"); +test_valid_value("text-align", "left"); +test_valid_value("text-align", "right"); +test_valid_value("text-align", "center"); +test_valid_value("text-align", "justify"); +test_valid_value("text-align", "match-parent"); +test_valid_value("text-align", "justify-all"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-autospace-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-autospace-computed.html new file mode 100644 index 0000000000..9656f70956 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-autospace-computed.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textAutospace</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-autospace"> +<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-autospace", "normal"); +test_computed_value("text-autospace", "no-autospace"); +test_computed_value("text-autospace", "auto"); + +test_computed_value("text-autospace", "ideograph-alpha"); +test_computed_value("text-autospace", "ideograph-numeric"); + +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-autospace-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-autospace-invalid.html new file mode 100644 index 0000000000..7be73ba76e --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-autospace-invalid.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-autospace with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-autospace"> +<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-autospace", "normal ideograph-alpha"); +test_invalid_value("text-autospace", "normal ideograph-alpha ideograph-numeric"); +test_invalid_value("text-autospace", "normal punctuation"); +test_invalid_value("text-autospace", "auto ideograph-alpha"); +test_invalid_value("text-autospace", "auto ideograph-alpha ideograph-numeric"); +test_invalid_value("text-autospace", "auto punctuation"); + +test_invalid_value("text-autospace", "normal insert"); +test_invalid_value("text-autospace", "normal replace"); +test_invalid_value("text-autospace", "auto insert"); +test_invalid_value("text-autospace", "auto replace"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-autospace-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-autospace-valid.html new file mode 100644 index 0000000000..903da68307 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-autospace-valid.html @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-autospace with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-autospace"> +<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-autospace", "normal"); +test_valid_value("text-autospace", "no-autospace"); + +test_valid_value("text-autospace", "auto"); + +test_valid_value("text-autospace", "ideograph-alpha"); +test_valid_value("text-autospace", "ideograph-numeric"); +test_valid_value("text-autospace", "ideograph-alpha ideograph-numeric"); + +test_valid_value("text-autospace", "punctuation"); +test_valid_value("text-autospace", "punctuation normal"); +test_valid_value("text-autospace", "punctuation ideograph-alpha"); +test_valid_value("text-autospace", "punctuation ideograph-alpha ideograph-numeric"); + +test_valid_value("text-autospace", "ideograph-alpha insert"); +test_valid_value("text-autospace", "ideograph-numeric insert"); +test_valid_value("text-autospace", "ideograph-alpha ideograph-numeric insert"); + +test_valid_value("text-autospace", "punctuation insert"); +test_valid_value("text-autospace", "punctuation normal insert"); +test_valid_value("text-autospace", "punctuation ideograph-alpha insert"); + +test_valid_value("text-autospace", "insert ideograph-alpha"); +test_valid_value("text-autospace", "insert ideograph-numeric"); +test_valid_value("text-autospace", "insert ideograph-alpha ideograph-numeric"); + +test_valid_value("text-autospace", "insert punctuation"); +test_valid_value("text-autospace", "insert punctuation normal"); +test_valid_value("text-autospace", "insert punctuation ideograph-alpha"); +test_valid_value("text-autospace", "insert punctuation ideograph-alpha ideograph-numeric"); + +test_valid_value("text-autospace", "ideograph-alpha replace"); +test_valid_value("text-autospace", "ideograph-numeric replace"); +test_valid_value("text-autospace", "ideograph-alpha ideograph-numeric replace"); + +test_valid_value("text-autospace", "punctuation replace"); +test_valid_value("text-autospace", "punctuation normal replace"); +test_valid_value("text-autospace", "punctuation ideograph-alpha replace"); + +test_valid_value("text-autospace", "replace ideograph-alpha"); +test_valid_value("text-autospace", "replace ideograph-numeric"); +test_valid_value("text-autospace", "replace ideograph-alpha ideograph-numeric"); + +test_valid_value("text-autospace", "replace punctuation"); +test_valid_value("text-autospace", "replace punctuation normal"); +test_valid_value("text-autospace", "replace punctuation ideograph-alpha"); +test_valid_value("text-autospace", "replace punctuation ideograph-alpha ideograph-numeric"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-group-align-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-group-align-invalid.html new file mode 100644 index 0000000000..0c42067bf6 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-group-align-invalid.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-group-align with invalid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-group-align-property"> +<meta name="assert" content="text-group-align supports only the grammar 'none | start | end | left | right | center'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_invalid_value("text-group-align", "auto"); +test_invalid_value("text-group-align", "match-parent"); +test_invalid_value("text-group-align", "justify"); +test_invalid_value("text-group-align", "wrap"); +test_invalid_value("text-group-align", "left right"); +test_invalid_value("text-group-align", "center start"); +test_invalid_value("text-group-align", "end start"); +test_invalid_value("text-group-align", "none center"); +test_invalid_value("text-group-align", "start center"); +test_invalid_value("text-group-align", "right center"); +test_invalid_value("text-group-align", "5px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-group-align-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-group-align-valid.html new file mode 100644 index 0000000000..7f6680bdc5 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-group-align-valid.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-group-align with valid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-group-align-property"> +<meta name="assert" content="text-group-align supports the full grammar 'none | start | end | left | right | center'."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_valid_value("text-group-align", "none"); +test_valid_value("text-group-align", "start"); +test_valid_value("text-group-align", "end"); +test_valid_value("text-group-align", "left"); +test_valid_value("text-group-align", "right"); +test_valid_value("text-group-align", "center"); +test_valid_value("text-group-align", "initial"); +test_valid_value("text-group-align", "inherit"); +test_valid_value("text-group-align", "unset"); +test_valid_value("text-group-align", "revert"); +test_valid_value("text-group-align", "revert-layer"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-indent-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-indent-computed.html new file mode 100644 index 0000000000..0296544e5f --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-indent-computed.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textIndent</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-indent"> +<meta name="assert" content="text-indent computed value is computed <length-percentage> value, plus any specified keywords."> +<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("text-indent", "10px"); +test_computed_value("text-indent", "20%"); +test_computed_value("text-indent", "calc(50% + 60px)"); +test_computed_value("text-indent", "-30px"); +test_computed_value("text-indent", "-40%"); +test_computed_value("text-indent", "calc(10px - 0.5em)", "-10px"); + +test_computed_value("text-indent", "10px hanging"); +test_computed_value("text-indent", "20% each-line"); +test_computed_value("text-indent", "calc(50% + 60px) hanging each-line"); +test_computed_value("text-indent", "each-line hanging calc(10px + 0.5em)", "30px hanging each-line"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-indent-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-indent-invalid.html new file mode 100644 index 0000000000..9b5d7754b1 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-indent-invalid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-indent with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-indent"> +<meta name="assert" content="text-indent supports only the grammar '[ <length-percentage> ] && hanging? && each-line?'."> +<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-indent", "auto"); +test_invalid_value("text-indent", "hanging"); +test_invalid_value("text-indent", "each-line"); +test_invalid_value("text-indent", "10"); + +test_invalid_value("text-indent", "10px hanging 20px"); +test_invalid_value("text-indent", "hanging 20% hanging"); +test_invalid_value("text-indent", "each-line each-line"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-indent-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-indent-valid.html new file mode 100644 index 0000000000..9433ba3d9d --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-indent-valid.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-indent with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-indent"> +<meta name="assert" content="text-indent supports the full grammar '[ <length-percentage> ] && hanging? && each-line?'."> +<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-indent", "10px"); +test_valid_value("text-indent", "20%"); +test_valid_value("text-indent", "calc(2em + 3ex)"); +test_valid_value("text-indent", "calc(50% + 60px)"); +test_valid_value("text-indent", "-30px"); +test_valid_value("text-indent", "-40%"); + +test_valid_value("text-indent", "10px hanging"); +test_valid_value("text-indent", "20% each-line"); +test_valid_value("text-indent", "calc(2em + 3ex) hanging each-line"); + +test_valid_value("text-indent", "hanging calc(50% + 60px)", "calc(50% + 60px) hanging"); +test_valid_value("text-indent", "each-line 10px", "10px each-line"); +test_valid_value("text-indent", "hanging 20% each-line", "20% hanging each-line"); +test_valid_value("text-indent", "each-line hanging calc(2em + 3ex)", "calc(2em + 3ex) hanging each-line"); +test_valid_value("text-indent", "calc(50% + 60px) each-line hanging", "calc(50% + 60px) hanging each-line"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-justify-computed-legacy.html b/testing/web-platform/tests/css/css-text/parsing/text-justify-computed-legacy.html new file mode 100644 index 0000000000..ba47bd408e --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-justify-computed-legacy.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textJustify distribute</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-justify"> +<meta name="assert" content="text-justify: distribute computed value (or is parse-time aliased with) 'inter-character'."> +<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-justify", "distribute", "inter-character"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-justify-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-justify-computed.html new file mode 100644 index 0000000000..3766478d0a --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-justify-computed.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textJustify</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-justify"> +<meta name="assert" content="text-justify computed value is specified keyword."> +<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-justify", "auto"); +test_computed_value("text-justify", "none"); +test_computed_value("text-justify", "inter-word"); +test_computed_value("text-justify", "inter-character"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-justify-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-justify-invalid.html new file mode 100644 index 0000000000..a009ef08eb --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-justify-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-justify with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-justify"> +<meta name="assert" content="text-justify supports only the grammar 'auto | none | inter-word | inter-character'."> +<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-justify", "normal"); +test_invalid_value("text-justify", "auto none"); +test_invalid_value("text-justify", "inter-character inter-word"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-justify-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-justify-valid.html new file mode 100644 index 0000000000..0991409da1 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-justify-valid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-justify with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-justify"> +<meta name="assert" content="text-justify supports the full grammar 'auto | none | inter-word | inter-character'."> +<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-justify", "auto"); +test_valid_value("text-justify", "none"); +test_valid_value("text-justify", "inter-word"); +test_valid_value("text-justify", "inter-character"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-spacing-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-spacing-computed.html new file mode 100644 index 0000000000..845cf075a9 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-spacing-computed.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textSpacing</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-property"> +<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-spacing", "normal"); +test_computed_value("text-spacing", "none"); +test_computed_value("text-spacing", "auto"); + +// `text-autospace`. +test_computed_value("text-spacing", "no-autospace"); + +// `text-spacing-trim`. +test_computed_value("text-spacing", "trim-start"); +test_computed_value("text-spacing", "space-all"); + +// `text-autospace` and `text-spacing-trim`. +test_computed_value("text-spacing", "normal normal", "normal"); +test_computed_value("text-spacing", "normal trim-start", "trim-start"); +test_computed_value("text-spacing", "no-autospace normal", "no-autospace"); +test_computed_value("text-spacing", "no-autospace space-all", "none"); +test_computed_value("text-spacing", "no-autospace trim-start", "trim-start no-autospace"); +// Test the reversed order. +test_computed_value("text-spacing", "trim-start normal ", "trim-start"); +test_computed_value("text-spacing", "normal no-autospace", "no-autospace"); +test_computed_value("text-spacing", "space-all no-autospace", "none"); +test_computed_value("text-spacing", "trim-start no-autospace", "trim-start no-autospace"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-spacing-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-spacing-invalid.html new file mode 100644 index 0000000000..99cac86fb8 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-spacing-invalid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-spacing with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-property"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +// These keywords must appear alone. +for (const keyword of ['none', 'auto']) { + test_invalid_value("text-spacing", `${keyword} ${keyword}`); + for (const keyword2 of ['no-autospace', 'space-first']) { + test_invalid_value("text-spacing", `${keyword} ${keyword2}`); + test_invalid_value("text-spacing", `${keyword2} ${keyword}`); + } +} +test_invalid_value("text-spacing", `normal normal no-autospace`); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-computed.html new file mode 100644 index 0000000000..163a740103 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-computed.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textSpacingTrim</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<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-spacing-trim", "auto"); +test_computed_value("text-spacing-trim", "normal"); +test_computed_value("text-spacing-trim", "space-all"); +test_computed_value("text-spacing-trim", "trim-auto"); +test_computed_value("text-spacing-trim", "trim-all"); +test_computed_value("text-spacing-trim", "trim-start"); +test_computed_value("text-spacing-trim", "space-first"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-invalid.html new file mode 100644 index 0000000000..9f835352b2 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-invalid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-spacing-trim with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<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-spacing-trim", "none"); +test_invalid_value("text-spacing-trim", "normal space-all"); +test_invalid_value("text-spacing-trim", "normal space-first"); +test_invalid_value("text-spacing-trim", "auto space-all"); +test_invalid_value("text-spacing-trim", "auto space-first"); +test_invalid_value("text-spacing-trim", "allow-end"); +test_invalid_value("text-spacing-trim", "allow-end space-first"); +test_invalid_value("text-spacing-trim", "space-first allow-end"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-valid.html new file mode 100644 index 0000000000..a83a099480 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-spacing-trim-valid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-spacing-trim with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<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-spacing-trim", "normal"); +test_valid_value("text-spacing-trim", "auto"); +test_valid_value("text-spacing-trim", "space-all"); +test_valid_value("text-spacing-trim", "trim-auto"); +test_valid_value("text-spacing-trim", "trim-all"); +test_valid_value("text-spacing-trim", "trim-start"); +test_valid_value("text-spacing-trim", "space-first"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-spacing-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-spacing-valid.html new file mode 100644 index 0000000000..d0cb332d2d --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-spacing-valid.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-spacing with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-property"> +<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-spacing", "normal"); +test_valid_value("text-spacing", "none"); +test_valid_value("text-spacing", "auto"); + +// `text-autospace`. +test_valid_value("text-spacing", "no-autospace"); + +// `text-spacing-trim`. +test_valid_value("text-spacing", "trim-start"); +test_valid_value("text-spacing", "space-all"); + +// `text-autospace` and `text-spacing-trim`. +test_valid_value("text-spacing", "normal normal", "normal"); +test_valid_value("text-spacing", "normal trim-start", "trim-start"); +test_valid_value("text-spacing", "no-autospace normal", "no-autospace"); +test_valid_value("text-spacing", "no-autospace space-all", "none"); +test_valid_value("text-spacing", "no-autospace trim-start", "trim-start no-autospace"); +// Test the reversed order. +test_valid_value("text-spacing", "trim-start normal ", "trim-start"); +test_valid_value("text-spacing", "normal no-autospace", "no-autospace"); +test_valid_value("text-spacing", "space-all no-autospace", "none"); +test_valid_value("text-spacing", "trim-start no-autospace", "trim-start no-autospace"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-transform-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-transform-computed.html new file mode 100644 index 0000000000..1808e6fdca --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-transform-computed.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textTransform</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-transform"> +<link rel="help" href="https://w3c.github.io/mathml-core/#new-text-transform-values"> +<meta name="assert" content="text-transform computed value is specified 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("text-transform", "none"); + +test_computed_value("text-transform", "capitalize"); +test_computed_value("text-transform", "uppercase"); +test_computed_value("text-transform", "lowercase"); +test_computed_value("text-transform", "full-width"); +test_computed_value("text-transform", "full-size-kana"); +test_computed_value("text-transform", "math-auto"); + +test_computed_value("text-transform", "capitalize full-width"); +test_computed_value("text-transform", "full-width full-size-kana"); + +test_computed_value("text-transform", "uppercase full-width full-size-kana"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-transform-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-transform-invalid.html new file mode 100644 index 0000000000..3981480d38 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-transform-invalid.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-transform with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-transform"> +<link rel="help" href="https://w3c.github.io/mathml-core/#new-text-transform-values"> +<meta name="assert" content="text-transform supports only the grammar 'none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto'."> +<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-transform", "none full-width"); +test_invalid_value("text-transform", "capitalize none"); + +test_invalid_value("text-transform", "capitalize full-width lowercase"); +test_invalid_value("text-transform", "uppercase full-size-kana uppercase"); +test_invalid_value("text-transform", "full-width full-size-kana full-width"); +test_invalid_value("text-transform", "full-size-kana capitalize full-size-kana"); + + +// math-auto keyword cannot be combined with other values. +test_invalid_value("text-transform", "none math-auto"); +test_invalid_value("text-transform", "math-auto none"); +test_invalid_value("text-transform", "uppercase math-auto"); +test_invalid_value("text-transform", "math-auto uppercase"); +test_invalid_value("text-transform", "lowercase math-auto"); +test_invalid_value("text-transform", "math-auto lowercase"); +test_invalid_value("text-transform", "capitalize math-auto"); +test_invalid_value("text-transform", "math-auto capitalize"); +test_invalid_value("text-transform", "full-width math-auto"); +test_invalid_value("text-transform", "math-auto full-width"); +test_invalid_value("text-transform", "full-size-kana math-auto"); +test_invalid_value("text-transform", "math-auto full-size-kana"); +test_invalid_value("text-transform", "math-auto math-auto"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-transform-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-transform-valid.html new file mode 100644 index 0000000000..522eb791b0 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-transform-valid.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-transform with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-transform"> +<link rel="help" href="https://w3c.github.io/mathml-core/#new-text-transform-values"> +<meta name="assert" content="text-transform supports the full grammar 'none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto'."> +<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-transform", "none"); + +test_valid_value("text-transform", "capitalize"); +test_valid_value("text-transform", "uppercase"); +test_valid_value("text-transform", "lowercase"); +test_valid_value("text-transform", "full-width"); +test_valid_value("text-transform", "full-size-kana"); +test_valid_value("text-transform", "math-auto"); + +test_valid_value("text-transform", "capitalize full-width"); +test_valid_value("text-transform", "uppercase full-size-kana"); +test_valid_value("text-transform", "full-width full-size-kana"); + +// serialization canonicalizes the order of values: https://drafts.csswg.org/cssom/#serialize-a-css-value +test_valid_value("text-transform", "full-width lowercase", "lowercase full-width"); +test_valid_value("text-transform", "full-size-kana capitalize", "capitalize full-size-kana"); +test_valid_value("text-transform", "full-size-kana full-width", "full-width full-size-kana"); + +test_valid_value("text-transform", "capitalize full-width full-size-kana"); + +// serialization canonicalizes the order of values +test_valid_value("text-transform", "full-width full-size-kana uppercase", "uppercase full-width full-size-kana"); +test_valid_value("text-transform", "full-size-kana lowercase full-width", "lowercase full-width full-size-kana"); +test_valid_value("text-transform", "lowercase full-size-kana full-width", "lowercase full-width full-size-kana"); +test_valid_value("text-transform", "full-width uppercase full-size-kana", "uppercase full-width full-size-kana"); +test_valid_value("text-transform", "full-size-kana full-width capitalize", "capitalize full-width full-size-kana"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-computed.html new file mode 100644 index 0000000000..aa9c3c5705 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-computed.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textWrap</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap"> +<meta name="assert" content="text-wrap computed value is '<text-wrap-mode> || <text-wrap-style>'."> +<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-wrap", "wrap"); +test_computed_value("text-wrap", "nowrap"); + +test_computed_value("text-wrap", "auto", "wrap"); +test_computed_value("text-wrap", "balance"); +test_computed_value("text-wrap", "stable"); + +test_computed_value("text-wrap", "wrap auto", "wrap"); +test_computed_value("text-wrap", "wrap balance", "balance"); +test_computed_value("text-wrap", "wrap stable", "stable"); +test_computed_value("text-wrap", "auto wrap", "wrap"); +test_computed_value("text-wrap", "balance wrap", "balance"); +test_computed_value("text-wrap", "stable wrap", "stable"); + +test_computed_value("text-wrap", "nowrap auto", "nowrap"); +test_computed_value("text-wrap", "nowrap balance"); +test_computed_value("text-wrap", "nowrap stable"); +test_computed_value("text-wrap", "auto nowrap", "nowrap"); +test_computed_value("text-wrap", "balance nowrap", "nowrap balance"); +test_computed_value("text-wrap", "stable nowrap", "nowrap stable"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-invalid.html new file mode 100644 index 0000000000..b67cecc183 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-invalid.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-wrap with invalid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap"> +<meta name="assert" content="text-wrap supports only the grammar '<text-wrap-mode> || <text-wrap-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("text-wrap", "normal"); +test_invalid_value("text-wrap", "none"); +test_invalid_value("text-wrap", "wrap nowrap"); +test_invalid_value("text-wrap", "pretty balance"); +test_invalid_value("text-wrap", "balance stable"); +test_invalid_value("text-wrap", "stable pretty"); +test_invalid_value("text-wrap", "delicious wrap"); +test_invalid_value("text-wrap", "5px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-computed.html new file mode 100644 index 0000000000..35e082b647 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-computed.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textWrapMode</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-mode"> +<meta name="assert" content="text-wrap-mode computed value is wrap | nowrap"> +<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-wrap-mode", "wrap"); +test_computed_value("text-wrap-mode", "nowrap"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-invalid.html new file mode 100644 index 0000000000..d63c1901c1 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-invalid.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-wrap-mode with invalid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-mode"> +<meta name="assert" content="text-wrap-mode supports only the grammar '<text-wrap-mode>'."> +<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-wrap-mode", "auto"); +test_invalid_value("text-wrap-mode", "normal"); +test_invalid_value("text-wrap-mode", "none"); +test_invalid_value("text-wrap-mode", "balance"); +test_invalid_value("text-wrap-mode", "pretty"); +test_invalid_value("text-wrap-mode", "stable"); +test_invalid_value("text-wrap-mode", "wrap stable"); +test_invalid_value("text-wrap-mode", "nowrap stable"); +test_invalid_value("text-wrap-mode", "wrap auto"); +test_invalid_value("text-wrap-mode", "balance balance"); +test_invalid_value("text-wrap-mode", "pretty pretty"); +test_invalid_value("text-wrap-mode", "stable stable"); +test_invalid_value("text-wrap-mode", "wrap nowrap"); +test_invalid_value("text-wrap-mode", "pretty balance"); +test_invalid_value("text-wrap-mode", "balance stable"); +test_invalid_value("text-wrap-mode", "stable pretty"); +test_invalid_value("text-wrap-mode", "delicious wrap"); +test_invalid_value("text-wrap-mode", "5px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-valid.html new file mode 100644 index 0000000000..5dde8b377f --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-mode-valid.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-wrap-mode with valid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-mode"> +<meta name="assert" content="text-wrap-mode supports the full 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("text-wrap-mode", "wrap"); +test_valid_value("text-wrap-mode", "nowrap"); + +test_valid_value("text-wrap-mode", "initial"); +test_valid_value("text-wrap-mode", "inherit"); +test_valid_value("text-wrap-mode", "unset"); +test_valid_value("text-wrap-mode", "revert"); +test_valid_value("text-wrap-mode", "revert-layer"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-pretty.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-pretty.html new file mode 100644 index 0000000000..425d1b9c97 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-pretty.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: text-wrap: pretty parsing</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap"> +<meta name="assert" content="text-wrap: pretty parsing"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="target"></div> +<script> +test_valid_value("text-wrap", "pretty"); +test_valid_value("text-wrap", "wrap pretty", "pretty"); +test_valid_value("text-wrap", "pretty wrap", "pretty"); +test_valid_value("text-wrap", "stable wrap", "stable"); +test_valid_value("text-wrap", "nowrap pretty"); +test_valid_value("text-wrap", "pretty nowrap", "nowrap pretty"); +test_valid_value("text-wrap-style", "pretty"); + +test_computed_value("text-wrap", "pretty"); +test_computed_value("text-wrap", "wrap pretty", "pretty"); +test_computed_value("text-wrap", "pretty wrap", "pretty"); +test_computed_value("text-wrap", "stable wrap", "stable"); +test_computed_value("text-wrap", "nowrap pretty"); +test_computed_value("text-wrap", "pretty nowrap", "nowrap pretty"); +test_computed_value("text-wrap-style", "pretty"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-computed.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-computed.html new file mode 100644 index 0000000000..14c9f03cf9 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-computed.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textWrapStyle</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-style"> +<meta name="assert" content="text-wrap-style computed value is auto | balance | pretty | stable"> +<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-wrap-style", "auto"); +test_computed_value("text-wrap-style", "balance"); +test_computed_value("text-wrap-style", "stable"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-invalid.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-invalid.html new file mode 100644 index 0000000000..dcda82e465 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-invalid.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-wrap-style with invalid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-style"> +<meta name="assert" content="text-wrap-style supports only the grammar '<text-wrap-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("text-wrap-style", "normal"); +test_invalid_value("text-wrap-style", "none"); +test_invalid_value("text-wrap-style", "wrap"); +test_invalid_value("text-wrap-style", "nowrap"); +test_invalid_value("text-wrap-style", "wrap wrap"); +test_invalid_value("text-wrap-style", "nowrap nowrap"); +test_invalid_value("text-wrap-style", "wrap nowrap"); +test_invalid_value("text-wrap-style", "pretty balance"); +test_invalid_value("text-wrap-style", "balance stable"); +test_invalid_value("text-wrap-style", "stable pretty"); +test_invalid_value("text-wrap-style", "delicious wrap"); +test_invalid_value("text-wrap-style", "5px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-valid.html new file mode 100644 index 0000000000..f826bdd2f0 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-style-valid.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-wrap-style with valid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap-style"> +<meta name="assert" content="text-wrap-style supports the full 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("text-wrap-style", "auto"); +test_valid_value("text-wrap-style", "balance"); +test_valid_value("text-wrap-style", "stable"); + +test_valid_value("text-wrap-style", "initial"); +test_valid_value("text-wrap-style", "inherit"); +test_valid_value("text-wrap-style", "unset"); +test_valid_value("text-wrap-style", "revert"); +test_valid_value("text-wrap-style", "revert-layer"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/text-wrap-valid.html b/testing/web-platform/tests/css/css-text/parsing/text-wrap-valid.html new file mode 100644 index 0000000000..95a855338e --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/text-wrap-valid.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-wrap with valid values</title> +<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-wrap"> +<meta name="assert" content="text-wrap supports the full grammar '<text-wrap-mode> || <text-wrap-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("text-wrap", "wrap"); +test_valid_value("text-wrap", "nowrap"); + +test_valid_value("text-wrap", "auto", "wrap"); +test_valid_value("text-wrap", "balance"); +test_valid_value("text-wrap", "stable"); + +test_valid_value("text-wrap", "wrap auto", "wrap"); +test_valid_value("text-wrap", "wrap balance", "balance"); +test_valid_value("text-wrap", "wrap stable", "stable"); +test_valid_value("text-wrap", "auto wrap", "wrap"); +test_valid_value("text-wrap", "balance wrap", "balance"); +test_valid_value("text-wrap", "stable wrap", "stable"); + +test_valid_value("text-wrap", "nowrap auto", "nowrap"); +test_valid_value("text-wrap", "nowrap balance"); +test_valid_value("text-wrap", "nowrap stable"); +test_valid_value("text-wrap", "auto nowrap", "nowrap"); +test_valid_value("text-wrap", "balance nowrap", "nowrap balance"); +test_valid_value("text-wrap", "stable nowrap", "nowrap stable"); + +test_valid_value("text-wrap", "initial"); +test_valid_value("text-wrap", "inherit"); +test_valid_value("text-wrap", "unset"); +test_valid_value("text-wrap", "revert"); +test_valid_value("text-wrap", "revert-layer"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-computed.html b/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-computed.html new file mode 100644 index 0000000000..506e257cbe --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-computed.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().whiteSpace</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space"> +<meta name="assert" content="white-space computed value is specified keyword."> +<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("white-space-collapse", "collapse"); +test_computed_value("white-space-collapse", "preserve"); +test_computed_value("white-space-collapse", "preserve-breaks"); +test_computed_value("white-space-collapse", "break-spaces"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-invalid.html b/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-invalid.html new file mode 100644 index 0000000000..0d2856ba37 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-invalid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing white-space-collapse with invalid values</title> +<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#white-space-collapsing"> +<meta name="assert" content="white-space-collapse supports only the grammar 'collapse | discard | preserve | preserve-breaks | preserve-spaces | break-spaces'."> +<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("white-space-collapse", "auto"); +test_invalid_value("white-space-collapse", "none"); +test_invalid_value("white-space-collapse", "collapse preserve"); +test_invalid_value("white-space-collapse", "preserve preserve-breaks"); +test_invalid_value("white-space-collapse", "delicious collapse"); +test_invalid_value("white-space-collapse", "5px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-valid.html b/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-valid.html new file mode 100644 index 0000000000..23c0cd39bb --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-collapse-valid.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing white-space-collapse with valid values</title> +<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#white-space-collapsing"> +<meta name="assert" content="white-space-collapse supports the full grammar 'collapse | discard | preserve | preserve-breaks | preserve-spaces | break-spaces'."> +<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("white-space-collapse", "collapse"); +test_valid_value("white-space-collapse", "preserve"); +test_valid_value("white-space-collapse", "preserve-breaks"); +test_valid_value("white-space-collapse", "break-spaces"); +test_valid_value("white-space-collapse", "initial"); +test_valid_value("white-space-collapse", "inherit"); +test_valid_value("white-space-collapse", "unset"); +test_valid_value("white-space-collapse", "revert"); +test_valid_value("white-space-collapse", "revert-layer"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-computed.html b/testing/web-platform/tests/css/css-text/parsing/white-space-computed.html new file mode 100644 index 0000000000..a7c2ec12eb --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-computed.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().whiteSpace</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space"> +<meta name="assert" content="white-space computed value is specified keyword."> +<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("white-space", "normal"); +test_computed_value("white-space", "pre"); +test_computed_value("white-space", "nowrap"); +test_computed_value("white-space", "pre-wrap"); +test_computed_value("white-space", "break-spaces"); +test_computed_value("white-space", "pre-line"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-invalid.html b/testing/web-platform/tests/css/css-text/parsing/white-space-invalid.html new file mode 100644 index 0000000000..599bd699c5 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-invalid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing white-space with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space"> +<meta name="assert" content="white-space supports only the grammar 'normal | pre | nowrap | pre-wrap | break-spaces | pre-line'."> +<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("white-space", "auto"); +test_invalid_value("white-space", "normal pre"); +test_invalid_value("white-space", "nowrap pre-wrap"); +test_invalid_value("white-space", "pre-line break-spaces"); +test_invalid_value("white-space", "balance"); +test_invalid_value("white-space", "pretty"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-shorthand-text-wrap.html b/testing/web-platform/tests/css/css-text/parsing/white-space-shorthand-text-wrap.html new file mode 100644 index 0000000000..b99dd19e48 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-shorthand-text-wrap.html @@ -0,0 +1,84 @@ +<!DOCTYPE html> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-white-space"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-wrap"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> +.balance { + text-wrap: balance; +} +</style> +<div id="balance" class="balance"></div> +<script> +test(() => { + const target = document.getElementById('balance'); + assert_equals(getComputedStyle(target).textWrap, 'balance'); +}, "`text-wrap: balance` should be set"); +</script> + +<style> +#text-wrap-after-white-space { + white-space: normal; + text-wrap: balance; +} +</style> +<div id="text-wrap-after-white-space"></div> +<script> +test(() => { + const target = document.getElementById('text-wrap-after-white-space'); + assert_equals(getComputedStyle(target).textWrap, 'balance'); +}, "`text-wrap` should not be affected by previous `white-space`"); +</script> + +<style> +#white-space-after-text-wrap-balance { + text-wrap: balance; + white-space: normal; +} +</style> +<div id="white-space-after-text-wrap-balance"></div> +<script> +test(() => { + const target = document.getElementById('white-space-after-text-wrap-balance'); + assert_equals(getComputedStyle(target).textWrap, 'balance'); +}, "`white-space` should not overwrite previous `text-wrap-style: balance`"); +</script> + +<style> +#white-space-after-text-wrap-nowrap { + text-wrap: nowrap balance; + white-space: normal; +} +</style> +<div id="white-space-after-text-wrap-nowrap"></div> +<script> +test(() => { + const target = document.getElementById('white-space-after-text-wrap-nowrap'); + assert_equals(getComputedStyle(target).textWrap, 'balance'); +}, "`white-space` should overwrite previous `text-wrap-mode: nowrap`"); +</script> + +<style> +.normal { + white-space: normal; +} +</style> +<div class="normal"> + <div id="parent-white-space" class="balance"></div> +</div> +<script> +test(() => { + const target = document.getElementById('parent-white-space'); + assert_equals(getComputedStyle(target).textWrap, 'balance'); +}, "`text-wrap` should not be affected by `white-space` on the parent"); +</script> + +<div style="text-wrap: balance nowrap;"> + <div id="parent-text-wrap" class="normal"></div> +</div> +<script> +test(() => { + const target = document.getElementById('parent-text-wrap'); + assert_equals(getComputedStyle(target).textWrap, 'balance'); +}, "`white-space` should overwrite `text-wrap-mode` on the parent"); +</script> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-shorthand.html b/testing/web-platform/tests/css/css-text/parsing/white-space-shorthand.html new file mode 100644 index 0000000000..9cd4bdb43b --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-shorthand.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<title>CSS Text Module Test: parsing white-space as a shorthand</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-white-space"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<div id="target"></div> +<script> +function test_valid_and_computed_value(property, specified, serialized) { + test_valid_value(property, specified, serialized); + test_computed_value(property, specified, serialized); +} + +test_valid_and_computed_value("white-space", "collapse", "normal"); +test_valid_and_computed_value("white-space", "wrap", "normal"); +test_valid_and_computed_value("white-space", "collapse wrap", "normal"); +test_valid_and_computed_value("white-space", "wrap collapse", "normal"); + +test_valid_and_computed_value("white-space", "preserve nowrap", "pre"); +test_valid_and_computed_value("white-space", "nowrap preserve", "pre"); + +test_valid_and_computed_value("white-space", "nowrap", "nowrap"); +test_valid_and_computed_value("white-space", "collapse nowrap", "nowrap"); +test_valid_and_computed_value("white-space", "nowrap collapse", "nowrap"); + +test_valid_and_computed_value("white-space", "preserve", "pre-wrap"); +test_valid_and_computed_value("white-space", "preserve wrap", "pre-wrap"); +test_valid_and_computed_value("white-space", "wrap preserve", "pre-wrap"); + +test_valid_and_computed_value("white-space", "break-spaces", "break-spaces"); +test_valid_and_computed_value("white-space", "break-spaces wrap", "break-spaces"); +test_valid_and_computed_value("white-space", "wrap break-spaces", "break-spaces"); + +test_valid_and_computed_value("white-space", "preserve-breaks", "pre-line"); +test_valid_and_computed_value("white-space", "preserve-breaks wrap", "pre-line"); +test_valid_and_computed_value("white-space", "wrap preserve-breaks", "pre-line"); + +// Combinations of existing values that are not pre-defined. +test_valid_and_computed_value("white-space", "preserve-breaks nowrap", "preserve-breaks nowrap"); +test_valid_and_computed_value("white-space", "nowrap preserve-breaks", "preserve-breaks nowrap"); + +// Values not available through the shorthand. +test_invalid_value("white-space", "balance"); +test_invalid_value("white-space", "collapse balance"); +test_invalid_value("white-space", "balance collapse"); +test_invalid_value("white-space", "preserve balance"); +test_invalid_value("white-space", "balance preserve"); +</script> diff --git a/testing/web-platform/tests/css/css-text/parsing/white-space-valid.html b/testing/web-platform/tests/css/css-text/parsing/white-space-valid.html new file mode 100644 index 0000000000..d872c0b6fb --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/white-space-valid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing white-space with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space"> +<meta name="assert" content="white-space supports the full grammar 'normal | pre | nowrap | pre-wrap | break-spaces | pre-line'."> +<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("white-space", "normal"); +test_valid_value("white-space", "pre"); +test_valid_value("white-space", "nowrap"); +test_valid_value("white-space", "pre-wrap"); +test_valid_value("white-space", "break-spaces"); +test_valid_value("white-space", "pre-line"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-break-computed.html b/testing/web-platform/tests/css/css-text/parsing/word-break-computed.html new file mode 100644 index 0000000000..5a3b7f6685 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-break-computed.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().wordBreak</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-break"> +<meta name="assert" content="word-break computed value is specified keyword."> +<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("word-break", "normal"); +test_computed_value("word-break", "keep-all"); +test_computed_value("word-break", "break-all"); +test_computed_value("word-break", "break-word"); +test_computed_value("word-break", "auto-phrase"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-break-invalid.html b/testing/web-platform/tests/css/css-text/parsing/word-break-invalid.html new file mode 100644 index 0000000000..91b4a8ec47 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-break-invalid.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-break with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-break"> +<meta name="assert" content="word-break supports only the grammar 'normal | break-all| keep-all | manual | auto-phrase | break-word'."> +<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("word-break", "auto"); +test_invalid_value("word-break", "normal keep-all"); +test_invalid_value("word-break", "break-all break-all"); +test_invalid_value("word-break", "normal break-word"); +test_invalid_value("word-break", "break-word normal"); +test_invalid_value("word-break", "keep-all break-word"); +test_invalid_value("word-break", "break-all break-word"); +test_invalid_value("word-break", "word-break"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-break-valid.html b/testing/web-platform/tests/css/css-text/parsing/word-break-valid.html new file mode 100644 index 0000000000..93c58e8557 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-break-valid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-break with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-break"> +<meta name="assert" content="word-break supports only the grammar 'normal | break-all| keep-all | manual | auto-phrase | break-word'."> +<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("word-break", "normal"); +test_valid_value("word-break", "break-all"); +test_valid_value("word-break", "keep-all"); +test_valid_value("word-break", "manual"); +test_valid_value("word-break", "auto-phrase"); +test_valid_value("word-break", "break-word"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-space-transform-computed.html b/testing/web-platform/tests/css/css-text/parsing/word-space-transform-computed.html new file mode 100644 index 0000000000..2137305cec --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-space-transform-computed.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().wordSpaceTransform</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#word-space-transform"> +<meta name="assert" content="word-space-transform computed value is specified keyword."> +<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("word-space-transform", "none"); +test_computed_value("word-space-transform", "space"); +test_computed_value("word-space-transform", "ideographic-space"); +test_computed_value("word-space-transform", "space auto-phrase"); +test_computed_value("word-space-transform", "ideographic-space auto-phrase"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-space-transform-invalid.html b/testing/web-platform/tests/css/css-text/parsing/word-space-transform-invalid.html new file mode 100644 index 0000000000..049bf1d0da --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-space-transform-invalid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-space-transform with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#word-space-transform"> +<meta name="assert" content="word-space-transform supports only the grammar 'none | [ space | ideographic-space ] && auto-phrase?'."> +<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("word-space-transform", "auto"); +test_invalid_value("word-space-transform", "normal"); +test_invalid_value("word-space-transform", "spaces"); +test_invalid_value("word-space-transform", "space ideographic-space"); +test_invalid_value("word-space-transform", "auto-phrase"); +test_invalid_value("word-space-transform", "none auto-phrase"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-space-transform-valid.html b/testing/web-platform/tests/css/css-text/parsing/word-space-transform-valid.html new file mode 100644 index 0000000000..2323931f53 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-space-transform-valid.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-space-transform with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#word-space-transform"> +<meta name="assert" content="word-space-transform supports the full grammar 'none | [ space | ideographic-space ] && auto-phrase?'."> +<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("word-space-transform", "none"); +test_valid_value("word-space-transform", "space"); +test_valid_value("word-space-transform", "ideographic-space"); +test_valid_value("word-space-transform", "space auto-phrase"); +test_valid_value("word-space-transform", "ideographic-space auto-phrase"); +test_valid_value("word-space-transform", "auto-phrase space"); +test_valid_value("word-space-transform", "auto-phrase ideographic-space"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-spacing-computed.html b/testing/web-platform/tests/css/css-text/parsing/word-spacing-computed.html new file mode 100644 index 0000000000..192dec6f7a --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-spacing-computed.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().wordSpacing</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing"> +<meta name="assert" content="word-spacing computed value is an absolute length."> +<meta name="assert" content="'normal' computes to zero."> +<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("word-spacing", "normal", "0px"); + +test_computed_value("word-spacing", "10px"); +test_computed_value("word-spacing", "-20px"); +test_computed_value("word-spacing", "calc(10px - 0.5em)", "-10px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-spacing-invalid.html b/testing/web-platform/tests/css/css-text/parsing/word-spacing-invalid.html new file mode 100644 index 0000000000..3a1c4ca487 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-spacing-invalid.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-spacing with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing"> +<meta name="assert" content="word-spacing supports only the grammar 'normal | <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("word-spacing", "auto"); +test_invalid_value("word-spacing", "20%"); + +test_invalid_value("word-spacing", "normal 10px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-spacing-valid.html b/testing/web-platform/tests/css/css-text/parsing/word-spacing-valid.html new file mode 100644 index 0000000000..217b2488f5 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-spacing-valid.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-spacing with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing"> +<meta name="assert" content="word-spacing supports the full grammar 'normal | <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("word-spacing", "normal"); + +test_valid_value("word-spacing", "10px"); +test_valid_value("word-spacing", "-20px"); +test_valid_value("word-spacing", "calc(2em + 3ex)"); +test_valid_value("word-spacing", "0", "0px"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-wrap-computed.html b/testing/web-platform/tests/css/css-text/parsing/word-wrap-computed.html new file mode 100644 index 0000000000..0f3639e2e1 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-wrap-computed.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().wordWrap</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-wrap"> +<meta name="assert" content="word-wrap computed value is specified keyword."> +<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("word-wrap", "normal"); +test_computed_value("word-wrap", "break-word"); +test_computed_value("word-wrap", "anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-wrap-invalid.html b/testing/web-platform/tests/css/css-text/parsing/word-wrap-invalid.html new file mode 100644 index 0000000000..40890775ca --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-wrap-invalid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-wrap with invalid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-wrap"> +<meta name="assert" content="word-wrap supports only the grammar 'normal | break-word | anywhere'."> +<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("word-wrap", "auto"); +test_invalid_value("word-wrap", "normal break-word"); +test_invalid_value("word-wrap", "anywhere anywhere"); +</script> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-text/parsing/word-wrap-valid.html b/testing/web-platform/tests/css/css-text/parsing/word-wrap-valid.html new file mode 100644 index 0000000000..ce5731551a --- /dev/null +++ b/testing/web-platform/tests/css/css-text/parsing/word-wrap-valid.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing word-wrap with valid values</title> +<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-wrap"> +<meta name="assert" content="word-wrap supports the full grammar 'normal | break-word | anywhere'."> +<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("word-wrap", "normal"); +test_valid_value("word-wrap", "break-word"); +test_valid_value("word-wrap", "anywhere"); +</script> +</body> +</html> |