If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED FIXED

Status

()

Core
XUL
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: Martijn Wargers (dead), Assigned: Neil Deakin)

Tracking

({assertion, testcase})

Trunk
x86
Windows XP
assertion, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

10 years ago
Created attachment 289679 [details]
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

Comment 1

10 years ago
Related to bug 384740?
(Reporter)

Updated

10 years ago
Depends on: 384740

Updated

9 years ago
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets

Comment 2

9 years ago
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!
(Assignee)

Comment 3

9 years ago
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.
(Assignee)

Comment 4

9 years ago
Created attachment 373166 [details] [diff] [review]
fix by checking the current document instead
(Assignee)

Comment 5

9 years ago
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)

Comment 7

9 years ago
Created attachment 373692 [details] [diff] [review]
updated patch that fixes the document displaying
Assignee: nobody → enndeakin
Attachment #373166 - Attachment is obsolete: true
Attachment #373692 - Flags: superreview?(Olli.Pettay)
Attachment #373692 - Flags: review?(Olli.Pettay)

Comment 8

9 years ago
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+
(Assignee)

Comment 9

9 years ago
Checked in. Filed bug 489562 on event handling.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.