mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make WebIDL constructors take a more specific global if possible (fixes #14071)
This commit is contained in:
parent
8af2327e95
commit
973f77c006
17 changed files with 50 additions and 49 deletions
|
@ -9,8 +9,8 @@ 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;
|
||||
use dom::window::Window;
|
||||
|
||||
/// An HTML comment.
|
||||
#[dom_struct]
|
||||
|
@ -31,8 +31,8 @@ impl Comment {
|
|||
CommentBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: &GlobalScope, data: DOMString) -> Fallible<Root<Comment>> {
|
||||
let document = global.as_window().Document();
|
||||
pub fn Constructor(window: &Window, data: DOMString) -> Fallible<Root<Comment>> {
|
||||
let document = window.Document();
|
||||
Ok(Comment::new(data, &document))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue