mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
structural changes to support Iframes
This commit is contained in:
parent
eaa20edcd7
commit
e9888b299c
30 changed files with 1416 additions and 835 deletions
|
@ -8,7 +8,6 @@ use dom::document::Document;
|
|||
use dom::element::{Element, HTMLHtmlElement, HTMLHtmlElementTypeId};
|
||||
use dom::node::Node;
|
||||
use dom::window::Window;
|
||||
use script_task::global_script_context;
|
||||
|
||||
pub struct DOMParser {
|
||||
owner: @mut Window, //XXXjdm Document instead?
|
||||
|
@ -22,7 +21,8 @@ impl DOMParser {
|
|||
wrapper: WrapperCache::new()
|
||||
};
|
||||
|
||||
let cx = global_script_context().js_compartment.cx.ptr;
|
||||
// TODO(tkuehn): This just handles the top-level page. Need to handle subframes.
|
||||
let cx = unsafe {(*owner.page).js_info.get_ref().js_compartment.cx.ptr};
|
||||
let cache = owner.get_wrappercache();
|
||||
let scope = cache.get_wrapper();
|
||||
parser.wrap_object_shared(cx, scope);
|
||||
|
@ -43,7 +43,7 @@ impl DOMParser {
|
|||
parent: Element::new(HTMLHtmlElementTypeId, ~"html")
|
||||
};
|
||||
|
||||
let root = Node::as_abstract_node(root);
|
||||
let root = Node::as_abstract_node((*self.owner.page).js_info.get_ref().js_compartment.cx.ptr, root);
|
||||
Document(root, None)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue