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

Unified Diff: LayoutTests/fast/text/font-variant-width.html

Issue 799123003: text-combine should scale rather than fall back to none when wide (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove one expected.txt and rebase-update (there was a directory rename) Created 5 years, 11 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
« no previous file with comments | « LayoutTests/fast/dynamic/text-combine.html ('k') | LayoutTests/fast/text/font-variant-width-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/text/font-variant-width.html
diff --git a/LayoutTests/fast/text/font-variant-width.html b/LayoutTests/fast/text/font-variant-width.html
index ae475fd3db8d6a3bd48887c0ff70da32ecfa8eff..e9988c34cf37cf801c79183a04de0f197bd438c0 100644
--- a/LayoutTests/fast/text/font-variant-width.html
+++ b/LayoutTests/fast/text/font-variant-width.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
@@ -9,64 +9,70 @@
src: url(../../third_party/LiberationSansWidthVariants/liberation_sans_width_variants.ttf) format("truetype");
}
-.vertical {
+#test {
font-family: "LiberationSansWidthVariants";
font-size: 24px;
text-rendering: geometricPrecision;
- -webkit-writing-mode: vertical-lr;
line-height: 100%;
margin: 0;
padding: 0px;
}
-.combine {
- -webkit-text-combine: horizontal;
+.hwid {
+ -webkit-font-feature-settings: 'hwid';
+}
+.twid {
+ -webkit-font-feature-settings: 'twid';
+}
+.qwid {
+ -webkit-font-feature-settings: 'qwid';
}
</style>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
-
- <script type="text/javascript">
+ <script>
setup({ explicit_done: true });
function testWidthVariant() {
- var EXPECTED_COMBINED_UNTIL = 8;
- var EXPECTED_LINE_HEIGHT = 24;
- var NUM_TESTS = 9;
- for (var testId = 0; testId < NUM_TESTS; testId++) {
- rectHeight = document.getElementsByClassName("combine")[testId].getBoundingClientRect().height;
- if (testId < EXPECTED_COMBINED_UNTIL) {
- test(function() {
- assert_equals(rectHeight, EXPECTED_LINE_HEIGHT, "Numbers laid out in one combining block.");
- }, "Numbers expected to be laid out in one combining block");
- } else {
- test(function() {
- assert_true(rectHeight > EXPECTED_LINE_HEIGHT, EXPECTED_LINE_HEIGHT, "Number laid out vertically, not combined.");
- }, "Number laid out vertically, not combined.");
- }
+ var elements = document.querySelectorAll("#test > div");
+ for (var i = 0; i < elements.length; ++i) {
+ var div = elements[i];
+ var normal = div.firstChild;
+ var text = normal.innerText;
+ test(function () {
+ var hwid = addVariant(normal, "hwid");
+ var twid = addVariant(normal, "twid");
+ var qwid = addVariant(normal, "qwid");
+ var width = normal.getBoundingClientRect().width;
+ var widthHwid = hwid.getBoundingClientRect().width;
+ var widthTwid = twid.getBoundingClientRect().width;
+ var widthQwid = qwid.getBoundingClientRect().width;
+ assert_less_than(widthHwid, width, "hwid");
+ assert_less_than(widthTwid, widthHwid, "twid");
+ assert_less_than(widthQwid, widthTwid, "qwid");
+ }, text);
}
done();
}
+ function addVariant(base, variantClassName) {
+ var variant = base.cloneNode(true);
+ variant.className = variantClassName;
+ base.parentElement.appendChild(document.createTextNode(" "));
+ base.parentElement.appendChild(variant);
+ return variant;
+ }
</script>
</head>
<body onload="testWidthVariant();">
- <div class="vertical">
- <!-- horizontally combined -->
- <div><span class="combine">1</span></div>
- <div><span class="combine">9</span></div>
- <div><span class="combine">11</span></div>
- <div><span class="combine">99</span></div>
- <div><span class="combine">111</span></div>
- <div><span class="combine">999</span></div>
- <div><span class="combine">1111</span></div>
- <div><span class="combine">9999</span></div>
- <!-- vertical -->
- <div><span class="combine">11111</span></div>
- <div><span class="combine">99999</span></div>
- <div><span class="combine">123456</span></div>
- <div><span class="combine">111111</span></div>
- <div><span class="combine">999999</span></div>
+ <div id="test">
+ <div><span>1</span></div>
+ <div><span>9</span></div>
+ <div><span>22</span></div>
+ <div><span>99</span></div>
+ <div><span>123456</span></div>
+ <div><span>222222</span></div>
+ <div><span>999999</span></div>
</div>
<div id="log"></div>
</body>
« no previous file with comments | « LayoutTests/fast/dynamic/text-combine.html ('k') | LayoutTests/fast/text/font-variant-width-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698