diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 6d46a3a9bc83..fd89a7e36f91 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -1049,9 +1049,12 @@ class IDLInterface(IDLObjectWithScope): "an interface with inherited interfaces", [attr.location, self.location]) elif identifier == "Global": - if not attr.noArguments(): - raise WebIDLError("[Global] must take no arguments", - [attr.location]) + if attr.hasValue(): + self.globalNames = [ attr.value() ] + elif attr.hasArgs(): + self.globalNames = attr.args() + else: + self.globalNames = [ self.identifier.name ] self._isOnGlobalProtoChain = True elif (identifier == "NeedNewResolve" or identifier == "OverrideBuiltins" or diff --git a/dom/webidl/DedicatedWorkerGlobalScope.webidl b/dom/webidl/DedicatedWorkerGlobalScope.webidl index 83a200f3c903..48f623c2de90 100644 --- a/dom/webidl/DedicatedWorkerGlobalScope.webidl +++ b/dom/webidl/DedicatedWorkerGlobalScope.webidl @@ -12,7 +12,8 @@ * this document. */ -[Global, Func="mozilla::dom::workers::DedicatedWorkerGlobalScope::Visible"] +[Global=(Worker,DedicatedWorker), + Func="mozilla::dom::workers::DedicatedWorkerGlobalScope::Visible"] interface DedicatedWorkerGlobalScope : WorkerGlobalScope { [Throws] void postMessage(any message, optional sequence transfer); diff --git a/dom/webidl/ServiceWorkerGlobalScope.webidl b/dom/webidl/ServiceWorkerGlobalScope.webidl index b9c3911a0d44..9b63d141dc0d 100644 --- a/dom/webidl/ServiceWorkerGlobalScope.webidl +++ b/dom/webidl/ServiceWorkerGlobalScope.webidl @@ -12,7 +12,8 @@ // The Pref controls exposure in general, the Func restricts it to inside the // ServiceWorkerGlobalScope (itself). -[Global, Func="mozilla::dom::workers::ServiceWorkerGlobalScope::Visible", +[Global=(Worker,ServiceWorker), + Func="mozilla::dom::workers::ServiceWorkerGlobalScope::Visible", Pref="dom.serviceWorkers.enabled"] interface ServiceWorkerGlobalScope : WorkerGlobalScope { // FIXME(nsm): Bug 982725 diff --git a/dom/webidl/SharedWorkerGlobalScope.webidl b/dom/webidl/SharedWorkerGlobalScope.webidl index 06dee655f4db..cda2fb5e4a85 100644 --- a/dom/webidl/SharedWorkerGlobalScope.webidl +++ b/dom/webidl/SharedWorkerGlobalScope.webidl @@ -12,7 +12,8 @@ * this document. */ -[Global, Func="mozilla::dom::workers::SharedWorkerGlobalScope::Visible"] +[Global=(Worker,SharedWorker), + Func="mozilla::dom::workers::SharedWorkerGlobalScope::Visible"] interface SharedWorkerGlobalScope : WorkerGlobalScope { readonly attribute DOMString name; attribute EventHandler onconnect;