Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / text / text-getSubStringLength.html
blob2698cb6de7896362a487c30486227002c50bb6fd
1 <!DOCTYPE html>
2 <title>SVGTextContentElement.getSubStringLength</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <div id=log></div>
6 <div>
7 <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
8 <text x="10" y="20">W3C &#x0646;&#x0634;&#x0627;&#x0637;</text>
9 <text x="10 50" y="40">AB</text>
10 </svg>
11 </div>
12 <script>
13 test(function() {
14 var text = document.querySelector('text');
15 assert_equals(text.getNumberOfChars(), 8);
16 var lenFirst4 = text.getSubStringLength(0, 4);
17 var lenLast4 = text.getSubStringLength(4, 4);
18 var lenAll = text.getSubStringLength(0, 8);
19 assert_approx_equals(lenFirst4 + lenLast4, lenAll, 0.01, 'Sum of the parts equal the total.');
20 }, document.title+', BiDi.');
21 test(function() {
22 var text = document.querySelector('text + text');
23 assert_equals(text.getNumberOfChars(), 2);
24 var lenFirst = text.getSubStringLength(0, 1);
25 var lenLast = text.getSubStringLength(1, 1);
26 var lenAll = text.getSubStringLength(0, 2);
27 assert_approx_equals(lenFirst + lenLast, lenAll, 0.01, 'Sum of the parts equal the total.');
28 }, document.title+', multiple text-chunks.');
29 </script>