Make WebIDL constructors take a more specific global if possible (fixes #14071)

This commit is contained in:
Rohan Prinja 2016-11-10 02:24:01 -05:00 committed by Anthony Ramine
parent 8af2327e95
commit 973f77c006
17 changed files with 50 additions and 49 deletions

View file

@ -12,10 +12,10 @@ 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;
use dom::window::Window;
use servo_atoms::Atom;
// https://dom.spec.whatwg.org/#documentfragment
@ -38,8 +38,8 @@ impl DocumentFragment {
DocumentFragmentBinding::Wrap)
}
pub fn Constructor(global: &GlobalScope) -> Fallible<Root<DocumentFragment>> {
let document = global.as_window().Document();
pub fn Constructor(window: &Window) -> Fallible<Root<DocumentFragment>> {
let document = window.Document();
Ok(DocumentFragment::new(&document))
}