mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Introduce GlobalScope::get_url
This commit is contained in:
parent
092504b4e3
commit
f38159b7d3
10 changed files with 39 additions and 39 deletions
|
@ -52,14 +52,15 @@ impl EventSource {
|
|||
pub fn Constructor(global: GlobalRef,
|
||||
url_str: DOMString,
|
||||
event_source_init: &EventSourceInit) -> Fallible<Root<EventSource>> {
|
||||
let global_scope = global.as_global_scope();
|
||||
// Steps 1-2
|
||||
let base_url = global.get_url();
|
||||
let base_url = global_scope.get_url();
|
||||
let url = match base_url.join(&*url_str) {
|
||||
Ok(u) => u,
|
||||
Err(_) => return Err(Error::Syntax)
|
||||
};
|
||||
// Step 3
|
||||
let event_source = EventSource::new(global.as_global_scope(), url, event_source_init.withCredentials);
|
||||
let event_source = EventSource::new(global_scope, url, event_source_init.withCredentials);
|
||||
// Step 4
|
||||
// Step 5
|
||||
// Step 6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue