mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Provide AbstractDocument::from_node(node: AbstractNode)
TSIA.
This commit is contained in:
parent
799e0ace78
commit
b19e31942e
1 changed files with 9 additions and 0 deletions
|
@ -75,6 +75,15 @@ impl AbstractDocument {
|
|||
document: ptr as *mut Box<Document>
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_node(node: AbstractNode) -> AbstractDocument {
|
||||
if !node.is_document() {
|
||||
fail!("node is not a document");
|
||||
}
|
||||
unsafe {
|
||||
cast::transmute(node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue