mirror of
https://github.com/servo/servo.git
synced 2025-07-31 19:20:22 +01:00
get rid of and_then in outerHTML setter
This commit is contained in:
parent
3542360d00
commit
d83f4d8a6e
1 changed files with 4 additions and 7 deletions
|
@ -1217,13 +1217,10 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
||||||
// 5. Let fragment be the result of invoking the fragment parsing algorithm with
|
// 5. Let fragment be the result of invoking the fragment parsing algorithm with
|
||||||
// the new value as markup, and parent as the context element.
|
// the new value as markup, and parent as the context element.
|
||||||
// 6. Replace the context object with fragment within the context object's parent.
|
// 6. Replace the context object with fragment within the context object's parent.
|
||||||
parent.r().parse_fragment(value)
|
let frag = try!(parent.r().parse_fragment(value));
|
||||||
.and_then(|frag| {
|
try!(context_parent.r().ReplaceChild(NodeCast::from_ref(frag.root().r()),
|
||||||
let frag = frag.root();
|
context_node));
|
||||||
let frag_node: JSRef<Node> = NodeCast::from_ref(frag.r());
|
Ok(())
|
||||||
try!(context_parent.r().ReplaceChild(frag_node, context_node));
|
|
||||||
Ok(())
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-parentnode-children
|
// http://dom.spec.whatwg.org/#dom-parentnode-children
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue