Bug 458637. Make sure to properly flag the XSLT result document as not being ready for layout until we StartLayout. r+sr=sicking
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 10 Oct 2008 13:44:43 -0400
changeset 20272 95e6729d80797ff92ef319087b87672f23d7bf95
parent 20271 3762e6244e6398f7dd5dd222badac7512cbb1815
child 20273 1dd91a933340a6f7840cf1c75bb041fc278e4835
push id2759
push userbzbarsky@mozilla.com
push dateFri, 10 Oct 2008 17:45:08 +0000
treeherdermozilla-central@95e6729d8079 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs458637
milestone1.9.1b2pre
Bug 458637. Make sure to properly flag the XSLT result document as not being ready for layout until we StartLayout. r+sr=sicking
content/xml/document/src/nsXMLContentSink.cpp
layout/base/nsPresShell.cpp
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -407,16 +407,17 @@ nsXMLContentSink::OnTransformDone(nsresu
   nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aResultDocument);
 
   nsCOMPtr<nsIContentViewer> contentViewer;
   mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
 
   if (NS_FAILED(aResult) && contentViewer) {
     // Transform failed.
     if (domDoc) {
+      aResultDocument->SetMayStartLayout(PR_FALSE);
       // We have an error document.
       contentViewer->SetDOMDocument(domDoc);
     }
     else {
       // We don't have an error document, display the
       // untransformed source document.
       nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(mDocument);
       contentViewer->SetDOMDocument(document);
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -2364,16 +2364,18 @@ PresShell::GetDidInitialReflow(PRBool *a
 
 NS_IMETHODIMP
 PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
 {
   if (mIsDestroying) {
     return NS_OK;
   }
 
+  NS_ASSERTION(!mDidInitialReflow, "Why are we being called?");
+
   nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
   mDidInitialReflow = PR_TRUE;
 
 #ifdef NS_DEBUG
   if (VERIFY_REFLOW_NOISY_RC & gVerifyReflowFlags) {
     if (mDocument) {
       nsIURI *uri = mDocument->GetDocumentURI();
       if (uri) {