Closed Bug 725559 Opened 14 years ago Closed 13 years ago

querySelector on TextNode triggers "ASSERTION: The optimization below to check ContentIsDescendantOf only for elements depends on aRoot being either an element or a document if it's in the document"

Categories

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

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: assertion, regression, testcase)

Attachments

(2 files)

Attached file testcase
###!!! ASSERTION: The optimization below to check ContentIsDescendantOf only for elements depends on aRoot being either an element or a document if it's in the document.: 'aRoot->IsElement() || aRoot->IsNodeOfType(nsINode::eDOCUMENT) || !aRoot->IsInDoc()', file content/base/src/nsGenericElement.cpp, line 5810
Attached file stack trace
querySelector should be throwing on text nodes. In the long term, the new bindings could take care of this. In the short term, we could nuke nsIDOMNodeSelector and put the API directly on document/element/documentFragment (which is what selectors API 2 does anyway). Jonas, thoughts? The assert is harmless apart from its impact on fuzz testing, by the way.
[01:13:33.800] TypeError: Value does not implement interface Element. @ https://bug725559.bugzilla.mozilla.org/attachment.cgi?id=595628:1 The long term is here... ;)
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
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: