From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- layout/generic/nsImageFrame.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'layout/generic/nsImageFrame.cpp') diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index e0a6243ed2..c1e69df6c9 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -18,6 +18,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/Encoding.h" #include "mozilla/HTMLEditor.h" +#include "mozilla/dom/FetchPriority.h" #include "mozilla/dom/ImageTracker.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/Helpers.h" @@ -268,7 +269,7 @@ BrokenImageIcon::BrokenImageIcon(const nsImageFrame& aFrame) { loadFlags, nullptr, contentPolicyType, u""_ns, false, /* aUseUrgentStartForChannel */ false, /* aLinkPreload */ - 0, getter_AddRefs(mImage)); + 0, FetchPriority::Auto, getter_AddRefs(mImage)); Unused << NS_WARN_IF(NS_FAILED(rv)); } @@ -554,15 +555,16 @@ void nsImageFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) { // // TODO(emilio): We might want to do the same for regular list-style-image or // even simple content: url() changes. - if (mKind == Kind::XULImage) { - if (!mContent->AsElement()->HasNonEmptyAttr(nsGkAtoms::src) && aOldStyle && + if (mKind == Kind::XULImage && aOldStyle) { + if (!mContent->AsElement()->HasNonEmptyAttr(nsGkAtoms::src) && aOldStyle->StyleList()->mListStyleImage != StyleList()->mListStyleImage) { UpdateXULImage(); } - if (!mOwnedRequest && aOldStyle && - aOldStyle->StyleDisplay()->EffectiveAppearance() != - StyleDisplay()->EffectiveAppearance()) { + // If we have no image our intrinsic size might be themed. We need to + // update the size even if the effective appearance hasn't changed to + // deal correctly with theme changes. + if (!mOwnedRequest) { UpdateIntrinsicSize(); } } -- cgit v1.2.3