mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Pass a &GlobalScope to WebIDL static methods and constructors
This commit is contained in:
parent
1fd470889d
commit
19108aa330
56 changed files with 198 additions and 245 deletions
|
@ -7,12 +7,12 @@ use dom::bindings::codegen::Bindings::DocumentFragmentBinding::DocumentFragmentM
|
|||
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||
use dom::bindings::codegen::UnionTypes::NodeOrString;
|
||||
use dom::bindings::error::{ErrorResult, Fallible};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::document::Document;
|
||||
use dom::element::Element;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::node::{Node, window_from_node};
|
||||
use dom::nodelist::NodeList;
|
||||
|
@ -38,8 +38,8 @@ impl DocumentFragment {
|
|||
DocumentFragmentBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: GlobalRef) -> Fallible<Root<DocumentFragment>> {
|
||||
let document = global.as_global_scope().as_window().Document();
|
||||
pub fn Constructor(global: &GlobalScope) -> Fallible<Root<DocumentFragment>> {
|
||||
let document = global.as_window().Document();
|
||||
|
||||
Ok(DocumentFragment::new(document.r()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue