Bug 1004202 - Stop calling PrepareToStartLoad in nsDocumentViewer::LoadStart; r=smaug
authorMs2ger <ms2ger@gmail.com>
Sat, 03 May 2014 09:34:00 +0200
changeset 181840 e50544d1d32d9d86f1db8a2c3338d5502773a402
parent 181839 cc42442f4728c36dcda8a2d833ac7f438d7ec6fa
child 181841 7ccef133912755ce2890b3b5f9ab651966ed96f8
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerssmaug
bugs1004202, 968805
milestone32.0a1
Bug 1004202 - Stop calling PrepareToStartLoad in nsDocumentViewer::LoadStart; r=smaug Before bug 968805, none of the callers would reach this branch. The callers in nsContentDLF.cpp call LoadStart immediately after constructing the nsDocumentViewer, so they hit the !mDocument case, and the comparison was always false for the caller in nsHTMLDocument::Open, as it passed an nsIHTMLDocument pointer, so the nsISupports pointers being compared were always different. (XPCOM rules require SameCOMIdentity in this case, to avoid exactly this issue.) I tested that the removed code was never reached after a backout of bug 968805.
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -555,20 +555,16 @@ nsDocumentViewer::~nsDocumentViewer()
  */
 /* virtual */ void
 nsDocumentViewer::LoadStart(nsIDocument* aDocument)
 {
   MOZ_ASSERT(aDocument);
 
   if (!mDocument) {
     mDocument = aDocument;
-  } else if (mDocument == aDocument) {
-    // Reset the document viewer's state back to what it was
-    // when the document load started.
-    PrepareToStartLoad();
   }
 }
 
 nsresult
 nsDocumentViewer::SyncParentSubDocMap()
 {
   nsCOMPtr<nsIDocShellTreeItem> item(mContainer);
   nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(item));