summaryrefslogtreecommitdiffstats
path: root/dom/html/ElementInternals.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /dom/html/ElementInternals.h
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/html/ElementInternals.h')
-rw-r--r--dom/html/ElementInternals.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/dom/html/ElementInternals.h b/dom/html/ElementInternals.h
index 7ced3b9771..4bbf5c96f3 100644
--- a/dom/html/ElementInternals.h
+++ b/dom/html/ElementInternals.h
@@ -27,6 +27,13 @@
aResult = ErrorResult(SetAttr(nsGkAtoms::attr, aValue)); \
}
+#define ARIA_REFLECT_ATTR_ELEMENT(method, attr) \
+ Element* Get##method() const { return GetAttrElement(nsGkAtoms::attr); } \
+ \
+ void Set##method(Element* aElement) { \
+ SetAttrElement(nsGkAtoms::attr, aElement); \
+ }
+
class nsINodeList;
class nsGenericHTMLElement;
@@ -119,9 +126,12 @@ class ElementInternals final : public nsIFormControl,
ARIA_REFLECT_ATTR(Role, role)
// AriaAttributes
+ ARIA_REFLECT_ATTR_ELEMENT(AriaActiveDescendantElement, aria_activedescendant)
ARIA_REFLECT_ATTR(AriaAtomic, aria_atomic)
ARIA_REFLECT_ATTR(AriaAutoComplete, aria_autocomplete)
ARIA_REFLECT_ATTR(AriaBusy, aria_busy)
+ ARIA_REFLECT_ATTR(AriaBrailleLabel, aria_braillelabel)
+ ARIA_REFLECT_ATTR(AriaBrailleRoleDescription, aria_brailleroledescription)
ARIA_REFLECT_ATTR(AriaChecked, aria_checked)
ARIA_REFLECT_ATTR(AriaColCount, aria_colcount)
ARIA_REFLECT_ATTR(AriaColIndex, aria_colindex)
@@ -172,6 +182,18 @@ class ElementInternals final : public nsIFormControl,
private:
~ElementInternals() = default;
+ /**
+ * Gets the attribute element for the given attribute.
+ * https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#explicitly-set-attr-element
+ */
+ Element* GetAttrElement(nsAtom* aAttr) const;
+
+ /**
+ * Sets an attribute element for the given attribute.
+ * https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#explicitly-set-attr-element
+ */
+ void SetAttrElement(nsAtom* aAttr, Element* aElement);
+
// It's a target element which is a custom element.
RefPtr<HTMLElement> mTarget;
@@ -211,6 +233,12 @@ class ElementInternals final : public nsIFormControl,
// owner document. This is only set to a number for elements inserted into the
// document by the parser from the network. Otherwise, it is -1.
int32_t mControlNumber;
+
+ /**
+ * Explicitly set attr-elements, see
+ * https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#explicitly-set-attr-element
+ */
+ nsTHashMap<RefPtr<nsAtom>, nsWeakPtr> mAttrElements;
};
} // namespace mozilla::dom