diff options
10 files changed, 11 insertions, 23 deletions
diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs index 74b61768a5e..8ca9104b945 100644 --- a/components/script/dom/request.rs +++ b/components/script/dom/request.rs @@ -92,8 +92,7 @@ impl Request { let mut fallback_credentials: Option<NetTraitsRequestCredentials> = None; // Step 4 - // TODO: `entry settings object` is not implemented in Servo yet. - let base_url = global.get_url(); + let base_url = global.api_base_url(); match input { // Step 5 diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs index 06a066d410c..1d9d62c079a 100644 --- a/components/script/dom/response.rs +++ b/components/script/dom/response.rs @@ -149,8 +149,7 @@ impl Response { // https://fetch.spec.whatwg.org/#dom-response-redirect pub fn Redirect(global: &GlobalScope, url: USVString, status: u16) -> Fallible<Root<Response>> { // Step 1 - // TODO: `entry settings object` is not implemented in Servo yet. - let base_url = global.get_url(); + let base_url = global.api_base_url(); let parsed_url = base_url.join(&url.0); // Step 2 diff --git a/tests/wpt/metadata/fetch/api/request/multi-globals/url-parsing.html.ini b/tests/wpt/metadata/fetch/api/request/multi-globals/url-parsing.html.ini deleted file mode 100644 index a6e5c4f239b..00000000000 --- a/tests/wpt/metadata/fetch/api/request/multi-globals/url-parsing.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[url-parsing.html] - type: testharness - [should parse the URL relative to the current settings object] - expected: FAIL - diff --git a/tests/wpt/metadata/fetch/api/response/multi-globals/url-parsing.html.ini b/tests/wpt/metadata/fetch/api/response/multi-globals/url-parsing.html.ini deleted file mode 100644 index ebf5ccc16d2..00000000000 --- a/tests/wpt/metadata/fetch/api/response/multi-globals/url-parsing.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[url-parsing.html] - type: testharness - [should parse the redirect Location URL relative to the current settings object] - expected: FAIL - diff --git a/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/current/current.html b/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/current/current.html index 82a48d40990..9bb6e0bbf3f 100644 --- a/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/current/current.html +++ b/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/current/current.html @@ -1,2 +1,3 @@ <!DOCTYPE html> <title>Current page used as a test helper</title> +<base href="success/"> diff --git a/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/incumbent/incumbent.html b/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/incumbent/incumbent.html index 8edc71cfb12..a885b8a0a73 100644 --- a/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/incumbent/incumbent.html +++ b/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/incumbent/incumbent.html @@ -6,9 +6,8 @@ <script> 'use strict'; -const current = document.querySelector('#c').contentWindow; - window.createRequest = (...args) => { + const current = document.querySelector('#c').contentWindow; return new current.Request(...args); }; diff --git a/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/url-parsing.html b/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/url-parsing.html index f20298ad628..df60e72507f 100644 --- a/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/url-parsing.html +++ b/tests/wpt/web-platform-tests/fetch/api/request/multi-globals/url-parsing.html @@ -18,9 +18,9 @@ const loadPromise = new Promise(resolve => { promise_test(() => { return loadPromise.then(() => { - const req = frames[0].createRequest("url"); + const req = document.querySelector('iframe').contentWindow.createRequest("url"); - assert_equals(req.url, new URL("current/url", location.href).href); + assert_equals(req.url, new URL("current/success/url", location.href).href); }); }, "should parse the URL relative to the current settings object"); diff --git a/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/current/current.html b/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/current/current.html index 82a48d40990..9bb6e0bbf3f 100644 --- a/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/current/current.html +++ b/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/current/current.html @@ -1,2 +1,3 @@ <!DOCTYPE html> <title>Current page used as a test helper</title> +<base href="success/"> diff --git a/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/incumbent/incumbent.html b/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/incumbent/incumbent.html index 4d1ee085440..f63372e64c2 100644 --- a/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/incumbent/incumbent.html +++ b/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/incumbent/incumbent.html @@ -7,10 +7,9 @@ <script> 'use strict'; -const current = document.querySelector('#c').contentWindow; -const relevant = document.querySelector('#r').contentWindow; - window.createRedirectResponse = (...args) => { + const current = document.querySelector('#c').contentWindow; + const relevant = document.querySelector('#r').contentWindow; return current.Response.redirect.call(relevant.Response, ...args); }; diff --git a/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/url-parsing.html b/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/url-parsing.html index 73bf9cfd0ad..5f2f42a1cea 100644 --- a/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/url-parsing.html +++ b/tests/wpt/web-platform-tests/fetch/api/response/multi-globals/url-parsing.html @@ -18,9 +18,9 @@ const loadPromise = new Promise(resolve => { promise_test(() => { return loadPromise.then(() => { - const res = frames[0].createRedirectResponse("url"); + const res = document.querySelector('iframe').contentWindow.createRedirectResponse("url"); - assert_equals(res.headers.get("Location"), new URL("current/url", location.href).href); + assert_equals(res.headers.get("Location"), new URL("current/success/url", location.href).href); }); }, "should parse the redirect Location URL relative to the current settings object"); |