OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <title>Service Workers: ServiceWorker</title> |
| 4 <head> |
| 5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#service-work
er-obj"> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 8 |
| 9 <script src=/resources/WebIDLParser.js></script> |
| 10 <script src=/resources/idlharness.js></script> |
| 11 |
| 12 </head> |
| 13 <body> |
| 14 |
| 15 <script type=text/plain id="idl_0"> |
| 16 [Constructor()] // no-op constructor |
| 17 interface ServiceWorker : Worker { |
| 18 readonly attribute DOMString scope; |
| 19 readonly attribute DOMString url; |
| 20 readonly attribute ServiceWorkerState state; |
| 21 |
| 22 // event |
| 23 attribute EventHandler onstatechange; |
| 24 }; |
| 25 |
| 26 enum ServiceWorkerState { |
| 27 "installing", |
| 28 "installed", |
| 29 "activating", |
| 30 "activated", |
| 31 "redundant" |
| 32 }; |
| 33 </pre> |
| 34 |
| 35 <!-- |
| 36 The `ServiceWorker` interface represents the document-side view of a Service |
| 37 Worker. This object provides a no-op constructor. Callers should note that only |
| 38 `ServiceWorker` objects created by the user agent (see |
| 39 `navigator.serviceWorker.installing`, `navigator.serviceWorker.waiting`, |
| 40 `navigator.serviceWorker.active` and `navigator.serviceWorker.controller`) will |
| 41 provide meaningful functionality. |
| 42 --> |
| 43 |
| 44 |
| 45 <script type=text/plain id="untested_idls"> |
| 46 interface EventHandler {}; |
| 47 interface Worker {}; |
| 48 </pre> |
| 49 |
| 50 <script> |
| 51 var idl_array = new IdlArray(); |
| 52 idl_array.add_untested_idls(document.getElementById("untested_idls").tex
tContent); |
| 53 idl_array.add_idls(document.getElementById("idl_0").textContent); |
| 54 idl_array.add_objects({ |
| 55 ServiceWorker: ["throw new Error ('No object defined for the Service
Worker interface')"], |
| 56 ServiceWorkerState: ["throw new Error ('No object defined for the Se
rviceWorkerState enum')"] |
| 57 }); |
| 58 idl_array.test(); |
| 59 </script> |
| 60 |
| 61 </body> |
| 62 </html> |
| 63 |
OLD | NEW |