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/HTMLStyleElement.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'dom/html/HTMLStyleElement.cpp') diff --git a/dom/html/HTMLStyleElement.cpp b/dom/html/HTMLStyleElement.cpp index ed4c141897..e0bc228011 100644 --- a/dom/html/HTMLStyleElement.cpp +++ b/dom/html/HTMLStyleElement.cpp @@ -91,15 +91,29 @@ nsresult HTMLStyleElement::BindToTree(BindContext& aContext, nsINode& aParent) { return rv; } -void HTMLStyleElement::UnbindFromTree(bool aNullParent) { +void HTMLStyleElement::UnbindFromTree(UnbindContext& aContext) { RefPtr oldDoc = GetUncomposedDoc(); ShadowRoot* oldShadow = GetContainingShadow(); - nsGenericHTMLElement::UnbindFromTree(aNullParent); + nsGenericHTMLElement::UnbindFromTree(aContext); Unused << UpdateStyleSheetInternal(oldDoc, oldShadow); } +bool HTMLStyleElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, + const nsAString& aValue, + nsIPrincipal* aMaybeScriptedPrincipal, + nsAttrValue& aResult) { + if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::blocking && + StaticPrefs::dom_element_blocking_enabled()) { + aResult.ParseAtomArray(aValue); + return true; + } + + return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, + aMaybeScriptedPrincipal, aResult); +} + void HTMLStyleElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName, const nsAttrValue* aValue, const nsAttrValue* aOldValue, @@ -199,4 +213,13 @@ nsDOMTokenList* HTMLStyleElement::Blocking() { return mBlocking; } +bool HTMLStyleElement::IsPotentiallyRenderBlocking() { + return BlockingContainsRender(); + + // TODO: handle implicitly potentially render blocking + // https://html.spec.whatwg.org/#implicitly-potentially-render-blocking + // A style element is implicitly potentially render-blocking if the element + // was created by its node document's parser. +} + } // namespace mozilla::dom -- cgit v1.2.3