Closed Bug 476087 Opened 17 years ago Closed 17 years ago

[FIX]"ASSERTION: Someone screwed up the indexing" with execCommand("indent") on td

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: bzbarsky)

References

Details

(Keywords: assertion, regression, testcase)

Attachments

(2 files)

Attached file testcase —
###!!! ASSERTION: out of bounds: 'PRInt32(aIndex) >= 0 && aIndex <= l', file /Users/jruderman/central/layout/base/nsChildIterator.h, line 132 ###!!! ASSERTION: Someone screwed up the indexing: '*iter == aChild', file /Users/jruderman/central/layout/base/nsCSSFrameConstructor.cpp, line 7897 ###!!! ASSERTION: anonymous nodes should not be in child lists: '!aOldChild->IsRootOfAnonymousSubtree()', file /Users/jruderman/central/layout/base/nsCSSFrameConstructor.cpp, line 12377 The second assertion was added in bug 307394 part 2.
Yeah. These are all about the same thing, actually. In this case, there's native anonymous content that nsHTMLEditor::CreateAnonymousElement calls RecreateFramesFor() on. This causes use to post that third assert, end up in a RecreateFramesForContent for the native anon content, get -1 as the index, and happily use that. There's no XBL involved, so we follow the "normal content" codepath. Now the issue, of course, is that recreating frames for native anonymous content is simply not supported and never has been. I hate hacks like this. :( I thought we had a bug on editor being broken here, but I can't find it offhand. I can make those first two asserts go away by just restoring the behavior we used to have here, which was to blindly append. In fact that's still the behavior, due to the bounds-checks in nsContentIterator. But really, the caller is broken and should be fixed.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #360031 - Flags: superreview?(dbaron)
Attachment #360031 - Flags: review?(dbaron)
It might be good to file a bug on the editor brokenness and mention the bug number in the comment.
Like I said in comment 1, I'm pretty sure we have a bug on that already. I'll look for it, but if someone else finds it first, so much the better. Once we find it, I'll add it to the comments.
Summary: "ASSERTION: Someone screwed up the indexing" with execCommand("indent") on td → [FIX]"ASSERTION: Someone screwed up the indexing" with execCommand("indent") on td
Comment on attachment 360031 [details] [diff] [review] Avoid the new asserts r+sr=dbaron, but maybe add an NS_WARNING in a final else?
Attachment #360031 - Flags: superreview?(dbaron)
Attachment #360031 - Flags: superreview+
Attachment #360031 - Flags: review?(dbaron)
Attachment #360031 - Flags: review+
Pushed http://hg.mozilla.org/mozilla-central/rev/6f89dd8e23af I filed bug 476670 because I can't seem to find the existing one.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: