Closed Bug 370933 Opened 19 years ago Closed 19 years ago

"ASSERTION: aBlock must be a block" with <input type="file">

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: assertion, regression, testcase)

Attachments

(4 files)

Attached file tiny testcase
Many pages, including https://bugzilla.mozilla.org/attachment.cgi?bugid=12345&action=enter and https://bugzilla.mozilla.org/query.cgi?format=advanced trigger ###!!! ASSERTION: aBlock must be a block: 'blockFrame', file layout/generic/nsBlockFrame.cpp I reduced the former to just <input type="file">.
Flags: blocking1.9?
Assignee: nobody → mats.palmgren
OS: Mac OS X → All
Hardware: PC → All
Attached file Testcase, <legend>
Attached file Testcase, <isindex>
Attached patch Patch rev. 1Splinter Review
nsFileControlFrame, nsIsIndexFrame and nsLegendFrame are subclasses of nsAreaFrame, so they should use nsAreaFrame::QueryInterface() at the end of their QI impl method, not nsHTMLContainerFrame::QueryInterface(). The fix is nsHTMLContainerFrame -> nsAreaFrame, the rest is just a bit of cleanup.
Attachment #255726 - Flags: superreview?(bzbarsky)
Attachment #255726 - Flags: review?(bzbarsky)
Comment on attachment 255726 [details] [diff] [review] Patch rev. 1 Makes sense, and good catch!
Attachment #255726 - Flags: superreview?(bzbarsky)
Attachment #255726 - Flags: superreview+
Attachment #255726 - Flags: review?(bzbarsky)
Attachment #255726 - Flags: review+
Comment on attachment 255726 [details] [diff] [review] Patch rev. 1 Actually, I think might confuse code that's outside these controls and expects them to actually be blocks in some sane way if they QI to that interface.
Attachment #255726 - Flags: superreview-
Attachment #255726 - Flags: superreview+
Attachment #255726 - Flags: review-
Attachment #255726 - Flags: review+
roc, do you think it's safe for random block-like replaced elements to QI to the block CID? Or should we just remove this assert? Though <legend> probably _should_ QI to a block, as far as that goes, no matter what.
I think we've been using QI to mean "is nsBlockFrame or a subclass" and I think that's appropriate. We *really* need some better checks via IsFrameOfType so we can get rid of the QI and avoid a lot of confusion. I'd like to see at least: 1) implements nsBlockFrame 2) IsFloatContainingBlock (which I think is the same as "lays out contents in block fashion", i.e. display-model:block (right?)) 3) IsBlockLevel (i.e., acts like a block to the outside, i.e. display-role:block)
(In reply to comment #7) > 3) IsBlockLevel (i.e., acts like a block to the outside, i.e. > display-role:block) I think this one is probably better determined from the style data than the frame type -- and we already can. Lots of frame types (e.g., images, form controls) can be given display:block. (One could argue that form controls should then become nsBlockFrames rather than form controls -- in fact, I think that probably would have been better -- but it's a little late for that now.)
Hmm, and currently IsFloatContainingBlock is true precisely for nsBlockFrame and its descendants. So maybe we just need one bit here, defined as both 1) and 2).
Note: if we decide to keep the QI's as is, we should probably make nsComboboxControlFrame use nsHTMLContainerFrame too. http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/forms/nsComboboxControlFrame.cpp&rev=1.394&root=/cvsroot&mark=321#291
Comment on attachment 255726 [details] [diff] [review] Patch rev. 1 Let's take this to fix the asserts and then we can work on eliminating uses of this CID for determining block-frame-ness.
Attachment #255726 - Flags: superreview-
Attachment #255726 - Flags: superreview+
Attachment #255726 - Flags: review-
Attachment #255726 - Flags: review+
IsFloatContainingBlock() (or equivalent bit) should mean "won't drop frames that you put on its float list". This is probably equivalent to "is an nsBlockFrame", but I'd also be happy using two different bits for those two slightly different concepts...
Mats, do you want to check that in, or should I do it?
Blocks: 354600
Checked in to trunk at 2007-02-23 20:42 PST -> FIXED
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Should be covered by plenty of existing tests. We just need assertions to turn Tinderbox orange!
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: