|
@@ -49,6 +49,10 @@ impl<'a> NodeView<'a> {
|
|
.flatten()
|
|
.flatten()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ pub fn listeners(&self) -> &'a [Listener<'a>] {
|
|
|
|
+ self.el().map(|el| el.listeners).unwrap_or_default()
|
|
|
|
+ }
|
|
|
|
+
|
|
fn el(&self) -> Option<&'a VElement<'a>> {
|
|
fn el(&self) -> Option<&'a VElement<'a>> {
|
|
if let VNode::Element(el) = &self.inner {
|
|
if let VNode::Element(el) = &self.inner {
|
|
Some(el)
|
|
Some(el)
|
|
@@ -178,6 +182,7 @@ pub struct NodeMask {
|
|
tag: bool,
|
|
tag: bool,
|
|
namespace: bool,
|
|
namespace: bool,
|
|
text: bool,
|
|
text: bool,
|
|
|
|
+ listeners: bool,
|
|
}
|
|
}
|
|
|
|
|
|
impl NodeMask {
|
|
impl NodeMask {
|
|
@@ -191,6 +196,7 @@ impl NodeMask {
|
|
|| (self.namespace && other.namespace)
|
|
|| (self.namespace && other.namespace)
|
|
|| self.attritutes.overlaps(&other.attritutes)
|
|
|| self.attritutes.overlaps(&other.attritutes)
|
|
|| (self.text && other.text)
|
|
|| (self.text && other.text)
|
|
|
|
+ || (self.listeners && other.listeners)
|
|
}
|
|
}
|
|
|
|
|
|
pub fn union(&self, other: &Self) -> Self {
|
|
pub fn union(&self, other: &Self) -> Self {
|
|
@@ -199,6 +205,7 @@ impl NodeMask {
|
|
tag: self.tag | other.tag,
|
|
tag: self.tag | other.tag,
|
|
namespace: self.namespace | other.namespace,
|
|
namespace: self.namespace | other.namespace,
|
|
text: self.text | other.text,
|
|
text: self.text | other.text,
|
|
|
|
+ listeners: self.listeners | other.listeners,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -208,6 +215,7 @@ impl NodeMask {
|
|
tag: false,
|
|
tag: false,
|
|
namespace: false,
|
|
namespace: false,
|
|
text: false,
|
|
text: false,
|
|
|
|
+ listeners: false,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -233,4 +241,9 @@ impl NodeMask {
|
|
self.text = true;
|
|
self.text = true;
|
|
self
|
|
self
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ pub const fn with_listeners(mut self) -> Self {
|
|
|
|
+ self.listeners = true;
|
|
|
|
+ self
|
|
|
|
+ }
|
|
}
|
|
}
|