|
@@ -74,7 +74,7 @@ macro_rules! impl_attribute_match {
|
|
$attr:ident $fil:ident: $vil:ident (in $ns:literal),
|
|
$attr:ident $fil:ident: $vil:ident (in $ns:literal),
|
|
) => {
|
|
) => {
|
|
if $attr == stringify!($fil) {
|
|
if $attr == stringify!($fil) {
|
|
- return Some((stringify!(fil), Some(ns)));
|
|
|
|
|
|
+ return Some((stringify!(fil), Some($ns)));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -180,14 +180,26 @@ macro_rules! impl_element_match {
|
|
};
|
|
};
|
|
|
|
|
|
(
|
|
(
|
|
- $el:ident $name:ident $namespace:tt {
|
|
|
|
|
|
+ $el:ident $name:ident $namespace:literal {
|
|
$(
|
|
$(
|
|
$fil:ident: $vil:ident $extra:tt,
|
|
$fil:ident: $vil:ident $extra:tt,
|
|
)*
|
|
)*
|
|
}
|
|
}
|
|
) => {
|
|
) => {
|
|
if $el == stringify!($name) {
|
|
if $el == stringify!($name) {
|
|
- return Some((stringify!($name), Some(stringify!($namespace))));
|
|
|
|
|
|
+ return dbg!(Some((stringify!($name), Some($namespace))));
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ (
|
|
|
|
+ $el:ident $name:ident [$_:literal, $namespace:tt] {
|
|
|
|
+ $(
|
|
|
|
+ $fil:ident: $vil:ident $extra:tt,
|
|
|
|
+ )*
|
|
|
|
+ }
|
|
|
|
+ ) => {
|
|
|
|
+ if $el == stringify!($name) {
|
|
|
|
+ return dbg!(Some((stringify!($name), Some($namespace))));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -207,6 +219,8 @@ macro_rules! impl_element_match_attributes {
|
|
$attr $fil: $vil ($extra),
|
|
$attr $fil: $vil ($extra),
|
|
);
|
|
);
|
|
)*
|
|
)*
|
|
|
|
+
|
|
|
|
+ return impl_map_global_attributes!($el $attr $name None);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -223,10 +237,41 @@ macro_rules! impl_element_match_attributes {
|
|
$attr $fil: $vil ($extra),
|
|
$attr $fil: $vil ($extra),
|
|
);
|
|
);
|
|
)*
|
|
)*
|
|
|
|
+
|
|
|
|
+ return impl_map_global_attributes!($el $attr $name $namespace);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#[cfg(feature = "hot-reload-context")]
|
|
|
|
+macro_rules! impl_map_global_attributes {
|
|
|
|
+ (
|
|
|
|
+ $el:ident $attr:ident $element:ident None
|
|
|
|
+ ) => {
|
|
|
|
+ map_global_attributes($attr)
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ (
|
|
|
|
+ $el:ident $attr:ident $element:ident $namespace:literal
|
|
|
|
+ ) => {
|
|
|
|
+ if $namespace == "http://www.w3.org/2000/svg" {
|
|
|
|
+ map_svg_attributes($attr)
|
|
|
|
+ } else {
|
|
|
|
+ map_global_attributes($attr)
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ (
|
|
|
|
+ $el:ident $attr:ident $element:ident [$name:literal, $namespace:tt]
|
|
|
|
+ ) => {
|
|
|
|
+ if $namespace == "http://www.w3.org/2000/svg" {
|
|
|
|
+ map_svg_attributes($attr)
|
|
|
|
+ } else {
|
|
|
|
+ map_global_attributes($attr)
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+}
|
|
|
|
+
|
|
macro_rules! builder_constructors {
|
|
macro_rules! builder_constructors {
|
|
(
|
|
(
|
|
$(
|
|
$(
|
|
@@ -254,7 +299,7 @@ macro_rules! builder_constructors {
|
|
}
|
|
}
|
|
);
|
|
);
|
|
)*
|
|
)*
|
|
- map_global_attributes(attribute).or_else(|| map_svg_attributes(attribute))
|
|
|
|
|
|
+ None
|
|
}
|
|
}
|
|
|
|
|
|
fn map_element(element: &str) -> Option<(&'static str, Option<&'static str>)> {
|
|
fn map_element(element: &str) -> Option<(&'static str, Option<&'static str>)> {
|