Automatic update from web-platform-tests Fix tablutation inside a ruby base Tab stops must be positioned relative to the start content edge of the preserved tab's nearest block container ancestor, per CSS Text 3 white-space phase 2. Ruby bases are laid out by their own sub-LineBreaker, which measured each tab from the start of the ruby base rather than from the block container. As a result, tabs inside a ruby base were placed at the wrong offset and could crash when measuring max-content width. This CL introduces a tab_stop_offset_ member on LineBreaker that records the offset of a (sub-)line's start from the tab-stop origin. HandleControlItem adds tab_stop_offset_ when shaping tabulation characters. Guard the new behavior behind the TabSizeInRubyBase runtime feature. Spec: https://www.w3.org/TR/css-text-3/#white-space-phase-2 Bug: 505419357 Change-Id: I10aba8c1eaae54e9d4ab8c9b6ba2b0d94fa27296 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8038344 Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Koji Ishii <kojii@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1660956} -- wpt-commits: a2d61b13ff34cf8dee30daea4e25fe25fb638f1c wpt-pr: 61244
17 lines
407 B
HTML
17 lines
407 B
HTML
<!DOCTYPE html>
|
|
<meta charset="UTF-8">
|
|
<title>CSS Ruby Reference: tabulation inside a ruby base</title>
|
|
<link rel="stylesheet" href="/fonts/ahem.css">
|
|
<style>
|
|
div.test {
|
|
font: 25px/1 Ahem;
|
|
}
|
|
span.tab {
|
|
/* The tab starts at 25px; the next 100px tab stop is at 100px, i.e. 75px. */
|
|
padding-left: 75px;
|
|
}
|
|
</style>
|
|
<body>
|
|
<div class="test">X<ruby><span class="tab"></span>Y<rt>z</rt></ruby></div>
|
|
</body>
|