"ASSERTION: Element without owner document" with GC'd document

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
x86
Mac OS X
assertion, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

7 years ago
Created attachment 493496 [details]
testcase

1. Install 'DOM Fuzz Lite' from
    https://www.squarefree.com/extensions/domFuzzLite.xpi
2. Load the testcase.

###!!! ASSERTION: Element without owner document: 'Error', file content/base/src/nsGenericElement.cpp, line 3419
(Reporter)

Comment 1

7 years ago
Created attachment 493497 [details]
stack trace
Yeah, this assert is semi-bogus while documents can go away before their elements.

Luckily, we're planning to fix that...

Comment 3

7 years ago
Although I'm not sure whether we will actually force documents to live longer
than elements during unlink.
Sure, but that shouldn't be an issue for this testcase.
Depends on: 335998

Comment 5

6 years ago
Jesse, this is fixed, right?
(Reporter)

Comment 6

6 years ago
Yes.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
So should elements always have an ownerDocument then, ideally? Because I'm seeing currently a js error in one of my GreaseMonkey scripts that says that some element.ownerDocument is undefined.

Comment 8

5 years ago
element.ownerDocument should always point to a valid document.
.ownerDocument is defined in nsIDOMNode, so if ownerDocument is undefined, it sounds like
element isn't actually element object but something else.
You need to log in before you can comment on or make changes to this bug.