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
This commit is contained in:
Emilio Cobos Álvarez 2018-05-16 20:02:21 +02:00
parent f09824aad6
commit 6332002ac0

View File

@ -263,6 +263,9 @@ nsImageFrame::Init(nsIContent* aContent,
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?");
@ -270,11 +273,6 @@ nsImageFrame::Init(nsIContent* aContent,
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);