Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / text / bidi-getcomputedtextlength.html
blobe9fd5a9dba2a0c3faeb5eff54bbc3ad6df4ae96e
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");
17 var widthLtr = textElementLtr.getComputedTextLength();
18 var widthRtl = textElementRtl.getComputedTextLength();
20 assert_equals(widthLtr, widthRtl);
21 }, 'Direction does not affect computed text length.');
23 test(function() {
24 var textElementLtr = document.getElementById("ltrspace");
25 var textElementRtl = document.getElementById("rtlspace");
27 var widthLtr = textElementLtr.getComputedTextLength();
28 var widthRtl = textElementRtl.getComputedTextLength();
30 assert_equals(widthLtr, widthRtl);
31 }, 'Direction does not affect computed text length - whitespace.');
32 </script>