Bug 1666054 [wpt PR 25638] - Upload tests for font metrics override descriptors to WPT, a=testonly

Automatic update from web-platform-tests
Upload tests for font metrics override descriptors to WPT

Following the standardization of @font-face descriptors ascent-override,
descent-override and line-gap-override, this patch uploads the existing
test cases to WPT as test coverage.

This resolves the "Need Testcase (WPT)" label in
https://github.com/w3c/csswg-drafts/issues/4792

Bug: 1098355
Change-Id: Iffadff1fb159e52ca5a0675259381401fbe90c99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2419585
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808665}

--

wpt-commits: fba18cc5e2fb20eb8059b3d26009f4921e61a84b
wpt-pr: 25638
This commit is contained in:
Xiaocheng Hu 2020-09-22 09:16:59 +00:00 коммит произвёл moz-wptsync-bot
Родитель ebc7ae8631
Коммит dbe34f02a9
6 изменённых файлов: 188 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,47 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tests the ascent-override and descent-override descriptors of @font-face</title>
<style>
.target {
position: absolute;
font-size: 20px;
top: 10px;
left: 10px;
width: 60px;
height: 30px;
}
.top-aligned {
display: inline-block;
background-color: green;
width: 1em;
height: 1em; /* Same as the overridden ascent */
position: absolute;
top: 0;
left: 0;
}
.character {
display: inline-block;
background-color: green;
width: 1em; /* Same as an 'X' in Ahem */
height: 1em; /* Same as an 'X' in Ahem */
position: absolute;
top: 0.2em; /* Difference between the overridden ascent and the origianl ascent */
left: 1em;
}
.bottom-aligned {
display: inline-block;
background-color: green;
width: 1em;
height: 0.5em; /* Same as the overridden descent */
position: absolute;
top: 1em; /* Same as the overridden ascent */
left: 2em;
}
</style>
<div class="target">
<span class="top-aligned"></span><span class="character"></span><span class="bottom-aligned"></span>
</div>

Просмотреть файл

@ -0,0 +1,43 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-metrics-override-desc">
<link rel="match" href="ascent-descent-override-ref.html">
<title>Tests the ascent-override and descent-override descriptors of @font-face</title>
<style>
@font-face {
font-family: custom-font;
src: local(Ahem), url(/fonts/Ahem.ttf);
/* The default ascent and descent are 80% and 20%, respectively. */
ascent-override: 100%;
descent-override: 50%;
}
.target {
font: 20px custom-font;
color: green;
position: absolute;
top: 10px;
left: 10px;
}
.top-aligned {
display: inline-block;
background-color: green;
vertical-align: top;
width: 1em;
height: 1em; /* Same as the overridden ascent */
}
.bottom-aligned {
display: inline-block;
background-color: green;
vertical-align: bottom;
width: 1em;
height: 0.5em; /* Same as the overridden descent */
}
</style>
<div class="target">
<span class="top-aligned"></span>X<span class="bottom-aligned"></span>
</div>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tests the ascent-override and descent-override descriptors of @font-face</title>
<style>
.target {
position: absolute;
font-size: 20px;
top: 10px;
left: 10px;
width: 60px;
height: 30px;
}
.character {
display: inline-block;
background-color: green;
width: 1em; /* Same as an 'X' in Ahem */
height: 1em; /* Same as an 'X' in Ahem */
position: absolute;
}
</style>
<div class="target">
<span class="character" style="top: 0.5em; left: 0"></span>
<span class="character" style="top: 2.5em; left: 0"></span>
</div>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-metrics-override-desc">
<link rel="match" href="line-gap-override-ref.html">
<title>Tests the line-gap-override descriptor of @font-face</title>
<style>
@font-face {
font-family: custom-font;
src: local(Ahem), url(/fonts/Ahem.ttf);
line-gap-override: 100%;
}
.target {
font: 20px custom-font;
color: green;
position: absolute;
top: 10px;
left: 10px;
}
</style>
<div class="target">
X<br>
X
</div>

Просмотреть файл

@ -0,0 +1,12 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-metrics-override-desc">
<link rel="stylesheet" href="/fonts/ahem.css">
<title>Tests the 'normal' keyword on descriptors ascent-override, descent-override and line-gap-override</title>
<div style="font-family: Ahem">Test<br>Test</div>
<div style="font-family: Ahem">Test<br>Test</div>
<div style="font-family: Ahem">Test<br>Test</div>

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-metrics-override-desc">
<link rel="match" href="metrics-override-normal-keyword-ref.html">
<title>Tests the 'normal' keyword on descriptors ascent-override, descent-override and line-gap-override</title>
<style>
@font-face {
font-family: ascent-font;
src: local(Ahem), url(/fonts/Ahem.ttf);
ascent-override: 50%;
ascent-override: normal;
}
@font-face {
font-family: descent-font;
src: local(Ahem), url(/fonts/Ahem.ttf);
descent-override: 50%;
descent-override: normal;
}
@font-face {
font-family: line-gap-font;
src: local(Ahem), url(/fonts/Ahem.ttf);
line-gap-override: 50%;
line-gap-override: normal;
}
</style>
<div style="font-family: ascent-font">Test<br>Test</div>
<div style="font-family: descent-font">Test<br>Test</div>
<div style="font-family: line-gap-font">Test<br>Test</div>