Closed Bug 404798 Opened 12 years ago Closed 11 years ago

ASSERTION: element has no document, when documentElement is removed and datasources

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: enndeakin)

References

Details

(Keywords: assertion, testcase)

Attachments

(2 files, 1 obsolete file)

Attached file testcase
I'm seeing this assertion in current debug trunk build with the testcase:
###!!! ASSERTION: element has no document: 'doc', file c:/mozilla-build/mozilla/
content/xul/templates/src/nsXULTemplateBuilder.cpp, line 403
Related to bug 384740?
Depends on: 384740
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
I still see this on trunk, even with bug 384740 WFM.

Firefox doesn't paint the page when I click 'testcase'!  It still shows this bug report, with the new URL showing in the address bar!
The builder is likely delaying the initialization of the template builder until parsing is complete at which point the node is no longer in a document. Since that could actually be a valid situataion, for the assertion, we should probably just check the current document in nsXULDocument::CreateTemplateBuilder (instead of the owner document as it does currently) and return successfully if null.

However, I would say that the latter behaviour of not showing a blank page was a more problematic bug here.
The patch here fixes the assertion, but doesn't fix the issue where the page doesn't even appear.

That problem is caused because nsXULDocument::StartLayout returns early if it encounters a document with no root element, preventing InitialReflow from being called. I don't know if there's a reason it should be doing this; removing it causes to blank page to display but causes assertions at nsPresShell.cpp:5810 when mousing over it.
Yeah, I have no idea what all nsXULDocument::StartLayout is trying to do.

That assertion is bogus, imo.
Assignee: nobody → enndeakin
Attachment #373166 - Attachment is obsolete: true
Attachment #373692 - Flags: superreview?(Olli.Pettay)
Attachment #373692 - Flags: review?(Olli.Pettay)
Comment on attachment 373692 [details] [diff] [review]
updated patch that fixes the document displaying

Looks ok to me.
Could you perhaps file a followup to fix event handling when document doesn't have documentElement.
(or maybe there is already such bug)
Attachment #373692 - Flags: superreview?(Olli.Pettay)
Attachment #373692 - Flags: superreview+
Attachment #373692 - Flags: review?(Olli.Pettay)
Attachment #373692 - Flags: review+
Checked in. Filed bug 489562 on event handling.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.