Skip to content

Commit

Permalink
Bug 1862394 [wpt PR 42890] - Make ic-width consistent regardless of t…
Browse files Browse the repository at this point in the history
…ext orientation., a=testonly

Automatic update from web-platform-tests
Make ic-width consistent regardless of text orientation.

We obtained the ic-width using the FontMetrics::IdeographicFullWidth()
function. Unfortunately, this value is influenced by the text's
orientation. When the orientation is vertically upright,
IdeographicFullWidth() provides the vertical advance height of the CJK
water glyph. However, when the orientation is different, it returns the
horizontal width of the water glyph. As per the definition [1], the
ic-width for font-size-adjust should be a consistent value, which is the
horizontal advance width of the CJK water glyph divided by the font
size. This consistency should be maintained regardless of the text's
orientation.

[1] https://www.w3.org/TR/css-fonts-5/#valdef-font-size-adjust-ic-width

Test: external/wpt/css/css-fonts/font-size-adjust-text-orientation.html

Bug: 1219875
Change-Id: I3cc9e6128854aa7b127ba3932f34b9cfec1970ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4995847
Commit-Queue: ChangSeok Oh <changseok.oh@bytedance.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1234205}

--

wpt-commits: d1bb35dae8f4a383b45e17558f4631a322cc8a54
wpt-pr: 42890
  • Loading branch information
shivamidow authored and moz-wptsync-bot committed Dec 14, 2023
1 parent 468e312 commit 6a54185
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>font-size-adjust and text-orientation</title>
<link rel="author" title="ChangSeok Oh" href="mailto:changseok@webkit.org" />
<link rel="help" href="https://www.w3.org/TR/css-fonts-5/#font-size-adjust-prop" />
<style>
@font-face {
font-family: IcTestFullWidth;
src: url(../css-values/resources/IcTestFullWidth.woff2);
}
div {
font-family: IcTestFullWidth;
font-size: 40px;
font-size-adjust: ic-width 1.0;
writing-mode: vertical-rl;
text-orientation: mixed;
}
</style>
<div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>font-size-adjust and text-orientation</title>
<link rel="author" title="ChangSeok Oh" href="mailto:changseok@webkit.org" />
<link rel="help" href="https://www.w3.org/TR/css-fonts-5/#font-size-adjust-prop" />
<link rel="match" href="font-size-adjust-text-orientation-ref.html" />
<meta name="assert" content="Test checks whether text-orientation affects font-size-adjust.">
<style>
@font-face {
font-family: IcTestFullWidth;
src: url(../css-values/resources/IcTestFullWidth.woff2);
}
div {
font-family: IcTestFullWidth;
font-size: 40px;
font-size-adjust: ic-width 1.0;
writing-mode: vertical-rl;
text-orientation: upright;
}
</style>
<div></div>

0 comments on commit 6a54185

Please sign in to comment.