Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: LayoutTests/svg/text/text-getSubStringLength.html

Issue 206663003: Clip the start position when performing SVG text queries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing -expected.txt. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/svg/text/text-getSubStringLength-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 e qual 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 equ al the total.');
28 }, document.title+', multiple text-chunks.');
29 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/svg/text/text-getSubStringLength-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698