text-combine-upright-parsing-digits-001.html (3519B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Writing Modes: parsing text-combine-upright for digits</title> 6 <link rel="author" title="Masataka Yakura" href="http://google.com/+MasatakaYakura"> 7 <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#text-combine-upright"> 8 <meta name="assert" content="text-combine-upright supports `none`, `all`, `digits`, and `digits` followed by a digit in the range from 2 to 4."> 9 <meta name="flags" content="dom"> 10 <script src="/resources/testharness.js"></script> 11 <script src="/resources/testharnessreport.js"></script> 12 13 <style> 14 #valid_digits { 15 text-combine-upright: digits; 16 } 17 18 #valid_digits_2 { 19 text-combine-upright: digits 2; 20 } 21 22 #valid_digits_3 { 23 text-combine-upright: digits 3; 24 } 25 26 #valid_digits_4 { 27 text-combine-upright: digits 4; 28 } 29 30 #valid_digits_positive2 { 31 text-combine-upright: digits +2; 32 } 33 34 #valid_digits_positive3_nospace { 35 text-combine-upright: digits+3; 36 } 37 38 #valid_digits_tab_4_nospace { 39 text-combine-upright: digits 4; 40 } 41 42 #valid_digits_lf_2_nospace { 43 text-combine-upright: digits 44 2; 45 } 46 47 #valid_digits_tab_3 { 48 text-combine-upright: digits 3; 49 } 50 51 #valid_digits_tab_lf_4_nospace { 52 text-combine-upright: digits 53 4; 54 } 55 </style> 56 </head> 57 <body> 58 59 <div id="valid_digits"></div> 60 <div id="valid_digits_2"></div> 61 <div id="valid_digits_3"></div> 62 <div id="valid_digits_4"></div> 63 <div id="valid_digits_positive2"></div> 64 <div id="valid_digits_positive3_nospace"></div> 65 <div id="valid_digits_tab_4_nospace"></div> 66 <div id="valid_digits_lf_2_nospace"></div> 67 <div id="valid_digits_tab_3"></div> 68 <div id="valid_digits_tab_lf_4_nospace"></div> 69 70 <div id="log"></div> 71 72 <script> 73 var getComputedValueFor = function (id) { 74 var element = document.getElementById(id); 75 return window.getComputedStyle(element).textCombineUpright; 76 }; 77 78 test(function () { 79 assert_equals(getComputedValueFor('valid_digits'), 'digits 2'); 80 }, 'Computed value for `text-combine-upright: digits` is `digits 2`'); 81 82 test(function () { 83 assert_equals(getComputedValueFor('valid_digits_2'), 'digits 2'); 84 }, 'Computed value for `text-combine-upright: digits 2` is `digits 2`'); 85 86 test(function () { 87 assert_equals(getComputedValueFor('valid_digits_3'), 'digits 3'); 88 }, 'Computed value for `text-combine-upright: digits 3` is `digits 3`'); 89 90 test(function () { 91 assert_equals(getComputedValueFor('valid_digits_4'), 'digits 4'); 92 }, 'Computed value for `text-combine-upright: digits 4` is `digits 4`'); 93 94 test(function () { 95 assert_equals(getComputedValueFor('valid_digits_positive2'), 'digits 2'); 96 }, 'Computed value for `text-combine-upright: digits +2` is `digits 2`'); 97 98 test(function () { 99 assert_equals(getComputedValueFor('valid_digits_positive3_nospace'), 'digits 3'); 100 }, 'Computed value for `text-combine-upright: digits+3` is `digits 3`'); 101 102 test(function () { 103 assert_equals(getComputedValueFor('valid_digits_tab_4_nospace'), 'digits 4'); 104 }, 'Computed value for `text-combine-upright: digits[TAB]4` is `digits 4`'); 105 106 test(function () { 107 assert_equals(getComputedValueFor('valid_digits_lf_2_nospace'), 'digits 2'); 108 }, 'Computed value for `text-combine-upright: digits[LF]2` is `digits 2`'); 109 110 test(function () { 111 assert_equals(getComputedValueFor('valid_digits_tab_3'), 'digits 3'); 112 }, 'Computed value for `text-combine-upright: digits [TAB]3` is `digits 3`'); 113 114 test(function () { 115 assert_equals(getComputedValueFor('valid_digits_tab_lf_4_nospace'), 'digits 4'); 116 }, 'Computed value for `text-combine-upright: digits[TAB][LF]4` is `digits 4`'); 117 </script> 118 </body> 119 </html>