| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <div id="target">Test</div> |
| 5 <script> |
| 6 test(function() { |
| 7 var values = [ |
| 8 {input: "0.5in", expected: "48px"}, |
| 9 {input: "1.27cm", expected: "48px"}, |
| 10 {input: "12.7mm", expected: "48px"}, |
| 11 {input: "2cm", expected: "75.5906px"}, |
| 12 {input: "20mm", expected: "75.5906px"}, |
| 13 {input: "24pt", expected: "32px"}, |
| 14 {input: "2pc", expected: "32px"}, |
| 15 {input: "2em", expected: "32px"}, |
| 16 {input: "3ex", expected: "21px"}, |
| 17 {input: "200%", expected: "32px"}, |
| 18 {input: "2", expected: "32px"}, |
| 19 {input: "50px", expected: "50px"}, |
| 20 {input: "-1em", expected: "50px"}, |
| 21 {input: "normal", expected: "20px"}, |
| 22 {input: "inherit", expected: "20px"}, |
| 23 ]; |
| 24 for (let {input, expected} of values) { |
| 25 target.style.lineHeight = input; |
| 26 assert_equals(getComputedStyle(target).lineHeight, expected); |
| 27 } |
| 28 target.textContent = ""; |
| 29 }, 'getComputedStyle(element) should return a length (the used value)'); |
| 30 </script> |
| OLD | NEW |