From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/html/HTMLImageElement.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'dom/html/HTMLImageElement.cpp') diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp index 1aa23cdea8..691216d152 100644 --- a/dom/html/HTMLImageElement.cpp +++ b/dom/html/HTMLImageElement.cpp @@ -10,19 +10,17 @@ #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/HTMLImageElementBinding.h" #include "mozilla/dom/NameSpaceConstants.h" +#include "mozilla/dom/UnbindContext.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" -#include "nsStyleConsts.h" #include "nsPresContext.h" #include "nsSize.h" #include "mozilla/dom/Document.h" #include "nsImageFrame.h" -#include "nsIScriptContext.h" #include "nsContentUtils.h" #include "nsContainerFrame.h" #include "nsNodeInfoManager.h" #include "mozilla/MouseEvents.h" -#include "nsContentPolicyUtils.h" #include "nsFocusManager.h" #include "mozilla/dom/DOMIntersectionObserver.h" #include "mozilla/dom/HTMLFormElement.h" @@ -30,7 +28,6 @@ #include "mozilla/dom/UserActivation.h" #include "nsAttrValueOrString.h" #include "imgLoader.h" -#include "Image.h" // Responsive images! #include "mozilla/dom/HTMLSourceElement.h" @@ -223,6 +220,10 @@ bool HTMLImageElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, if (aAttribute == nsGkAtoms::loading) { return ParseLoadingAttribute(aValue, aResult); } + if (aAttribute == nsGkAtoms::fetchpriority) { + ParseFetchPriority(aValue, aResult); + return true; + } if (ParseImageAttribute(aAttribute, aValue, aResult)) { return true; } @@ -564,9 +565,9 @@ nsresult HTMLImageElement::BindToTree(BindContext& aContext, nsINode& aParent) { return rv; } -void HTMLImageElement::UnbindFromTree(bool aNullParent) { +void HTMLImageElement::UnbindFromTree(UnbindContext& aContext) { if (mForm) { - if (aNullParent || !FindAncestorForm(mForm)) { + if (aContext.IsUnbindRoot(this) || !FindAncestorForm(mForm)) { ClearForm(true); } else { UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT); @@ -578,8 +579,8 @@ void HTMLImageElement::UnbindFromTree(bool aNullParent) { mInDocResponsiveContent = false; } - nsImageLoadingContent::UnbindFromTree(aNullParent); - nsGenericHTMLElement::UnbindFromTree(aNullParent); + nsImageLoadingContent::UnbindFromTree(); + nsGenericHTMLElement::UnbindFromTree(aContext); } void HTMLImageElement::UpdateFormOwner() { @@ -1377,4 +1378,8 @@ void HTMLImageElement::QueueImageLoadTask(bool aAlwaysLoad) { CycleCollectedJSContext::Get()->DispatchToMicroTask(task.forget()); } +FetchPriority HTMLImageElement::GetFetchPriorityForImage() const { + return nsGenericHTMLElement::GetFetchPriority(); +} + } // namespace mozilla::dom -- cgit v1.2.3