Diff
Modified: trunk/Source/WebCore/ChangeLog (134848 => 134849)
--- trunk/Source/WebCore/ChangeLog 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/ChangeLog 2012-11-16 00:16:35 UTC (rev 134849)
@@ -1,3 +1,66 @@
+2012-11-15 Kentaro Hara <[email protected]>
+
+ Remove CodeGenerator::StripModule
+ https://bugs.webkit.org/show_bug.cgi?id=102338
+
+ Reviewed by Adam Barth.
+
+ Now WebKit IDL files have no modules. (The Web IDL spec has no modules.)
+ We can remove CodeGenerator::StripModule.
+ This might break some internal builds if the internal builds are still
+ using modules. Ping haraken@ you observe it.
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (ForAllParents):
+ (AttributeNameForGetterAndSetter):
+ (IsStrictSubtype):
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ (GetClassName):
+ (GetImplClassName):
+ (GetParentImplClassName):
+ (GetParent):
+ (ConversionNeeded):
+ (GetCPPTypeGetter):
+ (AddForwardDeclarationsForType):
+ (AddIncludesForType):
+ (GenerateImplementation):
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ (GetParentClassName):
+ (GetParentGObjType):
+ (GetClassName):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GetParentClassName):
+ (AddIncludesForTypeInImpl):
+ (AddIncludesForTypeInHeader):
+ (GenerateParametersCheckExpression):
+ (GenerateImplementation):
+ (GenerateParametersCheck):
+ (GetNativeTypeFromSignature):
+ (JSValueToNative):
+ (NativeToJSValue):
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ (GetClassName):
+ (GetImplClassName):
+ (GetParentImplClassName):
+ (GetParentAndProtocols):
+ (GetPropertyAttributes):
+ (ConversionNeeded):
+ (GetObjCTypeGetter):
+ (AddForwardDeclarationsForType):
+ (AddIncludesForType):
+ (GenerateImplementation):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (AddIncludesForType):
+ (GenerateHeader):
+ (IsSubType):
+ (GenerateSingleBatchedAttribute):
+ (GenerateImplementation):
+ (BaseInterfaceName):
+ (GetTypeFromSignature):
+ (IsWrapperType):
+
2012-11-15 Luke Macpherson <[email protected]>
Make assumptions about m_parentStyle consistent within StyleResolver::applyProperty()
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (134848 => 134849)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2012-11-16 00:16:35 UTC (rev 134849)
@@ -114,14 +114,6 @@
return $reference;
}
-sub StripModule($)
-{
- my $object = shift;
- my $name = shift;
- $name =~ s/[a-zA-Z0-9]*:://;
- return $name;
-}
-
sub ProcessDocument
{
my $object = shift;
@@ -187,7 +179,7 @@
my $interface = shift;
for (@{$interface->parents}) {
- my $interfaceName = $object->StripModule($_);
+ my $interfaceName = $_;
my $parentInterface = $object->ParseInterface($interfaceName, $parentsOnly);
if ($beforeRecursion) {
@@ -533,7 +525,7 @@
if ($attribute->signature->extendedAttributes->{"ImplementedAs"}) {
$attributeName = $attribute->signature->extendedAttributes->{"ImplementedAs"};
}
- my $attributeType = $generator->StripModule($attribute->signature->type);
+ my $attributeType = $attribute->signature->type;
# Avoid clash with C++ keyword.
$attributeName = "_operator" if $attributeName eq "operator";
@@ -707,7 +699,7 @@
$object->ForAllParents($dataNode, sub {
my $interface = shift;
- if ($object->StripModule($interface->name) eq $interfaceName) {
+ if ($interface->name eq $interfaceName) {
$found = 1;
}
return "prune" if $found;
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm (134848 => 134849)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm 2012-11-16 00:16:35 UTC (rev 134849)
@@ -137,7 +137,7 @@
sub GetClassName
{
- my $name = $codeGenerator->StripModule(shift);
+ my $name = shift;
# special cases
return "WebDOMString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue";
@@ -150,7 +150,7 @@
sub GetImplClassName
{
- return $codeGenerator->StripModule(shift);
+ return shift;
}
sub GetParentImplClassName
@@ -162,7 +162,7 @@
return "Object";
}
- return $codeGenerator->StripModule($dataNode->parents(0));
+ return $dataNode->parents(0);
}
sub GetParent
@@ -175,11 +175,11 @@
$parent = "WebDOMObject";
$parent = "WebDOMEventTarget" if $dataNode->extendedAttributes->{"EventTarget"};
} elsif ($numParents eq 1) {
- my $parentName = $codeGenerator->StripModule($dataNode->parents(0));
+ my $parentName = $dataNode->parents(0);
$parent = "WebDOM" . $parentName;
} else {
my @parents = @{$dataNode->parents};
- my $firstParent = $codeGenerator->StripModule(shift(@parents));
+ my $firstParent = shift(@parents);
$parent = "WebDOM" . $firstParent;
}
@@ -269,14 +269,14 @@
sub ConversionNeeded
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return !$codeGenerator->IsNonPointerType($type) && !$codeGenerator->IsStringType($type);
}
sub GetCPPTypeGetter
{
my $argName = shift;
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return $argName if $codeGenerator->IsPrimitiveType($type) or $codeGenerator->IsStringType($type);
return "static_cast<WebCore::Range::CompareHow>($argName)" if $type eq "CompareHow";
@@ -286,7 +286,7 @@
sub AddForwardDeclarationsForType
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
my $public = shift;
return if $codeGenerator->IsNonPointerType($type) or $codeGenerator->IsStringType($type);
@@ -297,7 +297,7 @@
sub AddIncludesForType
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return if $codeGenerator->GetSequenceType($type);
return if $codeGenerator->GetArrayType($type);
@@ -705,7 +705,7 @@
next if SkipAttribute($attribute);
AddIncludesForType($attribute->signature->type);
- my $idlType = $codeGenerator->StripModule($attribute->signature->type);
+ my $idlType = $attribute->signature->type;
my $attributeName = $attribute->signature->name;
my $attributeType = GetCPPType($attribute->signature->type, 0);
@@ -833,7 +833,7 @@
AddIncludesForType($param->type);
- my $idlType = $codeGenerator->StripModule($param->type);
+ my $idlType = $param->type;
my $implGetter = GetCPPTypeGetter($paramName, $idlType);
push(@parameterNames, $implGetter);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (134848 => 134849)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2012-11-16 00:16:35 UTC (rev 134849)
@@ -80,7 +80,7 @@
my $dataNode = shift;
return "WebKitDOMObject" if @{$dataNode->parents} eq 0;
- return "WebKitDOM" . $codeGenerator->StripModule($dataNode->parents(0));
+ return "WebKitDOM" . $dataNode->parents(0);
}
# From String::CamelCase 0.01
@@ -150,11 +150,11 @@
my $dataNode = shift;
return "WEBKIT_TYPE_DOM_OBJECT" if @{$dataNode->parents} eq 0;
- return "WEBKIT_TYPE_DOM_" . ClassNameToGObjectType($codeGenerator->StripModule($dataNode->parents(0)));
+ return "WEBKIT_TYPE_DOM_" . ClassNameToGObjectType($dataNode->parents(0));
}
sub GetClassName {
- my $name = $codeGenerator->StripModule(shift);
+ my $name = shift;
return "WebKitDOM$name";
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (134848 => 134849)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2012-11-16 00:16:35 UTC (rev 134849)
@@ -186,7 +186,7 @@
return $dataNode->extendedAttributes->{"JSLegacyParent"} if $dataNode->extendedAttributes->{"JSLegacyParent"};
return "JSDOMWrapper" if (@{$dataNode->parents} eq 0);
- return "JS" . $codeGenerator->StripModule($dataNode->parents(0));
+ return "JS" . $dataNode->parents(0);
}
sub GetCallbackClassName
@@ -206,7 +206,7 @@
sub AddIncludesForTypeInImpl
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
my $isCallback = @_ ? shift : 0;
AddIncludesForType($type, $isCallback, \%implIncludes);
@@ -233,7 +233,7 @@
sub AddIncludesForTypeInHeader
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
my $isCallback = @_ ? shift : 0;
AddIncludesForType($type, $isCallback, \%headerIncludes);
@@ -1288,7 +1288,7 @@
foreach my $parameter (@{$function->parameters}) {
last if $parameterIndex >= $numParameters;
my $value = "arg$parameterIndex";
- my $type = $codeGenerator->StripModule($parameter->type);
+ my $type = $parameter->type;
# Only DOMString or wrapper types are checked.
# For DOMString with StrictTypeChecking only Null, Undefined and Object
@@ -1833,7 +1833,7 @@
if ($numAttributes > 0) {
foreach my $attribute (@{$dataNode->attributes}) {
my $name = $attribute->signature->name;
- my $type = $codeGenerator->StripModule($attribute->signature->type);
+ my $type = $attribute->signature->type;
$codeGenerator->AssertNotSequenceType($type);
my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $attribute);
my $implGetterFunctionName = $codeGenerator->WK_lcfirst($name);
@@ -1884,7 +1884,7 @@
push(@implContent, " }\n");
push(@implContent, " return jsNull();\n");
} elsif ($attribute->signature->type =~ /Constructor$/) {
- my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
+ my $constructorType = $attribute->signature->type;
$constructorType =~ s/Constructor$//;
# When Constructor attribute is used by DOMWindow.idl, it's correct to pass castedThis as the global object
# When JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
@@ -2052,7 +2052,7 @@
foreach my $attribute (@{$dataNode->attributes}) {
if (!IsReadonly($attribute)) {
my $name = $attribute->signature->name;
- my $type = $codeGenerator->StripModule($attribute->signature->type);
+ my $type = $attribute->signature->type;
my $putFunctionName = GetAttributeSetterName($interfaceName, $className, $attribute);
my $implSetterFunctionName = $codeGenerator->WK_ucfirst($name);
@@ -2663,7 +2663,7 @@
$implIncludes{"JSDOMBinding.h"} = 1;
foreach my $parameter (@{$function->parameters}) {
- my $argType = $codeGenerator->StripModule($parameter->type);
+ my $argType = $parameter->type;
# Optional arguments with [Optional] should generate an early call with fewer arguments.
# Optional arguments with [Optional=...] should not generate the early call.
@@ -3032,7 +3032,7 @@
sub GetNativeTypeFromSignature
{
my $signature = shift;
- my $type = $codeGenerator->StripModule($signature->type);
+ my $type = $signature->type;
if ($type eq "unsigned long" and $signature->extendedAttributes->{"IsIndex"}) {
# Special-case index arguments because we need to check that they aren't < 0.
@@ -3143,7 +3143,7 @@
my $value = shift;
my $conditional = $signature->extendedAttributes->{"Conditional"};
- my $type = $codeGenerator->StripModule($signature->type);
+ my $type = $signature->type;
return "$value.toBoolean(exec)" if $type eq "boolean";
return "$value.toNumber(exec)" if $type eq "double";
@@ -3230,7 +3230,7 @@
my $thisValue = shift;
my $conditional = $signature->extendedAttributes->{"Conditional"};
- my $type = $codeGenerator->StripModule($signature->type);
+ my $type = $signature->type;
return "jsBoolean($value)" if $type eq "boolean";
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (134848 => 134849)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2012-11-16 00:16:35 UTC (rev 134849)
@@ -312,7 +312,7 @@
sub GetClassName
{
- my $name = $codeGenerator->StripModule(shift);
+ my $name = shift;
# special cases
return "NSString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue";
@@ -339,7 +339,7 @@
sub GetImplClassName
{
- my $name = $codeGenerator->StripModule(shift);
+ my $name = shift;
return "DOMImplementationFront" if $name eq "DOMImplementation";
return "DOMWindow" if $name eq "AbstractView";
@@ -352,7 +352,7 @@
return "Object" if @{$dataNode->parents} eq 0;
- my $parent = $codeGenerator->StripModule($dataNode->parents(0));
+ my $parent = $dataNode->parents(0);
# special cases
return "Object" if $parent eq "HTMLCollection";
@@ -375,7 +375,7 @@
$parent = "DOMObject";
}
} elsif ($numParents eq 1) {
- my $parentName = $codeGenerator->StripModule($dataNode->parents(0));
+ my $parentName = $dataNode->parents(0);
if ($isProtocol) {
die "Parents of protocols must also be protocols." unless IsProtocolType($parentName);
push(@protocols, "DOM" . $parentName);
@@ -390,7 +390,7 @@
}
} else {
my @parents = @{$dataNode->parents};
- my $firstParent = $codeGenerator->StripModule(shift(@parents));
+ my $firstParent = shift(@parents);
if (IsProtocolType($firstParent)) {
push(@protocols, "DOM" . $firstParent);
if (!$isProtocol) {
@@ -401,7 +401,6 @@
}
foreach my $parentName (@parents) {
- $parentName = $codeGenerator->StripModule($parentName);
die "Everything past the first class should be a protocol!" unless IsProtocolType($parentName);
push(@protocols, "DOM" . $parentName);
@@ -491,7 +490,7 @@
sub GetPropertyAttributes
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
my $readOnly = shift;
my @attributes = ();
@@ -513,7 +512,7 @@
sub ConversionNeeded
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return !$codeGenerator->IsNonPointerType($type) && !$codeGenerator->IsStringType($type) && !IsNativeObjCType($type);
}
@@ -521,7 +520,7 @@
sub GetObjCTypeGetter
{
my $argName = shift;
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return $argName if $codeGenerator->IsPrimitiveType($type) or $codeGenerator->IsStringType($type) or IsNativeObjCType($type);
return $argName . "Node" if $type eq "EventTarget";
@@ -539,7 +538,7 @@
sub AddForwardDeclarationsForType
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
my $public = shift;
return if $codeGenerator->IsNonPointerType($type);
@@ -563,7 +562,7 @@
sub AddIncludesForType
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return if $codeGenerator->IsNonPointerType($type);
return if $codeGenerator->GetSequenceType($type);
@@ -1175,7 +1174,7 @@
next if SkipAttribute($attribute);
AddIncludesForType($attribute->signature->type);
- my $idlType = $codeGenerator->StripModule($attribute->signature->type);
+ my $idlType = $attribute->signature->type;
my $attributeName = $attribute->signature->name;
my $attributeType = GetObjCType($attribute->signature->type);
@@ -1493,7 +1492,7 @@
AddIncludesForType($param->type);
- my $idlType = $codeGenerator->StripModule($param->type);
+ my $idlType = $param->type;
my $implGetter = GetObjCTypeGetter($paramName, $idlType);
push(@parameterNames, $implGetter);
@@ -1582,7 +1581,7 @@
# make a new parameter name if the original conflicts with a property name
$paramName = "in" . ucfirst($paramName) if $attributeNames{$paramName};
- my $idlType = $codeGenerator->StripModule($param->type);
+ my $idlType = $param->type;
next if not $codeGenerator->IsSVGTypeNeedingTearOff($idlType) or $implClassName =~ /List$/;
my $implGetter = GetObjCTypeGetter($paramName, $idlType);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (134848 => 134849)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-11-16 00:16:28 UTC (rev 134848)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-11-16 00:16:35 UTC (rev 134849)
@@ -137,7 +137,7 @@
sub AddIncludesForType
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
# When we're finished with the one-file-per-class
# reorganization, we won't need these special cases.
@@ -301,7 +301,7 @@
|| GetGenerateIsReachable($dataNode) || $className =~ /SVG/;
if (!$hasDependentLifetime) {
foreach (@{$dataNode->parents}) {
- my $parent = $codeGenerator->StripModule($_);
+ my $parent = $_;
$headerIncludes{"V8${parent}.h"} = 1;
}
}
@@ -366,7 +366,7 @@
# Let the compiler statically determine this for us.
my $separator = "";
foreach (@{$dataNode->parents}) {
- my $parent = $codeGenerator->StripModule($_);
+ my $parent = $_;
$headerIncludes{"V8${parent}.h"} = 1;
push(@headerContent, "${separator}V8${parent}::hasDependentLifetime");
$separator = " || ";
@@ -778,7 +778,7 @@
my $parentType = shift;
return 1 if ($dataNode->name eq $parentType);
foreach (@allParents) {
- my $parent = $codeGenerator->StripModule($_);
+ my $parent = $_;
return 1 if $parent eq $parentType;
}
return 0;
@@ -2333,7 +2333,7 @@
# Constructor
if ($attribute->signature->type =~ /Constructor$/) {
- my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
+ my $constructorType = $attribute->signature->type;
$constructorType =~ s/Constructor$//;
# $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
# We do not generate the header file for NamedConstructor of class XXXX,
@@ -2689,7 +2689,7 @@
my $parentClass = "";
my $parentClassTemplate = "";
foreach (@{$dataNode->parents}) {
- my $parent = $codeGenerator->StripModule($_);
+ my $parent = $_;
AddToImplIncludes("V8${parent}.h");
$parentClass = "V8" . $parent;
$parentClassTemplate = $parentClass . "::GetTemplate()";
@@ -3478,10 +3478,10 @@
my $dataNode = shift;
while (@{$dataNode->parents}) {
- $dataNode = $codeGenerator->ParseInterface($codeGenerator->StripModule(@{$dataNode->parents}[0]), 1);
+ $dataNode = $codeGenerator->ParseInterface(@{$dataNode->parents}[0], 1);
}
- return $codeGenerator->StripModule($dataNode->name);
+ return $dataNode->name;
}
sub GenerateToV8Converters
@@ -3675,7 +3675,7 @@
{
my $signature = shift;
- return $codeGenerator->StripModule($signature->type);
+ return $signature->type;
}
@@ -4029,7 +4029,7 @@
sub IsWrapperType
{
- my $type = $codeGenerator->StripModule(shift);
+ my $type = shift;
return !($non_wrapper_types{$type});
}