Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-ruby-1] Define inline-axis coverage of underline on ruby #5996

Open
frivoal opened this issue Feb 15, 2021 · 1 comment
Open

[css-ruby-1] Define inline-axis coverage of underline on ruby #5996

frivoal opened this issue Feb 15, 2021 · 1 comment
Labels
css-ruby-1 Current Work

Comments

@frivoal
Copy link
Collaborator

frivoal commented Feb 15, 2021

Text decoration on ruby is currently specified as:

Text decoration does not propagate from the base text to the annotations.

When text decoration is specified on an ancestor of the ruby, it is drawn across the entire content area of the ruby base container, including any extra space added on either side of the ruby base contents to accommodate long annotations. When text decoration is specified on a ruby base itself, this extra space is not decorated, similar to how a box’s own padding is not decorated when text decoration is specified directly on that box. [CSS3-TEXT-DECOR]

Text decoration may be specified directly on ruby base containers and ruby annotation containers: in such cases it is propagated to all of the container’s bases or annotations (respectively), and is also drawn between them for continuity.

When underlining on bases and annotations individually, the definition seems reasonable, though I wonder whether underlining the extra space can be controlled by one of the text-decoration-skip-* properties (maybe text-decoration-skip-spaces?). The definition for decorations specified on an ancestor of the ruby seems fine too.

However, when decorating containers, this definition seems different from the normal way text decorations work and incomplete (e.g. what if the different bases in a container have a different vertical-align?). Maybe drawing the underline as if there was an anonoymous inline box wrapping all the bases / annotations in the base container / annotation container would be more consistent with how we usually do things, and give a more consistent answer as to the applicability of the text-decoration-skip-* properties. (Whether you actually need that anonymous box would be up to implementations, as long as the resulting underline is the same.)

PS: The spec also doesn't consider the effect of underlining on inter-character annotations. Maybe we want ruby {text-decoration-skip-self: none:} in the UA stylesheet so that ancestor text-decorations will draw across them (since they're now defined as atomic inlines)?

Relatated comments previously made:

@upsuper https://lists.w3.org/Archives/Public/www-style/2015Feb/0096.html
@patrickdark https://lists.w3.org/Archives/Public/www-style/2016Dec/0106.html

@frivoal frivoal added the css-ruby-1 Current Work label Feb 15, 2021
@fantasai fantasai changed the title [css-ruby-1] Define extent of underline for ruby [css-ruby-1] Define inline-axis coverage of underline on ruby Mar 17, 2021
@fantasai
Copy link
Collaborator

@upsuper's issue https://lists.w3.org/Archives/Public/www-style/2015Feb/0096.html

It is not clear how text decorations should be rendered on ruby elements, or more specifically, what should happen on sides of short base text with long annotation?

For example, if we have content like:

<ruby>base 1<rt>a very very very long annotation</rt>base 2<rt>another very
very very long annotation</rt></ruby>

then we specify "text-decoration: underline" to <ruby> or some of its inline ancestors. What should happen? Currently, WebKit and Blink and Trident won't draw the underline in the gap between the bases, and between text preceding/following and the ruby, while Gecko will draw lines in those places. More precisely, Gecko currently extends the decoration lines to the boundary of each box, other impls don't do that.

It seems to me that our (Gecko) impl makes more sense if the ruby is part of a sentence, while other impls make more sense when ruby is put alone as a single word.

This problem becomes more complicated when considering the different values of ruby-align. I guess users of "center" and "start" probably don't want to extend the lines to the boundary of boxes.

@patrickdark's response https://lists.w3.org/Archives/Public/www-style/2016Dec/0106.html

I think underline text decorations should always extend over annotations for ruby-align: center. I ran into this issue in Firefox 50 recently where a link was split into two to three components because of the "ruby overhang skip" effect and ultimately decided to hide all annotations nested within annotations because the presentation was so ugly.

I can imagine desirability for ruby underlines not extending over a final overhang for ruby-align: start or empty bases at either end of a ruby sequence, but I don't think it would be terrible for underlines to extend over those annotations either.

I've posted some (real world) ruby examples of the text I was working with at
https://patrick.dark.name/sandbox/miscellaneous/ruby.text.decoration.break.xhtml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-ruby-1 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants