w3c / html-ruby

HTML Ruby Markup Extensions
https://www.w3.org/TR/html-ruby-extensions/
Other
3 stars 3 forks source link

Need to explicitly mention the default placement of ruby with 2 sets of annotations #20

Closed r12a closed 3 months ago

r12a commented 3 months ago

The browser parsers already support most of what is needed for ruby, but a key challenge at the moment is that when there are two sets of ruby annotations they are not placed correctly by some browser engines.

There are examples of what to do in the spec, but i couldn't find any normative text or anything in the Rendering section to indicate the expected default positioning of the items around the base. This can be styled by the author using the CSS Ruby spec, but that is putting the cart before the horse. I think this spec needs to specify a default (ie. without CSS declarations) placement, ie. that the two items should go on different sides of the base. Which goes where can probably be left to the browser implementer (leaving latitude for them to factor in language-related positioning), but we shouldn't see both annotations on the same side of the base, or one set of annotations trailing along the baseline after the rest of the ruby element.

r12a commented 3 months ago

@frivoal responded:


This is covered in a part of the HTML specification (https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3) that this extension specification does not propose changing:

When a particular part of a ruby has more than one annotation, the annotations should be distributed on both sides of the base text so as to minimize the stacking of ruby annotations on one side.

Without introducing redundancy, it could be mentioned non-normatively in the advisement box at the start of https://www.w3.org/TR/html-ruby-extensions/#rendering that that section has a few existing additional requirements about ruby.

r12a commented 3 months ago

I think that that would be a good idea.