[webkit-dev] Ruby Text Enhancements

Eric Mader emader at apple.com
Wed Sep 22 15:59:04 PDT 2010


On Sep 21, 2010, at 7:16 PM, Roland Steiner wrote:

> 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'll look at this idea too. What do I need to do to find the neighboring inline elements?

> 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.

I've been looking at RenderOverflow, and I'm beginning to suspect that it's not the best way to proceed. Now I'm thinking that the negative margins are the way to go. My guess is that I need to set the margins on either the RenderRubyRun object or perhaps the RenderRuby object itself. To compute the correct margins, it looks to me like I'll need to access the widths of the RenderRubyText and RenderRubyBase objects. So far, I haven't been able to work out how to do that. Any clues would be greatly appreciated.

> Cheers,
> 
> - Roland

Regards,
Eric

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


More information about the webkit-dev mailing list