Closed Bug 405186 Opened 13 years ago Closed 13 years ago

[FIX]"ASSERTION: Have parent context and shouldn't" with tables, XBL

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: jruderman, Assigned: bzbarsky)

References

(Blocks 2 open bugs)

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

Attached file testcase
Loading the testcase triggers:

###!!! ASSERTION: Have parent context and shouldn't: 'Error', file /Users/jruderman/trunk/mozilla/layout/base/nsFrameManager.cpp, line 834
frame: TableCell(td)(-1) (0x2538720) style: 0x2538630 {}
Has parent context:  style: 0x25381b4 {}
Should be null

This might be related to bug 405184, but note that the assertion there is a DOM assertion rather than a style system assertion.
See also bug 404635, which triggers the same assertion as this testcase.
This is kind of bad.  Basically, the flattened tree looks like this:

  <table>
    <div style="position: fixed">
      <tr>
        <td>

and the DOM looks like this:

  <table>
    <tr>
      <td>


Then we remove the <td> from the DOM.  But GetPrimaryFrameFor() returns null, since we don't add internal table elements to the primary frame map, and FindPrimaryFrameFor doesn't walk through placeholders, so can't find the primary frame for the <tr>: it starts the walk at the content parent (the <table>), but needs to end up under the fixed-pos descendant (the <div>) and never does.  I wonder whether we can walk through placeholders somehow without making something like nested floats O(2^N) (due to walking both the float childlist and the placeholder).  Perhaps we should do a walk similar to the walk that frame destruction does?   That is, walk through placeholders and skip walking certain frame lists?
Flags: blocking1.9?
Blocks: 405184
Component: Layout: Tables → Layout
OS: Mac OS X → All
QA Contact: layout.tables → layout
Hardware: PC → All
Walk through placeholders and skip the out-of-flow (abspos and float) lists you mean? That sounds reasonable
Yeah, skip float, abspos, fixed lists.  Then we can back out the patch we landed for bug 403245 too...
Blocks: 403425
It's sooo tempting to try to clean up this code.  Maybe for moz2.  :(
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #290342 - Flags: superreview?(roc)
Attachment #290342 - Flags: review?(roc)
Summary: "ASSERTION: Have parent context and shouldn't" with tables, XBL → [FIX]"ASSERTION: Have parent context and shouldn't" with tables, XBL
Target Milestone: --- → mozilla1.9 M10
Attachment #290342 - Flags: superreview?(roc)
Attachment #290342 - Flags: superreview+
Attachment #290342 - Flags: review?(roc)
Attachment #290342 - Flags: review+
Comment on attachment 290342 [details] [diff] [review]
Works great, less filling

This fixes a range of cases where the frames for a node would not get removed when it got removed from the DOM, leading to crashes and the like.
Attachment #290342 - Flags: approval1.9?
Comment on attachment 290342 [details] [diff] [review]
Works great, less filling

a=beltzner for drivers
Attachment #290342 - Flags: approval1.9? → approval1.9+
Checked in, including reftest.  We still need to land the assertion test.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: blocking1.9? → in-testsuite?
Resolution: --- → FIXED
Blocks: 393661
Crashtest checked in.
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.