Closed Bug 1140160 Opened 5 years ago Closed 5 years ago

"ASSERTION: Unexpected parent" and "MOZ_CRASH(nsFieldSetFrame::InsertFrames not supported)"


(Core :: Layout, defect, critical)

Not set





(Reporter: jruderman, Assigned: mats)


(Blocks 1 open bug)


(Keywords: assertion, crash, testcase)


(3 files)

Attached file testcase
###!!! ASSERTION: Unexpected parent: 'parentFrame->GetType() != nsGkAtoms::fieldSetFrame', file layout/base/nsCSSFrameConstructor.cpp, line 7142

Hit MOZ_CRASH(nsFieldSetFrame::InsertFrames not supported) at layout/forms/nsFieldSetFrame.cpp:661

Even the crash is debug-only (it's in a big ifdef debug).
Attached file stack
I think roc added that MOZ_CRASH.
I can take a look since it's likely caused by the display:contents.
Assignee: nobody → mats
Something somewhere is missing a GetContentInsertionFrame(), clearly..
Blocks: 1140579
(In reply to Not doing reviews right now from comment #4)
> Something somewhere is missing a GetContentInsertionFrame(), clearly..

Hmm, nsFieldSetFrame doesn't have a GetContentInsertionFrame() method and
I don't think it ever did.  I think bug 496840 is what changed frame construction
so that nsFieldSetFrame::Insert/Append/RemoveFrames wouldn't be called
at all.  Before that change, I think it was called only for legend frames.
(bug 931464 later removed the code and made those methods assert if called)

Anyway, what normally happens is: GetInsertionPoint would flag this
as a "multiple insertion points" situation:

Then we'll either re-create the whole fieldset frame subtree:

or do an insertion, which leads to GetInsertionPrevSibling, which has a side-effect
of also fixing up the parent frame for fieldsets by calling GetAdjustedParentFrame:
which returns the right parent depending on the child:
OS: Mac OS X → All
Hardware: x86_64 → All
Attached patch fix+testsSplinter Review
This adds a GetAdjustedParentFrame on the relevant display:contents path
in GetInsertionPrevSibling.  I also clarified a comment that's a bit

(there's still an issue that <legend>s don't get the right frame type
in this situation, but it's a separate issue so I filed bug 1140579)
Attachment #8574202 - Flags: review?(roc)
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.