Bug 1462272: Remove a weirdly named variable, and call LoadIcons sooner. r?dholbert draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 16 May 2018 20:02:21 +0200
changeset 796729 81868c3cee21a54522fdbac79c857390402a87b2
parent 796237 b90be48dcc97066e106fa1777c3d3acc1e46cd1d
child 796730 533ae646146375ca6f74ccdba9a93e8c68e82247
push id110351
push userbmo:emilio@crisal.io
push dateFri, 18 May 2018 07:45:13 +0000
reviewersdholbert
bugs1462272
milestone62.0a1
Bug 1462272: Remove a weirdly named variable, and call LoadIcons sooner. r?dholbert So that the imageLoader code is all grouped together. LoadIcons should probably be a static, and the change shouldn't have any observable behavior. MozReview-Commit-ID: Anxe8c5OfLe
layout/generic/nsImageFrame.cpp
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -258,28 +258,26 @@ void
 nsImageFrame::Init(nsIContent*       aContent,
                    nsContainerFrame* aParent,
                    nsIFrame*         aPrevInFlow)
 {
   nsAtomicContainerFrame::Init(aContent, aParent, aPrevInFlow);
 
   mListener = new nsImageListener(this);
 
+  if (!gIconLoad)
+    LoadIcons(PresContext());
+
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(aContent);
   if (!imageLoader) {
     MOZ_CRASH("Why do we have an nsImageFrame here at all?");
   }
 
   imageLoader->AddNativeObserver(mListener);
 
-  nsPresContext *aPresContext = PresContext();
-
-  if (!gIconLoad)
-    LoadIcons(aPresContext);
-
   // We have a PresContext now, so we need to notify the image content node
   // that it can register images.
   imageLoader->FrameCreated(this);
 
   // Give image loads associated with an image frame a small priority boost!
   nsCOMPtr<imgIRequest> currentRequest;
   imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
                           getter_AddRefs(currentRequest));