diff options
author | sreeise <reeisesean@gmail.com> | 2019-05-28 03:23:47 -0400 |
---|---|---|
committer | sreeise <reeisesean@gmail.com> | 2019-07-14 09:24:43 -0400 |
commit | 871239a3e302d4aefdbbad1b0141511dcd66afc4 (patch) | |
tree | 7c5907d5d1bef787d91c3bc469cb31436e20babc /components/script/dom/bindings/codegen/parser | |
parent | 2b843483722de683c1277f803a9a45dd6afa09cf (diff) | |
download | servo-871239a3e302d4aefdbbad1b0141511dcd66afc4.tar.gz servo-871239a3e302d4aefdbbad1b0141511dcd66afc4.zip |
Change bindings generation to make Exposed annotation aware of members/partial interfaces
Diffstat (limited to 'components/script/dom/bindings/codegen/parser')
3 files changed, 33 insertions, 0 deletions
diff --git a/components/script/dom/bindings/codegen/parser/WebIDL.py b/components/script/dom/bindings/codegen/parser/WebIDL.py index e18b6e34a2c..7ea8423e860 100644 --- a/components/script/dom/bindings/codegen/parser/WebIDL.py +++ b/components/script/dom/bindings/codegen/parser/WebIDL.py @@ -3723,6 +3723,7 @@ class IDLInterfaceMember(IDLObjectWithIdentifier, IDLExposureMixins): IDLObjectWithIdentifier.__init__(self, location, None, identifier) IDLExposureMixins.__init__(self, location) self.tag = tag + self.exposed = set() if extendedAttrDict is None: self._extendedAttrDict = {} else: @@ -3756,12 +3757,16 @@ class IDLInterfaceMember(IDLObjectWithIdentifier, IDLExposureMixins): def getExtendedAttribute(self, name): return self._extendedAttrDict.get(name, None) + def exposedSet(self): + return self.exposed + def finish(self, scope): # We better be exposed _somewhere_. if (len(self._exposureGlobalNames) == 0): print(self.identifier.name) assert len(self._exposureGlobalNames) != 0 IDLExposureMixins.finish(self, scope) + globalNameSetToExposureSet(scope, self._exposureGlobalNames, self.exposed) def validate(self): if self.isAttr() or self.isMethod(): diff --git a/components/script/dom/bindings/codegen/parser/exposed-globals.patch b/components/script/dom/bindings/codegen/parser/exposed-globals.patch new file mode 100644 index 00000000000..02ad787f5e0 --- /dev/null +++ b/components/script/dom/bindings/codegen/parser/exposed-globals.patch @@ -0,0 +1,27 @@ +--- WebIDL.py ++++ WebIDL.py +@@ -3653,6 +3653,7 @@ class IDLInterfaceMember(IDLObjectWithIdentifier, IDLExposureMixins): + IDLObjectWithIdentifier.__init__(self, location, None, identifier) + IDLExposureMixins.__init__(self, location) + self.tag = tag ++ self.exposed = set() + if extendedAttrDict is None: + self._extendedAttrDict = {} + else: +@@ -3686,12 +3687,16 @@ class IDLInterfaceMember(IDLObjectWithIdentifier, IDLExposureMixins): + def getExtendedAttribute(self, name): + return self._extendedAttrDict.get(name, None) + ++ def exposedSet(self): ++ return self.exposed ++ + def finish(self, scope): + # We better be exposed _somewhere_. + if (len(self._exposureGlobalNames) == 0): + print self.identifier.name + assert len(self._exposureGlobalNames) != 0 + IDLExposureMixins.finish(self, scope) ++ globalNameSetToExposureSet(scope, self._exposureGlobalNames, self.exposed) + + def validate(self): + if self.isAttr() or self.isMethod(): diff --git a/components/script/dom/bindings/codegen/parser/update.sh b/components/script/dom/bindings/codegen/parser/update.sh index fee9720ab2d..570b8b4506d 100755 --- a/components/script/dom/bindings/codegen/parser/update.sh +++ b/components/script/dom/bindings/codegen/parser/update.sh @@ -4,6 +4,7 @@ patch < debug.patch patch < callback-location.patch patch < union-typedef.patch patch < inline.patch +patch < exposed-globals.patch wget https://hg.mozilla.org/mozilla-central/archive/tip.tar.gz/dom/bindings/parser/tests/ -O tests.tar.gz rm -r tests |