Bug 1316111. Move the 'caches' attribute to WindowOrWorkerGlobalScope, to align with the spec. r=bkelly
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 11 Nov 2016 16:09:05 -0500
changeset 352346 efcde9f288abca491607c6e333c7c36da20f0b86
parent 352345 0114eda62ce256dfaf4eddb761cea277bdefe572
child 352347 a0d9aedec3072f4fedabb177547272c679935b61
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1316111
milestone52.0a1
Bug 1316111. Move the 'caches' attribute to WindowOrWorkerGlobalScope, to align with the spec. r=bkelly
dom/webidl/Window.webidl
dom/webidl/WindowOrWorkerGlobalScope.webidl
dom/webidl/WorkerGlobalScope.webidl
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -250,22 +250,16 @@ interface WindowModal {
   [Throws, Func="nsGlobalWindow::IsModalContentWindow", NeedsSubjectPrincipal]
   readonly attribute any dialogArguments;
 
   [Throws, Func="nsGlobalWindow::IsModalContentWindow", NeedsSubjectPrincipal]
   attribute any returnValue;
 };
 Window implements WindowModal;
 
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
-partial interface Window {
-[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
-readonly attribute CacheStorage caches;
-};
-
 // Mozilla-specific stuff
 partial interface Window {
   //[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
   [NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
 
   // Mozilla extensions
   /**
    * Method for scrolling this window by a number of lines.
--- a/dom/webidl/WindowOrWorkerGlobalScope.webidl
+++ b/dom/webidl/WindowOrWorkerGlobalScope.webidl
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/.
  *
  * The origin of this IDL file is:
  * https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
  * https://fetch.spec.whatwg.org/#fetch-method
  * https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
+ * https://w3c.github.io/ServiceWorker/#self-caches
  */
 
 // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin
 [NoInterfaceObject, Exposed=(Window,Worker)]
 interface WindowOrWorkerGlobalScope {
   // XXXbz We don't implement 'origin' yet on either window or worker globals.
   // See bug 1306170.
   // [Replaceable] readonly attribute USVString origin;
@@ -55,16 +56,22 @@ partial interface WindowOrWorkerGlobalSc
 
 // http://w3c.github.io/IndexedDB/#factory-interface
 partial interface WindowOrWorkerGlobalScope {
    // readonly attribute IDBFactory indexedDB;
    [Throws]
    readonly attribute IDBFactory? indexedDB;
 };
 
+// https://w3c.github.io/ServiceWorker/#self-caches
+partial interface WindowOrWorkerGlobalScope {
+  [Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
+  readonly attribute CacheStorage caches;
+};
+
 // Mozilla extensions
 partial interface WindowOrWorkerGlobalScope {
   // Extensions to ImageBitmap bits.
   // Bug 1141979 - [FoxEye] Extend ImageBitmap with interfaces to access its
   // underlying image data
   //
   // Note:
   // Overloaded functions cannot have different "extended attributes",
--- a/dom/webidl/WorkerGlobalScope.webidl
+++ b/dom/webidl/WorkerGlobalScope.webidl
@@ -30,22 +30,16 @@ interface WorkerGlobalScope : EventTarge
 
 partial interface WorkerGlobalScope {
   [Throws]
   void importScripts(DOMString... urls);
 
   readonly attribute WorkerNavigator navigator;
 };
 
-// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
-partial interface WorkerGlobalScope {
-[Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
-readonly attribute CacheStorage caches;
-};
-
 WorkerGlobalScope implements GlobalCrypto;
 WorkerGlobalScope implements WindowOrWorkerGlobalScope;
 
 // Not implemented yet: bug 1072107.
 // WorkerGlobalScope implements FontFaceSource;
 
 // Mozilla extensions
 partial interface WorkerGlobalScope {