Re: [CSS3-UI] text-overflow:ellipsis (freshly rewritten/expanded and incorporated into editor's draft)

On Tue, Feb 1, 2011 at 00:27, Robert O'Callahan <robert@ocallahan.org> wrote:
> On Tue, Feb 1, 2011 at 3:11 PM, Tantek Çelik <tantek@cs.stanford.edu> wrote:
>>
>> On Sun, Jan 23, 2011 at 19:04, Robert O'Callahan <robert@ocallahan.org>
>> wrote:> The effect of
>> > text-overflow:ellipsis on lines whose line boxes are not direct children
>> > of
>> > the block box(es) with text-overflow is currently undefined.
>>
>> I think this *is* actually both well defined (if indirectly) and
>> interoperable. That is, the effect of the definition in the spec is
>> that *only* the direct block element parent of line boxes can affect
>> the text-overflow behavior of those line boxes since text-overflow is
>> not inherited by default (and each block element potentially sets its
>> own dimensions and overflow).
>
> Ah, but what about anonymous block boxes?

Their presence should not affect text-overflow behavior.

> E.g.
>
> <!DOCTYPE HTML>
> <div style="text-overflow:ellipsis; overflow:auto; width:10%; height:100px;
> border:1px solid black; font-size:16px;
> white-space:pre;">Hello<div>XYZ</div>Kitty</div>
>
> Here, the nearest ancestor block boxes containing "Hello" and "Kitty" are
> anonymous. It looks like IE9 and Opera apply text-overflow to those words,
> but Webkit does not.

Great example / test case.

Confirmed that IE9 and Opera interop on this, and IMHO do the right
(predictable and expected) thing.

Thus I've incorporated a version of the example (including testing a
nested element) into the editor's draft as well as tightened up the
spec language accordingly.

http://dev.w3.org/csswg/css3-ui/#text-overflow

Thanks,

Tantek

-- 
http://tantek.com/ - I made an HTML5 tutorial! http://tantek.com/html5

Received on Friday, 4 February 2011 04:21:00 UTC