OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="UTF-8"> |
| 3 <title>getSubStringLength() with Arabic script</title> |
| 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> |
| 6 <svg width="50px" height="120px" font-family="Arial" font-size="30px"> |
| 7 <text id="ltrtext" y="30">إعلانات</text> |
| 8 <text id="rtltext" y="90" x="75" direction="rtl">إعلانات</text> |
| 9 </svg> |
| 10 <script> |
| 11 test(function() { |
| 12 var textElms = document.querySelectorAll('text'); |
| 13 var ltr = textElms[0]; |
| 14 var rtl = textElms[1]; |
| 15 var subExtentsLtr = []; |
| 16 var subExtentsRtl = []; |
| 17 for (var i = 1; i < 7; ++i) { |
| 18 subExtentsLtr.push(ltr.getSubStringLength(1, i)); |
| 19 subExtentsRtl.push(rtl.getSubStringLength(1, i)); |
| 20 } |
| 21 |
| 22 assert_array_equals(subExtentsLtr, subExtentsRtl); |
| 23 }, '"direction" does not affect sub string lengths.'); |
| 24 </script> |
OLD | NEW |