[wpt-sync] Sync PR 64932 - [ruby] Split a word in <ruby> only if the line can't wrap elsewhere
Categories
(Core :: Layout: Ruby, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64932 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64932
Details from upstream follow.
Gleb Mazovetskiy <glebm@google.com> wrote:
[ruby] Split a word in <ruby> only if the line can't wrap elsewhere
With
overflow-wrap: break-wordoranywhere, a \<ruby> that doesn't
fit at the end of a line gets split mid-word to fill the line, even when
there is a space before it where the line could wrap. CSS Text says
emergency breaking applies only when there are no other break
opportunities on the line, which is how plain text already behaves.A ruby's base and annotations are laid out by nested line breakers.
Each of them handledoverflow-wrapby itself: on overflow it retried
with break-anywhere right away, before the outer line breaker had a
chance to wrap at the earlier space.With this CL, nested line breakers never start the break-anywhere retry
themselves. They inherit the outer line breaker's state instead, and
the ruby column tells the outer line breaker that its content allows
break-anywhere. The outer line breaker first tries normal break points,
and only if none fit does it retry with break-anywhere, which the
nested line breakers then follow.The change is behind the RubyOverflowWrapDeferToOuterLine runtime flag.
Test: blink_unittests --gtest_filter=LineBreakerTest.RubyOverflowWrap*
Test: external/wpt/css/css-ruby/break-within-bases/overflow-wrap-break-word.html
Bug: 580840306
Change-Id: I27e10982f5b532857f9cb09b6536551bcbedc342
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8766178
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Reviewed-by: Kent Tamura \<tkent@chromium.org>
Commit-Queue: Gleb Mazovetskiy \<glebm@google.com>
Cr-Commit-Position: refs/heads/main@{#1740372}
| Assignee | ||
Updated•11 days ago
|
| Assignee | ||
Comment 1•11 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=121984
| Assignee | ||
Comment 2•11 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 8 subtests
Status Summary
Firefox
OK : 1
PASS: 4
FAIL: 4
Chrome
OK : 1
PASS: 2
FAIL: 6
Safari
OK : 1
PASS: 4
FAIL: 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /css/css-ruby/break-within-bases/overflow-wrap-break-word.html [wpt.fyi]
- overflow-wrap: break-word emergency-breaks inside a single ruby wider than the line:
FAIL(Chrome:PASS, Safari:FAIL) - overflow-wrap: break-word on inner span inside <ruby> defers to prior space and breaks when wider than line:
FAIL(Chrome:FAIL, Safari:FAIL) - overflow-wrap: break-word inside multi-word ruby prefers normal space break before emergency breaking:
FAIL(Chrome:PASS, Safari:FAIL) - nested ruby with overflow-wrap: break-word wraps intact after space and breaks when wider than line:
FAIL(Chrome:FAIL, Safari:FAIL)
- overflow-wrap: break-word emergency-breaks inside a single ruby wider than the line:
Comment 4•8 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e82b39faa11d
https://hg.mozilla.org/mozilla-central/rev/1d619a25d103
Description
•