mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Remove helpers that correspond to DOM methods
This commit is contained in:
parent
b43a2ed807
commit
06436e9c79
8 changed files with 227 additions and 331 deletions
|
@ -1215,11 +1215,13 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
|||
let context_document = document_from_node(self).root();
|
||||
let context_node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
// Step 1.
|
||||
let context_parent = match context_node.parent_node() {
|
||||
// Step 2.
|
||||
None => return Ok(()),
|
||||
Some(parent) => parent.root()
|
||||
};
|
||||
let context_parent = match context_node.GetParentNode() {
|
||||
None => {
|
||||
// Step 2.
|
||||
return Ok(());
|
||||
},
|
||||
Some(parent) => parent,
|
||||
}.root();
|
||||
|
||||
let parent = match context_parent.r().type_id() {
|
||||
// Step 3.
|
||||
|
@ -1230,11 +1232,10 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
|||
let body_elem = Element::create(QualName::new(ns!(HTML), atom!(body)),
|
||||
None, context_document.r(),
|
||||
ElementCreator::ScriptCreated);
|
||||
let body_node: Temporary<Node> = NodeCast::from_temporary(body_elem);
|
||||
body_node.root()
|
||||
NodeCast::from_temporary(body_elem)
|
||||
},
|
||||
_ => context_node.parent_node().unwrap().root()
|
||||
};
|
||||
_ => context_node.GetParentNode().unwrap()
|
||||
}.root();
|
||||
|
||||
// Step 5.
|
||||
let frag = try!(parent.r().parse_fragment(value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue