Skip to content

[css-ruby] ruby-merge:merge and long annotations #6004

@frivoal

Description

@frivoal

I think the expected behavior of ruby-merge:merge is reasonably clear when the measure of the (merged) annotations is shorter than the measure of the corresponding bases, but not in the opposite situation.

The relevant spec sections are https://drafts.csswg.org/css-ruby-1/#ruby-layout and https://drafts.csswg.org/css-ruby-1/#collapsed-ruby

Let's explore that with ASCII art.

First, just to get used to the space distribution algorithms and how my diagrams work, here are a few non problematic cases:

separate / non spanning:

|[  a1  ]|[  a2  ]|[annotation-3]|   <- uses ruby-align on each annotation
|[Base 1]|[Base 2]|[   Base 3   ]|   <- uses ruby-align on each base

Spanning (short):

|[  a1  ]|[   short span  ]|         <- uses ruby-align on each annotation
|[Base 1]|[Base 2]|[Base 3]|         <- no extra space, nothing to align

Merged (short):

|[    merged annotation   ]|         <- uses ruby-align on the annotation container
|[Base 1]|[Base 2]|[Base 3]|         <- no extra space, nothing to align

Spanning (long):

|[  a1  ]|[spanning annotation]|     <- uses ruby-align on each annotation (no extra space in spanner)
|[Base 1]|[ Base 2 ]|[ Base 3 ]|     <- uses ruby-align on each base, extra space divided to columns

Now, here's the tricky bit. Merged (long):

|[This is a long merged annotation]| <- no extra space, nothing to align
|[ Base 1  ]|[ Base 2 ]|[ Base 3  ]| <- uses ruby-align on each base like for a spanner?
             ?or maybe?
|[      Base 1 Base 2 Base 3      ]| <- treats the bases as merged as well?

The key question is whether 'ruby-merge' should apply to base container or just to annotations. If it does apply to the base container, you can switch between these two variants manually. If it does not, we need to decide which of the two you get. The second variant seems more desirable, but what do you do if there are multiple annotation levels? Merge if any of them is merge? Merge if all of them are merge?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions