Re: [css-ruby] Nested Ruby

On 07/02/2014 01:47 PM, Boris Zbarsky wrote:
> On 7/2/14, 4:25 PM, fantasai wrote:
>>    # For the purpose of the rules above, a ruby container directly
>>    # parented by a ruby container is considered to be a ruby base
>>    # container.
>
> Er, that's pretty confusing.  Why not just do that directly in the
> algorithm instead?  That would be much preferable.  For example,
> it would make it clear that this stuff is nothing like the table
> setup and the same code should not be reused for it!

Okay.

>> So, yes, this particular box structure is left as-is.
>
> Would the desired behavior not be achievable if the inner ruby
> container got wrapped in a ruby base?

Depends on what you then do with ruby containers wrapped in ruby
bases. The problem here is trying to make nested <ruby> work, e.g.
this is expected to work:

<ruby>
   <ruby>base1<rt>note1</rt>base2<rt>note2</rt></ruby> <rt>NOTE12</rt>
   <ruby>base3<rt>note3</rt>base4<rt>note5</rt></ruby> <rt>NOTE34</rt>
   <rb>base5</rb> <rt>note5</rt> <rtc>NOTE5</rtc>
</ruby>

note1 note2  note3 note4 base5
base1 base2  base3 base4 note5
   NOTE12        NOTE34   NOTE5

The outer ruby structure needs to be aware of the inner ruby annotations
so it doesn't overwrite them, and the notes within each level need to be
aware of each other so they don't collide even when ruby annotations are
allowed to overhang, and the contents of each level of annotation should
align.

It's possible collision avoidance is better handled at layout time, and
we just need to nest the inner ruby container inside a ruby base. That
probably would also handle cases like

<ruby>
   <rb>Some text that's long <ruby><rb>base<rt>note</ruby> more text</rb>
   <rt>An annotation that shouldn't collide with "note"</rt>
</ruby>

but it might make alignment a bit tricky. (At this point, good alignment
is not important, but at some point in the future I suspect people will
care.)

~fantasai

Received on Thursday, 3 July 2014 06:33:15 UTC