Bug 1896889 [wpt PR 46283] - [text-box-trim] Support vertical flow, a=testonly

Automatic update from web-platform-tests
[text-box-trim] Support vertical flow

In doing this, this patch adds the `FontBaseline` variations
of `Alphabetic()`, `CapHeight()`, and `XHeight()` in the
`FontMetrics` class.

Also, the rounding methods in `AdjustEdges()` were different
from what `FontMetrics::FixedAscent()` does. This patch adds
`Fixed` variants to `FontMetrics` to make reviewing the
consistency easier.

All changes are under a currently disabled runtime flag.

Bug: 40254880
Change-Id: I470f1df976ff210ee7c3cdb336b73f44a59909d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539097
Reviewed-by: Kent Tamura <[email protected]>
Auto-Submit: Koji Ishii <[email protected]>
Commit-Queue: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1301750}

--

wpt-commits: 044beefe2fe9706c899bd503c5953abf07546fc0
wpt-pr: 46283
This commit is contained in:
Koji Ishii authored and moz-wptsync-bot committed 2024-05-23 10:00:39 +00:00
1 parent 210f6147ed
commit 4e94de9f6d
2 files changed
+19 -5

No files matched your search

@@ -7,7 +7,7 @@
}
.spacer {
background: lightgray;
height: 100px;
block-size: 100px;
}
.target {
font-family: test-font;
@@ -17,12 +17,16 @@
.offset {
position: relative;
}
.vrl { writing-mode: vertical-rl; }
.vlr { writing-mode: vertical-lr; }
.text .target { line-height: 150px; }
.text .offset { top: -25px; }
.text .offset { inset-block-start: -25px; }
.cap .target { line-height: 130px; }
.cap .offset { top: -35px; }
.cap .offset { inset-block-start: -35px; }
.ex .target { line-height: 90px; }
.ex .offset { top: -55px; }
.ex .offset { inset-block-start: -55px; }
.vlr.alphabetic .target { line-height: 130px; }
.vlr.alphabetic .offset { inset-block-start: -35px;}
</style>
<div class="spacer"></div>
<div class="target">
@@ -7,6 +7,13 @@
<meta name="variant" content="?class=text">
<meta name="variant" content="?class=cap">
<meta name="variant" content="?class=ex">
<meta name="variant" content="?class=vrl,leading">
<meta name="variant" content="?class=vrl,text">
<meta name="variant" content="?class=vrl,cap">
<meta name="variant" content="?class=vrl,ex">
<meta name="variant" content="?class=vlr,leading">
<meta name="variant" content="?class=vlr,text">
<meta name="variant" content="?class=vlr,alphabetic">
<style>
@font-face {
font-family: test-font;
@@ -14,7 +21,7 @@
}
.spacer {
background: lightgray;
height: 100px;
block-size: 100px;
}
.target {
font-family: test-font;
@@ -22,10 +29,13 @@
line-height: 2;
text-box-trim: start;
}
.vrl { writing-mode: vertical-rl; }
.vlr { writing-mode: vertical-lr; }
.leading .target { text-box-edge: leading; }
.text .target { text-box-edge: text; }
.cap .target { text-box-edge: cap; }
.ex .target { text-box-edge: ex; }
.vlr.alphabetic .target { text-box-edge: text alphabetic; }
</style>
<div class="spacer"></div>
<div class="target">A</div>