Implement Window::get_cx() to reduce code repetition.

This commit is contained in:
Ms2ger 2013-10-13 12:06:32 +02:00
parent fc9fdf30a6
commit da2cf6cbd7
8 changed files with 19 additions and 19 deletions

View file

@ -22,7 +22,7 @@ impl Text {
}
pub fn Constructor(owner: @mut Window, text: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
let cx = owner.get_cx();
let text = @Text::new(null_str_as_empty(text), owner.Document());
Ok(unsafe { Node::as_abstract_node(cx, text) })
}