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 799747 9f462222fd130b5c9b557aa48590cce612914fe0
parent 799746 c8e825f5aeff5ef12ca99fa5b407f0fd85100556
child 799748 d12f694a034d6b7259d15f939d01bd9f3ec19623
push id111161
push userbmo:emilio@crisal.io
push dateFri, 25 May 2018 10:25:09 +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));