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
|
@ -6,7 +6,6 @@ use dom::bindings::codegen::Bindings::TextDecoderBinding;
|
|||
use dom::bindings::codegen::Bindings::TextDecoderBinding::TextDecoderMethods;
|
||||
use dom::bindings::conversions::array_buffer_view_data;
|
||||
use dom::bindings::error::{Error, Fallible};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::str::{DOMString, USVString};
|
||||
|
@ -44,7 +43,7 @@ impl TextDecoder {
|
|||
}
|
||||
|
||||
/// https://encoding.spec.whatwg.org/#dom-textdecoder
|
||||
pub fn Constructor(global: GlobalRef,
|
||||
pub fn Constructor(global: &GlobalScope,
|
||||
label: DOMString,
|
||||
options: &TextDecoderBinding::TextDecoderOptions)
|
||||
-> Fallible<Root<TextDecoder>> {
|
||||
|
@ -61,7 +60,7 @@ impl TextDecoder {
|
|||
Some("replacement") => return TextDecoder::make_range_error(),
|
||||
_ => ()
|
||||
};
|
||||
Ok(TextDecoder::new(global.as_global_scope(), encoding, options.fatal))
|
||||
Ok(TextDecoder::new(global, encoding, options.fatal))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue