diff --git a/typed-html/src/elements.rs b/typed-html/src/elements.rs index 5068de3..ab3767a 100644 --- a/typed-html/src/elements.rs +++ b/typed-html/src/elements.rs @@ -129,7 +129,7 @@ declare_elements! { formmethod: FormMethod, formnovalidate: Bool, formtarget: Target, - name: Id, + name: String, type: ButtonType, value: String, } in [FlowContent, PhrasingContent, InteractiveContent, FormContent] with PhrasingContent; @@ -171,7 +171,7 @@ declare_elements! { autocomplete: OnOff, enctype: FormEncodingType, method: FormMethod, - name: Id, + name: String, novalidate: Bool, target: Target, } in [FlowContent] with FlowContent; @@ -230,7 +230,7 @@ declare_elements! { min: String, minlength: usize, multiple: Bool, - name: Id, + name: String, pattern: String, placeholder: String, readonly: Bool, @@ -288,7 +288,7 @@ declare_elements! { output { for: SpacedSet, form: Id, - name: Id, + name: String, } in [FlowContent, PhrasingContent, FormContent] with PhrasingContent; p in [FlowContent] with PhrasingContent; pre in [FlowContent] with PhrasingContent; @@ -320,7 +320,7 @@ declare_elements! { disabled: Bool, form: Id, multiple: Bool, - name: Id, + name: String, required: Bool, size: usize, } in [FlowContent, PhrasingContent, InteractiveContent, FormContent] with SelectContent; @@ -339,7 +339,7 @@ declare_elements! { form: Id, maxlength: usize, minlength: usize, - name: Id, + name: String, placeholder: String, readonly: Bool, required: Bool, @@ -512,3 +512,24 @@ fn test_twitter_cards() { frag.to_string() ); } + +#[test] +fn test_form_element_names_can_be_any_string() { + use crate as axohtml; + use crate::{dom::DOMTree, html}; + + let frag: DOMTree = html!( +
+ +