feat: arbitrary attributes

This commit is contained in:
Jonathan Kelley committed 2022-05-05 16:50:33 -04:00
1 parent f2c48c5d90
commit 356f37e9ee
7 files changed
+298 -9

No files matched your search

+4 -3
View File
@@ -167,8 +167,9 @@ pub enum DomEdit<'bump> {
field: &'static str,
/// The value of the attribute.
value: &'bump str,
value: AttributeValue<'bump>,
// value: &'bump str,
/// The (optional) namespace of the attribute.
/// For instance, "style" is in the "style" namespace.
ns: Option<&'bump str>,
@@ -286,7 +287,7 @@ impl<'a> Mutations<'a> {
self.edits.push(SetText { text, root });
}
pub(crate) fn set_attribute(&mut self, attribute: &'a Attribute, root: u64) {
pub(crate) fn set_attribute(&mut self, attribute: &'a Attribute<'a>, root: u64) {
let Attribute {
name,
value,
@@ -296,7 +297,7 @@ impl<'a> Mutations<'a> {
self.edits.push(SetAttribute {
field: name,
value,
value: value.clone(),
ns: *namespace,
root,
});