Index: LayoutTests/svg/text/bidi-getcomputedtextlength.html |
diff --git a/LayoutTests/svg/text/bidi-getcomputedtextlength.html b/LayoutTests/svg/text/bidi-getcomputedtextlength.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e9fd5a9dba2a0c3faeb5eff54bbc3ad6df4ae96e |
--- /dev/null |
+++ b/LayoutTests/svg/text/bidi-getcomputedtextlength.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE html> |
+<meta charset="UTF-8"> |
+<title>getComputedTextLength() with arabic script</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<svg width="50px" height="60px" font-family="Arial" font-size="30px"> |
+ <text id="ltrtext" y="30">إعلانات</text> |
+ <text id="rtltext" y="60" direction="rtl">إعلانات</text> |
+ <text id="ltrspace"><tspan>نه</tspan> با</text> |
+ <text id="rtlspace" direction="rtl"><tspan>نه</tspan> با</text> |
+</svg> |
+<script> |
+test(function() { |
+ var textElementLtr = document.getElementById("ltrtext"); |
+ var textElementRtl = document.getElementById("rtltext"); |
+ |
+ var widthLtr = textElementLtr.getComputedTextLength(); |
+ var widthRtl = textElementRtl.getComputedTextLength(); |
+ |
+ assert_equals(widthLtr, widthRtl); |
+}, 'Direction does not affect computed text length.'); |
+ |
+test(function() { |
+ var textElementLtr = document.getElementById("ltrspace"); |
+ var textElementRtl = document.getElementById("rtlspace"); |
+ |
+ var widthLtr = textElementLtr.getComputedTextLength(); |
+ var widthRtl = textElementRtl.getComputedTextLength(); |
+ |
+ assert_equals(widthLtr, widthRtl); |
+}, 'Direction does not affect computed text length - whitespace.'); |
+</script> |