Skip to content

Commit d85c6ac

Browse files
committed
[css-inline-3] Expand tests for text-box* parsing and computation
1 parent 98b4b20 commit d85c6ac

10 files changed

+53
-23
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
>
2-
<title>Inheritance of CSS Inline Layout propertiestitle>
2+
<title>Inheritance of CSS Inline Layout Text Edge Propertiestitle>
33
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-edge">
44
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-trim">
55
<script src="/resources/testharness.js">script>
@@ -9,6 +9,6 @@
99
<div id="target">div>
1010
div>
1111
<script>
12-
assert_inherited('text-box-edge', 'auto', 'text');
12+
assert_not_inherited('text-box-edge', 'auto', 'text');
1313
assert_not_inherited('text-box-trim', 'none', 'trim-start');
1414
script>

css/css-inline/text-box-trim/parsing/text-box-computed.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
>
2+
<title>text-box getComputedStyle() returns correctly resolved valuestitle>
23
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box">
34
<script src="/resources/testharness.js">script>
45
<script src="/resources/testharnessreport.js">script>

css/css-inline/text-box-trim/parsing/text-box-edge-computed.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
>
2-
<title>Tests parsing of the text-box-edge propertytitle>
3-
<link rel="author" title="Google LLC" href="https://www.google.com/">
2+
<title>text-box getComputedStyle() returns correctly resolved valuestitle>
43
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#text-edges">
5-
<meta name="assert" content="text-box-edge supports the full grammar leading | [ text | cap | ex | ideographic | ideographic-ink ] [ text | alphabetic | ideographic | ideographic-ink ]">
64
<script src="/resources/testharness.js">script>
75
<script src="/resources/testharnessreport.js">script>
86
<script src="/css/support/computed-testcommon.js">script>

css/css-inline/text-box-trim/parsing/text-box-edge-invalid.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
>
2-
<title>Tests parsing of the text-box-edge propertytitle>
3-
<link rel="author" title="Google LLC" href="https://www.google.com/">
2+
<title>text-box-edge rejects invalid valuestitle>
43
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#text-edges">
5-
<meta name="assert" content="text-box-edge supports the full grammar leading | [ text | cap | ex | ideographic | ideographic-ink ] [ text | alphabetic | ideographic | ideographic-ink ]">
64
<script src="/resources/testharness.js">script>
75
<script src="/resources/testharnessreport.js">script>
86
<script src="/css/support/parsing-testcommon.js">script>
97

108
<script>
119
// invalid keyword
10+
11+
test_invalid_value('text-box-edge', 'none');
12+
test_invalid_value('text-box-edge', 'normal');
1213
test_invalid_value('text-box-edge', 'leading');
1314
test_invalid_value('text-box-edge', 'auto leading');
1415
test_invalid_value('text-box-edge', 'leading auto');
16+
test_invalid_value('text-box-edge', 'normal text');
17+
test_invalid_value('text-box-edge', 'text none');
1518

1619
// invalid grammar
1720
test_invalid_value('text-box-edge', 'alphabetic');

css/css-inline/text-box-trim/parsing/text-box-edge-valid.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
>
2-
<title>Tests parsing of the text-box-edge propertytitle>
3-
<link rel="author" title="Google LLC" href="https://www.google.com/">
2+
<title>text-box-edge parses valid values according to its grammartitle>
43
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#text-edges">
5-
<meta name="assert" content="text-box-edge supports the full grammar leading | [ text | cap | ex | ideographic | ideographic-ink ] [ text | alphabetic | ideographic | ideographic-ink ]">
64
<script src="/resources/testharness.js">script>
75
<script src="/resources/testharnessreport.js">script>
86
<script src="/css/support/parsing-testcommon.js">script>
@@ -12,7 +10,10 @@
1210
test_valid_value('text-box-edge', 'text');
1311
test_valid_value('text-box-edge', 'ex');
1412
test_valid_value('text-box-edge', 'cap');
13+
test_valid_value('text-box-edge', 'ideographic');
14+
test_valid_value('text-box-edge', 'ideographic-ink');
1515
test_valid_value('text-box-edge', 'text alphabetic');
16+
test_valid_value('text-box-edge', 'ideographic text');
1617
test_valid_value('text-box-edge', 'text text', 'text');
1718
test_valid_value('text-box-edge', 'cap alphabetic');
1819
test_valid_value('text-box-edge', 'cap text', 'cap');
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
>
2+
<title>text-box rejects invalid valuestitle>
23
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box">
34
<script src="/resources/testharness.js">script>
45
<script src="/resources/testharnessreport.js">script>
@@ -7,8 +8,19 @@
78
<script>
89
// invalid keyword
910
test_invalid_value('text-box', 'em');
11+
test_invalid_value('text-box', 'leading');
12+
test_invalid_value('text-box', 'trim-both leading');
13+
14+
// invalid grammars
15+
text_invalid_value('text-box', 'normal normal');
16+
test_invalid_value('text-box', 'normal none');
17+
text_invalid_value('text-box', 'auto normal');
1018
test_invalid_value('text-box', 'normal text');
1119
test_invalid_value('text-box', 'text normal');
12-
test_invalid_value('text-box', 'auto leading');
13-
test_invalid_value('text-box', 'leading auto');
20+
text_invalid_value('text-box', 'alphabetic text');
21+
text_invalid_value('text-box', 'alphabetic cap');
22+
text_invalid_value('text-box', 'cap none alphabetic');
23+
text_invalid_value('text-box', 'cap trim-both alphabetic');
24+
text_invalid_value('text-box', 'text none text');
25+
text_invalid_value('text-box', 'text trim-both text');
1426
script>

css/css-inline/text-box-trim/parsing/text-box-shorthand.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
>
2-
<meta charset="utf-8">
2+
<title>text-box shorthand defaults omitted values per spectitle>
33
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box">
44
<script src="/resources/testharness.js">script>
55
<script src="/resources/testharnessreport.js">script>

css/css-inline/text-box-trim/parsing/text-box-trim-computed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
>
2-
<title>Tests parsing of the text-box-trim propertytitle>
2+
<title>text-box getComputedStyle() returns correctly resolved valuestitle>
33
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box-trim">
44
<script src="/resources/testharness.js">script>
55
<script src="/resources/testharnessreport.js">script>

css/css-inline/text-box-trim/parsing/text-box-trim-valid.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
>
2+
<title>text-box-trim parses valid values according to its grammartitle>
23
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#leading-trim">
34
<script src="/resources/testharness.js">script>
45
<script src="/resources/testharnessreport.js">script>
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,44 @@
11
>
2+
<title>text-box parses valid values according to its grammartitle>
23
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box">
34
<script src="/resources/testharness.js">script>
45
<script src="/resources/testharnessreport.js">script>
56
<script src="/css/support/parsing-testcommon.js">script>
67

78
<script>
8-
// `normal | || `
9+
// initial values
910
test_valid_value('text-box', 'normal');
11+
test_valid_value('text-box', 'none', 'normal');
12+
test_valid_value('text-box', 'auto', 'normal');
13+
test_valid_value('text-box', 'none auto', 'normal');
14+
test_valid_value('text-box', 'auto none', 'normal');
1015

1116
// ``: `none | trim-start | trim-end | trim-both`
12-
test_valid_value('text-box', 'none', 'normal');
1317
test_valid_value('text-box', 'trim-start');
1418
test_valid_value('text-box', 'trim-end');
1519
test_valid_value('text-box', 'trim-both');
1620

17-
// ``: `auto | `
18-
test_valid_value('text-box', 'none auto', 'normal');
19-
test_valid_value('text-box', 'trim-start auto', 'trim-start');
20-
test_valid_value('text-box', 'trim-both auto', 'trim-both');
21-
2221
// ``
2322
test_valid_value('text-box', 'text');
23+
test_valid_value('text-box', 'cap');
24+
test_valid_value('text-box', 'ideographic');
2425
test_valid_value('text-box', 'cap alphabetic');
26+
test_valid_value('text-box', 'text alphabetic');
27+
28+
// Mix initial and non-initial values
29+
test_valid_value('text-box', 'trim-start auto', 'trim-start');
30+
test_valid_value('text-box', 'auto trim-both', 'trim-both');
31+
test_valid_value('text-box', 'none text', 'none text');
32+
test_valid_value('text-box', 'text text none', 'none text');
33+
test_valid_value('text-box', 'none cap', 'none cap');
34+
test_valid_value('text-box', 'cap ideographic none', 'none cap ideographic');
35+
test_valid_value('text-box', 'ideographic none', 'none ideographic');
2536

2637
// Both `` and ``
2738
test_valid_value('text-box', 'trim-both text', 'text');
2839
test_valid_value('text-box', 'trim-start text');
29-
test_valid_value('text-box', 'trim-start cap alphabetic');
40+
test_valid_value('text-box', 'text text trim-both', 'text');
41+
test_valid_value('text-box', 'text text trim-end', 'trim-end');
42+
test_valid_value('text-box', 'cap alphabetic trim-start', 'trim-start cap alphabetic');
43+
test_valid_value('text-box', 'trim-both cap alphabetic', 'cap alphabetic');
3044
script>

0 commit comments

Comments
 (0)