Bug 1462272: Remove a weirdly named variable, and call LoadIcons sooner. r=dholbert
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 16 May 2018 20:02:21 +0200
changeset 419861 24f85fad27a433ff6322216a2464a4737d1effa4
parent 419860 2d94b092d7e0dd61f7d0e1cf8ff4f8c7dd2e3053
child 419862 072d64b67a99f0ceafb79d821c52f57cb4160768
push id34052
push userccoroiu@mozilla.com
push dateFri, 25 May 2018 17:52:14 +0000
treeherdermozilla-central@94d7f0e1c4d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1462272
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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));