text-box-valid.html (2617B)
1 <!DOCTYPE html> 2 <title>text-box parses valid values according to its grammar</title> 3 <link rel="help" href="https://drafts.csswg.org/css-inline-3/#propdef-text-box"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/css/support/parsing-testcommon.js"></script> 7 8 <script> 9 // initial values 10 test_valid_value('text-box', 'normal'); 11 test_valid_value('text-box', 'none', 'normal'); 12 test_valid_value('text-box', 'none auto', 'normal'); 13 test_valid_value('text-box', 'auto none', 'normal'); 14 test_valid_value('text-box', 'auto', 'trim-both'); 15 16 // `<text-box-trim>`: `none | trim-start | trim-end | trim-both` 17 test_valid_value('text-box', 'trim-start'); 18 test_valid_value('text-box', 'trim-end'); 19 test_valid_value('text-box', 'trim-both'); 20 21 // `<text-edge>` 22 test_valid_value('text-box', 'text'); 23 test_valid_value('text-box', 'ideographic'); 24 test_valid_value('text-box', 'cap alphabetic'); 25 test_valid_value('text-box', 'text alphabetic'); 26 27 // Mix initial and non-initial values 28 test_valid_value('text-box', 'trim-start auto', 'trim-start'); 29 test_valid_value('text-box', 'trim-both auto', 'trim-both'); 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 text'); 34 test_valid_value('text-box', 'cap alphabetic none', 'none cap alphabetic'); 35 test_valid_value('text-box', 'ideographic none', 'none ideographic'); 36 37 // Both `<text-box-trim>` and `<text-box-edge>` 38 test_valid_value('text-box', 'trim-both text', 'text'); 39 test_valid_value('text-box', 'trim-start text'); 40 test_valid_value('text-box', 'text text trim-both', 'text'); 41 test_valid_value('text-box', 'text text trim-end', 'trim-end text'); 42 test_valid_value('text-box', 'cap alphabetic trim-start', 'trim-start cap alphabetic'); 43 test_valid_value('text-box', 'trim-start cap alphabetic'); 44 test_valid_value('text-box', 'trim-both cap alphabetic', 'cap alphabetic'); 45 test_valid_value('text-box', 'trim-start ideographic ideographic', 'trim-start ideographic'); 46 test_valid_value('text-box', 'trim-start ideographic-ink ideographic-ink', 'trim-start ideographic-ink'); 47 test_valid_value('text-box', 'trim-end cap text'); 48 test_valid_value('text-box', 'trim-end ex text'); 49 test_valid_value('text-box', 'cap text trim-end', 'trim-end cap text'); 50 test_valid_value('text-box', 'ex text trim-end', 'trim-end ex text'); 51 test_valid_value('text-box', 'cap text trim-both', 'cap text'); 52 test_valid_value('text-box', 'ex text trim-both', 'ex text'); 53 </script>