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
{{ message }}
Repository navigation
[css-ruby] Style of intra-annotation white spaces #5962
I notice a problem when I implement the vertical positioning of ruby annotations. The problem is that, the intra-annotation white spaces cannot be properly styled, which makes the height of text container look incorrect. For example, there is a piece of code in the spec:
Here, authors cannot specify any style for the pseudo-rt. It won't have a problem in normal case if UA gives the elements a proper default style. But in some cases, author may want to specify different style to annotations, for example, "rt { font-size: 30%; }". Then the boxes for the intra-annotation white space would be taller than its neighbors.
the anonymous boxes holding inter-annotation spaces are made to inherit from the previous annotation (in document order)
the anonymous boxes holding inter-annotation spaces (and possbly all anonymous annotation boxes) inherit from the annotation container, but if that container is itself anonymous it is inheritsfrom its first non-anonymous child annotation (while all its non-anonymous children continue to inherit from their ruby container grandparent).
The first of these two seems simpler. The second one would give more consistent spacing when some bases have a different size / font, which might be nice, but it's unclear how much that matters.
Directly messing with their height contribution is probably not the answer here, as that wouldn't take care of how wide the space should be, which is also font / font-size dependent.
It won't have a problem in normal case if UA gives the elements a proper default style.
The default font size of rt element in the user agent style sheet is 50%. Anonymous rt elements will inherit their font size from the ruby container which uses a font size of 100%. So, there will be a height difference all the time.
The default font size of rt element in the user agent style sheet is 50%. Anonymous rt elements will inherit their font size from the ruby container which uses a font size of 100%. So, there will be a height difference all the time.
I forgot the whole context of that sentence when I sent it initially, but I'd like to note that it is possible for UA to style specific anonymous box they generate in a way which normal content is not able to access, i.e. if we want, I think it's possible to say that anonymous ruby annotation has 50% of the font size. But that has two problems:
if it's inside an rtc with 50% font size, it would become 25% of the base font size, and it may not be easy to fix because anonymous box is usually special, so it may not have the full selector support
if user wants a different font size, the anonymous box's style would change with that.
I think in most common use cases, i.e. Japanese's kana annotation, it is not a problem, because there is generally no whitespace within the annotation between characters.
Activity
frivoal commentedon Feb 9, 2021
I think we could solve this in one of two ways:
The first of these two seems simpler. The second one would give more consistent spacing when some bases have a different size / font, which might be nice, but it's unclear how much that matters.
Directly messing with their height contribution is probably not the answer here, as that wouldn't take care of how wide the space should be, which is also font / font-size dependent.
frivoal commentedon Feb 9, 2021
(also, this was discussed in the 2015 Sydney F2F)
TalbotG commentedon Jul 28, 2021
@upsuper , I noticed such issue myself in your own test:
http://wpt.live/css/css-ruby/ruby-intra-level-whitespace-001.html
I created a more revealing test out of it:
http://www.gtalbot.org/BrowserBugsSection/CSS3Ruby/ruby-intra-level-whitespace-001-GT.html
The default font size of rt element in the user agent style sheet is 50%. Anonymous rt elements will inherit their font size from the ruby container which uses a font size of 100%. So, there will be a height difference all the time.
upsuper commentedon Jul 31, 2021
I forgot the whole context of that sentence when I sent it initially, but I'd like to note that it is possible for UA to style specific anonymous box they generate in a way which normal content is not able to access, i.e. if we want, I think it's possible to say that anonymous ruby annotation has 50% of the font size. But that has two problems:
rtcwith 50% font size, it would become 25% of the base font size, and it may not be easy to fix because anonymous box is usually special, so it may not have the full selector supportI think in most common use cases, i.e. Japanese's kana annotation, it is not a problem, because there is generally no whitespace within the annotation between characters.