we'd better get this fixed
Assignee: nobody → roc
Priority: -- → P2
The issue is most likely that nsXULDocument::StartLayout calls InitialReflow on the presshell unconditionally. If it's already been called (e.g. by nsSubDocumentFrame::Init calling nsSubDocumentFrame::ShowDocShell calling nsDocShell::SetVisibility calling DocumentViewerImpl::Show which does InitPresentationStuff(PR_TRUE)), then we'll get these asserts. So it's a timing issue: if the style change that causes a frame reconstruct (the body display change) comes through after the XUL has started loading but before it's finished loading (e.g. while it's waiting for the stylesheet), we'll get this problem. I suppose we could skip the InitialReflow call if it's already happened (as the HTML sink does). But we should double-check the BeginObservingDocument() mess. I _think_ it would always have been called in that case and the presshell would be observing the document, but worth checking.
I have reproduced this with the testcase but *very* infrequently. I let it run for hundreds of reloads and I've only seen the assertions fire twice. I also got one of these once: ###!!! ASSERTION: Shallow unbind won't clear document and binding parent on kids!: 'aDeep || (!GetCurrentDoc() && !GetBindingParent())', file /Users/roc/mozilla-trunk/content/base/src/nsGenericElement.cpp, line 2086 Boris, do you want to take this bug?
Created attachment 290621 [details] Testcase that should reliably reproduce this I can try to look at this, but I'm pretty crunched for time right now... I'm also not sure there's a sane way to fix this while giving correct behavior in all cases without digging deep into the tree-building code that the XUL prototype walk does. :( I'm pretty sure I can get to this for beta3.
I think it's pretty clear you're the right person to fix this if you possibly can. Send some bugs my way in return :-)
Assignee: roc → bzbarsky
Sweet, this is the last known bug that triggers the assertion added in bug 334514.
Created attachment 296858 [details] [diff] [review] Proposed fix The major change here is that when doing Show() on a viewer for an already-existing document we'll only do the initial reflow if the document is ready for it. Documents start our ready by default, and become unready when StartDocumentLoad is called. After that, either the sink or the caller of StartDocumentLoad() sets the document as ready again. The existing BeginObservingDocument() calls are all not needed, since document viewer calls it.
11 years ago
Summary: Leak with XUL in iframe → [FIX]Leak with XUL in iframe
Fixed 2008-01-20 10:02. Checked in my testcase as a crashtest.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008050621 Firefox/3.0pre - no leak/assertion on testcase --> Verified fixed
Status: RESOLVED → VERIFIED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
9 years ago
Target Milestone: --- → mozilla1.9.1b1
9 years ago
Depends on: 537507
You need to log in before you can comment on or make changes to this bug.