Index: LayoutTests/svg/text/text-getSubStringLength.html |
diff --git a/LayoutTests/svg/text/text-getSubStringLength.html b/LayoutTests/svg/text/text-getSubStringLength.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2698cb6de7896362a487c30486227002c50bb6fd |
--- /dev/null |
+++ b/LayoutTests/svg/text/text-getSubStringLength.html |
@@ -0,0 +1,29 @@ |
+<!DOCTYPE html> |
+<title>SVGTextContentElement.getSubStringLength</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<div id=log></div> |
+<div> |
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> |
+ <text x="10" y="20">W3C نشاط</text> |
+ <text x="10 50" y="40">AB</text> |
+ </svg> |
+</div> |
+<script> |
+test(function() { |
+ var text = document.querySelector('text'); |
+ assert_equals(text.getNumberOfChars(), 8); |
+ var lenFirst4 = text.getSubStringLength(0, 4); |
+ var lenLast4 = text.getSubStringLength(4, 4); |
+ var lenAll = text.getSubStringLength(0, 8); |
+ assert_approx_equals(lenFirst4 + lenLast4, lenAll, 0.01, 'Sum of the parts equal the total.'); |
+}, document.title+', BiDi.'); |
+test(function() { |
+ var text = document.querySelector('text + text'); |
+ assert_equals(text.getNumberOfChars(), 2); |
+ var lenFirst = text.getSubStringLength(0, 1); |
+ var lenLast = text.getSubStringLength(1, 1); |
+ var lenAll = text.getSubStringLength(0, 2); |
+ assert_approx_equals(lenFirst + lenLast, lenAll, 0.01, 'Sum of the parts equal the total.'); |
+}, document.title+', multiple text-chunks.'); |
+</script> |