Last Comment Bug 615034 - "ASSERTION: Element without owner document" with GC'd document
: "ASSERTION: Element without owner document" with GC'd document
Status: RESOLVED FIXED
: assertion, testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on: strongparent
Blocks: 326633
  Show dependency treegraph
 
Reported: 2010-11-26 21:40 PST by Jesse Ruderman
Modified: 2012-05-14 04:21 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (289 bytes, text/html)
2010-11-26 21:40 PST, Jesse Ruderman
no flags Details
stack trace (3.21 KB, text/plain)
2010-11-26 21:41 PST, Jesse Ruderman
no flags Details

Description Jesse Ruderman 2010-11-26 21:40:54 PST
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
Comment 1 Jesse Ruderman 2010-11-26 21:41:17 PST
Created attachment 493497 [details]
stack trace
Comment 2 Boris Zbarsky [:bz] 2010-11-29 09:59:39 PST
Yeah, this assert is semi-bogus while documents can go away before their elements.

Luckily, we're planning to fix that...
Comment 3 Olli Pettay [:smaug] 2010-11-29 10:04:21 PST
Although I'm not sure whether we will actually force documents to live longer
than elements during unlink.
Comment 4 Boris Zbarsky [:bz] 2010-11-29 10:44:07 PST
Sure, but that shouldn't be an issue for this testcase.
Comment 5 Olli Pettay [:smaug] 2011-08-26 12:38:11 PDT
Jesse, this is fixed, right?
Comment 6 Jesse Ruderman 2011-08-26 13:27:24 PDT
Yes.
Comment 7 Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2012-05-13 15:52:35 PDT
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 Olli Pettay [:smaug] 2012-05-14 04:21:22 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.