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/HTMLLinkElement.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'dom/html/HTMLLinkElement.cpp') diff --git a/dom/html/HTMLLinkElement.cpp b/dom/html/HTMLLinkElement.cpp index 53c2d86d8d..cb316a6f7b 100644 --- a/dom/html/HTMLLinkElement.cpp +++ b/dom/html/HTMLLinkElement.cpp @@ -110,7 +110,7 @@ void HTMLLinkElement::LinkAdded() { CreateAndDispatchEvent(u"DOMLinkAdded"_ns); } -void HTMLLinkElement::UnbindFromTree(bool aNullParent) { +void HTMLLinkElement::UnbindFromTree(UnbindContext& aContext) { CancelDNSPrefetch(*this); CancelPrefetchOrPreload(); @@ -130,7 +130,7 @@ void HTMLLinkElement::UnbindFromTree(bool aNullParent) { } } - nsGenericHTMLElement::UnbindFromTree(aNullParent); + nsGenericHTMLElement::UnbindFromTree(aContext); Unused << UpdateStyleSheetInternal(oldDoc, oldShadowRoot); } @@ -164,6 +164,12 @@ bool HTMLLinkElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, ParseFetchPriority(aValue, aResult); return true; } + + if (aAttribute == nsGkAtoms::blocking && + StaticPrefs::dom_element_blocking_enabled()) { + aResult.ParseAtomArray(aValue); + return true; + } } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, @@ -703,4 +709,14 @@ nsDOMTokenList* HTMLLinkElement::Blocking() { return mBlocking; } +bool HTMLLinkElement::IsPotentiallyRenderBlocking() { + return BlockingContainsRender(); + + // TODO: handle implicitly potentially render blocking + // https://html.spec.whatwg.org/#implicitly-potentially-render-blocking + // The default type for resources given by the stylesheet keyword is text/css. + // A link element of this type is implicitly potentially render-blocking if + // the element was created by its node document's parser. +} + } // namespace mozilla::dom -- cgit v1.2.3