nsTableOuterFrame::Reflow doesn't init desired size if no reflow is required

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

nsTableOuterFrame::Reflow doesn't init desired size if no reflow is required

Boris Zbarsky
Testcase:

<div style="float: left; border: 1px solid red">
<fieldset style="width: 5px">
ThisLongTextIsHere
</fieldset>
</div>

<div style="clear: both">
<table style="width: 10px; margin: auto" border="1">
<tr><td>
ThisIsALongWordThisIsALongWordThisIsALongWordThisIsALongWord
</td></tr>
</table>
</div>

(probably not minimal, but reproduces the problem).

When I load this, I don't see the table's text, and it has a computed height of
0.  I do have some local changes that affect the mComputedSize of tables, so I
poked around, and found that in nsTableOuterFrame::Reflow we have:

(gdb) p reflowAllKids
$44 = 0
(gdb) p reflowCaption
$45 = 0
(gdb) p reflowInner
$46 = 0

(this is the reflow when we try not having a vertical scrollbar, and for my
table this reflow can be completely optimized away since it's narrower than the
viewport).  But in this case we never set any of the members of aDesiredSize,
except for setting width and height to 0...

David, I'm not sure whether you're actively working on this code, so I'm not
touching it for now.  Let me know, ok?

-Boris
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: nsTableOuterFrame::Reflow doesn't init desired size if no reflow is required

L. David Baron
On Friday 2006-04-28 14:47 -0500, Boris Zbarsky wrote:

> (gdb) p reflowAllKids
> $44 = 0
> (gdb) p reflowCaption
> $45 = 0
> (gdb) p reflowInner
> $46 = 0
>
> (this is the reflow when we try not having a vertical scrollbar, and for my
> table this reflow can be completely optimized away since it's narrower than
> the viewport).  But in this case we never set any of the members of
> aDesiredSize, except for setting width and height to 0...
I don't follow this bit.  Reflow calls UpdateReflowMetrics which calls
SetDesiredSize.  (Too many functions there, probably, but never mind
that.)

-David

--
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nsTableOuterFrame::Reflow doesn't init desired size if no reflow is required

Boris Zbarsky
In reply to this post by Boris Zbarsky
L. David Baron wrote:
> I don't follow this bit.  Reflow calls UpdateReflowMetrics which calls
> SetDesiredSize.  (Too many functions there, probably, but never mind
> that.)

OK, so I traced more carefully... ;)

We have reflowInner false, so we never do anything interesting with
innerMet.  But then we call FinishReflowChild on mInnerTableFrame and
pass it innerMet as the metrics.  This resizes mInnerTableFrame to 0x0.

Then UpdateReflowMetrics looks at the rect, etc, but the height is 0 by
that point...

-Boris
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: nsTableOuterFrame::Reflow doesn't init desired size if no reflow is required

L. David Baron
On Friday 2006-04-28 16:46 -0500, Boris Zbarsky wrote:

> L. David Baron wrote:
> >I don't follow this bit.  Reflow calls UpdateReflowMetrics which calls
> >SetDesiredSize.  (Too many functions there, probably, but never mind
> >that.)
>
> OK, so I traced more carefully... ;)
>
> We have reflowInner false, so we never do anything interesting with
> innerMet.  But then we call FinishReflowChild on mInnerTableFrame and
> pass it innerMet as the metrics.  This resizes mInnerTableFrame to 0x0.
>
> Then UpdateReflowMetrics looks at the rect, etc, but the height is 0 by
> that point...
Ah, right, yeah, I never really finished converting nsTableOuterFrame.
That's what the:
  // XXXldb Most of the input variables here are now uninitialized!
comment means.

I think we need to figure out how to fill in innerMet and captionMet.
ascent/descent might be interesting.

-David

--
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nsTableOuterFrame::Reflow doesn't init desired size if no reflow is required

Bernd-13
In reply to this post by Boris Zbarsky
L. David Baron wrote:

> Ah, right, yeah, I never really finished converting nsTableOuterFrame.
> That's what the:
>   // XXXldb Most of the input variables here are now uninitialized!
> comment means.
>
> I think we need to figure out how to fill in innerMet and captionMet.
> ascent/descent might be interesting.

If you wish, I could start with a proposal for the later one. But I
would not like to duplicate your work. At which time scale the proposal
should be ready?

Bernd


_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout