Closed
Bug 386014
Opened 17 years ago
Closed 17 years ago
[FIXr]"ASSERTION: Should have found a parent before this" with a position:fixed table and captions
Categories
(Core :: Layout: Tables, defect, P1)
Core
Layout: Tables
Tracking
()
RESOLVED
FIXED
mozilla1.9beta1
People
(Reporter: jruderman, Assigned: bzbarsky)
References
Details
(Keywords: assertion, testcase)
Attachments
(2 files)
416 bytes,
application/xhtml+xml
|
Details | |
16.08 KB,
patch
|
bernd_mozilla
:
review+
roc
:
superreview+
dbaron
:
approval1.9+
|
Details | Diff | Splinter Review |
###!!! ASSERTION: Should have found a parent before this: 'aProspectiveParent->GetStyleContext()->GetPseudoType() == nsCSSAnonBoxes::viewportScroll', mozilla/layout/generic/nsFrame.cpp, line 5540
This assertion also showed up in bug 378240, which is now fixed.
Reporter | ||
Comment 1•17 years ago
|
||
Assignee | ||
Comment 2•17 years ago
|
||
So... is it me, or is dynamically inserting a caption into a table generally broken on trunk?
In any case, this assert is firing for a good reason: we're using the wrong style context parent for the caption here.
Assignee | ||
Comment 3•17 years ago
|
||
Looks like dynamic caption insertion in this case got broken by bug 309322. But on trunk only, not branch...
Assignee | ||
Comment 4•17 years ago
|
||
Oh, it hasn't landed on branch...
Assignee | ||
Comment 5•17 years ago
|
||
I filed bug 389924 on that issue.
Assignee | ||
Comment 6•17 years ago
|
||
The idea here is to make ContentInserted more like ContentAppended and the codepath which constructs a table frame and then its kids. For both ContentAppended and that codepath, the parent used for ConstructFrame() when doing the caption is the _inner_ table frame (for ContentAppended() because GetFrameFor() gets the content insertion frame). The caption construction code adjusts this as needed later.
Blow by blow:
Hunk 1: Remove code that's no longer needed because we never pass outer tables to AdjustParentFrame. Fix some indentation.
Hunk 2: Replace the code that finally gets the right parent for the caption by a function that does exactly what this code is doing.
Hunk 3: Remove code that's no longer needed because we never pass outer tables to GetAdjustedParentFrame.
Hunk 4: Comment change
Hunk 5: Remove code that is not needed because AdjustParentFrame handles that situation (and better, since it checks for special kids).
Hunk 6: First part that's needed to actually fix this bug: when getting a parent based on prev or next sibling, get that parent's content insertion frame. This makes our prospective parent the same as other codepaths.
Hunk 7: Same as hunk 5.
Hunk 8: Adjust check for valid prevSibling a little, since now parentFrame may not actually be prevSibling->GetParent()
Hunk 9: Same as hunk 8, for captions.
The rest is tests. Test 1a (the situation in this testcase) fails without this patch, because the background is not actually inherited from the right place.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #274254 -
Flags: superreview?(roc)
Attachment #274254 -
Flags: review?(bernd_mozilla)
Assignee | ||
Updated•17 years ago
|
Flags: in-testsuite?
OS: Mac OS X → All
Priority: -- → P1
Hardware: PC → All
Summary: "ASSERTION: Should have found a parent before this" with a position:fixed table and captions → [FIX]"ASSERTION: Should have found a parent before this" with a position:fixed table and captions
Target Milestone: --- → mozilla1.9beta2
Attachment #274254 -
Flags: review?(bernd_mozilla) → review+
Attachment #274254 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Updated•17 years ago
|
Summary: [FIX]"ASSERTION: Should have found a parent before this" with a position:fixed table and captions → [FIXr]"ASSERTION: Should have found a parent before this" with a position:fixed table and captions
Assignee | ||
Comment 7•17 years ago
|
||
Comment on attachment 274254 [details] [diff] [review]
Proposed fix
Fix incorrect style context parenting for captions when using ContentInserted. Mostly removes redundant code, actually, and makes this codepath act like our other (more commonly used) codepaths for captions. Risk is low.
Attachment #274254 -
Flags: approval1.9?
Comment on attachment 274254 [details] [diff] [review]
Proposed fix
a19=dbaron
Attachment #274254 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 9•17 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•