From 03620dec40b80ebdbab2a0e55b6bbfeeb0a2fd78 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 5 May 2026 15:08:19 +0100 Subject: [PATCH] Introduce MathMLAnchorElement interface --- spec.html | 32 +++++++++++++++++++++++++++++++- webidl/MathMLAnchorElement.idl | 6 ++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 webidl/MathMLAnchorElement.idl diff --git a/spec.html b/spec.html index 02ec63b..5b560de 100644 --- a/spec.html +++ b/spec.html @@ -687,7 +687,7 @@

DOM and JavaScript

All the nodes representing MathML elements in the DOM must implement, and expose to scripts, the following - MathMLElement interface. + MathMLElement interface, unless otherwise specified.


           

The {{GlobalEventHandlers}} and @@ -4691,6 +4691,36 @@

Linking <a>

Note that this means that in the absence of an href attribute, <a> may be seen as equivalent to <mrow>.
+ +

+ The <a> element + must implement, and expose to scripts, the following + MathMLAnchorElement interface. +

+

+
+        
+

The href getter steps are:

+
    +
  1. Reinitialize url.
  2. +
  3. Let url be this's url.
  4. +
  5. If url is null and this has no [^a/href^] content attribute, then return the empty string.
  6. +
  7. Otherwise, if url is null, then return this's [^a/href^] content attribute's value.
  8. +
  9. Return url, serialized.
  10. +
+
+ +
+

The set the url algorithm for a MathMLAnchorElement are:

+
    +
  1. If this element's [^a/href^] content attribute is absent, then return.
  2. +
  3. Let url be the result of encoding-parsing a URL given this element's [^a/href^] content attribute's value, relative to this element's node document.
  4. +
  5. If url is not failure, then set this's url to url.
  6. +
+
+ +

To update href for a MathMLAnchorElement, set the element's [^a/href^] content attribute's + value to the element's url, serialized.

Enlivening Expressions

diff --git a/webidl/MathMLAnchorElement.idl b/webidl/MathMLAnchorElement.idl new file mode 100644 index 0000000..d826beb --- /dev/null +++ b/webidl/MathMLAnchorElement.idl @@ -0,0 +1,6 @@ +[Exposed=Window] +interface MathMLAnchorElement : MathMLElement { + [ReflectSetter] attribute USVString href; + [Reflect] attribute DOMString target; +}; +MathMLAnchorElement includes HyperlinkElementUtils;