Bug 1073124 part 1. Hack the "System" global name into the Web IDL parser, since we have no actual Web IDL interface for system globals. r=khuey
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -1064,16 +1064,19 @@ class IDLInterface(IDLObjectWithScope):
m.isMethod() and not m.isStatic())) == 1)
def isExposedInWindow(self):
return 'Window' in self.exposureSet
def isExposedInAnyWorker(self):
return len(self.getWorkerExposureSet()) > 0
+ def isExposedInSystemGlobals(self):
+ return 'BackstagePass' in self.exposureSet
+
def isExposedOnlyInSomeWorkers(self):
assert self.isExposedInAnyWorker()
workerScopes = self.parentScope.globalNameMapping["Worker"]
return len(workerScopes.difference(self.exposureSet)) > 0
def getWorkerExposureSet(self):
workerScopes = self.parentScope.globalNameMapping["Worker"]
return workerScopes.intersection(self.exposureSet)
@@ -5604,16 +5607,20 @@ class Parser(Tokenizer):
)
logger.reportGrammarErrors()
self._globalScope = IDLScope(BuiltinLocation("<Global Scope>"), None, None)
# To make our test harness work, pretend like we have a primary global already. Note that we _don't_ set _globalScope.primaryGlobalAttr, so we'll still be able to detect multiple PrimaryGlobal extended attributes.
self._globalScope.primaryGlobalName = "FakeTestPrimaryGlobal"
self._globalScope.globalNames.add("FakeTestPrimaryGlobal")
self._globalScope.globalNameMapping["FakeTestPrimaryGlobal"].add("FakeTestPrimaryGlobal")
+ # And we add the special-cased "System" global name, which
+ # doesn't have any corresponding interfaces.
+ self._globalScope.globalNames.add("System")
+ self._globalScope.globalNameMapping["System"].add("BackstagePass")
self._installBuiltins(self._globalScope)
self._productions = []
self._filename = "<builtin>"
self.lexer.input(Parser._builtins)
self._filename = None
self.parser.parse(lexer=self.lexer,tracking=True)