Closed
Bug 389583
Opened 17 years ago
Closed 17 years ago
Asserts on redoing totally empty line.
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
References
Details
(Keywords: assertion, testcase)
Attachments
(5 files)
564 bytes,
text/html
|
Details | |
480 bytes,
text/html
|
Details | |
1.17 KB,
patch
|
sharparrow1
:
review+
MatsPalmgren_bugz
:
superreview+
dbaron
:
approval1.9+
|
Details | Diff | Splinter Review |
1.92 KB,
patch
|
sharparrow1
:
review+
MatsPalmgren_bugz
:
superreview+
dbaron
:
approval1.9+
|
Details | Diff | Splinter Review |
1.19 KB,
application/xhtml+xml
|
Details |
I've got two testcases that cause asserts about redoing a totally empty line, both derived from a testcase from fantasai. There are two separate issues and I have a patch that fixes both of them.
Assignee | ||
Comment 1•17 years ago
|
||
Assignee | ||
Comment 2•17 years ago
|
||
Assignee | ||
Comment 3•17 years ago
|
||
This is a very simple one, it should be obvious.
Attachment #273840 -
Flags: superreview?(mats.palmgren)
Attachment #273840 -
Flags: review?(sharparrow1)
Assignee | ||
Comment 4•17 years ago
|
||
Here the situation is that there is a float extending to the bottom of the column and we try to place another float, which doesn't fit in the remaining width. During nsBlockReflowState::FlowAndPlaceFloat, we call nsBlockReflowState::GetAvailableSpace repeatedly; it finally returns a band rectangle with height zero at the bottom of the column which is considered *not* to be adjacent to the existing float. I think this behaviour is acceptable (and changing it seems risky), but we need to change this assertion so that it doesn't fire in that case.
Attachment #273844 -
Flags: superreview?(mats.palmgren)
Attachment #273844 -
Flags: review?(sharparrow1)
Assignee | ||
Comment 5•17 years ago
|
||
(I think this behaviour is acceptable because it's conceptually indeterminate whether a zero-height band which is at a float's top or bottom edge is "adjacent to" that float or not.)
Updated•17 years ago
|
Attachment #273844 -
Attachment mime type: application/text → text/plain
Updated•17 years ago
|
Attachment #273844 -
Attachment is patch: true
Updated•17 years ago
|
Attachment #273840 -
Flags: review?(sharparrow1) → review+
Comment 6•17 years ago
|
||
(In reply to comment #2) > Created an attachment (id=273837) [details] > testcase #2 This testcase appears to render fine without any assertions on my box; maybe the patch to Bug 387201?
Assignee | ||
Comment 7•17 years ago
|
||
Maybe, but I don't see how. You're still returning a zero-height band with no floats in it, as far as I can tell.
Comment 8•17 years ago
|
||
Text of the assertion, for searching purposes: ###!!! ASSERTION: redo line on totally empty line: 'aState.IsImpactedByFloat()', file mozilla/layout/generic/nsBlockFrame.cpp, line 3356
Comment 9•17 years ago
|
||
Testcase 1 also triggers: ###!!! ASSERTION: bad prev-in-flow ancestor chain: 'nsLayoutUtils::IsProperAncestorFrame(prevBlock, fpif)', file mozilla/layout/generic/nsBlockFrame.cpp, line 4346
Comment 10•17 years ago
|
||
(In reply to comment #9) > Testcase 1 also triggers: > ###!!! ASSERTION: bad prev-in-flow ancestor chain: I think this assertion is a recent regression, last 7 days or so.
Comment 11•17 years ago
|
||
(bug 301844 / bug 389776 covers the new assertion)
Comment 12•17 years ago
|
||
for the record
Comment 13•17 years ago
|
||
Comment on attachment 273840 [details] [diff] [review] fix testcase #1 sr=mats
Attachment #273840 -
Flags: superreview?(mats.palmgren) → superreview+
Comment 14•17 years ago
|
||
Comment on attachment 273844 [details] [diff] [review] fix testcase #2 >Index: layout/generic/nsBlockFrame.cpp > if (LINE_REFLOW_REDO_NEXT_BAND == lineReflowStatus) { > // This happens only when we have a line that is impacted by > // floats and the first element in the line doesn't fit with > // the floats. > // > // What we do is to advance past the first float we find and > // then reflow the line all over again. >- NS_ASSERTION(aState.IsImpactedByFloat(), >- "redo line on totally empty line"); The comment talks about *a line* that is impacted by floats, maybe the assertion was meant to check that? That is, shouldn't we assert "aLine->IsImpactedByFloat()" instead?
Comment 15•17 years ago
|
||
BTW, the layout for testcase #2 is: +--------+ | | +--------+ | | | | +--------+ | | +--------+ | | | | | | | | | | | | | | | | shouldn't it be like this instead: +--------+ | | | | | | +--------+ | | | | +--------+ | | | | | | +--------+ | | | | | | | |
Comment 16•17 years ago
|
||
The correct rendering is actually more like: +--------++--------+ | || | | || | | || | | || | | || | | || | +--------++--------+ | || | | || | | || | The two floats should be able to fit next to each other. Note that that's actually the rendering I was getting in my build until recently... not sure what changed it. I think we shouldn't screw around with the assertion until the testcase is fixed.
Comment 17•17 years ago
|
||
> The two floats should be able to fit next to each other.
But the column width is less than the float margin-box width. Since the
second float doesn't fit next to the first float I would expect it to be
moved below. (which is what we appear to be trying to do, although we
over do it IMO)
Increasing the column width slightly gives the layout you're suggesting.
Assignee | ||
Comment 18•17 years ago
|
||
(In reply to comment #14) > (From update of attachment 273844 [details] [diff] [review]) > >Index: layout/generic/nsBlockFrame.cpp > > if (LINE_REFLOW_REDO_NEXT_BAND == lineReflowStatus) { > > // This happens only when we have a line that is impacted by > > // floats and the first element in the line doesn't fit with > > // the floats. > > // > > // What we do is to advance past the first float we find and > > // then reflow the line all over again. > >- NS_ASSERTION(aState.IsImpactedByFloat(), > >- "redo line on totally empty line"); > > The comment talks about *a line* that is impacted by floats, > maybe the assertion was meant to check that? > That is, shouldn't we assert "aLine->IsImpactedByFloat()" instead? aState.IsImpactedByFloat() is checking the right thing, which is whether the current band has at least one float in it. aLine->IsImpactedByFloat might be equivalent but I'd have to check to see when exactly that gets set. > shouldn't it be like this instead: Yes. The rendering is still wrong after these patches, and I believe the rendering should be as you (Mats) suggest --- not what Eli suggests; the float border-boxes are each 110px wide, so they can't fit next to each other in a 200px wide column. The problem with the rendering is that when we reflow the second float, aState.mY (the current Y coordinate) is 0, i.e. we're at the top of the second column. So we reflow it there and the float breaks so the first piece has height 250px. But the float doesn't fit into the band containing the last piece of the first float. We try the next band, where it fits horizontally, but we don't reflow the float again so now it doesn't fit vertically! And it gets pushed to the next column. The most obvious way to fix this would be to reflow a float again if we move it down and it doesn't fit vertically anymore. But that's more than I want to do in this bug.
Comment 19•17 years ago
|
||
I think you're misinterpreting the float reflow code; see http://lxr.mozilla.org/seamonkey/source/layout/generic/nsBlockReflowState.cpp#831.
Assignee | ||
Comment 20•17 years ago
|
||
oops, I missed that. (dbaron's comment is wrong, therefore.) There must be some other explanation for the broken rendering, then.
Comment 21•17 years ago
|
||
(In reply to comment #19) > I think you're misinterpreting the float reflow code; see > http://lxr.mozilla.org/seamonkey/source/layout/generic/nsBlockReflowState.cpp#831. > Oops, you're right... we actually should be reflowing, but we aren't.
Comment 22•17 years ago
|
||
Comment on attachment 273844 [details] [diff] [review] fix testcase #2 Actually I think our current behavior on this testcase is intentional... it has the effect of avoiding breaking floats if we don't have to. r+ assuming you fix up the comment before the assertion to mention this situation.
Attachment #273844 -
Flags: review?(sharparrow1) → review+
Assignee | ||
Comment 23•17 years ago
|
||
I guess that is true. OK, thanks.
Assignee | ||
Updated•17 years ago
|
Attachment #273840 -
Flags: approval1.9?
Comment on attachment 273840 [details] [diff] [review] fix testcase #1 a1.9=dbaron
Attachment #273840 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 25•17 years ago
|
||
checked in attachment 273840 [details] [diff] [review]
Updated•17 years ago
|
Attachment #273844 -
Flags: superreview?(mats.palmgren) → superreview+
Assignee | ||
Comment 26•17 years ago
|
||
Comment on attachment 273844 [details] [diff] [review] fix testcase #2 just moves an assert, zero risk
Attachment #273844 -
Flags: approval1.9?
Comment on attachment 273844 [details] [diff] [review] fix testcase #2 a1.9=dbaron
Attachment #273844 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 28•17 years ago
|
||
checked that in too.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•