Re: [css-ruby] About side of additional leading

On Wed, Dec 31, 2014 at 9:27 AM, L. David Baron <dbaron@dbaron.org> wrote:

> On Wednesday 2014-12-31 09:14 +1100, Xidorn Quan wrote:
> > The current spec says:
> >
> >     ... then additional leading is added on the appropriate side of the
> > ruby base container such that ...
> >
> > I guess the word "side" should be in plural form, so that UAs are allowed
> > to add leadings to both sides if they think it is better.
>
> It seems like the spec should say where the additional leading goes,
> rather than leaving it up to the UA.
>
> Otherwise the same markup will lead to overlapping text in some UAs
> but not others.


The current impl of WebKit adds the extra leading to the side where the
annotation is. Given that, I think the bottom line is:
1. If the line-height is enough for the annotations, don't change anything
<= it has been in the spec, and shouldn't be changed
2. If annotations are only on one side, the leading can only be added to
that side.
so that the spec can be compatible with existing impls.

I'm not sure what should happen for both side annotations. In my current
pending patch, I implement the following algorithm:
1. set delta leading to the difference between the total height of
annotations and the total leadings
2. if delta leading is less than zero, exit the algorithm
3. if the leading on one side is enough for annotations on its side, but
the other is not, then add the delta leading to the latter side, otherwise,
extend both leadings to the total height of annotations on its side.

- Xidorn

Received on Thursday, 1 January 2015 22:19:22 UTC