Closed Bug 495883 Opened 16 years ago Closed 16 years ago

"ASSERTION: Unable to get an nsIScriptGlobalObject from the ScriptGlobalObjectOwner!"

Categories

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

x86
macOS
defect

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: jruderman, Assigned: smaug)

References

Details

(Keywords: assertion)

Attachments

(4 files)

Attached file stack trace
###!!! ASSERTION: Unable to get an nsIScriptGlobalObject from the ScriptGlobalObjectOwner!: 'global', file dom/src/jsurl/nsJSProtocolHandler.cpp, line 166 The page script is calling cloneNode. Based on the stack, I'd guess the subtree being cloned includes a frame whose src attribute is a javascript: URL. I can't reproduce this in a way that allows me to make a reduced testcase :( sicking looked at this a little but thought bz would understand it better.
Yikes. So we're cloning a document. That's fine. But then we create a frameloader for the frame that happens to be in that document! We should almost certainly be checking whether the document has a container before doing that. We need to fix this on 1.9.1 too, imo, though I wouldn't block initial release on it...
Blocks: 42976
Flags: wanted1.9.1?
Flags: blocking1.9.2?
Attached file Testcase
Oh, this is extra fun. The first load (from inside BindToTree) fails because in the frame loader we go to CheckForRecursiveLoad(), which ends up in nsFrameLoader::EnsureDocShell, which can't get a win_private from the docshell (because the docshell has no treeowner), so returns error. But then we set the src attr node from the attr map on the new element, which triggers another load attempt, and this time mDocShell is non-null (even though it was never properly set up), so we go ahead and try to do the load in it.
There are variants of this (e.g. getting a document out of an iframe before removing that iframe from the DOM) that also don't need the "createDocument can create HTML documents" thing. Heck, I could probably toss an <html:iframe> into a random XML document... I would have thought our data document content policy would have prevented these documents from doing loads at all, though. Why is it not catching them? Do we not flag them as data documents?
I think we should try to get to this one for 1.9.2.
Flags: blocking1.9.2? → blocking1.9.2+
Priority: -- → P2
Assignee: nobody → Olli.Pettay
Blocks: 511084
Attached patch patchSplinter Review
We shouldn't even create the frame loader if it is not needed. Error handling is simplified a bit so that OOM isn't any different than for example data document handling. Posted the patch to tryserver. I filed a followup bug 511084 to figure out what to do with nsGenericHTMLFrameElement::EnsureFrameLoader(). It has the !GetParent check.
Attachment #395033 - Flags: review?(jonas)
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
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: