Re: [css-ruby] Propose to make anonymous ruby text container "inherit" styles from their child

On 03/11/2015 06:53 PM, Xidorn Quan wrote:
> It is always a problem that anonymous ruby text containers are not affected by styles of their children.
>
> In most cases, it is not necessary for authors to be aware of the existence of the anonymous ruby text container. But the fact
> that the anonymous box inherits styles from its parent could indeed cause some weired result sometimes. Consider the following
> example:
>
> <ruby><rb>base1<rb>base2<rt>text1<rt style="vertical-align: top">text2</ruby>
>
> In this example, authors should expect that "text2" is aligned with "text1" because there is no element taller than them in
> the annotation. But with the current spec, "text2" may be placed higher than "text1" because the anonymous ruby text container
> inherits line-height and font-size from <ruby>, which makes the line of annotation be actually 2x as tall as it is expected.
>
> Since styles of anonymous boxes are not inherited by their children, there is no cyclic dependency.

This is an interesting idea. I'm not sure how well it fits with
the architecture of various layout engines, but I don't have a
problem with it since I can't figure out a better way to solve
this problem!

Have you asked bzbarsky and/or dbaron what they think?

~fantasai

Received on Wednesday, 29 July 2015 00:36:12 UTC