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
|
@ -22,11 +22,11 @@ use dom::characterdata::CharacterData;
|
|||
use dom::document::Document;
|
||||
use dom::documentfragment::DocumentFragment;
|
||||
use dom::element::Element;
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlbodyelement::HTMLBodyElement;
|
||||
use dom::htmlscriptelement::HTMLScriptElement;
|
||||
use dom::node::{Node, UnbindContext};
|
||||
use dom::text::Text;
|
||||
use dom::window::Window;
|
||||
use heapsize::HeapSizeOf;
|
||||
use js::jsapi::JSTracer;
|
||||
use std::cell::{Cell, UnsafeCell};
|
||||
|
@ -70,8 +70,8 @@ impl Range {
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-range
|
||||
pub fn Constructor(global: &GlobalScope) -> Fallible<Root<Range>> {
|
||||
let document = global.as_window().Document();
|
||||
pub fn Constructor(window: &Window) -> Fallible<Root<Range>> {
|
||||
let document = window.Document();
|
||||
Ok(Range::new_with_doc(&document))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue