Re: [css-ruby] Style of intra-annotation white spaces

On Sat, Nov 22, 2014 at 12:35 PM, fantasai <fantasai.lists@inkedblade.net>
wrote:

> On 11/21/2014 12:49 AM, Xidorn Quan wrote:
>
>> I notice a problem when I implement the vertical positioning of ruby
>> annotations. The problem is that, the intra-annotation
>> white spaces cannot be properly styled, which makes the height of text
>> container look incorrect. For example, there is a piece
>> of code in the spec:
>>
>> <ruby>
>>    <rb>one</rb> <rb>two</rb>
>>    <rt>1</rt> <rt>2</rt>
>> </ruby>
>>
>> After generating anonymous boxes, the frame tree is similar to:
>>
>> <ruby>
>>    <pseudo-rbc><rb>one</rb><pseudo-rb> <pseudo-rb><rb>two</rb></
>> pseudo-rbc>
>>    <pseudo-rtc><rt>1</rt><pseudo-rt> </pseudo-rt><rt>2</rt></psedudo-rtc>
>> </ruby>
>>
>> Here, authors cannot specify any style for the <pseudo-rt/>. It won't
>> have a problem in normal case if UA gives the elements a
>> proper default style. But in some cases, author may want to specify
>> different style to annotations, for example, "rt {
>> font-size: 30%; }". Then the boxes for the intra-annotation white space
>> would be taller than its neighbors.
>>
>> This problem is relatively less troublesome for <pseudo-rb/>s since
>> authors can always specify styles to their parents, and
>> let them inherit. But if an auithor changes the font-size of <rb>, he/she
>> would notice this problem as well.
>>
>> I have no idea about any perfect solution. But I suggest that we can make
>> anonymous intra-annotation white spaces completely
>> collapsed to nothing, and leave only the anonymous boxes for pairing.
>>
>
> I agree it's a troublesome case, but I don't think we can collapse
> the intra-annotation white spaces to nothing. The reason they are
> preserved is to maintain the spacing between adjacent annotations
> in cases where the annotation script uses spaces between words.
>
> We could, perhaps, treat the line-height of inter-annotation (and
> perhaps also inter-base) spaces as always being zero, however.
> Would that make sense? It would solve the height problem while
> respecting the advance width.
>

I think it is a reasonable compromise, although authors may still notice
the advance width being too wide.

In addition, we may need to change the default style sheet, so that those
white spaces can have a proper default behavior.

- Xidorn

Received on Saturday, 22 November 2014 02:45:52 UTC