nk2028.shn.hk/tshet-uinh-autoderiver - The line breaks do not render, causing all content within the <rt> tags to appear on a single line
Categories
(Web Compatibility :: Site Reports, defect, P3)
Tracking
(firefox130 affected, firefox131 affected, firefox132 affected)
People
(Reporter: ctanase, Unassigned)
References
()
Details
(Keywords: webcompat:needs-diagnosis, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs])
User Story
platform:windows,mac,linux,android impact:content-missing configuration:general affects:all branch:release diagnosis-team:layout
Attachments
(3 files)
Environment:
Operating system: Windows 10
Firefox version: Firefox 131.0/130/132
Steps to reproduce:
- Go to https://codepen.io/pen/ or any code editor.
- Copy and paste this code into the editor
<ruby>盘<rp>(</rp><rt lang="och-Latn-fonipa">ban<span hidden=""> / </span><br>ban<span hidden=""> / </span><br>buan<span hidden=""> / </span><br>buan<span hidden=""> / </span><br>ban</rt><rp>)</rp></ruby>
- Render the code.
- Observe the results.
Expected Behavior:
The text within the <rt>
elements should render each line separated by line breaks, resulting in correctly formatted phonetic annotations.
Actual Behavior:
The line breaks do not render, causing all content within the <rt> tags to appear on a single line
Notes:
- Reproduces regardless of the status of ETP
- Reproduces in Firefox Nightly, and Firefox Release
- Does not reproduce in Chrome
Created from https://github.com/webcompat/web-bugs/issues/141607
Reporter | ||
Updated•2 months ago
|
Reporter | ||
Updated•2 months ago
|
Reporter | ||
Comment 1•2 months ago
|
||
Updated•2 months ago
|
Comment 2•24 days ago
|
||
For convenience, here's a simple HTML testcase with the content from comment 0 (which reproduces the behavior-difference just fine -- no need for codepen etc.)
Comment 3•24 days ago
|
||
Comment 4•24 days ago
|
||
In Firefox, there's no space between "a b" -- the br
gets ignored, basically. In Chrome, there is a space there (the br
gets morphed into a space for some reason). In WebKit, there's an actual linebreak.
The spec text here says:
Suppress line breaks: Convert all forced line breaks inside ruby annotations (regardless of white-space value) as defined for collapsible segment breaks in CSS Text Level 3 § 4.1.2.
https://drafts.csswg.org/css-ruby/#anon-gen-unbreak
That links to https://www.w3.org/TR/css-text-3/#line-break-transform which basically says browsers can do whatever they want:
First, any collapsible segment break immediately following another collapsible segment break is removed.
(For our purposes here, that means <br><br><br>
is collapsed down to <br>
.)
Then any remaining segment break is either transformed into a space (U+0020) or removed depending on the context before and after the break.
The rules for this operation are UA-defined in this level.
This leaves room for possibly converting to a space or entirely removing it, in a UA-defined way (i.e. up to the browser), "depending on the context".
So: what Chrome is doing and what we're doing are both allowed by the spec. I'm not familiar enough with ruby to know what contextual clues might make removal vs. converting-to-a-space a better outcome.
Comment 5•24 days ago
|
||
:xidorn, do you happen to know/recall whether there's any reason to favor preserving vs. collapsing the linebreak in the ruby annotation here?
Comment 6•23 days ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #5)
:xidorn, do you happen to know/recall whether there's any reason to favor preserving vs. collapsing the linebreak in the ruby annotation here?
Not sure exactly what your question is.
As noted in the spec text, the main reason to suppress line breaks is to avoid define how to make multi-line annotation work, as it can be tricky to define and implement. And also with multi-level annotation supported with <rtc>
, there is no real use case for multi-line annotation.
If you are talking about whether to transform them into space, I think the context it depends on is mainly whether there are CJ characters before or after. You can see the EXAMPLE immediately after that section to understand the intention there. Based on that intention, I believe we should convert it to space. The reason we don't currently do so is likely just because I overlooked this part and just do the basic suppression rather than any proper conversion.
Comment 7•23 days ago
|
||
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #6)
If you are talking about whether to transform them into space, I think the context it depends on is mainly whether there are CJ characters before or after. You can see the EXAMPLE immediately after that section to understand the intention there. Based on that intention, I believe we should convert it to space. The reason we don't currently do so is likely just because I overlooked this part and just do the basic suppression rather than any proper conversion.
Thanks! That answers my question. (I was mostly wondering whether collapsing-linebreaks-away entirely (rather than transforming-to-space-characters) was an intentional/preferred outcome vs. just-how-things-worked-out).
I'll file a platform bug on considering matching Chrome on this. Thanks again!
Comment 8•23 days ago
|
||
Having said that: looking a bit closer at comment 0 and github and the chromium version of this bug report: it looks like the reporter wasn't asking for the linebreaks to render as spaces, but rather was asking them to render as linebreaks.
From that perspective, this is INVALID; the spec clearly says that linebreaks in ruby annotations should be suppressed (and Chrome/Firefox both do suppress them).
Hence, closing; but I will still spin off a followup to consider converting those linebreaks to spaces.
Comment 9•23 days ago
|
||
(filed bug 1928428 on potentially converting linebreaks to spaces)
Description
•