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/Element.h | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'dom/base/Element.h') diff --git a/dom/base/Element.h b/dom/base/Element.h index 6c717bfc88..40a8052aef 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -90,7 +90,6 @@ class nsIDOMXULSelectControlElement; class nsIDOMXULSelectControlItemElement; class nsIFrame; class nsIHTMLCollection; -class nsIMozBrowserFrame; class nsIPrincipal; class nsIScreen; class nsIScrollableFrame; @@ -244,6 +243,15 @@ class Grid; SetOrRemoveNullableStringAttr(nsGkAtoms::attr, aValue, aRv); \ } +#define REFLECT_NULLABLE_ELEMENT_ATTR(method, attr) \ + Element* Get##method() const { \ + return GetAttrAssociatedElement(nsGkAtoms::attr); \ + } \ + \ + void Set##method(Element* aElement) { \ + ExplicitlySetAttrElement(nsGkAtoms::attr, aElement); \ + } + class Element : public FragmentOrElement { public: #ifdef MOZILLA_INTERNAL_API @@ -458,23 +466,14 @@ class Element : public FragmentOrElement { */ virtual bool IsInteractiveHTMLContent() const; - /** - * Returns |this| as an nsIMozBrowserFrame* if the element is a frame or - * iframe element. - * - * We have this method, rather than using QI, so that we can use it during - * the servo traversal, where we can't QI DOM nodes because of non-thread-safe - * refcounts. - */ - virtual nsIMozBrowserFrame* GetAsMozBrowserFrame() { return nullptr; } - /** * Is the attribute named aAttribute a mapped attribute? */ NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const; nsresult BindToTree(BindContext&, nsINode& aParent) override; - void UnbindFromTree(bool aNullParent = true) override; + void UnbindFromTree(UnbindContext&) override; + using nsIContent::UnbindFromTree; virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const; static void MapNoAttributesInto(mozilla::MappedDeclarationsBuilder&); @@ -658,8 +657,13 @@ class Element : public FragmentOrElement { REFLECT_NULLABLE_DOMSTRING_ATTR(Role, role) // AriaAttributes + REFLECT_NULLABLE_ELEMENT_ATTR(AriaActiveDescendantElement, + aria_activedescendant) REFLECT_NULLABLE_DOMSTRING_ATTR(AriaAtomic, aria_atomic) REFLECT_NULLABLE_DOMSTRING_ATTR(AriaAutoComplete, aria_autocomplete) + REFLECT_NULLABLE_DOMSTRING_ATTR(AriaBrailleLabel, aria_braillelabel) + REFLECT_NULLABLE_DOMSTRING_ATTR(AriaBrailleRoleDescription, + aria_brailleroledescription) REFLECT_NULLABLE_DOMSTRING_ATTR(AriaBusy, aria_busy) REFLECT_NULLABLE_DOMSTRING_ATTR(AriaChecked, aria_checked) REFLECT_NULLABLE_DOMSTRING_ATTR(AriaColCount, aria_colcount) @@ -1107,8 +1111,6 @@ class Element : public FragmentOrElement { return FindAttributeDependence(aAttribute, aMaps, N); } - static nsStaticAtom* const* HTMLSVGPropertiesToTraverseAndUnlink(); - MOZ_CAN_RUN_SCRIPT virtual void HandleInvokeInternal(nsAtom* aAction, ErrorResult& aRv) {} @@ -1245,6 +1247,16 @@ class Element : public FragmentOrElement { void ClearExplicitlySetAttrElement(nsAtom*); + /** + * Gets the attribute element for the given attribute. + * https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#explicitly-set-attr-element + * Unlike GetAttrAssociatedElement, this returns the target even if it isn't + * a descendant of any of this element's shadow-including ancestors. It also + * doesn't attempt to retrieve an element using a string id set in the content + * attribute. + */ + Element* GetExplicitlySetAttrElement(nsAtom* aAttr) const; + PseudoStyleType GetPseudoElementType() const { nsresult rv = NS_OK; auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv); @@ -1332,6 +1344,10 @@ class Element : public FragmentOrElement { void GetLoading(nsAString& aValue) const; bool ParseLoadingAttribute(const nsAString& aValue, nsAttrValue& aResult); + // https://html.spec.whatwg.org/#potentially-render-blocking + virtual bool IsPotentiallyRenderBlocking() { return false; } + bool BlockingContainsRender() const; + // Shadow DOM v1 enum class ShadowRootDeclarative : bool { No, Yes }; -- cgit v1.2.3