You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)?
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.
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.
Text decoration on ruby is currently specified as:
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
The text was updated successfully, but these errors were encountered: