Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

line layout question: should inline frames with nonzero border/padding/margin be considered empty depending on skipsides

0 views
Skip to first unread message

Boris Zbarsky

unread,
Sep 3, 2009, 12:47:10 AM9/3/09
to
Consider this testcase:

<!DOCTYPE html>
<html>
<body style="width: 0">
<span style="border-style: solid; border-width: 0 0 0 1px;">
<div style="display: inline-block; width: 100px"></div>
</span>
next
</body>
</html>

In Gecko that shows a blank line between the vertical bar and the text
"next", because the continuation of the span has IsSelfEmpty() false,
and hence isEmpty ends up false in nsLineLayout::ReflowFrame.

In Opera and Webkit, the blank line is not present.

It seems to me that we should perhaps be taking the GetSkipSides for the
frame into account when determining self-emptiness... The problem is
that this state isn't really reliable until after bidi reordering and
the like, right?

-Boris

Boris Zbarsky

unread,
Sep 3, 2009, 1:23:16 AM9/3/09
to
Boris Zbarsky wrote:
> It seems to me that we should perhaps be taking the GetSkipSides for the
> frame into account when determining self-emptiness... The problem is
> that this state isn't really reliable until after bidi reordering and
> the like, right?

On the other hand, bidi reordering might change the outcome of
IsSelfEmpty() in some rare cases, but should never change IsEmpty(),
right? So maybe it's safe to just set a bit during reflow if we end up
in a situation where we skip both start and end sides, and return
IsSelfEmpty() == true in those cases?

-Boris

Robert O'Callahan

unread,
Sep 3, 2009, 10:19:53 PM9/3/09
to
On 3/09/09 4:47 PM, Boris Zbarsky wrote:
> It seems to me that we should perhaps be taking the GetSkipSides for the
> frame into account when determining self-emptiness... The problem is
> that this state isn't really reliable until after bidi reordering and
> the like, right?

Actually I'm not sure whether bidi reordering should change GetSkipSides
... I'd have to reread the CSS 2.1 spec and our code.

Rob

Boris Zbarsky

unread,
Sep 3, 2009, 10:28:53 PM9/3/09
to
Robert O'Callahan wrote:
> Actually I'm not sure whether bidi reordering should change GetSkipSides
> ... I'd have to reread the CSS 2.1 spec and our code.

It certainly does in our code, and I'd hope the spec matches that.
That's the only behavior that can possibly make sense. Otherwise you
get borders halfway through the text.

That said, for the frames I care about (those somewhere in the middle of
an {ib} split), bidi reordering can't change the fact that both start
and end are skipped. I could just hack knowledge of ib splits into
nsInlineFrame::IsSelfEmpty if people are ok with that.

-Boris

0 new messages