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>
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.');
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.');