Closed
Bug 413091
Opened 17 years ago
Closed 16 years ago
<colgroup> triggers "ASSERTION: Table width is less than the sum of its columns' min widths" and more
Categories
(Core :: Layout: Tables, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: bernd_mozilla)
References
(Blocks 1 open bug)
Details
(Keywords: assertion, regression, testcase)
Attachments
(2 files, 1 obsolete file)
(deleted),
application/xhtml+xml
|
Details | |
(deleted),
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
Loading this very simple testcase triggers:
###!!! ASSERTION: Table width is less than the sum of its columns' min widths: '!(aWidthType == BTLS_FINAL_WIDTH && aWidth < guess_min)', file /Users/jruderman/trunk/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 764
###!!! ASSERTION: didn't subtract all that we added: '(space == 0 || space == nscoord_MAX) && ((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f) : (basis.c == 0 || basis.c == nscoord_MAX))', file /Users/jruderman/trunk/mozilla/layout/tables/BasicTableLayoutStrategy.cpp, line 991
I'm guessing this is a regression from bug 368504. The first assertion is new (added in the patch for that bug).
Reporter | ||
Comment 1•17 years ago
|
||
Of all the reftests and crashtests, only layout/base/crashtests/337268-1.html triggers these assertions. That testcase is not very similar to this one, so once this bug is fixed, the testcase here should probably go in as a crashtest.
Attachment #372942 -
Flags: superreview?(bzbarsky)
Attachment #372942 -
Flags: review?(dholbert)
Comment 3•16 years ago
|
||
I'm not sure I follow either the comment or the fix. Can you explain?
In several places we add/subtract 2 cellspacings for example http://mxr.mozilla.org/mozilla-central/source/layout/tables/nsTableFrame.cpp#120
without care if we have cells at all
The assert is caused in particular by http://mxr.mozilla.org/mozilla-central/source/layout/tables/BasicTableLayoutStrategy.cpp#639 where 2 cellspacings are removed. One could also fix that place but I think the supplied patch fits better into the general picture, I am not religous about this.
Updated•16 years ago
|
Attachment #372942 -
Flags: review?(dbaron)
Comment 5•16 years ago
|
||
How can ColumnHasCellSpacingBefore(0) ever return false?
Comment 6•16 years ago
|
||
Ah, I see -- a table with no cells, but a colgroup.
I think we should change nsTableFrame::ColumnHasCellSpacingBefore to return true unconditionally if the index is 0. Would that fix this bug?
I am not sure that this will not have unintended side effects
see for instance
http://mxr.mozilla.org/mozilla-central/source/layout/tables/BasicTableLayoutStrategy.cpp#738
Comment 9•16 years ago
|
||
So the semantics and name of the function ColumnHasCellSpacingBefore are based on the assumption that there's always cell spacing before the first column and after the last column (if there are columns at all), and therefore we don't need a function to check whether there's cell spacing after the last column.
That said, we might want to change the case you point out (plus the matching http://hg.mozilla.org/mozilla-central/annotate/9498df7e5ecd/layout/tables/BasicTableLayoutStrategy.cpp#l938 ) to check whether cells originate in the column rather than using ColumnHasCellSpacingBefore (which isn't really what we mean in that case).
Assignee | ||
Comment 10•16 years ago
|
||
this changes ColumnHasCellSpacingBefore so that the 0th column always has a cellspacing before
and it fixes the two callers that need to know if there are cells originating rather than if there is a cellspacing
Attachment #372942 -
Attachment is obsolete: true
Attachment #373057 -
Flags: superreview?(dbaron)
Attachment #373057 -
Flags: review?(dbaron)
Attachment #372942 -
Flags: superreview?(bzbarsky)
Attachment #372942 -
Flags: review?(dholbert)
Attachment #372942 -
Flags: review?(dbaron)
Updated•16 years ago
|
Attachment #373057 -
Flags: superreview?(dbaron)
Attachment #373057 -
Flags: superreview+
Attachment #373057 -
Flags: review?(dbaron)
Attachment #373057 -
Flags: review+
Comment 11•16 years ago
|
||
Comment on attachment 373057 [details] [diff] [review]
revised patch
r+sr=dbaron.
Could you add the test as a crashtest as well?
Assignee | ||
Comment 12•16 years ago
|
||
>Could you add the test as a crashtest as well?
done, I only omitted them in the patch as I thought this is self explaining.
http://hg.mozilla.org/mozilla-central/rev/dccda3f7724b
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•