mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Supprot css class selection
This commit is contained in:
parent
0ae2081e63
commit
97b5f5cdd6
1 changed files with 10 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue