create a shadow dom when a custom element is mounted

This commit is contained in:
Evan Almloff committed 2023-04-12 10:05:09 -05:00
1 parent e7fb03f900
commit 788c00274e
5 files changed
+295 -97

No files matched your search

+3 -3
View File
@@ -60,7 +60,7 @@ impl<'a, V: FromAnyValue> NodeView<'a, V> {
NodeType::Element(ElementNode { attributes, .. }) => Some(
attributes
.iter()
.filter(move |(attr, _)| self.mask.attritutes.contains_attribute(&attr.name))
.filter(move |(attr, _)| self.mask.attritutes.contains(&attr.name))
.map(|(attr, val)| OwnedAttributeView {
attribute: attr,
value: val,
@@ -107,8 +107,8 @@ pub enum AttributeMask {
}
impl AttributeMask {
/// Check if the given attribute is visible
fn contains_attribute(&self, attr: &str) -> bool {
/// Check if the mask contains the given attribute
pub fn contains(&self, attr: &str) -> bool {
match self {
AttributeMask::All => true,
AttributeMask::Some(attrs) => attrs.contains(attr),