Open Bug 1928428 Opened 1 month ago Updated 1 month ago

Firefox collapses linebreaks away entirely in <rt> (ruby annotations), but perhaps should replace them with spaces, depending on the context (e.g. Latin text vs. Chinese characters)

Categories

(Core :: Layout: Ruby, defect)

defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

Details

STR:

  1. View these testcases, and look specifically at the annotation text (the smaller text)
    https://bugzilla.mozilla.org/attachment.cgi?id=9434403
    https://bugzilla.mozilla.org/attachment.cgi?id=9434406

FIREFOX RESULTS:
No spaces at all in the first testcase (banbanbuanbuanban)
No space between "a" and "b" in the second testcase

CHROME RESULTS:
Spaces between ban ban buan etc.
Space between a and b.

Maybe we should match the Chrome results?

This is about how to handle <br> characters in annotations -- they get collapsed/suppressed, but it's just a question of whether to render the collapsed result as a visible space character vs. as nothing at all. As I worked through in bug 1918992 comment 4, the ruby & css-text-3 specs seem to allow either behavior ("depending on the context before and after the break ... UA-defined"), but perhaps we should consider matching Chrome on this for interop purposes, except in cases where we see reasons to do the no-visible-space behavior.

Quoting xidorn (who implemented most of our ruby code) from bug bug 1918992 comment #6, RE whether or not to render as pace "depending on the context" per spec:

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.

The example that xidorn references is https://drafts.csswg.org/css-text-3/#example-e2e8c9a5 which says:
In languages that have no word separators, such as Chinese, “unbreaking” a line requires joining the two lines with no intervening space.

In the testcases that I linked in comment 0, the annotations are using latin characters (not Chinese characters), which is why maybe analyzing-the-context might give us a clue that we should convert to a space.

Summary: Firefox collapses linebreaks away entirely in <rt> (ruby annotations), but perhaps should replace them with spaces → Firefox collapses linebreaks away entirely in <rt> (ruby annotations), but perhaps should replace them with spaces, depending on the context (e.g. Latin text vs. Chinese characters)
You need to log in before you can comment on or make changes to this bug.