Rename variables that refer to global objects.

This clarifies whether those variables will point to a Window object or an
arbitrary global object.

Note in particular that all IDL Constructors will accept an arbitrary global
object.
This commit is contained in:
Ms2ger 2014-07-15 12:09:21 +02:00
parent ab1a188e95
commit f963ed99ac
21 changed files with 95 additions and 92 deletions

View file

@ -45,8 +45,8 @@ impl FormData {
reflect_dom_object(box FormData::new_inherited(form, window), window, FormDataBinding::Wrap)
}
pub fn Constructor(window: &JSRef<Window>, form: Option<JSRef<HTMLFormElement>>) -> Fallible<Temporary<FormData>> {
Ok(FormData::new(form, window))
pub fn Constructor(global: &JSRef<Window>, form: Option<JSRef<HTMLFormElement>>) -> Fallible<Temporary<FormData>> {
Ok(FormData::new(form, global))
}
}
@ -115,9 +115,9 @@ trait PrivateFormDataHelpers{
impl PrivateFormDataHelpers for FormData {
fn get_file_from_blob(&self, value: &JSRef<Blob>, filename: Option<DOMString>) -> Temporary<File> {
let global = self.window.root();
let window = self.window.root();
let f: Option<&JSRef<File>> = FileCast::to_ref(value);
let name = filename.unwrap_or(f.map(|inner| inner.name.clone()).unwrap_or("blob".to_string()));
File::new(&*global, value, name)
File::new(&*window, value, name)
}
}