Closed Bug 613793 Opened 14 years ago Closed 14 years ago

"ASSERTION: Not an element?" with doctype, document fragment

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b8
Tracking Status
blocking2.0 --- -

People

(Reporter: jruderman, Assigned: Ms2ger)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files, 2 obsolete files)

Attached file testcase
###!!! ASSERTION: Nodes that are not documents, document fragments or elements can't be parents!: 'aParent->IsNodeOfType(nsINode::eDOCUMENT) || aParent->IsNodeOfType(nsINode::eDOCUMENT_FRAGMENT) || aParent->IsElement()', file content/base/src/nsGenericElement.cpp, line 3827

(like in bug 564047), followed by an additional assertion:

###!!! ASSERTION: Not an element?: 'IsElement()', file Element.h, line 95
Attached file stack traces
Hmm.  In this case aParent is of course an nsDOMDocumentType.  nsINode::ReplaceOrInsertBefore should probably check for document/fragment/element at the beginning, I think, instead of checking for "not data and not attribute"...
Oh, but that second assert is bad; we really do need to fix this.

Ms2ger, if you don't have time let me know and I'll do it.
blocking2.0: --- → ?
Attached patch Patch v1 (obsolete) — Splinter Review
This is untested, but I believe it would fix the bug. I'm not sure when I'll have time to test it, so I'm putting it up already.
Attachment #492212 - Flags: review?(bzbarsky)
The included test passes. I might have time to do a full test run later this week, but no promises.
Comment on attachment 492212 [details] [diff] [review]
Patch v1

No, I really do think we should whitelist (incidentally, that would be faster), not blacklist.
Attachment #492212 - Flags: review?(bzbarsky) → review-
Attached patch Patch v2 (obsolete) — Splinter Review
Something like this?
Attachment #492212 - Attachment is obsolete: true
Attachment #493592 - Flags: review?(bzbarsky)
Comment on attachment 493592 [details] [diff] [review]
Patch v2

Yes, though you should take the eAttribute check out too, and drop the "nsINode::" bits.  r=me with those changes.
Attachment #493592 - Flags: review?(bzbarsky) → review+
Comment on attachment 493592 [details] [diff] [review]
Patch v2

Dropping the Attr check causes an unexpected pass in the dom test suite. Can I just disable it?
Which test has the unexpected pass?
Ah.  That test is testing that appending an element to an Attr throws HIERARCHY_REQUEST_ERR.  Which we didn't use to do, and which we now do.

So the right thing is to just remove this test from the attributeModTests array in dom/tests/mochitest/dom-level1-core/exclusions.js, I think.
Will do.
Not sure I can say this is a blocker, but I'll approve the patch.
blocking2.0: ? → -
Attachment #493592 - Flags: approval2.0+
Assignee: nobody → Ms2ger
Attachment #493592 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/583c8c32b487
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Keywords: checkin-needed
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
No longer depends on: 564047
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: