On Wed, Sep 22, 2010 at 6:57 AM, Eric Mader
<emader@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.