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
22 lines
571 B
HTML
22 lines
571 B
HTML
<!DOCTYPE html>
|
|
<meta charset="UTF-8">
|
|
<title>CSS Ruby Reference: multiple tabulations across ruby nesting levels</title>
|
|
<link rel="stylesheet" href="/fonts/ahem.css">
|
|
<style>
|
|
div.test {
|
|
font: 25px/1 Ahem;
|
|
width: max-content;
|
|
}
|
|
span.tab1 {
|
|
/* First tab starts at 50px -> 100px stop -> 50px. */
|
|
padding-left: 50px;
|
|
}
|
|
span.tab2 {
|
|
/* Second tab starts at 125px -> 200px stop -> 75px. */
|
|
padding-left: 75px;
|
|
}
|
|
</style>
|
|
<body>
|
|
<div class="test">Z<ruby>M<ruby><span class="tab1"></span>N<rt>p</rt></ruby><span class="tab2"></span>O<rt>q</rt></ruby></div>
|
|
</body>
|