RE: [css3-ruby][css3-linebox] Proposal to add "auto" value for the line-stacking-ruby property

Please forget the "150%" idea; we've got a better one.

I made a picture to make sure we're on the same page.
http://lists.w3.org/Archives/Public/www-archive/2010Dec/att-0006/ruby-overlap.png
The gray boxes are line boxes. The two line boxes can be either within blocks or cross blocks. The sample picture does not include paddings/borders/margins.

GOALS:
If a line has at least one "rubyB", use "include-ruby"; the 2nd line in the picture is moved down.
Otherwise use "exclude-ruby"; i.e., the ruby is ignored for line stacking.

OPTION 1:
Compare the top of the ruby box against the (bottom of line box - half-leading) of the previous line.

OPTION 2:
Calculate the vertical center of the ruby box (red horizontal line in the picture), then compare it against the top of the line box.

PROS/CONS for OPTION 1:
* Figuring out "the previous line" could be difficult. If we define it as "the previous line in the block formatting context", floats are always "exclude-ruby", and thus it may overlap the previous line. If we define it as "the previous line within the HTML stream", blocks after floats may overlap blocks before floats. Also, page-break must be treated special.
* The logic/code can be complex, as it needs to find the previous/next line.

PROS/CONS for OPTION 2:
* The ruby may overlap if the previous line has smaller leading. This includes smaller font-size, smaller line-height, and replaced elements.

ADDITIONAL OPTION:
If the element has visible borders, compare the top of the ruby box against it. If the ruby box overlaps the border, use "include-ruby".

DISCUSSIONS IN JAPAN:
I discussed this in the meeting of about 10 people including JLTF members, and also got some responses in two Japanese MLs. Everyone from there thinks either is a good option, and edge cases are good compromises. Some prefers OPTION 2 because it looks simpler, but nobody has good idea how much actually it is from coding point of view, so we concluded that we'd ask opinions here by showing both options.

Some said that the spec could make the actual condition UA dependent, and show these options as examples if it helps implementers.

The ADDITIONAL OPTION is nice to have. It helps "auto" value works within table cells and when the block has borders. But experts think authors would add paddings in most of the cases, so it is not required to have it.

ACTUAL SIZE V.S. FONT SIZE ISSUE:
There was an argument where font-size should be used instead of actual box size to avoid using "include-ruby" unexpectedly as a result of non-linear scaling of fonts, and/or possible fractions of glyphs. We were not sure how much it really is a problem, so the argument was that using font-size is safer. Maybe this can be UA dependent.


I hope this mail clarifies current situation. Please feel free to ask me any questions, and any feedbacks are greatly appreciated.


Regards,
Koji

Received on Friday, 10 December 2010 19:58:58 UTC