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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html

Issue 1847763002: Only synthesize grapheme widths once for surrogate pair characters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 4 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
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <meta charset="utf8"> 2 <meta charset="utf8">
3 <style> 3 <style>
4 .testTextRun { 4 .testTextRun {
5 font-size: 35px; 5 font-size: 35px;
6 } 6 }
7 .description { 7 #highlightContainer rect {
8 font-size: 12px; 8 fill-opacity: 0.3;
9 text-anchor: middle;
10 }
11 #highlightContainer text {
12 text-anchor: middle;
13 font-size: 8px;
14 -webkit-user-select: none;
15 user-select: none;
16 } 9 }
17 </style> 10 </style>
18 <svg width="600px" height="500px" xmlns="http://www.w3.org/2000/svg"> 11 <svg width="600px" height="500px" xmlns="http://www.w3.org/2000/svg">
19 <g id="highlightContainer"/> 12 <g id="highlightContainer"/>
20 <g>
21 <!-- multiple combining diacritics in LTR -->
22 <text x="50" y="50" class="testTextRun" font-family="cursive">ab&#x030c; c&#x030c;&#x030c;</text>
23 <text x="200" y="50" class="testTextRun" font-family="serif">ab&#x030c;c &#x030c;&#x030c;</text>
24 <text x="350" y="50" class="testTextRun" font-family="sans-serif">ab&#x0 30c;c&#x030c;&#x030c;</text>
25 13
26 <!-- multiple combining diacritics in RTL --> 14 <!-- multiple combining diacritics in LTR -->
27 <text x="100" y="125" class="testTextRun" font-family="cursive" directio n="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text> 15 <text x="50" y="50" class="testTextRun" font-family="cursive">ab&#x030c;c&#x 030c;&#x030c;</text>
28 <text x="250" y="125" class="testTextRun" font-family="serif" direction= "rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text> 16 <text x="200" y="50" class="testTextRun" font-family="serif">ab&#x030c;c&#x0 30c;&#x030c;</text>
29 <text x="400" y="125" class="testTextRun" font-family="sans-serif" direc tion="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text> 17 <text x="350" y="50" class="testTextRun" font-family="sans-serif">ab&#x030c; c&#x030c;&#x030c;</text>
30 18
31 <!-- multiple combining diacritics on ligatures in LTR --> 19 <!-- multiple combining diacritics in RTL -->
32 <text x="50" y="200" class="testTextRun" font-family="cursive">fi&#x030c ; ffi&#x030c;&#x030c;</text> 20 <text x="100" y="125" class="testTextRun" font-family="cursive" direction="r tl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
33 <text x="200" y="200" class="testTextRun" font-family="serif">fi&#x030c; ffi&#x030c;&#x030c;</text> 21 <text x="250" y="125" class="testTextRun" font-family="serif" direction="rtl ">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
34 <text x="350" y="200" class="testTextRun" font-family="sans-serif">fi&#x 030c; ffi&#x030c;&#x030c;</text> 22 <text x="400" y="125" class="testTextRun" font-family="sans-serif" direction ="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
35 23
36 <!-- combining diacritics on ligatures in mixed bidi runs --> 24 <!-- multiple combining diacritics on ligatures in LTR -->
37 <text x="50" y="275" class="testTextRun" font-family="cursive">ff&#x030c ;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text> 25 <text x="50" y="200" class="testTextRun" font-family="cursive">fi&#x030c; ff i&#x030c;&#x030c;</text>
38 <text x="200" y="275" class="testTextRun" font-family="serif">ff&#x030c; &#1600;&#1600;&#1604;&#1575;ff&#x030c;</text> 26 <text x="200" y="200" class="testTextRun" font-family="serif">fi&#x030c; ffi &#x030c;&#x030c;</text>
39 <text x="350" y="275" class="testTextRun" font-family="sans-serif">ff&#x 030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text> 27 <text x="350" y="200" class="testTextRun" font-family="sans-serif">fi&#x030c ; ffi&#x030c;&#x030c;</text>
40 28
41 <!-- combining diacritics which are wider than characters in mixed bidi runs --> 29 <!-- combining diacritics on ligatures in mixed bidi runs -->
42 <text x="50" y="350" class="testTextRun" font-family="cursive"> &#x030c; &#64944;i&#819;</text> 30 <text x="50" y="275" class="testTextRun" font-family="cursive">ff&#x030c;&#1 600;&#1600;&#1604;&#1575;ff&#x030c;</text>
43 <text x="200" y="350" class="testTextRun" font-family="serif"> &#x030c;& #64944;i&#819;</text> 31 <text x="200" y="275" class="testTextRun" font-family="serif">ff&#x030c;&#16 00;&#1600;&#1604;&#1575;ff&#x030c;</text>
44 <text x="350" y="350" class="testTextRun" font-family="sans-serif"> &#x0 30c;&#64944;i&#819;</text> 32 <text x="350" y="275" class="testTextRun" font-family="sans-serif">ff&#x030c ;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
45 </g> 33
34 <!-- combining diacritics which are wider than characters in mixed bidi runs -->
35 <text x="50" y="350" class="testTextRun" font-family="cursive"> &#x030c;&#64 944;i&#819;</text>
36 <text x="200" y="350" class="testTextRun" font-family="serif"> &#x030c;&#649 44;i&#819;</text>
37 <text x="350" y="350" class="testTextRun" font-family="sans-serif"> &#x030c; &#64944;i&#819;</text>
46 </svg> 38 </svg>
39 <script src="resources/highlightGlyphs.js"></script>
47 <script> 40 <script>
48 function highlightGlyph(text, index, color) { 41 highlightGlyphs(document.querySelectorAll('.testTextRun'), highlightContaine r);
49 var extent = text.getExtentOfChar(index);
50 // Highlight rect that we've selected using the extent information
51 var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
52 rectElement.setAttribute("x", extent.x);
53 rectElement.setAttribute("y", extent.y);
54 rectElement.setAttribute("width", extent.width);
55 rectElement.setAttribute("height", extent.height);
56 rectElement.setAttribute("fill-opacity", "0.3");
57 rectElement.setAttribute("fill", color);
58 document.getElementById("highlightContainer").appendChild(rectElement);
59 // Output the start offset
60 var textElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
61 textElement.setAttribute("x", extent.x + extent.width / 2);
62 textElement.setAttribute("y", extent.y + extent.height + 7);
63 textElement.appendChild(document.createTextNode(index));
64 document.getElementById("highlightContainer").appendChild(textElement);
65 }
66
67 var colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet" ];
68 // Highlight each glyph with a semi-transparent rectangle and
69 // a number corresponding to the queried character index.
70 var textElements = document.querySelectorAll(".testTextRun");
71 for (var elemNum = 0; elemNum < textElements.length; ++elemNum) {
72 var text = textElements[elemNum];
73 var charCount = text.getNumberOfChars();
74 for (var index = 0; index < charCount; ++index)
75 highlightGlyph(text, index, colors[index % colors.length]);
76 }
77 </script> 42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698