summaryrefslogtreecommitdiffstats
path: root/dom/html/HTMLImageElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/html/HTMLImageElement.cpp')
-rw-r--r--dom/html/HTMLImageElement.cpp21
1 files changed, 13 insertions, 8 deletions
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