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/base/nsImageLoadingContent.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'dom/base/nsImageLoadingContent.cpp') diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index c1320a3472..fa1798ce35 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -47,6 +47,7 @@ #include "mozilla/dom/BindContext.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" +#include "mozilla/dom/FetchPriority.h" #include "mozilla/dom/PContent.h" // For TextRecognitionResult #include "mozilla/dom/HTMLImageElement.h" #include "mozilla/dom/ImageTextBinding.h" @@ -1143,7 +1144,8 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce, nsresult rv = nsContentUtils::LoadImage( aNewURI, element, aDocument, triggeringPrincipal, 0, referrerInfo, this, loadFlags, element->LocalName(), getter_AddRefs(req), policyType, - mUseUrgentStartForChannel); + mUseUrgentStartForChannel, /* aLinkPreload */ false, + /* aEarlyHintPreloaderId */ 0, GetFetchPriorityForImage()); // Reset the flag to avoid loading from XPCOM or somewhere again else without // initiated by user interaction. @@ -1639,10 +1641,12 @@ void nsImageLoadingContent::BindToTree(BindContext& aContext, } } -void nsImageLoadingContent::UnbindFromTree(bool aNullParent) { +void nsImageLoadingContent::UnbindFromTree() { // We may be leaving the document, so if our image is tracked, untrack it. nsCOMPtr doc = GetOurCurrentDoc(); - if (!doc) return; + if (!doc) { + return; + } UntrackImage(mCurrentRequest); UntrackImage(mPendingRequest); @@ -1860,3 +1864,7 @@ nsLoadFlags nsImageLoadingContent::LoadFlags() { } return nsIRequest::LOAD_NORMAL; } + +FetchPriority nsImageLoadingContent::GetFetchPriorityForImage() const { + return FetchPriority::Auto; +} -- cgit v1.2.3