Bug 999162 - Don't set the first-paint flag on a location change on the same document. r=drs
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 24 Apr 2014 11:40:00 +0200
changeset 180469 60c2852b75eebd93838d787eff5cc44c7cecde1a
parent 180468 4d713f81644d35c8ca107f64226a9ca25232c614
child 180470 05519890c1cc85202cdd998e42aba8abee5b58cb
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersdrs
bugs999162
milestone31.0a1
Bug 999162 - Don't set the first-paint flag on a location change on the same document. r=drs
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -742,16 +742,17 @@ TabChild::Observe(nsISupports *aSubject,
     }
   } else if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
     if (IsAsyncPanZoomEnabled()) {
       nsCOMPtr<nsIDocument> subject(do_QueryInterface(aSubject));
       nsCOMPtr<nsIDocument> doc(GetDocument());
 
       if (SameCOMIdentity(subject, doc)) {
         nsCOMPtr<nsIDOMWindowUtils> utils(GetDOMWindowUtils());
+        utils->SetIsFirstPaint(true);
 
         mContentDocumentIsDisplayed = true;
 
         // Reset CSS viewport and zoom to default on new page, then
         // calculate them properly using the actual metadata from the
         // page.
         SetCSSViewport(kDefaultViewportSize);
 
@@ -805,19 +806,16 @@ TabChild::OnLocationChange(nsIWebProgres
   }
 
   nsCOMPtr<nsIDOMWindow> window;
   aWebProgress->GetDOMWindow(getter_AddRefs(window));
   if (!window) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIDOMWindowUtils> utils(do_GetInterface(window));
-  utils->SetIsFirstPaint(true);
-
   nsCOMPtr<nsIDOMDocument> progressDoc;
   window->GetDocument(getter_AddRefs(progressDoc));
   if (!progressDoc) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDOMDocument> domDoc;
   WebNavigation()->GetDocument(getter_AddRefs(domDoc));