mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -8,13 +8,13 @@ use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
|||
use dom::bindings::codegen::Bindings::TextBinding::{self, TextMethods};
|
||||
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||
use dom::bindings::error::{Error, Fallible};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::js::RootedReference;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::Document;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::node::Node;
|
||||
|
||||
/// An HTML text node.
|
||||
|
@ -35,8 +35,8 @@ impl Text {
|
|||
document, TextBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: GlobalRef, text: DOMString) -> Fallible<Root<Text>> {
|
||||
let document = global.as_global_scope().as_window().Document();
|
||||
pub fn Constructor(global: &GlobalScope, text: DOMString) -> Fallible<Root<Text>> {
|
||||
let document = global.as_window().Document();
|
||||
Ok(Text::new(text, document.r()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue