Pass a &GlobalScope to WebIDL static methods and constructors

This commit is contained in:
Anthony Ramine 2016-10-04 00:54:05 +02:00
parent 1fd470889d
commit 19108aa330
56 changed files with 198 additions and 245 deletions

View file

@ -4,9 +4,9 @@
use cssparser::serialize_identifier;
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::reflector::Reflector;
use dom::bindings::str::DOMString;
use dom::globalscope::GlobalScope;
#[dom_struct]
pub struct CSS {
@ -15,7 +15,7 @@ pub struct CSS {
impl CSS {
// http://dev.w3.org/csswg/cssom/#serialize-an-identifier
pub fn Escape(_: GlobalRef, ident: DOMString) -> Fallible<DOMString> {
pub fn Escape(_: &GlobalScope, ident: DOMString) -> Fallible<DOMString> {
let mut escaped = String::new();
serialize_identifier(&ident, &mut escaped).unwrap();
Ok(DOMString::from(escaped))