Bug 1393837 - Make sure codegen includes all the parent interfaces r=peterv
MozReview-Commit-ID: 5UWExNmYyME
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -1075,16 +1075,30 @@ class CGHeaders(CGWrapper):
# interface object as the proto of our interface object.
if iface.hasInterfaceObject():
parent = iface.parent
while parent and not parent.hasInterfaceObject():
parent = parent.parent
if parent:
ancestors.append(parent)
interfaceDeps.extend(ancestors)
+
+ # Include parent interface headers needed for jsonifier code.
+ jsonInterfaceParents = []
+ for desc in descriptors:
+ if not desc.operations['Jsonifier']:
+ continue
+ parent = desc.interface.parent
+ while parent:
+ parentDesc = desc.getDescriptor(parent.identifier.name)
+ if parentDesc.operations['Jsonifier']:
+ jsonInterfaceParents.append(parentDesc.interface)
+ parent = parent.parent
+ interfaceDeps.extend(jsonInterfaceParents)
+
bindingIncludes = set(self.getDeclarationFilename(d) for d in interfaceDeps)
# Grab all the implementation declaration files we need.
implementationIncludes = set(d.headerFile for d in descriptors if d.needsHeaderInclude())
# Grab the includes for checking hasInstance
interfacesImplementingSelf = set()
for d in descriptors: