mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Implement Window::get_cx() to reduce code repetition.
This commit is contained in:
parent
fc9fdf30a6
commit
da2cf6cbd7
8 changed files with 19 additions and 19 deletions
|
@ -26,7 +26,7 @@ impl DOMParser {
|
|||
};
|
||||
|
||||
// TODO(tkuehn): This just handles the top-level page. Need to handle subframes.
|
||||
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
|
||||
let cx = owner.get_cx();
|
||||
let scope = owner.reflector().get_jsobject();
|
||||
parser.wrap_object_shared(cx, scope);
|
||||
parser
|
||||
|
@ -40,7 +40,7 @@ impl DOMParser {
|
|||
_s: &DOMString,
|
||||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<AbstractDocument> {
|
||||
let cx = (*self.owner.page).js_info.get_ref().js_compartment.cx.ptr;
|
||||
let cx = self.owner.get_cx();
|
||||
let document = match ty {
|
||||
Text_html => {
|
||||
HTMLDocument::new(None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue