Closed Bug 399209 Opened 17 years ago Closed 17 years ago

[FIX]"ASSERTION: Wrong parent style context" with table stuff

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: jruderman, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

Attached file testcase (deleted) —
Loading the testcase triggers: frame: TableCol(col)(0) (0x2666d84) style: 0x2784110 {} ###!!! ASSERTION: Wrong parent style context: 'Error', file /Users/jruderman/trunk/mozilla/layout/base/nsFrameManager.cpp, line 818 Wrong parent style context: style: 0x2783758 {} should be using: style: 0x2783dec {} About half of the time, it also triggers: ###!!! ASSERTION: Style contexts are not in the same style context tree: 'top1 == top2', file /Users/jruderman/trunk/mozilla/layout/base/nsFrameManager.cpp, line 781
Attached patch Fix (deleted) — Splinter Review
When we removed the col, we left the anonymous cols hanging around.... This patch makes sure to remove them. I'm not sure about replacing them with anonymous "cell" cols, but I think there are cases when we do need that, and detecting whether we do from here is hard. :( I _think_ having extra "cell" cols is ok, right?
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #284205 - Flags: superreview?(roc)
Attachment #284205 - Flags: review?(bernd_mozilla)
OS: Mac OS X → All
Priority: -- → P2
Hardware: PC → All
Summary: "ASSERTION: Wrong parent style context" with table stuff → [FIX]"ASSERTION: Wrong parent style context" with table stuff
Target Milestone: --- → mozilla1.9 M10
Comment on attachment 284205 [details] [diff] [review] Fix removing a col without calling nsTableFrame::RemoveCol is wrong. Having the cols not in sync with the cellmap was tolerated for too long time.
Attachment #284205 - Flags: review?(bernd_mozilla) → review-
Uh. This code IS calling RemoveCol for everyu single column it removes. It's just that RemoveCol replaces the col being removed with a eColAnonymousCell col. So if I have a <col span="3"> but only one cell, I'll end up with three eColAnonymousCell cols, not just one. That's the only odd thing about the behavior this patch gives. If that behavior is not acceptable, then we have to somehow figure out the "right" number of eColAnonymousCell cols to create. Any ideas how? Perhaps RemoveCol should actually be RemoveCols so we can remove the whole span at once? But are eColAnonymousCell colframes ever removed explicitly?
Comment on attachment 284205 [details] [diff] [review] Fix Resetting review request per comment 3. Bernd, if it's really very important that the set of colframes after removal of a <col> exactly match what we would have had if the <col> were not there at all, I can do that. But it seems like we deal with extra cols anyway, because of spans...
Attachment #284205 - Flags: review- → review?
Comment on attachment 284205 [details] [diff] [review] Fix Oh I did miss that this is a recursion call
Attachment #284205 - Flags: review? → review+
Attachment #284205 - Flags: superreview?(roc)
Attachment #284205 - Flags: superreview?(roc) → superreview+
Comment on attachment 284205 [details] [diff] [review] Fix Requesting 1.9 approval. I think this is reasonably low-risk... it's definitely less risky than leaving the code as-is.
Attachment #284205 - Flags: approval1.9?
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Depends on: 403249
Depends on: 404301
Should get in a test for this...
Flags: in-testsuite?
Testcase checked in as a crashtest. (bz, did you want something more?)
Flags: in-testsuite? → in-testsuite+
I added reftests for this using both background and visibility:collapse. Bernd, I put them under bugs/, but if you want me to put things like this under table-dom, let me know?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: