Index: Source/bindings/scripts/CodeGeneratorV8.pm |
diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm |
index 4b2fba9bcb8f636dbbde4691ee16de1d73d6e015..17d2a4a9e0ee8d4fb0d69138101c551b41a6541b 100644 |
--- a/Source/bindings/scripts/CodeGeneratorV8.pm |
+++ b/Source/bindings/scripts/CodeGeneratorV8.pm |
@@ -3142,6 +3142,57 @@ END |
push(@normalAttributes, $attribute); |
} |
} |
+ |
+ # Generate DOMWindow Constructor attributes. |
+ if ($interfaceName eq "DOMWindow") { |
+ foreach my $otherInterface ($codeGenerator->GetAllInterfaces()) { |
+ my $otherInterfaceName = $otherInterface->name; |
+ if ($otherInterface->extendedAttributes->{"NoInterfaceObject"}) { |
+ next; |
+ } |
+ my $attribute = domAttribute->new(); |
+ $attribute->type("attribute"); |
+ $attribute->signature(domSignature->new()); |
+ $attribute->signature->type("${otherInterfaceName}Constructor"); |
+ |
+ if ($otherInterface->extendedAttributes->{"InterfaceName"}) { |
+ $attribute->signature->name($otherInterface->extendedAttributes->{"InterfaceName"}); |
+ } else { |
+ $attribute->signature->name($otherInterfaceName); |
+ } |
+ |
+ # In addition to the regular property, for every [NamedConstructor] extended attribute on an interface, |
+ # a corresponding property MUST exist on the ECMAScript global object. |
+ my $namedConstructorAttribute; |
+ if ($otherInterface->extendedAttributes->{"NamedConstructor"}) { |
+ $namedConstructorAttribute = domAttribute->new(); |
+ $namedConstructorAttribute->type("attribute"); |
+ $namedConstructorAttribute->signature(domSignature->new()); |
+ $namedConstructorAttribute->signature->type("${otherInterfaceName}ConstructorConstructor"); |
+ $namedConstructorAttribute->signature->name(@{$otherInterface->constructors}[0]->signature->extendedAttributes->{"NamedConstructor"}); |
+ } |
+ |
+ my $attrExtendedAttributeList = {}; |
+ if ($otherInterface->extendedAttributes->{"Conditional"}) { |
+ $attrExtendedAttributeList->{"Conditional"} = $otherInterface->extendedAttributes->{"Conditional"}; |
+ } |
+ if ($otherInterface->extendedAttributes->{"EnabledAtRuntime"}) { |
+ $attrExtendedAttributeList->{"EnabledAtRuntime"} = $otherInterface->extendedAttributes->{"EnabledAtRuntime"}; |
+ push(@enabledAtRuntimeAttributes, $attribute); |
+ push(@enabledAtRuntimeAttributes, $namedConstructorAttribute) if $namedConstructorAttribute; |
+ } elsif ($otherInterface->extendedAttributes->{"EnabledPerContext"}) { |
+ $attrExtendedAttributeList->{"EnabledPerContext"} = $otherInterface->extendedAttributes->{"EnabledPerContext"}; |
+ push(@enabledPerContextAttributes, $attribute); |
+ push(@enabledPerContextAttributes, $namedConstructorAttribute) if $namedConstructorAttribute; |
+ } else { |
+ push(@normalAttributes, $attribute); |
+ push(@normalAttributes, $namedConstructorAttribute) if $namedConstructorAttribute; |
+ } |
+ $attribute->signature->extendedAttributes($attrExtendedAttributeList); |
+ $namedConstructorAttribute->signature->extendedAttributes($attrExtendedAttributeList) if $namedConstructorAttribute; |
+ } |
+ } |
+ |
$attributes = \@normalAttributes; |
# Put the attributes that disallow shadowing on the shadow object. |
if (@disallowsShadowing) { |