Bug 1017988 part 3. Allow the Global extended attribute to take a value. r=khuey

This commit is contained in:
Boris Zbarsky 2014-08-04 22:20:33 -04:00
parent 89252135e4
commit f5c775b4f2
4 changed files with 12 additions and 6 deletions

View File

@ -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

View File

@ -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<any> transfer);

View File

@ -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

View File

@ -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;