[webkit-dev] Ruby Text Enhancements

Roland Steiner rolandsteiner at google.com
Tue Sep 21 22:16:41 PDT 2010


Hi Eric,

comments inline:

On Wed, Sep 22, 2010 at 6:57 AM, Eric Mader <emader at apple.com> wrote:

>
> On Sep 20, 2010, at 9:52 PM, Roland Steiner wrote:
>
> Oh vey, that's ambituous! :)  There's so many corner cases I foresee on
> this one that I was just too happy to postpone it when we originally
> discussed to leave out CSS3 ruby stuff from the initial implementation,
> which is purely based off HTML5 - including supporting multiple base/text
> pairs within a single ruby, and line-breaking within the ruby.
>
> Yes, it's a bit scary. ;-) I don't think I could implement the whole thing
> at once, so I'm looking at doing a partial implementation. Maybe the first
> round would only check to be sure that the neighboring blocks aren't <ruby>
> blocks.
>

I would actually suggest cutting it down further and at first doing it only
where the neighbor is plain text - this should still catch 90% of the cases
where you'd want overhang and should vastly reduce the corner cases. You can
verify and compute this rather easily when layouting the ruby, and you'd not
need to worry about different glyph heights of neighboring inline elements,
or about replaced elements interfering. Overhang would be basically be the
minimum of: maximum overhang, or length of neighboring text run, or
available/remaining space on the line. The latter factor may also cause you
to need to break the ruby or move it to the next line altogether.


I'm looking at using a RenderOverflow object to implement this. Can you
> point me at any documentation for this class, other than what's in the code?
> I'm having some trouble sorting out what all the various rectangles used in
> conjunction with this object represent.
>

I have to say I'm not personally familiar with RenderOverflow, either
(haven't used it with ruby). Just judging from the description it stores
overflow rectangles for stuff that is actual content (layout overflow) and
stuff that is pure "cosmetic rendering", such as shadows or reflections
(visual overflow). For ruby overhang you'd be looking at layout overflow in
principle (unless the overhang text also has shadows and stuff, which may
add to the visual overflow), AFAICT. But as I said, I'm not really an expert
here.


Cheers,

- Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100922/53297e97/attachment.html>


More information about the webkit-dev mailing list