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

Side by Side Diff: LayoutTests/svg/text/bidi-text-query.svg

Issue 1083073002: Add a "logical query mode" to SVGTextQuery (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Older URL. Created 5 years, 8 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
OLDNEW
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <svg width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/ 2000/svg"> 2 <svg width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/ 2000/svg">
3 <g font-family="Arial" font-size="18"> 3 <g font-family="Arial" font-size="18">
4 <text x="10" y="50"><tspan direction="ltr" unicode-bidi="bidi-override">نشاط التدويل، W3C</tspan></text> 4 <text x="10" y="50"><tspan direction="ltr" unicode-bidi="bidi-override">نشاط التدويل، W3C</tspan></text>
5 <text x="10" y="80"><tspan direction="ltr" unicode-bidi="normal">نشاط التدوي ل، W3C</tspan></text> 5 <text x="10" y="80"><tspan direction="ltr" unicode-bidi="normal">نشاط التدوي ل، W3C</tspan></text>
6 <text x="10" y="110" text-anchor="end" direction="rtl">W3C <tspan>نشاط التدو يل،</tspan></text>
6 <g id="container"/> 7 <g id="container"/>
7 8
8 <script type="text/javascript"><![CDATA[ 9 <script type="text/javascript"><![CDATA[
9 function highlightGlyph(text, index, color) { 10 function highlightGlyph(text, index, color) {
10 var extent = text.getExtentOfChar(index); 11 var extent = text.getExtentOfChar(index);
11 12
12 // Highlight rect that we've selected using the extent information 13 // Highlight rect that we've selected using the extent information
13 var rectElement = document.createElementNS("http://www.w3.org/2000/s vg", "rect"); 14 var rectElement = document.createElementNS("http://www.w3.org/2000/s vg", "rect");
14 rectElement.setAttribute("x", extent.x); 15 rectElement.setAttribute("x", extent.x);
15 rectElement.setAttribute("y", extent.y); 16 rectElement.setAttribute("y", extent.y);
(...skipping 19 matching lines...) Expand all
35 var textElements = document.querySelectorAll("text"); 36 var textElements = document.querySelectorAll("text");
36 for (var elemNum = 0; elemNum < textElements.length; ++elemNum) { 37 for (var elemNum = 0; elemNum < textElements.length; ++elemNum) {
37 var text = textElements[elemNum]; 38 var text = textElements[elemNum];
38 var charCount = text.getNumberOfChars(); 39 var charCount = text.getNumberOfChars();
39 for (var index = 0; index < charCount; ++index) 40 for (var index = 0; index < charCount; ++index)
40 highlightGlyph(text, index, colors[index % colors.length]); 41 highlightGlyph(text, index, colors[index % colors.length]);
41 } 42 }
42 ]]></script> 43 ]]></script>
43 </g> 44 </g>
44 </svg> 45 </svg>
OLDNEW
« no previous file with comments | « LayoutTests/svg/text/bidi-getsubstringlength-expected.txt ('k') | LayoutTests/svg/text/textquery-collapsed-whitespace.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698