Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace instances of old ServiceWorker specification URL with new one #13416

Merged
merged 1 commit into from Sep 25, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -41,17 +41,17 @@ impl Client {
}

impl ClientMethods for Client {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client-url-attribute
// https://w3c.github.io/ServiceWorker/#client-url-attribute
fn Url(&self) -> USVString {
self.url.clone()
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client-frametype
// https://w3c.github.io/ServiceWorker/#client-frametype
fn FrameType(&self) -> FrameType {
self.frame_type
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client-id
// https://w3c.github.io/ServiceWorker/#client-id
fn Id(&self) -> DOMString {
let uid_str = format!("{}", self.id);
DOMString::from_string(uid_str)
@@ -103,7 +103,7 @@ impl NavigatorMethods for Navigator {
false
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-attribute
// https://w3c.github.io/ServiceWorker/#navigator-service-worker-attribute
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
self.service_worker.or_init(|| ServiceWorkerContainer::new(self.global().r()))
}
@@ -70,17 +70,17 @@ impl ServiceWorker {
}

impl ServiceWorkerMethods for ServiceWorker {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-state-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-state-attribute
fn State(&self) -> ServiceWorkerState {
self.state.get()
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-url-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-url-attribute
fn ScriptURL(&self) -> USVString {
USVString(self.script_url.borrow().clone())
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-postmessage
// https://w3c.github.io/ServiceWorker/#service-worker-postmessage
fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
// Step 1
if let ServiceWorkerState::Redundant = self.state.get() {
@@ -94,10 +94,10 @@ impl ServiceWorkerMethods for ServiceWorker {
Ok(())
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-container-onerror-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-container-onerror-attribute
event_handler!(error, GetOnerror, SetOnerror);

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#ref-for-service-worker-onstatechange-attribute-1
// https://w3c.github.io/ServiceWorker/#ref-for-service-worker-onstatechange-attribute-1
event_handler!(statechange, GetOnstatechange, SetOnstatechange);
}

@@ -48,12 +48,12 @@ impl Controllable for ServiceWorkerContainer {
}

impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-container-controller-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-container-controller-attribute
fn GetController(&self) -> Option<Root<ServiceWorker>> {
return self.controller.get()
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-container-register-method
// https://w3c.github.io/ServiceWorker/#service-worker-container-register-method
fn Register(&self,
script_url: USVString,
options: &RegistrationOptions) -> Fallible<Root<ServiceWorkerRegistration>> {
@@ -334,6 +334,6 @@ unsafe extern "C" fn interrupt_callback(cx: *mut JSContext) -> bool {
}

impl ServiceWorkerGlobalScopeMethods for ServiceWorkerGlobalScope {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-global-scope-onmessage-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-global-scope-onmessage-attribute
event_handler!(message, GetOnmessage, SetOnmessage);
}
@@ -83,22 +83,22 @@ pub fn longest_prefix_match(stored_scope: &Url, potential_match: &Url) -> bool {
}

impl ServiceWorkerRegistrationMethods for ServiceWorkerRegistration {
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-installing-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-registration-installing-attribute
fn GetInstalling(&self) -> Option<Root<ServiceWorker>> {
self.installing.as_ref().map(|sw| Root::from_ref(&**sw))
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-active-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-registration-active-attribute
fn GetActive(&self) -> Option<Root<ServiceWorker>> {
self.active.as_ref().map(|sw| Root::from_ref(&**sw))
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-waiting-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-registration-waiting-attribute
fn GetWaiting(&self) -> Option<Root<ServiceWorker>> {
self.waiting.as_ref().map(|sw| Root::from_ref(&**sw))
}

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-scope-attribute
// https://w3c.github.io/ServiceWorker/#service-worker-registration-scope-attribute
fn Scope(&self) -> USVString {
USVString(self.scope.clone())
}
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client
// https://w3c.github.io/ServiceWorker/#client

[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)]
interface Client {
@@ -33,7 +33,7 @@ interface NavigatorBluetooth {
readonly attribute Bluetooth bluetooth;
};

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker
// https://w3c.github.io/ServiceWorker/#navigator-service-worker
partial interface Navigator {
[SameObject, Pref="dom.serviceworker.enabled"] readonly attribute ServiceWorkerContainer serviceWorker;
};
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// http://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-obj
// http://w3c.github.io/ServiceWorker/#service-worker-obj
[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)]
interface ServiceWorker : EventTarget {
readonly attribute USVString scriptURL;
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-container
// https://w3c.github.io/ServiceWorker/#service-worker-container
[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)]
interface ServiceWorkerContainer : EventTarget {
[Unforgeable] readonly attribute ServiceWorker? controller;
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-global-scope
// https://w3c.github.io/ServiceWorker/#service-worker-global-scope

[Global=(Worker,ServiceWorker), Exposed=ServiceWorker,
Pref="dom.serviceworker.enabled"]
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-obj
// https://w3c.github.io/ServiceWorker/#service-worker-registration-obj
[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)]
interface ServiceWorkerRegistration : EventTarget {
[Unforgeable] readonly attribute ServiceWorker? installing;
@@ -69,7 +69,6 @@
"//w3c.github.io",
"//heycam.github.io/webidl",
"//webbluetoothcg.github.io/web-bluetooth/",
"//slightlyoff.github.io/ServiceWorker/spec/service_worker/",
# Not a URL
"// This interface is entirely internal to Servo, and should not be" +
" accessible to\n// web pages."
@@ -272,7 +272,7 @@ is called, the two conditions above apply like normal.
Dedicated and shared workers don't have an event that corresponds to the `load`
event in a document. Therefore these worker tests always behave as if the
`explicit_done` property is set to true. Service workers depend on the
[install](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-install-event)
[install](https://w3c.github.io/ServiceWorker/index.html#service-worker-global-scope-install-event)
event which is fired following the completion of [running the
worker](https://html.spec.whatwg.org/multipage/workers.html#run-a-worker).

@@ -374,7 +374,7 @@ object. These objects are structures as follows:

The `testharness.js` script can be used from within [dedicated workers, shared
workers](https://html.spec.whatwg.org/multipage/workers.html) and [service
workers](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/).
workers](https://w3c.github.io/ServiceWorker/).

Testing from a worker script is different from testing from an HTML document in
several ways:
@@ -401,7 +401,7 @@ several ways:
complete](#determining-when-all-tests-are-complete)). So these worker tests
behave as if they were started with the `explicit_done` option. Service
workers depend on the
[oninstall](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-install-event)
[oninstall](https://w3c.github.io/ServiceWorker/index.html#service-worker-global-scope-install-event)
event and don't require an explicit `done` call.

Here's an example that uses a dedicated worker.
@@ -434,7 +434,7 @@ Here's an example that uses a dedicated worker.
The argument to the `fetch_tests_from_worker` function can be a
[`Worker`](https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface),
a [`SharedWorker`](https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworker-interface)
or a [`ServiceWorker`](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-obj).
or a [`ServiceWorker`](https://w3c.github.io/ServiceWorker/#service-worker-obj).
Once called, the containing document fetches all the tests from the worker and
behaves as if those tests were running in the containing document itself.

@@ -2,14 +2,14 @@ interface Foo {
Promise<ResponsePromise<sequence<DOMString?>>> bar();
};

// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-08
// Extracted from https://w3c.github.io/ServiceWorker/ on 2014-05-08

interface ServiceWorkerClients {
Promise<Client[]?> getServiced();
Promise<any> reloadAll();
};

// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-13
// Extracted from https://w3c.github.io/ServiceWorker/ on 2014-05-13

interface FetchEvent : Event {
ResponsePromise<any> default();
@@ -1,4 +1,4 @@
// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-06
// Extracted from https://w3c.github.io/ServiceWorker/ on 2014-05-06

[MapClass(DOMString, DOMString)]
interface HeaderMap {
@@ -418,7 +418,7 @@ is called, the two conditions above apply like normal.
Dedicated and shared workers don't have an event that corresponds to the `load`
event in a document. Therefore these worker tests always behave as if the
`explicit_done` property is set to true. Service workers depend on the
[install](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-install-event)
[install](https://w3c.github.io/ServiceWorker/index.html#service-worker-global-scope-install-event)
event which is fired following the completion of [running the
worker](https://html.spec.whatwg.org/multipage/workers.html#run-a-worker).
@@ -526,7 +526,7 @@ object. These objects are structures as follows:
The `testharness.js` script can be used from within [dedicated workers, shared
workers](https://html.spec.whatwg.org/multipage/workers.html) and [service
workers](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/).
workers](https://w3c.github.io/ServiceWorker/).
Testing from a worker script is different from testing from an HTML document in
several ways:
@@ -553,7 +553,7 @@ several ways:
complete](#determining-when-all-tests-are-complete)). So these worker tests
behave as if they were started with the `explicit_done` option. Service
workers depend on the
[oninstall](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-global-scope-install-event)
[oninstall](https://w3c.github.io/ServiceWorker/index.html#service-worker-global-scope-install-event)
event and don't require an explicit `done` call.
Here's an example that uses a dedicated worker.
@@ -590,7 +590,7 @@ fetch_tests_from_worker(new Worker("worker.js"));
The argument to the `fetch_tests_from_worker` function can be a
[`Worker`](https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface),
a [`SharedWorker`](https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworker-interface)
or a [`ServiceWorker`](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-obj).
or a [`ServiceWorker`](https://w3c.github.io/ServiceWorker/#service-worker-obj).
Once called, the containing document fetches all the tests from the worker and
behaves as if those tests were running in the containing document itself.
@@ -3,14 +3,14 @@ interface Foo {
readonly attribute Promise<DOMString>[] baz;
};

// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-08
// Extracted from https://w3c.github.io/ServiceWorker/ on 2014-05-08

interface ServiceWorkerClients {
Promise<Client[]?> getServiced();
Promise<any> reloadAll();
};

// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-13
// Extracted from https://w3c.github.io/ServiceWorker/ on 2014-05-13

interface FetchEvent : Event {
ResponsePromise<any> default();
@@ -1,4 +1,4 @@
// Extracted from https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ on 2014-05-06
// Extracted from https://w3c.github.io/ServiceWorker/ on 2014-05-06

[MapClass(DOMString, DOMString)]
interface HeaderMap {
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache Storage: Verify that Window and Workers see same storage</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache.add and Cache.addAll</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-add">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-add">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache.delete</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-delete">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-delete">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache.match</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-match">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-match">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache.matchAll</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-matchall">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-matchall">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache.put</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-put">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-put">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>CacheStorage.keys</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>CacheStorage.match</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage-match">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage-match">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>CacheStorage</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Cache Storage: Verify credentials are respected by Cache operations</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../service-worker/resources/test-helpers.sub.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache Storage: Cache.add and Cache.addAll</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-add">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-add">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache Storage: Cache.delete</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-delete">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-delete">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<title>Cache Storage: Cache.match</title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-match">
<link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-match">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.