OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <style> | 4 <style> |
5 text { | 5 text { |
6 baseline-shift: inherit; | 6 baseline-shift: inherit; |
7 } | 7 } |
8 </style> | 8 </style> |
9 <svg height="0"><text></text></svg> | 9 <svg height="0"><text></text></svg> |
10 <script> | 10 <script> |
11 setup(function() { | 11 setup(function() { |
12 window.svg = document.querySelector('svg'); | 12 window.svg = document.querySelector('svg'); |
13 window.textElement = document.querySelector('text'); | 13 window.textElement = document.querySelector('text'); |
14 }); | 14 }); |
15 ['baseline', 'sub', 'super', '10px', '100%'].forEach(function(item) { | 15 [ |
| 16 {value: 'baseline', expected: '0px'}, |
| 17 {value: 'sub'}, |
| 18 {value: 'super'}, |
| 19 {value: '10px'}, |
| 20 {value: '100%'} |
| 21 ].forEach(function(item) { |
16 test(function() { | 22 test(function() { |
17 svg.style.setProperty('baseline-shift', item); | 23 svg.style.setProperty('baseline-shift', item.value); |
18 assert_equals(getComputedStyle(textElement).baselineShift, item); | 24 assert_equals(getComputedStyle(textElement).baselineShift, item.expected ||
item.value); |
19 }, 'Inheritance of the baseline-shift property - ' + item + '.'); | 25 }, 'Inheritance of the baseline-shift property - ' + item + '.'); |
20 }); | 26 }); |
21 </script> | 27 </script> |
OLD | NEW |