Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGet rid of dom::bindings::global #13596
Conversation
highfive
commented
Oct 5, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 5, 2016
|
For the record, when I glanced through a few of the first and last commits the other day, I was very much in favour of these changes. |
|
@jdm To be honest, I was expecting the opposite. Woooo! :D |
|
@bors-servo try |
Get rid of dom::bindings::global Globals in that PR are now represented by the fake IDL interface `GlobalScope`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13596) <!-- Reviewable:end -->
|
|
|
LGTM, I guess. |
| @@ -76,7 +76,11 @@ impl File { | |||
| // NOTE: Following behaviour might be removed in future, | |||
| // see https://github.com/w3c/FileAPI/issues/41 | |||
| let replaced_filename = DOMString::from_string(filename.replace("/", ":")); | |||
| Ok(File::new(global, BlobImpl::new_from_bytes(bytes), replaced_filename, modified, typeString)) | |||
| Ok(File::new(global.as_global_scope(), | |||
| BlobImpl::new_from_bytes(bytes), | |||
This comment has been minimized.
This comment has been minimized.
| @@ -308,8 +306,8 @@ impl XMLHttpRequestMethods for XMLHttpRequest { | |||
| fn Open_(&self, method: ByteString, url: USVString, async: bool, | |||
| username: Option<USVString>, password: Option<USVString>) -> ErrorResult { | |||
| // Step 1 | |||
| match self.global() { | |||
| GlobalRoot::Window(ref window) => { | |||
| match Root::downcast::<Window>(self.global_scope()) { | |||
This comment has been minimized.
This comment has been minimized.
| match *self.type_id() { | ||
| // https://html.spec.whatwg.org/multipage/#script-settings-for-browsing-contexts:api-base-url | ||
| GlobalScopeTypeId::Window => { | ||
| self.downcast::<Window>().unwrap().Document().base_url() |
This comment has been minimized.
This comment has been minimized.
| @@ -200,6 +200,12 @@ impl GlobalScope { | |||
| }, | |||
| } | |||
| } | |||
|
|
|||
| /// Extract a `Window`, causing thread failure if the global object is not | |||
This comment has been minimized.
This comment has been minimized.
| @@ -144,8 +144,7 @@ impl Blob { | |||
| let (buffer, is_new_buffer) = match *f.cache.borrow() { | |||
| Some(ref bytes) => (bytes.clone(), false), | |||
| None => { | |||
| let global = self.global(); | |||
| let bytes = read_file(global.r(), f.id.clone())?; | |||
| let bytes = read_file(&self.global_scope(), f.id.clone())?; | |||
This comment has been minimized.
This comment has been minimized.
| pub fn script_chan(&self) -> Box<ScriptChan + Send> { | ||
| match *self.type_id() { | ||
| GlobalScopeTypeId::Window => { | ||
| let window = self.downcast::<Window>().unwrap(); |
This comment has been minimized.
This comment has been minimized.
| /// this of this global scope. | ||
| pub fn networking_task_source(&self) -> Box<ScriptChan + Send> { | ||
| match *self.type_id() { | ||
| GlobalScopeTypeId::Window => { |
This comment has been minimized.
This comment has been minimized.
| @@ -43,7 +43,7 @@ | |||
| //! [`Fallible<T>`](error/type.Fallible.html). | |||
| //! Methods that use certain WebIDL types like `any` or `object` will get a | |||
| //! `*mut JSContext` argument prepended to the argument list. Static methods | |||
| //! will be passed a [`GlobalRef`](global/enum.GlobalRef.html) for the relevant | |||
| //! will be passed a `&GlobalScope` for the relevant | |||
This comment has been minimized.
This comment has been minimized.
| @@ -861,7 +861,7 @@ impl WindowMethods for Window { | |||
| #[allow(unrooted_must_root)] | |||
| // https://fetch.spec.whatwg.org/#fetch-method | |||
| fn Fetch(&self, input: RequestOrUSVString, init: &RequestInit) -> Rc<Promise> { | |||
| fetch::Fetch(self.global().r(), input, init) | |||
| fetch::Fetch(&self.global_scope(), input, init) | |||
This comment has been minimized.
This comment has been minimized.
| @@ -319,7 +319,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope { | |||
| #[allow(unrooted_must_root)] | |||
| // https://fetch.spec.whatwg.org/#fetch-method | |||
| fn Fetch(&self, input: RequestOrUSVString, init: &RequestInit) -> Rc<Promise> { | |||
| fetch::Fetch(self.global().r(), input, init) | |||
| fetch::Fetch(&self.global_scope(), input, init) | |||
This comment has been minimized.
This comment has been minimized.
|
|
|
@bors-servo delegate+ LGTM assuming only changes were rebasing and fixing my comments. |
|
|
|
@bors-servo r=Ms2ger p=10 |
|
|
Get rid of dom::bindings::global Globals in that PR are now represented by the fake IDL interface `GlobalScope`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13596) <!-- Reviewable:end -->
|
|
highfive
commented
Oct 7, 2016
|
|
@bors-servo retry #13360 |
|
|
|
|
nox commentedOct 5, 2016
•
edited by larsbergstrom
Globals in that PR are now represented by the fake IDL interface
GlobalScope.This change is