Firefox doesn't create linebreak opportunities for spaces inside of `rb` elements
Categories
(Core :: Layout: Ruby, defect)
Tracking
()
People
(Reporter: dholbert, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:90
Attachments
(5 files)
STR:
- Load attached testcase.
EXPECTED RESULTS:
Text should linewrap (one word on each line).
ACTUAL RESULTS:
Text does not linewrap.
This testcase just has some <rb> elements with a space at the end of each one (before the closing </rb> tag). That should create a linewrap opportunity, and it does in Chrome, but doesn't in Firefox.
This is the root cause of WebCompat Site Report bug 2003019.
| Reporter | ||
Comment 1•5 months ago
|
||
Here's a reference case where I simply replaced the rb elements with span elements. In this case, we do linewrap as expected.
(Chrome gives the same linewrapping results for testcase 1 and this reference case.)
| Reporter | ||
Comment 2•5 months ago
|
||
Notably: if I adjust the testcases to move the spaces outside of the rb tags (as in this version), then we get the correct rendering.
| Reporter | ||
Updated•5 months ago
|
| Reporter | ||
Comment 3•5 months ago
|
||
Here's another interesting testcase where we differ from Chrome.
For this one, we don't even render the spaces at all -- we show Doesthistextlinewrap (though the spaces are included if you copy the text to clipboard).
Chrome renders this testcase the same as all the others here (with linebreaks, and with spaces that do render properly if I increase the container width so that linebreaking isn't necessary).
| Reporter | ||
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 4•5 months ago
|
||
FWIW, the behavior in testcase 2 is expected per CSS Ruby spec:
Trim leading/trailing white space: Any intra-ruby white space that is not the sole in-flow child of its parent and is the first or last in-flow child of a ruby container, ruby annotation container, or ruby base container is removed, as if it had
display: none
For the initial testcase, I tend to agree there probably should be a break opportunity. We do have code handling its line breaking, and it seems to at least works correctly for Chinese and Japanese. I'm not sure what happens to the whitespaces.
Comment 5•5 months ago
|
||
Note that the line wrapping is handled correctly for Chinese and Japanese here. Specifically, it can't break between the question mark and Chinese character / kana before, and it can't break between kana and ッ as well, even if they are at <rb> boundary.
Updated•5 months ago
|
Description
•