From d76b15345bb3122529ddf3a8f23672ea27c8cbc9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 25 Aug 2014 15:07:44 -0400 Subject: [PATCH] Bug 1047777. Disallow the [CheckPermissions] extended attributeon things that are exposed in workers, since its implementation does not work correctly on workers. r=peterv --- dom/bindings/parser/WebIDL.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 48c305d26f2..8f1a77f03da 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -1007,7 +1007,14 @@ class IDLInterface(IDLObjectWithScope): if (self.getExtendedAttribute("Pref") and self._exposureGlobalNames != set([self.parentScope.primaryGlobalName])): - raise WebIDLError("[Pref] used on an member that is not %s-only" % + raise WebIDLError("[Pref] used on an interface that is not %s-only" % + self.parentScope.primaryGlobalName, + [self.location]) + + if (self.getExtendedAttribute("CheckPermissions") and + self._exposureGlobalNames != set([self.parentScope.primaryGlobalName])): + raise WebIDLError("[CheckPermissions] used on an interface that is " + "not %s-only" % self.parentScope.primaryGlobalName, [self.location]) @@ -3022,6 +3029,13 @@ class IDLInterfaceMember(IDLObjectWithIdentifier): "%s-only" % self._scope.primaryGlobalName, [self.location]) + if (self.getExtendedAttribute("CheckPermissions") and + self.exposureSet != set([self._scope.primaryGlobalName])): + raise WebIDLError("[CheckPermissions] used on an interface member " + "that is not %s-only" % + self._scope.primaryGlobalName, + [self.location]) + class IDLConst(IDLInterfaceMember): def __init__(self, location, identifier, type, value): IDLInterfaceMember.__init__(self, location, identifier,