mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -5,11 +5,11 @@
|
|||
use dom::bindings::codegen::Bindings::CommentBinding;
|
||||
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::Document;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::node::Node;
|
||||
|
||||
/// An HTML comment.
|
||||
|
@ -31,8 +31,8 @@ impl Comment {
|
|||
CommentBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: GlobalRef, data: DOMString) -> Fallible<Root<Comment>> {
|
||||
let document = global.as_global_scope().as_window().Document();
|
||||
pub fn Constructor(global: &GlobalScope, data: DOMString) -> Fallible<Root<Comment>> {
|
||||
let document = global.as_window().Document();
|
||||
Ok(Comment::new(data, document.r()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue