Supprot css class selection

This commit is contained in:
ILyoan 2013-05-30 11:20:52 +09:00
parent 0ae2081e63
commit 97b5f5cdd6

View file

@ -86,6 +86,16 @@ impl SelectHandler<AbstractNode<LayoutView>> for NodeSelectHandler {
}
}
fn with_node_classes<R>(&self, node: &AbstractNode<LayoutView>, f: &fn(Option<&str>) -> R) -> R {
if !node.is_element() {
fail!(~"attempting to style non-element node");
}
do node.with_imm_element() |element_n| {
f(element_n.get_attr("class"))
}
}
fn with_node_id<R>(&self, node: &AbstractNode<LayoutView>, f: &fn(Option<&str>) -> R) -> R {
if !node.is_element() {
fail!(~"attempting to style non-element node");