mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Make reflect_dom_object take a &GlobalScope
This commit is contained in:
parent
093b189b48
commit
fcb59d3057
132 changed files with 488 additions and 407 deletions
|
@ -10,6 +10,7 @@ use dom::bindings::global::GlobalRef;
|
|||
use dom::bindings::js::Root;
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::str::{DOMString, USVString};
|
||||
use dom::globalscope::GlobalScope;
|
||||
use encoding::EncoderTrap;
|
||||
use encoding::Encoding;
|
||||
use encoding::all::UTF_8;
|
||||
|
@ -30,7 +31,7 @@ impl TextEncoder {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(global: GlobalRef) -> Root<TextEncoder> {
|
||||
pub fn new(global: &GlobalScope) -> Root<TextEncoder> {
|
||||
reflect_dom_object(box TextEncoder::new_inherited(),
|
||||
global,
|
||||
TextEncoderBinding::Wrap)
|
||||
|
@ -38,7 +39,7 @@ impl TextEncoder {
|
|||
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder
|
||||
pub fn Constructor(global: GlobalRef) -> Fallible<Root<TextEncoder>> {
|
||||
Ok(TextEncoder::new(global))
|
||||
Ok(TextEncoder::new(global.as_global_scope()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue