Files
sousa-gecko/testing/web-platform/tests/css/css-ruby/ruby-tab-in-base-max-content-crash.html
T
Minseong Kim 39218f639a Bug 2054411 [wpt PR 61244] - Fix tablutation inside a ruby base, a=testonly
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
2026-07-14 11:17:48 +00:00

14 lines
281 B
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<meta charset="UTF-8">
<link rel="help" href="https://crbug.com/505419357">
<style>
div.test {
white-space: pre;
width: max-content;
}
</style>
<body>
<div class="test">あ<ruby>&Tab;あ   <rt>ああああああああ</rt></ruby>あ</div>
</body>
</html>