OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 span { | 3 span { |
4 font-family: monospace; | 4 font-family: monospace; |
5 tab-size: 2; | 5 tab-size: 2; |
6 white-space: pre; | 6 white-space: pre; |
7 width: intrinsic; | 7 width: fit-content; |
8 } | 8 } |
9 </style> | 9 </style> |
10 <div><span id="one-tab"><span>	</span>word</span></div> | 10 <div><span id="one-tab"><span>	</span>word</span></div> |
11 <div><span id="two-tabs"><span>	</span><span>	</span>word</span></div> | 11 <div><span id="two-tabs"><span>	</span><span>	</span>word</span></div> |
12 <script src="../../resources/js-test.js"></script> | 12 <script src="../../resources/js-test.js"></script> |
13 <script> | 13 <script> |
14 description('Tab characters should never be zero-width.'); | 14 description('Tab characters should never be zero-width.'); |
15 | 15 |
16 var oneTabLineWidth = document.getElementById("one-tab").getBoundingClientRect
().width; | 16 var oneTabLineWidth = document.getElementById("one-tab").getBoundingClientRect
().width; |
17 var twoTabLineWidth = document.getElementById("two-tabs").getBoundingClientRec
t().width; | 17 var twoTabLineWidth = document.getElementById("two-tabs").getBoundingClientRec
t().width; |
18 | 18 |
19 if (oneTabLineWidth == twoTabLineWidth) { | 19 if (oneTabLineWidth == twoTabLineWidth) { |
20 testFailed("oneTabLineWidth should not be equal to twoTabLineWidth."); | 20 testFailed("oneTabLineWidth should not be equal to twoTabLineWidth."); |
21 } else { | 21 } else { |
22 testPassed("oneTabLineWidth is not equal to twoTabLineWidth."); | 22 testPassed("oneTabLineWidth is not equal to twoTabLineWidth."); |
23 } | 23 } |
24 </script> | 24 </script> |
OLD | NEW |