mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 852219 part 6. Handle cases when the C++ class we want to actually inherit from is not the one that the WebIDL interface is mapped to. r=mccr8
This commit is contained in:
parent
c4a0a2468f
commit
d1d7bbfca7
@ -322,6 +322,7 @@ DOMInterfaces = {
|
||||
{
|
||||
'hasXPConnectImpls': True,
|
||||
'concrete': False,
|
||||
'jsImplParent': 'nsDOMEventTargetHelper'
|
||||
},
|
||||
{
|
||||
'workers': True,
|
||||
@ -1222,6 +1223,11 @@ DOMInterfaces = {
|
||||
'register': False
|
||||
},
|
||||
|
||||
'TestJSImplInterface4' : {
|
||||
'headerFile': 'TestJSImplGenBinding.h',
|
||||
'register': False
|
||||
},
|
||||
|
||||
'TestExternalInterface' : {
|
||||
'nativeType': 'mozilla::dom::TestExternalInterface',
|
||||
'headerFile': 'TestBindingHeader.h',
|
||||
|
@ -606,7 +606,7 @@ class CGHeaders(CGWrapper):
|
||||
jsParent = jsImplemented.interface.parent
|
||||
if jsParent:
|
||||
parentDesc = jsImplemented.getDescriptor(jsParent.identifier.name)
|
||||
declareIncludes.add(parentDesc.headerFile)
|
||||
declareIncludes.add(parentDesc.jsImplParentHeader)
|
||||
|
||||
# Let the machinery do its thing.
|
||||
def _includeString(includes):
|
||||
@ -8097,7 +8097,7 @@ class CGJSImplClass(CGBindingImplClass):
|
||||
|
||||
if descriptor.interface.parent:
|
||||
parentClass = descriptor.getDescriptor(
|
||||
descriptor.interface.parent.identifier.name).nativeType
|
||||
descriptor.interface.parent.identifier.name).jsImplParent
|
||||
baseClasses = [ClassBase(parentClass)]
|
||||
isupportsDecl = "NS_DECL_ISUPPORTS_INHERITED"
|
||||
ccDecl = ("NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(%s, %s)" %
|
||||
|
@ -211,6 +211,7 @@ class Descriptor(DescriptorProvider):
|
||||
nativeTypeDefault = "mozilla::dom::" + ifaceName
|
||||
|
||||
self.nativeType = desc.get('nativeType', nativeTypeDefault)
|
||||
self.jsImplParent = desc.get('jsImplParent', self.nativeType)
|
||||
|
||||
# Do something sane for JSObject
|
||||
if self.nativeType == "JSObject":
|
||||
@ -229,6 +230,10 @@ class Descriptor(DescriptorProvider):
|
||||
headerDefault = self.nativeType
|
||||
headerDefault = headerDefault.replace("::", "/") + ".h"
|
||||
self.headerFile = desc.get('headerFile', headerDefault)
|
||||
if self.jsImplParent == self.nativeType:
|
||||
self.jsImplParentHeader = self.headerFile
|
||||
else:
|
||||
self.jsImplParentHeader = self.jsImplParent.replace("::", "/") + ".h"
|
||||
|
||||
self.skipGen = desc.get('skipGen', False)
|
||||
|
||||
|
@ -11,3 +11,7 @@ interface TestJSImplInterface2 : TestCImplementedInterface {
|
||||
[Constructor, JSImplementation="@mozilla.org/test-js-impl-interface3;1"]
|
||||
interface TestJSImplInterface3 : TestCImplementedInterface2 {
|
||||
};
|
||||
|
||||
[Constructor, JSImplementation="@mozilla.org/test-js-impl-interface4;1"]
|
||||
interface TestJSImplInterface4 : EventTarget {
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user