From f8071d9a611156bec242bfdff368595a4b322dcc Mon Sep 17 00:00:00 2001 From: Ameyanagi Date: Thu, 18 Jan 2024 01:54:23 -0500 Subject: [PATCH 1/3] add MathML core elements --- packages/html/src/elements.rs | 192 ++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) diff --git a/packages/html/src/elements.rs b/packages/html/src/elements.rs index 37e6bb682..4121fe154 100644 --- a/packages/html/src/elements.rs +++ b/packages/html/src/elements.rs @@ -1744,4 +1744,196 @@ builder_constructors! { r#use ["use", "http://www.w3.org/2000/svg"] { href: String DEFAULT, }; + + // MathML elements + + /// Build a + /// [``](https://w3c.github.io/mathml-core/#dfn-annotation) + /// element. + annotation "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://w3c.github.io/mathml-core/#dfn-annotation-xml) + /// element. + annotation_xml ["annotation-xml", "http://www.w3.org/1998/Math/MathML"] {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/merror) + /// element. + merror "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math) + /// element. + math "http://www.w3.org/1998/Math/MathML" { + // rust name of the attribute | unit (this is currently ignored, you can use String as a default) | the HTML attribute name (this can be DEFAULT for a stringified name or a custom string like "display2") + display: String DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfrac) + /// element. + mfrac "http://www.w3.org/1998/Math/MathML" { + linethickness: usize DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi) + /// element. + mi "http://www.w3.org/1998/Math/MathML" { + mathvariant: String DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mmultiscripts) + /// element. + mmultiscripts "http://www.w3.org/1998/math/mathml" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mn) + /// element. + mn "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo) + /// element. + mo "http://www.w3.org/1998/Math/MathML" { + fence: Bool DEFAULT, + largeop: Bool DEFAULT, + lspace: usize DEFAULT, + maxsize: usize DEFAULT, + minsize: usize DEFAULT, + movablelimits: Bool DEFAULT, + rspace: usize DEFAULT, + separator: Bool DEFAULT, + stretchy: Bool DEFAULT, + symmetric: Bool DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mover) + /// element. + mover "http://www.w3.org/1998/Math/MathML" { + accent: Bool DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mpadded) + /// element. + mpadded "http://www.w3.org/1998/Math/MathML" { + depth: usize DEFAULT, + height: usize DEFAULT, + lspace: usize DEFAULT, + voffset: usize DEFAULT, + width: usize DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mphantom) + /// element. + mphantom "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mprescripts) + /// element. + mprescripts "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mroot) + /// element. + mroot "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mrow) + /// element. + mrow "http://www.w3.org/1998/Math/MathML" { + + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/ms) + /// element. + ms "http://www.w3.org/1998/Math/MathML" { + lquote: String DEFAULT, + rquote: String DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mspace) + /// element. + mspace "http://www.w3.org/1998/Math/MathML" { + depth: usize DEFAULT, + height: usize DEFAULT, + width: usize DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msqrt) + /// element. + msqrt "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle) + /// element. + mstyle "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msub) + /// element. + msub "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msubsup) + /// element. + msubsup "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msup) + /// element. + msup "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable) + /// element. + mtable "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtd) + /// element. + mtd "http://www.w3.org/1998/Math/MathML" { + columnspan: usize DEFAULT, + rowspan: usize DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtext) + /// element. + mtext "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtr) + /// element. + mtr "http://www.w3.org/1998/Math/MathML" {}; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munder) + /// element. + munder "http://www.w3.org/1998/Math/MathML" { + accentunder: Bool DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munderover) + /// element. + munderover "http://www.w3.org/1998/Math/MathML" { + accent: Bool DEFAULT, + accentunder: Bool DEFAULT, + }; + + /// Build a + /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics) + /// element. + symantics "http://www.w3.org/1998/Math/MathML" { + encoding: String DEFAULT, + }; } From 27254eecc69ca4b8e64d0401216ccaac406fef7d Mon Sep 17 00:00:00 2001 From: Ameyanagi <77273474+Ameyanagi@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:13:55 -0500 Subject: [PATCH 2/3] added annotation-xml --- packages/html/src/elements.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/html/src/elements.rs b/packages/html/src/elements.rs index 4121fe154..2e54d452f 100644 --- a/packages/html/src/elements.rs +++ b/packages/html/src/elements.rs @@ -1750,12 +1750,16 @@ builder_constructors! { /// Build a /// [``](https://w3c.github.io/mathml-core/#dfn-annotation) /// element. - annotation "http://www.w3.org/1998/Math/MathML" {}; + annotation "http://www.w3.org/1998/Math/MathML" { + encoding: String DEFAULT, + }; /// Build a /// [``](https://w3c.github.io/mathml-core/#dfn-annotation-xml) /// element. - annotation_xml ["annotation-xml", "http://www.w3.org/1998/Math/MathML"] {}; + annotationXml ["annotation-xml", "http://www.w3.org/1998/Math/MathML"] { + encoding: String DEFAULT, + }; /// Build a /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/merror) @@ -1933,7 +1937,7 @@ builder_constructors! { /// Build a /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics) /// element. - symantics "http://www.w3.org/1998/Math/MathML" { + semantics "http://www.w3.org/1998/Math/MathML" { encoding: String DEFAULT, }; } From a3f6d21beaba5536d57a537f9784eab56806f6c5 Mon Sep 17 00:00:00 2001 From: Ameyanagi <77273474+Ameyanagi@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:54:57 -0500 Subject: [PATCH 3/3] deleted unused comment --- packages/html/src/elements.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/html/src/elements.rs b/packages/html/src/elements.rs index 2e54d452f..c5e5e3ab5 100644 --- a/packages/html/src/elements.rs +++ b/packages/html/src/elements.rs @@ -1770,7 +1770,6 @@ builder_constructors! { /// [``](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math) /// element. math "http://www.w3.org/1998/Math/MathML" { - // rust name of the attribute | unit (this is currently ignored, you can use String as a default) | the HTML attribute name (this can be DEFAULT for a stringified name or a custom string like "display2") display: String DEFAULT, };