Bug 1004202 - Stop calling PrepareToStartLoad in nsDocumentViewer::LoadStart; r=smaug
authorMs2ger <ms2ger@gmail.com>
Sat, 03 May 2014 09:34:00 +0200
changeset 181840 e50544d1d32d
parent 181839 cc42442f4728
child 181841 7ccef1339127
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));