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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
diff --git a/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html b/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
index 83a617ae5d083fc531b1574b7840dba6af9f127e..21cef57fcc3a41605b93fa4ad8d23bae24808b30 100644
--- a/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
+++ b/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
@@ -4,74 +4,39 @@
.testTextRun {
font-size: 35px;
}
- .description {
- font-size: 12px;
- text-anchor: middle;
- }
- #highlightContainer text {
- text-anchor: middle;
- font-size: 8px;
- -webkit-user-select: none;
- user-select: none;
+ #highlightContainer rect {
+ fill-opacity: 0.3;
}
</style>
<svg width="600px" height="500px" xmlns="http://www.w3.org/2000/svg">
<g id="highlightContainer"/>
- <g>
- <!-- multiple combining diacritics in LTR -->
- <text x="50" y="50" class="testTextRun" font-family="cursive">ab&#x030c;c&#x030c;&#x030c;</text>
- <text x="200" y="50" class="testTextRun" font-family="serif">ab&#x030c;c&#x030c;&#x030c;</text>
- <text x="350" y="50" class="testTextRun" font-family="sans-serif">ab&#x030c;c&#x030c;&#x030c;</text>
- <!-- multiple combining diacritics in RTL -->
- <text x="100" y="125" class="testTextRun" font-family="cursive" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
- <text x="250" y="125" class="testTextRun" font-family="serif" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
- <text x="400" y="125" class="testTextRun" font-family="sans-serif" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
+ <!-- multiple combining diacritics in LTR -->
+ <text x="50" y="50" class="testTextRun" font-family="cursive">ab&#x030c;c&#x030c;&#x030c;</text>
+ <text x="200" y="50" class="testTextRun" font-family="serif">ab&#x030c;c&#x030c;&#x030c;</text>
+ <text x="350" y="50" class="testTextRun" font-family="sans-serif">ab&#x030c;c&#x030c;&#x030c;</text>
+
+ <!-- multiple combining diacritics in RTL -->
+ <text x="100" y="125" class="testTextRun" font-family="cursive" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
+ <text x="250" y="125" class="testTextRun" font-family="serif" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
+ <text x="400" y="125" class="testTextRun" font-family="sans-serif" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
- <!-- multiple combining diacritics on ligatures in LTR -->
- <text x="50" y="200" class="testTextRun" font-family="cursive">fi&#x030c; ffi&#x030c;&#x030c;</text>
- <text x="200" y="200" class="testTextRun" font-family="serif">fi&#x030c; ffi&#x030c;&#x030c;</text>
- <text x="350" y="200" class="testTextRun" font-family="sans-serif">fi&#x030c; ffi&#x030c;&#x030c;</text>
+ <!-- multiple combining diacritics on ligatures in LTR -->
+ <text x="50" y="200" class="testTextRun" font-family="cursive">fi&#x030c; ffi&#x030c;&#x030c;</text>
+ <text x="200" y="200" class="testTextRun" font-family="serif">fi&#x030c; ffi&#x030c;&#x030c;</text>
+ <text x="350" y="200" class="testTextRun" font-family="sans-serif">fi&#x030c; ffi&#x030c;&#x030c;</text>
- <!-- combining diacritics on ligatures in mixed bidi runs -->
- <text x="50" y="275" class="testTextRun" font-family="cursive">ff&#x030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
- <text x="200" y="275" class="testTextRun" font-family="serif">ff&#x030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
- <text x="350" y="275" class="testTextRun" font-family="sans-serif">ff&#x030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
+ <!-- combining diacritics on ligatures in mixed bidi runs -->
+ <text x="50" y="275" class="testTextRun" font-family="cursive">ff&#x030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
+ <text x="200" y="275" class="testTextRun" font-family="serif">ff&#x030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
+ <text x="350" y="275" class="testTextRun" font-family="sans-serif">ff&#x030c;&#1600;&#1600;&#1604;&#1575;ff&#x030c;</text>
- <!-- combining diacritics which are wider than characters in mixed bidi runs -->
- <text x="50" y="350" class="testTextRun" font-family="cursive"> &#x030c;&#64944;i&#819;</text>
- <text x="200" y="350" class="testTextRun" font-family="serif"> &#x030c;&#64944;i&#819;</text>
- <text x="350" y="350" class="testTextRun" font-family="sans-serif"> &#x030c;&#64944;i&#819;</text>
- </g>
+ <!-- combining diacritics which are wider than characters in mixed bidi runs -->
+ <text x="50" y="350" class="testTextRun" font-family="cursive"> &#x030c;&#64944;i&#819;</text>
+ <text x="200" y="350" class="testTextRun" font-family="serif"> &#x030c;&#64944;i&#819;</text>
+ <text x="350" y="350" class="testTextRun" font-family="sans-serif"> &#x030c;&#64944;i&#819;</text>
</svg>
+<script src="resources/highlightGlyphs.js"></script>
<script>
- function highlightGlyph(text, index, color) {
- var extent = text.getExtentOfChar(index);
- // Highlight rect that we've selected using the extent information
- var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
- rectElement.setAttribute("x", extent.x);
- rectElement.setAttribute("y", extent.y);
- rectElement.setAttribute("width", extent.width);
- rectElement.setAttribute("height", extent.height);
- rectElement.setAttribute("fill-opacity", "0.3");
- rectElement.setAttribute("fill", color);
- document.getElementById("highlightContainer").appendChild(rectElement);
- // Output the start offset
- var textElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
- textElement.setAttribute("x", extent.x + extent.width / 2);
- textElement.setAttribute("y", extent.y + extent.height + 7);
- textElement.appendChild(document.createTextNode(index));
- document.getElementById("highlightContainer").appendChild(textElement);
- }
-
- var colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];
- // Highlight each glyph with a semi-transparent rectangle and
- // a number corresponding to the queried character index.
- var textElements = document.querySelectorAll(".testTextRun");
- for (var elemNum = 0; elemNum < textElements.length; ++elemNum) {
- var text = textElements[elemNum];
- var charCount = text.getNumberOfChars();
- for (var index = 0; index < charCount; ++index)
- highlightGlyph(text, index, colors[index % colors.length]);
- }
+ highlightGlyphs(document.querySelectorAll('.testTextRun'), highlightContainer);
</script>

Powered by Google App Engine
This is Rietveld 408576698