OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> |
| 3 <title>getComputedTextLength() with arabic script</title> |
| 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <svg width="50px" height="60px" font-family="Arial" font-size="30px"> |
| 7 <text id="ltrtext" y="30">إعلانات</text> |
| 8 <text id="rtltext" y="60" direction="rtl">إعلانات</text> |
| 9 <text id="ltrspace"><tspan>نه</tspan> با</text> |
| 10 <text id="rtlspace" direction="rtl"><tspan>نه</tspan> با</text> |
| 11 </svg> |
| 12 <script> |
| 13 test(function() { |
| 14 var textElementLtr = document.getElementById("ltrtext"); |
| 15 var textElementRtl = document.getElementById("rtltext"); |
| 16 |
| 17 var widthLtr = textElementLtr.getComputedTextLength(); |
| 18 var widthRtl = textElementRtl.getComputedTextLength(); |
| 19 |
| 20 assert_equals(widthLtr, widthRtl); |
| 21 }, 'Direction does not affect computed text length.'); |
| 22 |
| 23 test(function() { |
| 24 var textElementLtr = document.getElementById("ltrspace"); |
| 25 var textElementRtl = document.getElementById("rtlspace"); |
| 26 |
| 27 var widthLtr = textElementLtr.getComputedTextLength(); |
| 28 var widthRtl = textElementRtl.getComputedTextLength(); |
| 29 |
| 30 assert_equals(widthLtr, widthRtl); |
| 31 }, 'Direction does not affect computed text length - whitespace.'); |
| 32 </script> |
OLD | NEW |