Implement Metadata + HTTPEquiv types for meta elements.

This commit is contained in:
Bodil Stokke 2018-11-17 21:49:38 +00:00
parent 5a72616f97
commit 2c53d5d2ca
2 changed files with 36 additions and 2 deletions

View File

@ -53,8 +53,8 @@ declare_elements!{
meta {
charset: String, // FIXME IANA standard names
content: String,
http_equiv: String, // FIXME string enum
name: String, // FIXME string enum
http_equiv: HTTPEquiv,
name: Metadata,
} in [MetadataContent];
style {
type: Mime,

View File

@ -84,6 +84,14 @@ pub enum FormMethod {
Get,
}
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)]
pub enum HTTPEquiv {
#[strum(to_string = "content-security-policy")]
ContentSecurityPolicy,
#[strum(to_string = "refresh")]
Refresh,
}
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)]
pub enum ImageDecoding {
#[strum(to_string = "sync")]
@ -190,6 +198,32 @@ pub enum LinkType {
Tag,
}
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)]
pub enum Metadata {
#[strum(to_string = "application-name")]
ApplicationName,
#[strum(to_string = "author")]
Author,
#[strum(to_string = "description")]
Description,
#[strum(to_string = "generator")]
Generator,
#[strum(to_string = "keywords")]
Keywords,
#[strum(to_string = "referrer")]
Referrer,
#[strum(to_string = "creator")]
Creator,
#[strum(to_string = "googlebot")]
Googlebot,
#[strum(to_string = "publisher")]
Publisher,
#[strum(to_string = "robots")]
Robots,
#[strum(to_string = "viewport")]
Viewport,
}
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)]
pub enum OnOff {
#[strum(to_string = "on")]