summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/scripts')
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm81
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorCPP.pm60
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorGObject.pm150
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm43
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorObjC.pm76
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm58
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp5
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h4
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp260
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h36
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp37
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp3
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp729
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h94
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestInterface.cpp62
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestInterface.h4
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp297
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.h32
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm5
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.h38
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm178
-rw-r--r--WebCore/bindings/scripts/test/TestInterface.idl1
-rw-r--r--WebCore/bindings/scripts/test/TestObj.idl24
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestCallback.cpp1
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.cpp4
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.h4
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp301
27 files changed, 2091 insertions, 496 deletions
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index 7c0f427..fbcee02 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -381,5 +381,86 @@ sub LinkOverloadedFunctions
}
}
+sub AttributeNameForGetterAndSetter
+{
+ my ($generator, $attribute) = @_;
+
+ my $attributeName = $attribute->signature->name;
+
+ # Avoid clash with C++ keyword.
+ $attributeName = "_operator" if $attributeName eq "operator";
+
+ # SVG animated types need to use a special attribute name.
+ # The rest of the special casing for SVG animated types is handled in the language-specific code generators.
+ $attributeName .= "Animated" if $generator->IsSVGAnimatedType($generator->StripModule($attribute->signature->type));
+
+ return $attributeName;
+}
+
+sub ContentAttributeName
+{
+ my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
+
+ my $contentAttributeName = $attribute->signature->extendedAttributes->{"Reflect"}
+ || $attribute->signature->extendedAttributes->{"ReflectURL"};
+ return undef if !$contentAttributeName;
+
+ $contentAttributeName = lc $generator->AttributeNameForGetterAndSetter($attribute) if $contentAttributeName eq "1";
+
+ my $namespace = $generator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
+
+ $implIncludes->{"${namespace}.h"} = 1;
+ return "WebCore::${namespace}::${contentAttributeName}Attr";
+}
+
+sub GetterExpressionPrefix
+{
+ my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
+
+ my $contentAttributeName = $generator->ContentAttributeName($implIncludes, $interfaceName, $attribute);
+
+ if (!$contentAttributeName) {
+ return $generator->WK_lcfirst($generator->AttributeNameForGetterAndSetter($attribute)) . "(";
+ }
+
+ my $functionName;
+ if ($attribute->signature->extendedAttributes->{"ReflectURL"}) {
+ $functionName = "getURLAttribute";
+ } elsif ($attribute->signature->type eq "boolean") {
+ $functionName = "hasAttribute";
+ } elsif ($attribute->signature->type eq "long") {
+ $functionName = "getIntegralAttribute";
+ } elsif ($attribute->signature->type eq "unsigned long") {
+ $functionName = "getUnsignedIntegralAttribute";
+ } else {
+ $functionName = "getAttribute";
+ }
+
+ return "$functionName($contentAttributeName"
+}
+
+sub SetterExpressionPrefix
+{
+ my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
+
+ my $contentAttributeName = $generator->ContentAttributeName($implIncludes, $interfaceName, $attribute);
+
+ if (!$contentAttributeName) {
+ return "set" . $generator->WK_ucfirst($generator->AttributeNameForGetterAndSetter($attribute)) . "(";
+ }
+
+ my $functionName;
+ if ($attribute->signature->type eq "boolean") {
+ $functionName = "setBooleanAttribute";
+ } elsif ($attribute->signature->type eq "long") {
+ $functionName = "setIntegralAttribute";
+ } elsif ($attribute->signature->type eq "unsigned long") {
+ $functionName = "setUnsignedIntegralAttribute";
+ } else {
+ $functionName = "setAttribute";
+ }
+
+ return "$functionName($contentAttributeName, "
+}
1;
diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index f441b0e..7df91ca 100644
--- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -145,7 +145,6 @@ sub GetClassName
# special cases
return "WebDOMString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue";
- return "WebDOMAbstractView" if $name eq "DOMWindow";
return "WebDOMObject" if $name eq "DOMObject";
return "bool" if $name eq "boolean";
return $name if $codeGenerator->IsPrimitiveType($name);
@@ -155,10 +154,7 @@ sub GetClassName
sub GetImplClassName
{
- my $name = $codeGenerator->StripModule(shift);
-
- return "DOMWindow" if $name eq "AbstractView";
- return $name;
+ return $codeGenerator->StripModule(shift);
}
sub GetParentImplClassName
@@ -203,7 +199,8 @@ sub ShouldSkipTypeInImplementation
return 1 if $typeInfo->signature->extendedAttributes->{"CustomArgumentHandling"}
or $typeInfo->signature->extendedAttributes->{"CustomGetter"}
- or $typeInfo->signature->extendedAttributes->{"NeedsUserGestureCheck"};
+ or $typeInfo->signature->extendedAttributes->{"NeedsUserGestureCheck"}
+ or $typeInfo->signature->extendedAttributes->{"CPPCustom"};
# FIXME: We don't generate bindings for SVG related interfaces yet
return 1 if $typeInfo->signature->name =~ /getSVGDocument/;
@@ -297,12 +294,6 @@ sub AddIncludesForType
return;
}
- if ($type eq "DOMWindow") {
- $implIncludes{"DOMWindow.h"} = 1;
- $implIncludes{"WebDOMAbstractView.h"} = 1;
- return;
- }
-
if ($type eq "EventListener") {
$implIncludes{"WebNativeEventListener.h"} = 1;
return;
@@ -388,12 +379,12 @@ sub GenerateHeader
push(@headerContent, " explicit $className($implClassNameWithNamespace*);\n");
# Copy constructor on classes which have the d-ptr
- if (@{$dataNode->parents} eq 0) {
+ if ($parentName eq "WebDOMObject") {
push(@headerContent, " $className(const $className&);\n");
}
# Destructor
- if (@{$dataNode->parents} eq 0) {
+ if ($parentName eq "WebDOMObject") {
push(@headerContent, " ~$className();\n");
}
@@ -505,7 +496,7 @@ sub GenerateHeader
push(@headerContent, "\n");
push(@headerContent, " $implClassNameWithNamespace* impl() const;\n");
- if (@{$dataNode->parents} eq 0) {
+ if ($parentName eq "WebDOMObject") {
push(@headerContent, "\nprotected:\n");
push(@headerContent, " struct ${className}Private;\n");
push(@headerContent, " ${className}Private* m_impl;\n");
@@ -607,7 +598,7 @@ sub GenerateImplementation
push(@implContent, "#include <wtf/RefPtr.h>\n\n");
# Private datastructure, encapsulating WebCore types
- if (@{$dataNode->parents} eq 0) {
+ if ($baseClass eq "WebDOMObject") {
push(@implContent, "struct ${className}::${className}Private {\n");
push(@implContent, " ${className}Private($implClassNameWithNamespace* object = 0)\n");
push(@implContent, " : impl(object)\n");
@@ -620,12 +611,12 @@ sub GenerateImplementation
# Constructor
push(@implContent, "${className}::$className()\n");
push(@implContent, " : ${baseClass}()\n");
- push(@implContent, " , m_impl(0)\n") if (@{$dataNode->parents} eq 0);
+ push(@implContent, " , m_impl(0)\n") if ($baseClass eq "WebDOMObject");
push(@implContent, "{\n");
push(@implContent, "}\n\n");
push(@implContent, "${className}::$className($implClassNameWithNamespace* impl)\n");
- if (@{$dataNode->parents} eq 0) {
+ if ($baseClass eq "WebDOMObject") {
push(@implContent, " : ${baseClass}()\n");
push(@implContent, " , m_impl(new ${className}Private(impl))\n");
push(@implContent, "{\n");
@@ -679,18 +670,7 @@ sub GenerateImplementation
# - GETTER
my $getterSig = "$attributeType $className\:\:$attributeName() const\n";
my $hasGetterException = @{$attribute->getterExceptions};
- my $getterContentHead;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterContentHead = "impl()->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr";
- } else {
- $getterContentHead = "impl()->" . $codeGenerator->WK_lcfirst($attributeName) . "(";
- }
+ my $getterContentHead = "impl()->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
my $getterContentTail = ")";
# Special cases
@@ -698,8 +678,6 @@ sub GenerateImplementation
if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$getterContentHead = "WebCore::String::number(" . $getterContentHead;
$getterContentTail .= ")";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $getterContentTail .= ".toInt()";
} elsif ($attribute->signature->type eq "SerializedScriptValue") {
$getterContentHead = "$getterContentHead";
$getterContentTail .= "->toString()";
@@ -750,10 +728,8 @@ sub GenerateImplementation
my $argName = "new" . ucfirst($attributeName);
my $arg = GetCPPTypeGetter($argName, $idlType);
- # The definition of ConvertFromString and ConvertToString is flipped for the setter
- if ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $arg = "WebCore::String::number($arg)";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
+ # The definition of ConvertToString is flipped for the setter
+ if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$arg = "WebCore::String($arg).toInt()";
}
@@ -762,18 +738,10 @@ sub GenerateImplementation
push(@implContent, "{\n");
push(@implContent, AddEarlyReturnStatement());
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
push(@implContent, " $exceptionInit\n") if $hasSetterException;
my $ec = $hasSetterException ? ", ec" : "";
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContent, " impl()->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, $arg$ec);\n");
- } else {
- push(@implContent, " impl()->$coreSetterName($arg$ec);\n");
- }
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+ push(@implContent, " impl()->$setterExpressionPrefix$arg$ec);\n");
push(@implContent, " $exceptionRaiseOnError\n") if $hasSetterException;
push(@implContent, "}\n\n");
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index e98c661..ef2a125 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -301,11 +301,29 @@ sub GetWriteableProperties {
return @result;
}
+sub GenerateConditionalString
+{
+ my $node = shift;
+ my $conditional = $node->extendedAttributes->{"Conditional"};
+ if ($conditional) {
+ if ($conditional =~ /&/) {
+ return "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
+ } elsif ($conditional =~ /\|/) {
+ return "ENABLE(" . join(") || ENABLE(", split(/\|/, $conditional)) . ")";
+ } else {
+ return "ENABLE(" . $conditional . ")";
+ }
+ } else {
+ return "";
+ }
+}
+
sub GenerateProperty {
my $attribute = shift;
my $interfaceName = shift;
my @writeableProperties = @{shift @_};
+ my $conditionalString = GenerateConditionalString($attribute->signature);
my $camelPropName = $attribute->signature->name;
my $setPropNameFunction = $codeGenerator->WK_ucfirst($camelPropName);
my $getPropNameFunction = $codeGenerator->WK_lcfirst($camelPropName);
@@ -314,7 +332,9 @@ sub GenerateProperty {
my $propNameCaps = uc($propName);
$propName =~ s/_/-/g;
my ${propEnum} = "PROP_${propNameCaps}";
+ push(@cBodyPriv, "#if ${conditionalString}\n") if $conditionalString;
push(@cBodyPriv, " ${propEnum},\n");
+ push(@cBodyPriv, "#endif /* ${conditionalString} */\n") if $conditionalString;
my $propType = $attribute->signature->type;
my ${propGType} = decamelize($propType);
@@ -341,35 +361,26 @@ sub GenerateProperty {
my $convertFunction = "";
if ($gtype eq "string") {
$convertFunction = "WebCore::String::fromUTF8";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $convertFunction = "WebCore::String::number";
}
- my $setterContentHead;
- my $getterContentHead;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $camelPropName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $setterContentHead = "coreSelf->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, ${convertFunction}(g_value_get_$gtype(value))";
- $getterContentHead = "coreSelf->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr";
- } else {
- $setterContentHead = "coreSelf->set${setPropNameFunction}(${convertFunction}(g_value_get_$gtype(value))";
- $getterContentHead = "coreSelf->${getPropNameFunction}(";
- }
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+
+ my $getterContentHead = "coreSelf->$getterExpressionPrefix";
+ my $setterContentHead = "coreSelf->$setterExpressionPrefix${convertFunction}(g_value_get_$gtype(value))";
if (grep {$_ eq $attribute} @writeableProperties) {
+ push(@txtSetProps, "#if ${conditionalString}\n") if $conditionalString;
push(@txtSetProps, " case ${propEnum}:\n {\n");
push(@txtSetProps, " WebCore::ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
push(@txtSetProps, " ${setterContentHead}");
push(@txtSetProps, ", ec") if @{$attribute->setterExceptions};
push(@txtSetProps, ");\n");
push(@txtSetProps, " break;\n }\n");
+ push(@txtSetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
}
+ push(@txtGetProps, "#if ${conditionalString}\n") if $conditionalString;
push(@txtGetProps, " case ${propEnum}:\n {\n");
my $exception = "";
@@ -392,17 +403,6 @@ EOF
$done = 1;
}
- if($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- # TODO: Add other conversion functions for different types. Current
- # IDLs only list longs.
- if($gtype eq "long") {
- $convertFunction = "";
- $postConvertFunction = ".toInt()";
- } else {
- die "Can't convert to type ${gtype}.";
- }
- }
-
# FIXME: get rid of this glitch?
my $_gtype = $gtype;
if ($gtype eq "ushort") {
@@ -410,10 +410,11 @@ EOF
}
if (!$done) {
- push(@txtGetProps, " g_value_set_$_gtype(value, ${convertFunction}coreSelf->${getPropNameFunction}(${exception})${postConvertFunction});\n");
+ push(@txtGetProps, " g_value_set_$_gtype(value, ${convertFunction}coreSelf->${getterExpressionPrefix}${exception})${postConvertFunction});\n");
}
push(@txtGetProps, " break;\n }\n");
+ push(@txtGetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
my %param_spec_options = ("int", "G_MININT, /* min */\nG_MAXINT, /* max */\n0, /* default */",
"boolean", "FALSE, /* default */",
@@ -439,7 +440,9 @@ EOF
$param_spec_options{$gtype}
${gparamflag}));
EOF
+ push(@txtInstallProps, "#if ${conditionalString}\n") if $conditionalString;
push(@txtInstallProps, $txtInstallProp);
+ push(@txtInstallProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
}
my %breakWords = ("before" => 1, "can" => 1, "context" => 1, "dbl" => 1, "drag" => 1,
@@ -755,10 +758,11 @@ sub GenerateFunction {
}
my $functionSigName = $function->signature->name;
- my $functionSigType = $function->signature->type;
+ my $functionSigType = $prefix eq "set_" ? "void" : $function->signature->type;
my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($functionSigName);
my $returnType = GetGlibTypeName($functionSigType);
my $returnValueIsGDOMType = IsGDOMClassType($functionSigType);
+ my $conditionalString = GenerateConditionalString($function->signature);
my $functionSig = "${className}* self";
@@ -788,7 +792,7 @@ sub GenerateFunction {
}
}
if ($paramIsGDOMType || ($paramIDLType eq "DOMString") || ($paramIDLType eq "CompareHow")) {
- $paramName = "_g_" . $paramName;
+ $paramName = "converted_" . $paramName;
}
if ($callImplParams) {
$callImplParams .= ", $paramName";
@@ -812,7 +816,12 @@ sub GenerateFunction {
$functionSig .= ", GError **error";
}
- push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n\n");
+ push(@hBody, "#if ${conditionalString}\n") if $conditionalString;
+ push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n");
+ push(@hBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
+ push(@hBody, "\n");
+
+ push(@cBody, "#if ${conditionalString}\n") if $conditionalString;
push(@cBody, "$returnType\n$functionName($functionSig)\n{\n");
if ($conditionalMethods{$functionName}) {
@@ -821,9 +830,9 @@ sub GenerateFunction {
if ($returnType ne "void") {
# TODO: return proper default result
- push(@cBody, " g_return_val_if_fail (self, 0);\n");
+ push(@cBody, " g_return_val_if_fail(self, 0);\n");
} else {
- push(@cBody, " g_return_if_fail (self);\n");
+ push(@cBody, " g_return_if_fail(self);\n");
}
# The WebKit::core implementations check for NULL already; no need to
@@ -838,9 +847,9 @@ sub GenerateFunction {
if (!$paramTypeIsPrimitive) {
if ($returnType ne "void") {
# TODO: return proper default result
- push(@cBody, " g_return_val_if_fail ($paramName, 0);\n");
+ push(@cBody, " g_return_val_if_fail($paramName, 0);\n");
} else {
- push(@cBody, " g_return_if_fail ($paramName);\n");
+ push(@cBody, " g_return_if_fail($paramName);\n");
}
}
}
@@ -852,19 +861,19 @@ sub GenerateFunction {
my $paramIsGDOMType = IsGDOMClassType($paramIDLType);
if ($paramIDLType eq "DOMString") {
- push(@cBody, " WebCore::String _g_${paramName} = WebCore::String::fromUTF8($paramName);\n");
+ push(@cBody, " WebCore::String converted_${paramName} = WebCore::String::fromUTF8($paramName);\n");
} elsif ($paramIDLType eq "CompareHow") {
- push(@cBody, " WebCore::Range::CompareHow _g_${paramName} = static_cast<WebCore::Range::CompareHow>($paramName);\n");
+ push(@cBody, " WebCore::Range::CompareHow converted_${paramName} = static_cast<WebCore::Range::CompareHow>($paramName);\n");
} elsif ($paramIsGDOMType) {
- push(@cBody, " WebCore::${paramIDLType} * _g_${paramName} = WebKit::core($paramName);\n");
+ push(@cBody, " WebCore::${paramIDLType} * converted_${paramName} = WebKit::core($paramName);\n");
if ($returnType ne "void") {
# TODO: return proper default result
- push(@cBody, " g_return_val_if_fail (_g_${paramName}, 0);\n");
+ push(@cBody, " g_return_val_if_fail(converted_${paramName}, 0);\n");
} else {
- push(@cBody, " g_return_if_fail (_g_${paramName});\n");
+ push(@cBody, " g_return_if_fail(converted_${paramName});\n");
}
}
- $returnParamName = "_g_".$paramName if $param->extendedAttributes->{"Return"};
+ $returnParamName = "converted_".$paramName if $param->extendedAttributes->{"Return"};
}
my $assign = "";
@@ -923,35 +932,25 @@ EOF
return;
} elsif ($functionSigType eq "DOMString") {
my $getterContentHead;
- my $reflect = $function->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $function->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $functionSigName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterContentHead = "${assign}convertToUTF8String(item->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr));\n";
+ if ($prefix) {
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $function);
+ $getterContentHead = "${assign}convertToUTF8String(item->$getterExpressionPrefix${exceptions}));\n";
} else {
$getterContentHead = "${assign}convertToUTF8String(item->${functionSigName}(${callImplParams}${exceptions}));\n";
}
-
push(@cBody, " ${getterContentHead}");
} else {
- my $setterContentHead;
- my $reflect = $function->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $function->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $functionSigName : ($reflect || $reflectURL);
- $contentAttributeName =~ s/set//;
- $contentAttributeName = $codeGenerator->WK_lcfirst($contentAttributeName);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- $setterContentHead = "${assign}${assignPre}item->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, ${callImplParams}${exceptions}${assignPost});\n";
+ my $contentHead;
+ if ($prefix eq "get_") {
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $function);
+ $contentHead = "${assign}${assignPre}item->$getterExpressionPrefix${callImplParams}${exceptions}${assignPost});\n";
+ } elsif ($prefix eq "set_") {
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $function);
+ $contentHead = "${assign}${assignPre}item->$setterExpressionPrefix${callImplParams}${exceptions}${assignPost});\n";
} else {
- $setterContentHead = "${assign}${assignPre}item->${functionSigName}(${callImplParams}${exceptions}${assignPost});\n";
+ $contentHead = "${assign}${assignPre}item->${functionSigName}(${callImplParams}${exceptions}${assignPost});\n";
}
-
- push(@cBody, " ${setterContentHead}");
+ push(@cBody, " ${contentHead}");
if(@{$function->raisesExceptions}) {
my $exceptionHandling = << "EOF";
@@ -982,7 +981,9 @@ EOF
push(@cBody, "#endif\n");
}
- push(@cBody, "}\n\n");
+ push(@cBody, "}\n");
+ push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
+ push(@cBody, "\n");
}
sub ClassHasFunction {
@@ -1014,7 +1015,6 @@ sub GenerateFunctions {
# This will conflict with the get_type() function we define to return a GType
# according to GObject conventions. Skip this for now.
|| $attribute->signature->name eq "URL" # TODO: handle this
- || $attribute->signature->extendedAttributes->{"ConvertFromString"} # TODO: handle this
) {
next TOP;
}
@@ -1044,8 +1044,8 @@ sub GenerateFunctions {
$function = new domFunction();
$function->signature(new domSignature());
- $function->signature->name($setname);
- $function->signature->type("void");
+ $function->signature->name($attribute->signature->name);
+ $function->signature->type($attribute->signature->type);
$function->signature->extendedAttributes($attribute->signature->extendedAttributes);
my $param = new domSignature();
@@ -1058,7 +1058,7 @@ sub GenerateFunctions {
$function->raisesExceptions($attribute->setterExceptions);
- $object->GenerateFunction($interfaceName, $function, "");
+ $object->GenerateFunction($interfaceName, $function, "set_");
}
}
@@ -1128,7 +1128,7 @@ sub GenerateEndHeader {
my $guard = $className . "_h";
push(@hBody, "G_END_DECLS\n\n");
- push(@hBody, "#endif /* $guard */\n");
+ push(@hPrefixGuardEnd, "#endif /* $guard */\n");
}
sub GeneratePrivateHeader {
@@ -1189,7 +1189,7 @@ EOF
#endif /* ${guard} */
EOF
print PRIVHEADER $text;
-
+
close(PRIVHEADER);
}
@@ -1248,6 +1248,11 @@ sub Generate {
my $parentGObjType = GetParentGObjType($dataNode);
my $interfaceName = $dataNode->name;
+ # Add the guard if the 'Conditional' extended attribute exists
+ my $conditionalString = GenerateConditionalString($dataNode);
+ push(@conditionGuardStart, "#if ${conditionalString}\n\n") if $conditionalString;
+ push(@conditionGuardEnd, "#endif /* ${conditionalString} */\n") if $conditionalString;
+
# Add the default impl header template
@cPrefix = split("\r", $licenceTemplate);
push(@cPrefix, "\n");
@@ -1308,6 +1313,7 @@ sub WriteData {
print HEADER "\n";
print HEADER @hBodyPre;
print HEADER @hBody;
+ print HEADER @hPrefixGuardEnd;
close(HEADER);
@@ -1318,6 +1324,7 @@ sub WriteData {
print IMPL @cPrefix;
print IMPL "#include <glib-object.h>\n";
print IMPL "#include \"config.h\"\n\n";
+ print IMPL @conditionGuardStart;
print IMPL "#include <wtf/GetPtr.h>\n";
print IMPL "#include <wtf/RefPtr.h>\n";
print IMPL map { "#include \"$_\"\n" } sort keys(%implIncludes);
@@ -1326,6 +1333,7 @@ sub WriteData {
print IMPL "\n";
print IMPL @cBodyPriv;
+ print IMPL @conditionGuardEnd;
close(IMPL);
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index c3521bf..4e2e911 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
@@ -1170,7 +1170,7 @@ END
push(@implContent, " return ${functionName}$overload->{overloadIndex}(exec);\n");
}
push(@implContent, <<END);
- return JSValue::encode(throwTypeError(exec));
+ return throwVMTypeError(exec);
}
END
@@ -1570,20 +1570,9 @@ sub GenerateImplementation
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName()", "castedThis") . ";\n");
}
} else {
+ my $getterExpression = "imp->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute) . ")";
+ my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion, $getterExpression, "castedThis");
push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n");
- my $value;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $name : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $value = "imp->$getAttributeFunctionName(${namespace}::${contentAttributeName}Attr)"
- } else {
- $value = "imp->$implGetterFunctionName()";
- }
- my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion, $value, "castedThis");
if ($codeGenerator->IsSVGAnimatedType($type)) {
push(@implContent, " RefPtr<$type> obj = $jsType;\n");
push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n");
@@ -1734,17 +1723,10 @@ sub GenerateImplementation
push(@implContent, " imp->commitChange(podImp, castedThis);\n");
} else {
my $nativeValue = JSValueToNative($attribute->signature, "value");
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+
push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $name : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContent, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, $nativeValue");
- } else {
- push(@implContent, " imp->set$implSetterFunctionName($nativeValue");
- }
+ push(@implContent, " imp->$setterExpressionPrefix$nativeValue");
push(@implContent, ", ec") if @{$attribute->setterExceptions};
push(@implContent, ");\n");
push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
@@ -2330,7 +2312,7 @@ sub JSValueToNative
return "static_cast<SVGPaint::SVGPaintType>($value.toInt32(exec))" if $type eq "SVGPaintType";
if ($type eq "DOMString") {
- return "valueToStringWithNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertNullToNullString"};
+ return "valueToStringWithNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertNullToNullString"} || $signature->extendedAttributes->{"Reflect"} || $signature->extendedAttributes->{"ReflectURL"};
return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"};
return "ustringToString($value.toString(exec))";
}
@@ -2424,13 +2406,6 @@ sub NativeToJSValue
}
}
- if ($codeGenerator->IsSVGAnimatedType($type)) {
- # Some SVGFE*Element.idl use 'operator' as attribute name, rewrite as '_operator' to avoid clashes with C/C++
- $value =~ s/operator\(\)/_operator\(\)/ if ($value =~ /operator/);
- $value =~ s/\(\)//;
- $value .= "Animated()";
- }
-
if ($type eq "CSSStyleDeclaration") {
$implIncludes{"CSSMutableStyleDeclaration.h"} = 1;
}
@@ -2766,6 +2741,7 @@ sub GenerateConstructorDefinition
my $canConstruct = $dataNode->extendedAttributes->{"CanBeConstructed"};
my $customConstructFunction = $dataNode->extendedAttributes->{"CustomConstructFunction"};
my $callWith = $dataNode->extendedAttributes->{"CallWith"};
+ my $numberOfconstructParameters = $dataNode->extendedAttributes->{"ConstructorParameters"};
push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", 0, &${constructorClassName}Table, 0 };\n\n");
@@ -2773,6 +2749,7 @@ sub GenerateConstructorDefinition
push(@$outputArray, " : DOMConstructorObject(${constructorClassName}::createStructure(globalObject->objectPrototype()), globalObject)\n");
push(@$outputArray, "{\n");
push(@$outputArray, " putDirect(exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n");
+ push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(exec, ${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;
push(@$outputArray, "}\n\n");
push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index daead72..7d66979 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) 2010 Google Inc.
#
@@ -793,6 +793,12 @@ sub GenerateHeader
push(@headerAttributes, $property) if $public;
push(@privateHeaderAttributes, $property) unless $public;
} else {
+ my $attributeConditionalString = GenerateConditionalString($attribute->signature);
+ if ($attributeConditionalString) {
+ push(@headerAttributes, "#if ${attributeConditionalString}\n") if $public;
+ push(@privateHeaderAttributes, "#if ${attributeConditionalString}\n") unless $public;
+ }
+
# - GETTER
my $getter = "- (" . $attributeType . ")" . $attributeName . $declarationSuffix;
push(@headerAttributes, $getter) if $public;
@@ -804,6 +810,11 @@ sub GenerateHeader
push(@headerAttributes, $setter) if $public;
push(@privateHeaderAttributes, $setter) unless $public;
}
+
+ if ($attributeConditionalString) {
+ push(@headerAttributes, "#endif\n") if $public;
+ push(@privateHeaderAttributes, "#endif\n") unless $public;
+ }
}
}
@@ -1164,13 +1175,9 @@ sub GenerateImplementation
} elsif ($attributeName eq "frame") {
# Special case attribute frame to be frameBorders.
$attributeInterfaceName .= "Borders";
- } elsif ($attributeName eq "ownerDocument") {
- # FIXME: for now special case attribute ownerDocument to call document, this is incorrect
- # legacy behavior. (see http://bugs.webkit.org/show_bug.cgi?id=10889)
- $attributeName = "document";
- } elsif ($codeGenerator->IsSVGAnimatedType($idlType)) {
- # Special case for animated types.
- $attributeName .= "Animated";
+ } elsif ($attributeName eq "operator") {
+ # Avoid clash with C++ keyword.
+ $attributeInterfaceName = "_operator";
}
$attributeNames{$attributeInterfaceName} = 1;
@@ -1178,23 +1185,14 @@ sub GenerateImplementation
# - GETTER
my $getterSig = "- ($attributeType)$attributeInterfaceName\n";
- # Some SVGFE*Element.idl use 'operator' as attribute name, rewrite as '_operator' to avoid clashes with C/C++
- $attributeName =~ s/operatorAnimated/_operatorAnimated/ if ($attributeName =~ /operatorAnimated/);
- $getterSig =~ s/operator/_operator/ if ($getterSig =~ /operator/);
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+
+ # FIXME: Special case attribute ownerDocument to call document. This makes it return the
+ # document when called on the document itself. Legacy behavior, see <https://bugs.webkit.org/show_bug.cgi?id=10889>.
+ $getterExpressionPrefix =~ s/\bownerDocument\b/document/;
my $hasGetterException = @{$attribute->getterExceptions};
- my $getterContentHead;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterContentHead = "IMPL->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr";
- } else {
- $getterContentHead = "IMPL->" . $codeGenerator->WK_lcfirst($attributeName) . "(";
- }
+ my $getterContentHead = "IMPL->$getterExpressionPrefix";
my $getterContentTail = ")";
# Special case for DOMSVGNumber
@@ -1245,8 +1243,6 @@ sub GenerateImplementation
} elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$getterContentHead = "WebCore::String::number(" . $getterContentHead;
$getterContentTail .= ")";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $getterContentTail .= ".toInt()";
} elsif ($codeGenerator->IsPodType($idlType) or $idlType eq "Date") {
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
@@ -1271,6 +1267,8 @@ sub GenerateImplementation
$getterContent = $getterContentHead . $getterContentTail;
}
+ my $attributeConditionalString = GenerateConditionalString($attribute->signature);
+ push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
push(@implContent, $getterSig);
push(@implContent, "{\n");
push(@implContent, " $jsContextSetter\n");
@@ -1291,7 +1289,7 @@ sub GenerateImplementation
} else {
push(@implContent, " return $getterContent;\n");
}
- push(@implContent, "}\n\n");
+ push(@implContent, "}\n");
# - SETTER
if (!$attributeIsReadonly) {
@@ -1303,15 +1301,14 @@ sub GenerateImplementation
my $argName = "new" . ucfirst($attributeInterfaceName);
my $arg = GetObjCTypeGetter($argName, $idlType);
- # The definition of ConvertFromString and ConvertToString is flipped for the setter
- if ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $arg = "WebCore::String::number($arg)";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
+ # The definition of ConvertToString is flipped for the setter
+ if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$arg = "WebCore::String($arg).toInt()";
}
my $setterSig = "- (void)$setterName:($attributeType)$argName\n";
+ push(@implContent, "\n");
push(@implContent, $setterSig);
push(@implContent, "{\n");
push(@implContent, " $jsContextSetter\n");
@@ -1332,23 +1329,18 @@ sub GenerateImplementation
push(@implContent, " IMPL->$coreSetterName($arg);\n");
}
} else {
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- push(@implContent, " $exceptionInit\n") if $hasSetterException;
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
my $ec = $hasSetterException ? ", ec" : "";
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContent, " IMPL->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, $arg$ec);\n");
- } else {
- push(@implContent, " IMPL->$coreSetterName($arg$ec);\n");
- }
+ push(@implContent, " $exceptionInit\n") if $hasSetterException;
+ push(@implContent, " IMPL->$setterExpressionPrefix$arg$ec);\n");
push(@implContent, " $exceptionRaiseOnError\n") if $hasSetterException;
}
- push(@implContent, "}\n\n");
+ push(@implContent, "}\n");
}
+
+ push(@implContent, "#endif\n") if $attributeConditionalString;
+ push(@implContent, "\n");
}
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index e471500..e249caa 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -677,7 +677,7 @@ END
my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
if ($getterStringUsesImp && $reflect && IsNodeSubType($dataNode) && $codeGenerator->IsStringType($attrType)) {
# Generate super-compact call for regular attribute getter:
- my $contentAttributeName = $reflect eq "1" ? $attrName : $reflect;
+ my $contentAttributeName = $reflect eq "1" ? lc $attrName : $reflect;
my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
$implIncludes{"${namespace}.h"} = 1;
push(@implContentDecls, " return getElementStringAttr(info, ${namespace}::${contentAttributeName}Attr);\n");
@@ -708,34 +708,13 @@ END
$attrName = $attribute->signature->extendedAttributes->{"v8referenceattr"};
}
- my $getterFunc = $codeGenerator->WK_lcfirst($attrName);
-
- if ($codeGenerator->IsSVGAnimatedType($attribute->signature->type)) {
- # Some SVGFE*Element.idl use 'operator' as attribute name; rewrite as '_operator' to avoid clashes with C/C++
- $getterFunc = "_" . $getterFunc if ($attrName =~ /operator/);
- $getterFunc .= "Animated";
- }
-
my $returnType = GetTypeFromSignature($attribute->signature);
my $getterString;
if ($getterStringUsesImp) {
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? $attrName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterString = "imp->$getAttributeFunctionName(${namespace}::${contentAttributeName}Attr";
- } else {
- $getterString = "imp->$getterFunc(";
- }
+ $getterString = "imp->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
$getterString .= "ec" if $useExceptions;
$getterString .= ")";
- if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $getterString .= ".toInt()";
- }
} else {
$getterString = "impInstance";
}
@@ -887,7 +866,7 @@ END
my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
if (($reflect || $reflectURL) && IsNodeSubType($dataNode) && $codeGenerator->IsStringType($attrType)) {
# Generate super-compact call for regular attribute setter:
- my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? $attrName : ($reflect || $reflectURL);
+ my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? lc $attrName : ($reflect || $reflectURL);
my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
$implIncludes{"${namespace}.h"} = 1;
push(@implContentDecls, " setElementStringAttr(info, ${namespace}::${contentAttributeName}Attr, value);\n");
@@ -912,14 +891,7 @@ END
push(@implContentDecls, " $nativeType v = " . JSValueToNative($attribute->signature, "value") . ";\n");
}
- my $result = "";
- if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $result .= "WebCore::String::number(";
- }
- $result .= "v";
- if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $result .= ")";
- }
+ my $result = "v";
my $returnType = GetTypeFromSignature($attribute->signature);
if (IsRefPtrType($returnType)) {
$result = "WTF::getPtr(" . $result . ")";
@@ -935,15 +907,8 @@ END
if ($implClassName eq "float") {
push(@implContentDecls, " *imp = $result;\n");
} else {
- my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName);
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? $attrName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContentDecls, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, $result");
- } elsif ($attribute->signature->type eq "EventListener") {
+ if ($attribute->signature->type eq "EventListener") {
+ my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName);
$implIncludes{"V8AbstractEventListener.h"} = 1;
push(@implContentDecls, " transferHiddenDependency(info.Holder(), imp->$attrName(), value, V8${interfaceName}::eventListenerCacheIndex);\n");
if ($interfaceName eq "WorkerContext" and $attribute->signature->name eq "onerror") {
@@ -954,7 +919,8 @@ END
push(@implContentDecls, " imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)");
}
} else {
- push(@implContentDecls, " imp->set$implSetterFunctionName($result");
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+ push(@implContentDecls, " imp->$setterExpressionPrefix$result");
}
push(@implContentDecls, ", ec") if $useExceptions;
push(@implContentDecls, ");\n");
@@ -1104,7 +1070,7 @@ END
push(@implContentDecls, " return ${name}$overload->{overloadIndex}Callback(args);\n");
}
push(@implContentDecls, <<END);
- V8Proxy::setDOMException(SYNTAX_ERR);
+ V8Proxy::throwTypeError();
return notHandledByInterceptor();
END
push(@implContentDecls, "}\n\n");
@@ -1283,9 +1249,9 @@ sub GenerateBatchedAttributeData
foreach my $attribute (@$attributes) {
my $conditionalString = GenerateConditionalString($attribute->signature);
- push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
+ push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
GenerateSingleBatchedAttribute($interfaceName, $attribute, ",", "");
- push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+ push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
}
}
@@ -2712,7 +2678,7 @@ sub GetNativeTypeFromSignature
my $mode = "";
if ($signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"}) {
$mode = "WithUndefinedOrNullCheck";
- } elsif ($signature->extendedAttributes->{"ConvertNullToNullString"}) {
+ } elsif ($signature->extendedAttributes->{"ConvertNullToNullString"} || $signature->extendedAttributes->{"Reflect"} || $signature->extendedAttributes->{"ReflectURL"}) {
$mode = "WithNullCheck";
}
$type .= "<$mode>";
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
index 0b20841..0436e13 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
@@ -19,6 +19,9 @@
*/
#include "config.h"
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "WebDOMTestInterface.h"
#include "TestInterface.h"
@@ -73,3 +76,5 @@ WebDOMTestInterface toWebKit(WebCore::TestInterface* value)
{
return WebDOMTestInterface(value);
}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
index d0cee5b..4e7af6d 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
@@ -23,6 +23,8 @@
#ifndef WebDOMTestInterface_h
#define WebDOMTestInterface_h
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include <WebDOMObject.h>
#include <WebDOMString.h>
@@ -50,3 +52,5 @@ WebCore::TestInterface* toWebCore(const WebDOMTestInterface&);
WebDOMTestInterface toWebKit(WebCore::TestInterface*);
#endif
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index e540a57..65bc9f3 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -22,6 +22,7 @@
#include "WebDOMTestObj.h"
#include "AtomicString.h"
+#include "HTMLNames.h"
#include "KURL.h"
#include "SerializedScriptValue.h"
#include "TestObj.h"
@@ -173,33 +174,163 @@ void WebDOMTestObj::setTestObjAttr(const WebDOMTestObj& newTestObjAttr)
impl()->setTestObjAttr(toWebCore(newTestObjAttr));
}
-int WebDOMTestObj::attrWithException() const
+WebDOMString WebDOMTestObj::reflectedStringAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+}
+
+void WebDOMTestObj::setReflectedStringAttr(const WebDOMString& newReflectedStringAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, newReflectedStringAttr);
+}
+
+int WebDOMTestObj::reflectedIntegralAttr() const
{
if (!impl())
return 0;
- return impl()->attrWithException();
+ return impl()->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr);
}
-void WebDOMTestObj::setAttrWithException(int newAttrWithException)
+void WebDOMTestObj::setReflectedIntegralAttr(int newReflectedIntegralAttr)
{
if (!impl())
return;
- impl()->setAttrWithException(newAttrWithException);
+ impl()->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, newReflectedIntegralAttr);
}
-int WebDOMTestObj::attrWithSetterException() const
+bool WebDOMTestObj::reflectedBooleanAttr() const
+{
+ if (!impl())
+ return false;
+
+ return impl()->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr);
+}
+
+void WebDOMTestObj::setReflectedBooleanAttr(bool newReflectedBooleanAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, newReflectedBooleanAttr);
+}
+
+WebDOMString WebDOMTestObj::reflectedURLAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+}
+
+void WebDOMTestObj::setReflectedURLAttr(const WebDOMString& newReflectedURLAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, newReflectedURLAttr);
+}
+
+WebDOMString WebDOMTestObj::reflectedStringAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+}
+
+void WebDOMTestObj::setReflectedStringAttr(const WebDOMString& newReflectedStringAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, newReflectedStringAttr);
+}
+
+int WebDOMTestObj::reflectedCustomIntegralAttr() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr);
+}
+
+void WebDOMTestObj::setReflectedCustomIntegralAttr(int newReflectedCustomIntegralAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, newReflectedCustomIntegralAttr);
+}
+
+bool WebDOMTestObj::reflectedCustomBooleanAttr() const
+{
+ if (!impl())
+ return false;
+
+ return impl()->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr);
+}
+
+void WebDOMTestObj::setReflectedCustomBooleanAttr(bool newReflectedCustomBooleanAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, newReflectedCustomBooleanAttr);
+}
+
+WebDOMString WebDOMTestObj::reflectedURLAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+}
+
+void WebDOMTestObj::setReflectedURLAttr(const WebDOMString& newReflectedURLAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, newReflectedURLAttr);
+}
+
+int WebDOMTestObj::attrWithGetterException() const
{
if (!impl())
return 0;
WebCore::ExceptionCode ec = 0;
- int result = impl()->attrWithSetterException(ec);
+ int result = impl()->attrWithGetterException(ec);
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
return result;
}
+void WebDOMTestObj::setAttrWithGetterException(int newAttrWithGetterException)
+{
+ if (!impl())
+ return;
+
+ WebCore::ExceptionCode ec = 0;
+ impl()->setAttrWithGetterException(newAttrWithGetterException, ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+}
+
+int WebDOMTestObj::attrWithSetterException() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->attrWithSetterException();
+}
+
void WebDOMTestObj::setAttrWithSetterException(int newAttrWithSetterException)
{
if (!impl())
@@ -210,21 +341,42 @@ void WebDOMTestObj::setAttrWithSetterException(int newAttrWithSetterException)
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
}
-int WebDOMTestObj::attrWithGetterException() const
+WebDOMString WebDOMTestObj::stringAttrWithGetterException() const
{
if (!impl())
- return 0;
+ return WebDOMString();
- return impl()->attrWithGetterException();
+ WebCore::ExceptionCode ec = 0;
+ WebDOMString result = impl()->stringAttrWithGetterException(ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return static_cast<const WebCore::String&>(result);
}
-void WebDOMTestObj::setAttrWithGetterException(int newAttrWithGetterException)
+void WebDOMTestObj::setStringAttrWithGetterException(const WebDOMString& newStringAttrWithGetterException)
{
if (!impl())
return;
WebCore::ExceptionCode ec = 0;
- impl()->setAttrWithGetterException(newAttrWithGetterException, ec);
+ impl()->setStringAttrWithGetterException(newStringAttrWithGetterException, ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+}
+
+WebDOMString WebDOMTestObj::stringAttrWithSetterException() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->stringAttrWithSetterException());
+}
+
+void WebDOMTestObj::setStringAttrWithSetterException(const WebDOMString& newStringAttrWithSetterException)
+{
+ if (!impl())
+ return;
+
+ WebCore::ExceptionCode ec = 0;
+ impl()->setStringAttrWithSetterException(newStringAttrWithSetterException, ec);
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
}
@@ -236,6 +388,92 @@ WebDOMString WebDOMTestObj::scriptStringAttr() const
return static_cast<const WebCore::String&>(impl()->scriptStringAttr());
}
+#if ENABLE(Condition1)
+int WebDOMTestObj::conditionalAttr1() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->conditionalAttr1();
+}
+
+void WebDOMTestObj::setConditionalAttr1(int newConditionalAttr1)
+{
+ if (!impl())
+ return;
+
+ impl()->setConditionalAttr1(newConditionalAttr1);
+}
+
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
+int WebDOMTestObj::conditionalAttr2() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->conditionalAttr2();
+}
+
+void WebDOMTestObj::setConditionalAttr2(int newConditionalAttr2)
+{
+ if (!impl())
+ return;
+
+ impl()->setConditionalAttr2(newConditionalAttr2);
+}
+
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
+int WebDOMTestObj::conditionalAttr3() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->conditionalAttr3();
+}
+
+void WebDOMTestObj::setConditionalAttr3(int newConditionalAttr3)
+{
+ if (!impl())
+ return;
+
+ impl()->setConditionalAttr3(newConditionalAttr3);
+}
+
+#endif
+int WebDOMTestObj::description() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->description();
+}
+
+int WebDOMTestObj::id() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->id();
+}
+
+void WebDOMTestObj::setId(int newId)
+{
+ if (!impl())
+ return;
+
+ impl()->setId(newId);
+}
+
+WebDOMString WebDOMTestObj::hash() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->hash());
+}
+
void WebDOMTestObj::voidMethod()
{
if (!impl())
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 7bcd988..33bc7fb 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -54,15 +54,43 @@ public:
void setStringAttr(const WebDOMString&);
WebDOMTestObj testObjAttr() const;
void setTestObjAttr(const WebDOMTestObj&);
- int attrWithException() const;
- void setAttrWithException(int);
- int attrWithSetterException() const;
- void setAttrWithSetterException(int);
+ WebDOMString reflectedStringAttr() const;
+ void setReflectedStringAttr(const WebDOMString&);
+ int reflectedIntegralAttr() const;
+ void setReflectedIntegralAttr(int);
+ bool reflectedBooleanAttr() const;
+ void setReflectedBooleanAttr(bool);
+ WebDOMString reflectedURLAttr() const;
+ void setReflectedURLAttr(const WebDOMString&);
+ WebDOMString reflectedStringAttr() const;
+ void setReflectedStringAttr(const WebDOMString&);
+ int reflectedCustomIntegralAttr() const;
+ void setReflectedCustomIntegralAttr(int);
+ bool reflectedCustomBooleanAttr() const;
+ void setReflectedCustomBooleanAttr(bool);
+ WebDOMString reflectedURLAttr() const;
+ void setReflectedURLAttr(const WebDOMString&);
int attrWithGetterException() const;
void setAttrWithGetterException(int);
+ int attrWithSetterException() const;
+ void setAttrWithSetterException(int);
+ WebDOMString stringAttrWithGetterException() const;
+ void setStringAttrWithGetterException(const WebDOMString&);
+ WebDOMString stringAttrWithSetterException() const;
+ void setStringAttrWithSetterException(const WebDOMString&);
int customAttr() const;
void setCustomAttr(int);
WebDOMString scriptStringAttr() const;
+ int conditionalAttr1() const;
+ void setConditionalAttr1(int);
+ int conditionalAttr2() const;
+ void setConditionalAttr2(int);
+ int conditionalAttr3() const;
+ void setConditionalAttr3(int);
+ int description() const;
+ int id() const;
+ void setId(int);
+ WebDOMString hash() const;
void voidMethod();
void voidMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
index a67b6ac..94f4ca5 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
@@ -21,6 +21,8 @@
#include <glib-object.h>
#include "config.h"
+#if ENABLE(DATABASE)
+
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "ExceptionCode.h"
@@ -55,38 +57,38 @@ gpointer kit(WebCore::TestCallback* obj)
gboolean
webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestCallback * item = WebKit::core(self);
- g_return_val_if_fail (class1param, 0);
- WebCore::Class1 * _g_class1param = WebKit::core(class1param);
- g_return_val_if_fail (_g_class1param, 0);
- gboolean res = item->callbackWithClass1Param(_g_class1param);
+ g_return_val_if_fail(class1param, 0);
+ WebCore::Class1 * converted_class1param = WebKit::core(class1param);
+ g_return_val_if_fail(converted_class1param, 0);
+ gboolean res = item->callbackWithClass1Param(converted_class1param);
return res;
}
gboolean
webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, gchar* str_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestCallback * item = WebKit::core(self);
- g_return_val_if_fail (class2param, 0);
- g_return_val_if_fail (str_arg, 0);
- WebCore::Class2 * _g_class2param = WebKit::core(class2param);
- g_return_val_if_fail (_g_class2param, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- gboolean res = item->callbackWithClass2Param(_g_class2param, _g_str_arg);
+ g_return_val_if_fail(class2param, 0);
+ g_return_val_if_fail(str_arg, 0);
+ WebCore::Class2 * converted_class2param = WebKit::core(class2param);
+ g_return_val_if_fail(converted_class2param, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ gboolean res = item->callbackWithClass2Param(converted_class2param, converted_str_arg);
return res;
}
glong
webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestCallback * item = WebKit::core(self);
- g_return_val_if_fail (class3param, 0);
- WebCore::Class3 * _g_class3param = WebKit::core(class3param);
- g_return_val_if_fail (_g_class3param, 0);
- glong res = item->callbackWithNonBoolReturnType(_g_class3param);
+ g_return_val_if_fail(class3param, 0);
+ WebCore::Class3 * converted_class3param = WebKit::core(class3param);
+ g_return_val_if_fail(converted_class3param, 0);
+ glong res = item->callbackWithNonBoolReturnType(converted_class3param);
return res;
}
@@ -182,3 +184,4 @@ WebKitDOMTestCallback* wrapTestCallback(WebCore::TestCallback* coreObject)
return wrapper;
}
} // namespace WebKit
+#endif /* ENABLE(DATABASE) */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
index 0d0021d..af22530 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
@@ -21,6 +21,8 @@
#include <glib-object.h>
#include "config.h"
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "ExceptionCode.h"
@@ -138,3 +140,4 @@ WebKitDOMTestInterface* wrapTestInterface(WebCore::TestInterface* coreObject)
return wrapper;
}
} // namespace WebKit
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index 5dfb255..efb362b 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -24,6 +24,7 @@
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "ExceptionCode.h"
+#include "HTMLNames.h"
#include "TestObj.h"
#include "WebKitDOMBinding.h"
#include "gobject/ConvertToUTF8String.h"
@@ -51,7 +52,7 @@ gpointer kit(WebCore::TestObj* obj)
void
webkit_dom_test_obj_void_method(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->voidMethod();
}
@@ -59,20 +60,20 @@ webkit_dom_test_obj_void_method(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (str_arg);
- g_return_if_fail (obj_arg);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_if_fail (_g_obj_arg);
- item->voidMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg);
+ g_return_if_fail(str_arg);
+ g_return_if_fail(obj_arg);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_if_fail(converted_obj_arg);
+ item->voidMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg);
}
glong
webkit_dom_test_obj_int_method(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->intMethod();
return res;
@@ -81,21 +82,21 @@ webkit_dom_test_obj_int_method(WebKitDOMTestObj* self)
glong
webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
- glong res = item->intMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg);
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ glong res = item->intMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg);
return res;
}
WebKitDOMTestObj*
webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethod());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -105,14 +106,14 @@ webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self)
WebKitDOMTestObj*
webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
- PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg));
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg));
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
return res;
}
@@ -120,14 +121,14 @@ webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg,
WebKitDOMTestObj*
webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
- PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(_g_str_arg, _g_obj_arg));
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(converted_str_arg, converted_obj_arg));
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
return res;
}
@@ -135,15 +136,15 @@ webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar*
WebKitDOMTestObj*
webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
WebCore::ExceptionCode ec = 0;
- PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(_g_str_arg, _g_obj_arg, ec));
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(converted_str_arg, converted_obj_arg, ec));
if (ec) {
WebCore::ExceptionCodeDescription ecdesc;
WebCore::getExceptionCodeDescription(ec, ecdesc);
@@ -156,18 +157,18 @@ webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* s
void
webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (serialized_arg);
- WebCore::SerializedScriptValue * _g_serialized_arg = WebKit::core(serialized_arg);
- g_return_if_fail (_g_serialized_arg);
- item->serializedValue(_g_serialized_arg);
+ g_return_if_fail(serialized_arg);
+ WebCore::SerializedScriptValue * converted_serialized_arg = WebKit::core(serialized_arg);
+ g_return_if_fail(converted_serialized_arg);
+ item->serializedValue(converted_serialized_arg);
}
void
webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
item->methodWithException(ec);
@@ -187,7 +188,7 @@ webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error
void
webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrame();
}
@@ -195,7 +196,7 @@ webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndArg(int_arg);
}
@@ -203,7 +204,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int
void
webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, glong int_arg, glong optional_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndOptionalArg(int_arg, optional_arg);
}
@@ -211,7 +212,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self,
void
webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndUserGesture(int_arg);
}
@@ -219,7 +220,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self,
void
webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg);
}
@@ -227,7 +228,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* s
void
webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withScriptStateVoid();
}
@@ -235,7 +236,7 @@ webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObj());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -245,7 +246,7 @@ webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
item->withScriptStateVoidException(ec);
@@ -259,7 +260,7 @@ webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GEr
WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObjException(ec));
@@ -275,7 +276,7 @@ webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GErr
void
webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withScriptExecutionContext();
}
@@ -283,7 +284,7 @@ webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->methodWithOptionalArg(opt);
}
@@ -291,7 +292,7 @@ webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt)
void
webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestObj* self, glong non_opt, glong opt)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->methodWithNonOptionalArgAndOptionalArg(non_opt, opt);
}
@@ -299,7 +300,7 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestO
void
webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOMTestObj* self, glong non_opt, glong opt1, glong opt2)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->methodWithNonOptionalArgAndTwoOptionalArgs(non_opt, opt1, opt2);
}
@@ -307,7 +308,7 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOM
glong
webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->readOnlyIntAttr();
return res;
@@ -316,7 +317,7 @@ webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self)
gchar*
webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->readOnlyStringAttr());
return res;
@@ -325,7 +326,7 @@ webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self)
WebKitDOMTestObj*
webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->readOnlyTestObjAttr());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -335,7 +336,7 @@ webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self)
glong
webkit_dom_test_obj_get_int_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->intAttr();
return res;
@@ -344,7 +345,7 @@ webkit_dom_test_obj_get_int_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_int_attr(WebKitDOMTestObj* self, glong value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setIntAttr(value);
}
@@ -352,7 +353,7 @@ webkit_dom_test_obj_set_int_attr(WebKitDOMTestObj* self, glong value)
gint64
webkit_dom_test_obj_get_long_long_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gint64 res = item->longLongAttr();
return res;
@@ -361,7 +362,7 @@ webkit_dom_test_obj_get_long_long_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_long_long_attr(WebKitDOMTestObj* self, gint64 value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setLongLongAttr(value);
}
@@ -369,7 +370,7 @@ webkit_dom_test_obj_set_long_long_attr(WebKitDOMTestObj* self, gint64 value)
guint64
webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
guint64 res = item->unsignedLongLongAttr();
return res;
@@ -378,7 +379,7 @@ webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64 value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setUnsignedLongLongAttr(value);
}
@@ -386,7 +387,7 @@ webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64
gchar*
webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->stringAttr());
return res;
@@ -395,17 +396,17 @@ webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, gchar* value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (value);
- WebCore::String _g_value = WebCore::String::fromUTF8(value);
- item->setStringAttr(_g_value);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setStringAttr(converted_value);
}
WebKitDOMTestObj*
webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->testObjAttr());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -415,38 +416,165 @@ webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (value);
- WebCore::TestObj * _g_value = WebKit::core(value);
- g_return_if_fail (_g_value);
- item->setTestObjAttr(_g_value);
+ g_return_if_fail(value);
+ WebCore::TestObj * converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ item->setTestObjAttr(converted_value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, converted_value);
}
glong
-webkit_dom_test_obj_get_attr_with_exception(WebKitDOMTestObj* self)
+webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_integral_attr(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value);
+}
+
+gboolean
+webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gboolean res = item->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value)
{
- g_return_val_if_fail (self, 0);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- glong res = item->attrWithException();
+ item->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
return res;
}
void
-webkit_dom_test_obj_set_attr_with_exception(WebKitDOMTestObj* self, glong value)
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- item->setAttrWithException(value);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, converted_value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, converted_value);
}
glong
-webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GError **error)
+webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_custom_integral_attr(WebKitDOMTestObj* self, glong value)
{
- g_return_val_if_fail (self, 0);
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value);
+}
+
+gboolean
+webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gboolean res = item->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, converted_value);
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error)
+{
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
- glong res = item->attrWithSetterException(ec);
+ glong res = item->attrWithGetterException(ec);
if (ec) {
WebCore::ExceptionCodeDescription ecdesc;
WebCore::getExceptionCodeDescription(ec, ecdesc);
@@ -456,9 +584,32 @@ webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GErro
}
void
+webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ WebCore::ExceptionCode ec = 0;
+ item->setAttrWithGetterException(value, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc;
+ WebCore::getExceptionCodeDescription(ec, ecdesc);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->attrWithSetterException();
+ return res;
+}
+
+void
webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
item->setAttrWithSetterException(value, ec);
@@ -469,22 +620,50 @@ webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong
}
}
-glong
-webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self)
+gchar*
+webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- glong res = item->attrWithGetterException();
+ WebCore::ExceptionCode ec = 0;
+ gchar* res = convertToUTF8String(item->stringAttrWithGetterException(ec));
return res;
}
void
-webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error)
+webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
WebCore::ExceptionCode ec = 0;
- item->setAttrWithGetterException(value, ec);
+ item->setStringAttrWithGetterException(converted_value, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc;
+ WebCore::getExceptionCodeDescription(ec, ecdesc);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+}
+
+gchar*
+webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->stringAttrWithSetterException());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ WebCore::ExceptionCode ec = 0;
+ item->setStringAttrWithSetterException(converted_value, ec);
if (ec) {
WebCore::ExceptionCodeDescription ecdesc;
WebCore::getExceptionCodeDescription(ec, ecdesc);
@@ -495,16 +674,79 @@ webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong
gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->scriptStringAttr());
return res;
}
+#if ENABLE(Condition1)
+glong
+webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->conditionalAttr1();
+ return res;
+}
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1)
+void
+webkit_dom_test_obj_set_conditional_attr1(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setConditionalAttr1(value);
+}
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+glong
+webkit_dom_test_obj_get_conditional_attr2(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->conditionalAttr2();
+ return res;
+}
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+void
+webkit_dom_test_obj_set_conditional_attr2(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setConditionalAttr2(value);
+}
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+glong
+webkit_dom_test_obj_get_conditional_attr3(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->conditionalAttr3();
+ return res;
+}
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+void
+webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setConditionalAttr3(value);
+}
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
glong
webkit_dom_test_obj_get_description(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->description();
return res;
@@ -513,7 +755,7 @@ webkit_dom_test_obj_get_description(WebKitDOMTestObj* self)
glong
webkit_dom_test_obj_get_id(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->id();
return res;
@@ -522,7 +764,7 @@ webkit_dom_test_obj_get_id(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setId(value);
}
@@ -530,7 +772,7 @@ webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value)
gchar*
webkit_dom_test_obj_get_hash(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->hash());
return res;
@@ -562,11 +804,29 @@ enum {
PROP_UNSIGNED_LONG_LONG_ATTR,
PROP_STRING_ATTR,
PROP_TEST_OBJ_ATTR,
- PROP_ATTR_WITH_EXCEPTION,
- PROP_ATTR_WITH_SETTER_EXCEPTION,
+ PROP_REFLECTED_STRING_ATTR,
+ PROP_REFLECTED_INTEGRAL_ATTR,
+ PROP_REFLECTED_BOOLEAN_ATTR,
+ PROP_REFLECTED_URL_ATTR,
+ PROP_REFLECTED_STRING_ATTR,
+ PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR,
+ PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR,
+ PROP_REFLECTED_URL_ATTR,
PROP_ATTR_WITH_GETTER_EXCEPTION,
+ PROP_ATTR_WITH_SETTER_EXCEPTION,
+ PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
+ PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
PROP_CUSTOM_ATTR,
PROP_SCRIPT_STRING_ATTR,
+#if ENABLE(Condition1)
+ PROP_CONDITIONAL_ATTR1,
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ PROP_CONDITIONAL_ATTR2,
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ PROP_CONDITIONAL_ATTR3,
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
PROP_DESCRIPTION,
PROP_ID,
PROP_HASH,
@@ -609,9 +869,50 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
coreSelf->setStringAttr(WebCore::String::fromUTF8(g_value_get_string(value)));
break;
}
- case PROP_ATTR_WITH_EXCEPTION:
+ case PROP_REFLECTED_STRING_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_REFLECTED_INTEGRAL_ATTR:
+ {
+ coreSelf->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, (g_value_get_long(value)));
+ break;
+ }
+ case PROP_REFLECTED_BOOLEAN_ATTR:
+ {
+ coreSelf->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, (g_value_get_boolean(value)));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_REFLECTED_STRING_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR:
+ {
+ coreSelf->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, (g_value_get_long(value)));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR:
{
- coreSelf->setAttrWithException((g_value_get_long(value)));
+ coreSelf->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, (g_value_get_boolean(value)));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ {
+ WebCore::ExceptionCode ec = 0;
+ coreSelf->setAttrWithGetterException((g_value_get_long(value)), ec);
break;
}
case PROP_ATTR_WITH_SETTER_EXCEPTION:
@@ -620,12 +921,39 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
coreSelf->setAttrWithSetterException((g_value_get_long(value)), ec);
break;
}
- case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION:
{
WebCore::ExceptionCode ec = 0;
- coreSelf->setAttrWithGetterException((g_value_get_long(value)), ec);
+ coreSelf->setStringAttrWithGetterException(WebCore::String::fromUTF8(g_value_get_string(value)), ec);
+ break;
+ }
+ case PROP_STRING_ATTR_WITH_SETTER_EXCEPTION:
+ {
+ WebCore::ExceptionCode ec = 0;
+ coreSelf->setStringAttrWithSetterException(WebCore::String::fromUTF8(g_value_get_string(value)), ec);
+ break;
+ }
+#if ENABLE(Condition1)
+ case PROP_CONDITIONAL_ATTR1:
+ {
+ coreSelf->setConditionalAttr1((g_value_get_long(value)));
break;
}
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR2:
+ {
+ coreSelf->setConditionalAttr2((g_value_get_long(value)));
+ break;
+ }
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR3:
+ {
+ coreSelf->setConditionalAttr3((g_value_get_long(value)));
+ break;
+ }
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
case PROP_ID:
{
coreSelf->setId((g_value_get_long(value)));
@@ -685,20 +1013,66 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa
g_value_set_object(value, WebKit::kit(ptr.get()));
break;
}
- case PROP_ATTR_WITH_EXCEPTION:
+ case PROP_REFLECTED_STRING_ATTR:
{
- g_value_set_long(value, coreSelf->attrWithException());
+ g_value_take_string(value, convertToUTF8String(coreSelf->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)));
+ break;
+ }
+ case PROP_REFLECTED_INTEGRAL_ATTR:
+ {
+ g_value_set_long(value, coreSelf->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+ break;
+ }
+ case PROP_REFLECTED_BOOLEAN_ATTR:
+ {
+ g_value_set_boolean(value, coreSelf->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ g_value_take_string(value, convertToUTF8String(coreSelf->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)));
+ break;
+ }
+ case PROP_REFLECTED_STRING_ATTR:
+ {
+ g_value_take_string(value, convertToUTF8String(coreSelf->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR:
+ {
+ g_value_set_long(value, coreSelf->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR:
+ {
+ g_value_set_boolean(value, coreSelf->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ g_value_take_string(value, convertToUTF8String(coreSelf->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)));
+ break;
+ }
+ case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ {
+ WebCore::ExceptionCode ec = 0;
+ g_value_set_long(value, coreSelf->attrWithGetterException(ec));
break;
}
case PROP_ATTR_WITH_SETTER_EXCEPTION:
{
+ g_value_set_long(value, coreSelf->attrWithSetterException());
+ break;
+ }
+ case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION:
+ {
WebCore::ExceptionCode ec = 0;
- g_value_set_long(value, coreSelf->attrWithSetterException(ec));
+ g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithGetterException(ec)));
break;
}
- case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ case PROP_STRING_ATTR_WITH_SETTER_EXCEPTION:
{
- g_value_set_long(value, coreSelf->attrWithGetterException());
+ g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithSetterException()));
break;
}
case PROP_SCRIPT_STRING_ATTR:
@@ -706,6 +1080,27 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa
g_value_take_string(value, convertToUTF8String(coreSelf->scriptStringAttr()));
break;
}
+#if ENABLE(Condition1)
+ case PROP_CONDITIONAL_ATTR1:
+ {
+ g_value_set_long(value, coreSelf->conditionalAttr1());
+ break;
+ }
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR2:
+ {
+ g_value_set_long(value, coreSelf->conditionalAttr2());
+ break;
+ }
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR3:
+ {
+ g_value_set_long(value, coreSelf->conditionalAttr3());
+ break;
+ }
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
case PROP_DESCRIPTION:
{
g_value_set_long(value, coreSelf->description());
@@ -800,24 +1195,66 @@ G_MAXUINT64, /* min */
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
- PROP_ATTR_WITH_EXCEPTION,
- g_param_spec_long("attr-with-exception", /* name */
- "test_obj_attr-with-exception", /* short description */
- "read-write glong TestObj.attr-with-exception", /* longer - could do with some extra doc stuff here */
+ PROP_REFLECTED_STRING_ATTR,
+ g_param_spec_string("reflected-string-attr", /* name */
+ "test_obj_reflected-string-attr", /* short description */
+ "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_INTEGRAL_ATTR,
+ g_param_spec_long("reflected-integral-attr", /* name */
+ "test_obj_reflected-integral-attr", /* short description */
+ "read-write glong TestObj.reflected-integral-attr", /* longer - could do with some extra doc stuff here */
G_MINLONG, /* min */
G_MAXLONG, /* max */
0, /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
- PROP_ATTR_WITH_SETTER_EXCEPTION,
- g_param_spec_long("attr-with-setter-exception", /* name */
- "test_obj_attr-with-setter-exception", /* short description */
- "read-write glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ PROP_REFLECTED_BOOLEAN_ATTR,
+ g_param_spec_boolean("reflected-boolean-attr", /* name */
+ "test_obj_reflected-boolean-attr", /* short description */
+ "read-write gboolean TestObj.reflected-boolean-attr", /* longer - could do with some extra doc stuff here */
+ FALSE, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_URL_ATTR,
+ g_param_spec_string("reflected-url-attr", /* name */
+ "test_obj_reflected-url-attr", /* short description */
+ "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_STRING_ATTR,
+ g_param_spec_string("reflected-string-attr", /* name */
+ "test_obj_reflected-string-attr", /* short description */
+ "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR,
+ g_param_spec_long("reflected-custom-integral-attr", /* name */
+ "test_obj_reflected-custom-integral-attr", /* short description */
+ "read-write glong TestObj.reflected-custom-integral-attr", /* longer - could do with some extra doc stuff here */
G_MINLONG, /* min */
G_MAXLONG, /* max */
0, /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR,
+ g_param_spec_boolean("reflected-custom-boolean-attr", /* name */
+ "test_obj_reflected-custom-boolean-attr", /* short description */
+ "read-write gboolean TestObj.reflected-custom-boolean-attr", /* longer - could do with some extra doc stuff here */
+ FALSE, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_URL_ATTR,
+ g_param_spec_string("reflected-url-attr", /* name */
+ "test_obj_reflected-url-attr", /* short description */
+ "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
PROP_ATTR_WITH_GETTER_EXCEPTION,
g_param_spec_long("attr-with-getter-exception", /* name */
"test_obj_attr-with-getter-exception", /* short description */
@@ -827,12 +1264,68 @@ G_MAXLONG, /* max */
0, /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
+ PROP_ATTR_WITH_SETTER_EXCEPTION,
+ g_param_spec_long("attr-with-setter-exception", /* name */
+ "test_obj_attr-with-setter-exception", /* short description */
+ "read-write glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
+ g_param_spec_string("string-attr-with-getter-exception", /* name */
+ "test_obj_string-attr-with-getter-exception", /* short description */
+ "read-write gchar* TestObj.string-attr-with-getter-exception", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
+ g_param_spec_string("string-attr-with-setter-exception", /* name */
+ "test_obj_string-attr-with-setter-exception", /* short description */
+ "read-write gchar* TestObj.string-attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
PROP_SCRIPT_STRING_ATTR,
g_param_spec_string("script-string-attr", /* name */
"test_obj_script-string-attr", /* short description */
"read-only gchar* TestObj.script-string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READABLE));
+#if ENABLE(Condition1)
+ g_object_class_install_property(gobjectClass,
+ PROP_CONDITIONAL_ATTR1,
+ g_param_spec_long("conditional-attr1", /* name */
+ "test_obj_conditional-attr1", /* short description */
+ "read-write glong TestObj.conditional-attr1", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ g_object_class_install_property(gobjectClass,
+ PROP_CONDITIONAL_ATTR2,
+ g_param_spec_long("conditional-attr2", /* name */
+ "test_obj_conditional-attr2", /* short description */
+ "read-write glong TestObj.conditional-attr2", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ g_object_class_install_property(gobjectClass,
+ PROP_CONDITIONAL_ATTR3,
+ g_param_spec_long("conditional-attr3", /* name */
+ "test_obj_conditional-attr3", /* short description */
+ "read-write glong TestObj.conditional-attr3", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
g_object_class_install_property(gobjectClass,
PROP_DESCRIPTION,
g_param_spec_long("description", /* name */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
index ef5ccb8..8dcd8c3 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
@@ -160,27 +160,111 @@ webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value);
+
WEBKIT_API glong
-webkit_dom_test_obj_get_attr_with_exception(WebKitDOMTestObj* self);
+webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_integral_attr(WebKitDOMTestObj* self, glong value);
+
+WEBKIT_API gboolean
+webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_attr_with_exception(WebKitDOMTestObj* self, glong value);
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value);
WEBKIT_API glong
-webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GError **error);
+webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error);
+webkit_dom_test_obj_set_reflected_custom_integral_attr(WebKitDOMTestObj* self, glong value);
+
+WEBKIT_API gboolean
+webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value);
WEBKIT_API glong
-webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self);
+webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error);
WEBKIT_API void
webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error);
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error);
+
WEBKIT_API gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self);
+#if ENABLE(Condition1)
+WEBKIT_API glong
+webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self);
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1)
+WEBKIT_API void
+webkit_dom_test_obj_set_conditional_attr1(WebKitDOMTestObj* self, glong value);
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+WEBKIT_API glong
+webkit_dom_test_obj_get_conditional_attr2(WebKitDOMTestObj* self);
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+WEBKIT_API void
+webkit_dom_test_obj_set_conditional_attr2(WebKitDOMTestObj* self, glong value);
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+WEBKIT_API glong
+webkit_dom_test_obj_get_conditional_attr3(WebKitDOMTestObj* self);
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+WEBKIT_API void
+webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value);
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
WEBKIT_API glong
webkit_dom_test_obj_get_description(WebKitDOMTestObj* self);
diff --git a/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
index 693a48b..8e71df1 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
@@ -19,6 +19,9 @@
*/
#include "config.h"
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "JSTestInterface.h"
#include "TestInterface.h"
@@ -61,39 +64,30 @@ static const HashTableValue JSTestInterfaceConstructorTableValues[1] =
static JSC_CONST_HASHTABLE HashTable JSTestInterfaceConstructorTable = { 1, 0, JSTestInterfaceConstructorTableValues, 0 };
class JSTestInterfaceConstructor : public DOMConstructorObject {
public:
- JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+ JSTestInterfaceConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
- putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
- virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
- virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
- virtual const ClassInfo* classInfo() const { return &s_info; }
- static const ClassInfo s_info;
-
- static PassRefPtr<Structure> createStructure(JSValue proto)
- {
- return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
- static EncodedJSValue JSC_HOST_CALL constructTestInterface(ExecState* exec)
- {
- ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext();
- if (!context)
- return throwVMError(exec, createReferenceError(exec, "Reference error"));
- return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context))));
- }
- virtual ConstructType getConstructData(ConstructData& constructData)
- {
- constructData.native.function = constructTestInterface;
- return ConstructTypeHost;
- }
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+ static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestInterface(JSC::ExecState*);
+ virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
};
const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", 0, &JSTestInterfaceConstructorTable, 0 };
+JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+{
+ putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
bool JSTestInterfaceConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSTestInterfaceConstructor, DOMObject>(exec, &JSTestInterfaceConstructorTable, this, propertyName, slot);
@@ -104,6 +98,20 @@ bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const
return getStaticValueDescriptor<JSTestInterfaceConstructor, DOMObject>(exec, &JSTestInterfaceConstructorTable, this, propertyName, descriptor);
}
+EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* exec)
+{
+ ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext();
+ if (!context)
+ return throwVMError(exec, createReferenceError(exec, "Reference error"));
+ return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context))));
+}
+
+ConstructType JSTestInterfaceConstructor::getConstructData(ConstructData& constructData)
+{
+ constructData.native.function = constructJSTestInterface;
+ return ConstructTypeHost;
+}
+
/* Hash table for prototype */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
@@ -173,3 +181,5 @@ TestInterface* toTestInterface(JSC::JSValue value)
}
}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/JS/JSTestInterface.h b/WebCore/bindings/scripts/test/JS/JSTestInterface.h
index 23b183b..09d7d7c 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestInterface.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestInterface.h
@@ -21,6 +21,8 @@
#ifndef JSTestInterface_h
#define JSTestInterface_h
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "JSDOMBinding.h"
#include <runtime/JSGlobalObject.h>
#include <runtime/JSObjectWithGlobalObject.h>
@@ -79,4 +81,6 @@ JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC
} // namespace WebCore
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
#endif
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 09b69cd..360782d 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "JSTestObj.h"
+#include "HTMLNames.h"
#include "JSEventListener.h"
#include "JSTestObj.h"
#include "JSlog.h"
@@ -46,7 +47,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
#define THUNK_GENERATOR(generator)
#endif
-static const HashTableValue JSTestObjTableValues[18] =
+static const HashTableValue JSTestObjTableValues[30] =
{
{ "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
{ "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -56,11 +57,29 @@ static const HashTableValue JSTestObjTableValues[18] =
{ "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) },
{ "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
{ "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
- { "attrWithException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithException), (intptr_t)setJSTestObjAttrWithException THUNK_GENERATOR(0) },
- { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) },
+ { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
+ { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
+ { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) },
+ { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) },
+ { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
+ { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr THUNK_GENERATOR(0) },
+ { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr THUNK_GENERATOR(0) },
+ { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) },
{ "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) },
+ { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) },
+ { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException THUNK_GENERATOR(0) },
+ { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException THUNK_GENERATOR(0) },
{ "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) },
{ "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
+#if ENABLE(Condition1)
+ { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1 THUNK_GENERATOR(0) },
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2 THUNK_GENERATOR(0) },
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3 THUNK_GENERATOR(0) },
+#endif
{ "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0 THUNK_GENERATOR(0) },
{ "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId THUNK_GENERATOR(0) },
{ "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -69,7 +88,7 @@ static const HashTableValue JSTestObjTableValues[18] =
};
#undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 65, 63, JSTestObjTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 69, 63, JSTestObjTableValues, 0 };
/* Hash table for constructor */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
@@ -86,27 +105,28 @@ static const HashTableValue JSTestObjConstructorTableValues[1] =
static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 1, 0, JSTestObjConstructorTableValues, 0 };
class JSTestObjConstructor : public DOMConstructorObject {
public:
- JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+ JSTestObjConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
- putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
- virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
- virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
- virtual const ClassInfo* classInfo() const { return &s_info; }
- static const ClassInfo s_info;
-
- static PassRefPtr<Structure> createStructure(JSValue proto)
- {
- return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};
const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 };
+JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+{
+ putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, slot);
@@ -277,31 +297,113 @@ JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier
return result;
}
-JSValue jsTestObjAttrWithException(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsNumber(exec, imp->attrWithException());
+ JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ ExceptionCode ec = 0;
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSC::JSValue result = jsNumber(exec, imp->attrWithGetterException(ec));
+ setDOMException(exec, ec);
return result;
}
JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->attrWithSetterException());
+ return result;
+}
+
+JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
ExceptionCode ec = 0;
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- JSC::JSValue result = jsNumber(exec, imp->attrWithSetterException(ec));
+ JSC::JSValue result = jsString(exec, imp->stringAttrWithGetterException(ec));
setDOMException(exec, ec);
return result;
}
-JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsNumber(exec, imp->attrWithGetterException());
+ JSValue result = jsString(exec, imp->stringAttrWithSetterException());
return result;
}
@@ -320,6 +422,39 @@ JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Ident
return result;
}
+#if ENABLE(Condition1)
+JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->conditionalAttr1());
+ return result;
+}
+#endif
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->conditionalAttr2());
+ return result;
+}
+#endif
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->conditionalAttr3());
+ return result;
+}
+#endif
+
JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
@@ -392,11 +527,69 @@ void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue valu
imp->setTestObjAttr(toTestObj(value));
}
-void setJSTestObjAttrWithException(ExecState* exec, JSObject* thisObject, JSValue value)
+void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- imp->setAttrWithException(value.toInt32(exec));
+ imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec));
+}
+
+void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
+}
+
+void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec));
+}
+
+void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
+}
+
+void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ imp->setAttrWithGetterException(value.toInt32(exec), ec);
+ setDOMException(exec, ec);
}
void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
@@ -408,12 +601,21 @@ void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject,
setDOMException(exec, ec);
}
-void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
+void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
ExceptionCode ec = 0;
- imp->setAttrWithGetterException(value.toInt32(exec), ec);
+ imp->setStringAttrWithGetterException(ustringToString(value.toString(exec)), ec);
+ setDOMException(exec, ec);
+}
+
+void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ imp->setStringAttrWithSetterException(ustringToString(value.toString(exec)), ec);
setDOMException(exec, ec);
}
@@ -422,6 +624,33 @@ void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value
static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
}
+#if ENABLE(Condition1)
+void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setConditionalAttr1(value.toInt32(exec));
+}
+#endif
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setConditionalAttr2(value.toInt32(exec));
+}
+#endif
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setConditionalAttr3(value.toInt32(exec));
+}
+#endif
+
void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
@@ -875,7 +1104,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -889,7 +1118,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecSta
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -910,7 +1139,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecSta
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -923,7 +1152,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecSta
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -938,15 +1167,15 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecSta
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
{
- if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
+ if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
- if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))
+ if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))
return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject())))
return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
if (exec->argumentCount() == 1)
return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
- return throwTypeError(exec);
+ return throwVMTypeError(exec);
}
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object)
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h
index dd84005..3b21c85 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -130,15 +130,39 @@ JSC::JSValue jsTestObjStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Ident
void setJSTestObjStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjTestObjAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjTestObjAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsTestObjAttrWithException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-void setJSTestObjAttrWithException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedIntegralAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedIntegralAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedBooleanAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedBooleanAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedCustomIntegralAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedCustomIntegralAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedCustomBooleanAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedCustomBooleanAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjCustomAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjCustomAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjScriptStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjConditionalAttr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjConditionalAttr1(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjConditionalAttr2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjConditionalAttr2(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjConditionalAttr3(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjConditionalAttr3(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjDescription(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjId(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjId(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
index 8fd7791..ab59333 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
@@ -25,6 +25,9 @@
*/
#import "config.h"
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#import "DOMInternal.h"
#import "DOMTestInterface.h"
@@ -85,3 +88,5 @@ DOMTestInterface *kit(WebCore::TestInterface* value)
addDOMWrapper(wrapper, value);
return [wrapper autorelease];
}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 6b50246..d8862da 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -47,15 +47,45 @@
- (void)setStringAttr:(NSString *)newStringAttr;
- (DOMTestObj *)testObjAttr;
- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr;
-- (int)attrWithException;
-- (void)setAttrWithException:(int)newAttrWithException;
-- (int)attrWithSetterException;
-- (void)setAttrWithSetterException:(int)newAttrWithSetterException;
+- (NSString *)reflectedStringAttr;
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
+- (int)reflectedIntegralAttr;
+- (void)setReflectedIntegralAttr:(int)newReflectedIntegralAttr;
+- (BOOL)reflectedBooleanAttr;
+- (void)setReflectedBooleanAttr:(BOOL)newReflectedBooleanAttr;
+- (NSString *)reflectedURLAttr;
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr;
+- (NSString *)reflectedStringAttr;
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
+- (int)reflectedCustomIntegralAttr;
+- (void)setReflectedCustomIntegralAttr:(int)newReflectedCustomIntegralAttr;
+- (BOOL)reflectedCustomBooleanAttr;
+- (void)setReflectedCustomBooleanAttr:(BOOL)newReflectedCustomBooleanAttr;
+- (NSString *)reflectedURLAttr;
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr;
- (int)attrWithGetterException;
- (void)setAttrWithGetterException:(int)newAttrWithGetterException;
+- (int)attrWithSetterException;
+- (void)setAttrWithSetterException:(int)newAttrWithSetterException;
+- (NSString *)stringAttrWithGetterException;
+- (void)setStringAttrWithGetterException:(NSString *)newStringAttrWithGetterException;
+- (NSString *)stringAttrWithSetterException;
+- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException;
- (int)customAttr;
- (void)setCustomAttr:(int)newCustomAttr;
- (NSString *)scriptStringAttr;
+#if ENABLE(Condition1)
+- (int)conditionalAttr1;
+- (void)setConditionalAttr1:(int)newConditionalAttr1;
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
+- (int)conditionalAttr2;
+- (void)setConditionalAttr2:(int)newConditionalAttr2;
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
+- (int)conditionalAttr3;
+- (void)setConditionalAttr3:(int)newConditionalAttr3;
+#endif
- (int)descriptionName;
- (int)idName;
- (void)setIdName:(int)newIdName;
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index e57ed87..9bbbf14 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -39,6 +39,7 @@
#import "DOMlogInternal.h"
#import "EventListener.h"
#import "ExceptionHandlers.h"
+#import "HTMLNames.h"
#import "JSMainThreadExecState.h"
#import "KURL.h"
#import "ObjCEventListener.h"
@@ -151,27 +152,125 @@
IMPL->setTestObjAttr(core(newTestObjAttr));
}
-- (int)attrWithException
+- (NSString *)reflectedStringAttr
{
WebCore::JSMainThreadNullState state;
- return IMPL->attrWithException();
+ return IMPL->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr);
}
-- (void)setAttrWithException:(int)newAttrWithException
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr
{
WebCore::JSMainThreadNullState state;
- IMPL->setAttrWithException(newAttrWithException);
+ IMPL->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, newReflectedStringAttr);
}
-- (int)attrWithSetterException
+- (int)reflectedIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr);
+}
+
+- (void)setReflectedIntegralAttr:(int)newReflectedIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, newReflectedIntegralAttr);
+}
+
+- (BOOL)reflectedBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr);
+}
+
+- (void)setReflectedBooleanAttr:(BOOL)newReflectedBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, newReflectedBooleanAttr);
+}
+
+- (NSString *)reflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr);
+}
+
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, newReflectedURLAttr);
+}
+
+- (NSString *)reflectedStringAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr);
+}
+
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, newReflectedStringAttr);
+}
+
+- (int)reflectedCustomIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr);
+}
+
+- (void)setReflectedCustomIntegralAttr:(int)newReflectedCustomIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, newReflectedCustomIntegralAttr);
+}
+
+- (BOOL)reflectedCustomBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr);
+}
+
+- (void)setReflectedCustomBooleanAttr:(BOOL)newReflectedCustomBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, newReflectedCustomBooleanAttr);
+}
+
+- (NSString *)reflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr);
+}
+
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, newReflectedURLAttr);
+}
+
+- (int)attrWithGetterException
{
WebCore::JSMainThreadNullState state;
WebCore::ExceptionCode ec = 0;
- int result = IMPL->attrWithSetterException(ec);
+ int result = IMPL->attrWithGetterException(ec);
WebCore::raiseOnDOMError(ec);
return result;
}
+- (void)setAttrWithGetterException:(int)newAttrWithGetterException
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ IMPL->setAttrWithGetterException(newAttrWithGetterException, ec);
+ WebCore::raiseOnDOMError(ec);
+}
+
+- (int)attrWithSetterException
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->attrWithSetterException();
+}
+
- (void)setAttrWithSetterException:(int)newAttrWithSetterException
{
WebCore::JSMainThreadNullState state;
@@ -180,17 +279,34 @@
WebCore::raiseOnDOMError(ec);
}
-- (int)attrWithGetterException
+- (NSString *)stringAttrWithGetterException
{
WebCore::JSMainThreadNullState state;
- return IMPL->attrWithGetterException();
+ WebCore::ExceptionCode ec = 0;
+ NSString *result = IMPL->stringAttrWithGetterException(ec);
+ WebCore::raiseOnDOMError(ec);
+ return result;
}
-- (void)setAttrWithGetterException:(int)newAttrWithGetterException
+- (void)setStringAttrWithGetterException:(NSString *)newStringAttrWithGetterException
{
WebCore::JSMainThreadNullState state;
WebCore::ExceptionCode ec = 0;
- IMPL->setAttrWithGetterException(newAttrWithGetterException, ec);
+ IMPL->setStringAttrWithGetterException(newStringAttrWithGetterException, ec);
+ WebCore::raiseOnDOMError(ec);
+}
+
+- (NSString *)stringAttrWithSetterException
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->stringAttrWithSetterException();
+}
+
+- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ IMPL->setStringAttrWithSetterException(newStringAttrWithSetterException, ec);
WebCore::raiseOnDOMError(ec);
}
@@ -212,6 +328,48 @@
return IMPL->scriptStringAttr();
}
+#if ENABLE(Condition1)
+- (int)conditionalAttr1
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->conditionalAttr1();
+}
+
+- (void)setConditionalAttr1:(int)newConditionalAttr1
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setConditionalAttr1(newConditionalAttr1);
+}
+#endif
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+- (int)conditionalAttr2
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->conditionalAttr2();
+}
+
+- (void)setConditionalAttr2:(int)newConditionalAttr2
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setConditionalAttr2(newConditionalAttr2);
+}
+#endif
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+- (int)conditionalAttr3
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->conditionalAttr3();
+}
+
+- (void)setConditionalAttr3:(int)newConditionalAttr3
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setConditionalAttr3(newConditionalAttr3);
+}
+#endif
+
- (int)descriptionName
{
WebCore::JSMainThreadNullState state;
diff --git a/WebCore/bindings/scripts/test/TestInterface.idl b/WebCore/bindings/scripts/test/TestInterface.idl
index 5a8b008..1f0aa18 100644
--- a/WebCore/bindings/scripts/test/TestInterface.idl
+++ b/WebCore/bindings/scripts/test/TestInterface.idl
@@ -30,6 +30,7 @@
// changes in its ouput.
module test {
interface [
+ Conditional=Condition1|Condition2,
CanBeConstructed,
CallWith=ScriptExecutionContext
] TestInterface {
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 1cb004c..ef4db10 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -40,6 +40,16 @@ module test {
attribute DOMString stringAttr;
attribute TestObj testObjAttr;
+ // Reflected DOM attributes
+ attribute [Reflect] DOMString reflectedStringAttr;
+ attribute [Reflect] long reflectedIntegralAttr;
+ attribute [Reflect] boolean reflectedBooleanAttr;
+ attribute [ReflectURL] DOMString reflectedURLAttr;
+ attribute [Reflect=customContentStringAttr] DOMString reflectedStringAttr;
+ attribute [Reflect=customContentIntegralAttr] long reflectedCustomIntegralAttr;
+ attribute [Reflect=customContentBooleanAttr] boolean reflectedCustomBooleanAttr;
+ attribute [ReflectURL=customContentURLAttr] DOMString reflectedURLAttr;
+
// Methods
void voidMethod();
void voidMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
@@ -55,10 +65,11 @@ module test {
void serializedValue(in SerializedScriptValue serializedArg);
// Exceptions
- void methodWithException() raises(DOMException);
- attribute long attrWithException raises(DOMException);
- attribute long attrWithSetterException getter raises(DOMException);
- attribute long attrWithGetterException setter raises(DOMException);
+ void methodWithException() raises(DOMException);
+ attribute long attrWithGetterException getter raises(DOMException);
+ attribute long attrWithSetterException setter raises(DOMException);
+ attribute DOMString stringAttrWithGetterException getter raises(DOMException);
+ attribute DOMString stringAttrWithSetterException setter raises(DOMException);
// 'Custom' extended attribute
attribute [Custom] long customAttr;
@@ -97,6 +108,11 @@ module test {
// 'ConvertScriptString' extended attribute
readonly attribute [ConvertScriptString] DOMString scriptStringAttr;
+ // 'Conditional' extended attribute
+ attribute [Conditional=Condition1] long conditionalAttr1;
+ attribute [Conditional=Condition1&Condition2] long conditionalAttr2;
+ attribute [Conditional=Condition1|Condition2] long conditionalAttr3;
+
#if defined(TESTING_V8) || defined(TESTING_JS)
// Overloads
void overloadedMethod(in TestObj objArg, in DOMString strArg);
diff --git a/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp b/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
index fef199a..eff4ebd 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
@@ -28,6 +28,7 @@
#include "V8Class2.h"
#include "V8CustomVoidCallback.h"
#include "V8DOMString.h"
+#include "V8Proxy.h"
#include <wtf/Assertions.h>
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index f0bfb86..340dca7 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "V8TestInterface.h"
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "RuntimeEnabledFeatures.h"
#include "V8Binding.h"
#include "V8BindingState.h"
@@ -113,3 +115,5 @@ void V8TestInterface::derefObject(void* object)
}
} // namespace WebCore
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index ce1310e..d2192ca 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -18,6 +18,8 @@
Boston, MA 02111-1307, USA.
*/
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#ifndef V8TestInterface_h
#define V8TestInterface_h
@@ -48,3 +50,5 @@ v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >);
}
#endif // V8TestInterface_h
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 69c57bb..4a54ae3 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -22,6 +22,7 @@
#include "V8TestObj.h"
#include "ExceptionCode.h"
+#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "ScriptCallStack.h"
#include "SerializedScriptValue.h"
@@ -151,28 +152,140 @@ static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
return;
}
-static v8::Handle<v8::Value> attrWithExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithException._get");
+ INC_STATS("DOM.TestObj.reflectedStringAttr._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
- return v8::Integer::New(imp->attrWithException());
+ return v8String(imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
}
-static void attrWithExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithException._set");
+ INC_STATS("DOM.TestObj.reflectedStringAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedIntegralAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+}
+
+static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedIntegralAttr._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
int v = toInt32(value);
- imp->setAttrWithException(v);
+ imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v);
return;
}
-static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithSetterException._get");
+ INC_STATS("DOM.TestObj.reflectedBooleanAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+}
+
+static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedBooleanAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ bool v = value->BooleanValue();
+ imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+}
+
+static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedStringAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+}
+
+static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedStringAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+}
+
+static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+}
+
+static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ bool v = value->BooleanValue();
+ imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+}
+
+static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.attrWithGetterException._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
ExceptionCode ec = 0;
- int v = imp->attrWithSetterException(ec);
+ int v = imp->attrWithGetterException(ec);
if (UNLIKELY(ec)) {
V8Proxy::setDOMException(ec);
return v8::Handle<v8::Value>();
@@ -180,6 +293,25 @@ static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::Str
return v8::Integer::New(v);
}
+static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.attrWithGetterException._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ ExceptionCode ec = 0;
+ imp->setAttrWithGetterException(v, ec);
+ if (UNLIKELY(ec))
+ V8Proxy::setDOMException(ec);
+ return;
+}
+
+static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.attrWithSetterException._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->attrWithSetterException());
+}
+
static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.attrWithSetterException._set");
@@ -192,20 +324,45 @@ static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
return;
}
-static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithGetterException._get");
+ INC_STATS("DOM.TestObj.stringAttrWithGetterException._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
- return v8::Integer::New(imp->attrWithGetterException());
+ ExceptionCode ec = 0;
+ String v = imp->stringAttrWithGetterException(ec);
+ if (UNLIKELY(ec)) {
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+ }
+ return v8String(v);
}
-static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithGetterException._set");
+ INC_STATS("DOM.TestObj.stringAttrWithGetterException._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
- int v = toInt32(value);
+ V8Parameter<> v = value;
ExceptionCode ec = 0;
- imp->setAttrWithGetterException(v, ec);
+ imp->setStringAttrWithGetterException(v, ec);
+ if (UNLIKELY(ec))
+ V8Proxy::setDOMException(ec);
+ return;
+}
+
+static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.stringAttrWithSetterException._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->stringAttrWithSetterException());
+}
+
+static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.stringAttrWithSetterException._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<> v = value;
+ ExceptionCode ec = 0;
+ imp->setStringAttrWithSetterException(v, ec);
if (UNLIKELY(ec))
V8Proxy::setDOMException(ec);
return;
@@ -218,6 +375,78 @@ static v8::Handle<v8::Value> scriptStringAttrAttrGetter(v8::Local<v8::String> na
return v8StringOrNull(imp->scriptStringAttr());
}
+#if ENABLE(Condition1)
+
+static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr1._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->conditionalAttr1());
+}
+
+#endif // ENABLE(Condition1)
+
+#if ENABLE(Condition1)
+
+static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr1._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setConditionalAttr1(v);
+ return;
+}
+
+#endif // ENABLE(Condition1)
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+
+static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr2._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->conditionalAttr2());
+}
+
+#endif // ENABLE(Condition1) && ENABLE(Condition2)
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+
+static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr2._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setConditionalAttr2(v);
+ return;
+}
+
+#endif // ENABLE(Condition1) && ENABLE(Condition2)
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
+static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr3._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->conditionalAttr3());
+}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
+static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr3._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setConditionalAttr3(v);
+ return;
+}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.description._get");
@@ -643,7 +872,7 @@ static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args)
return overloadedMethod3Callback(args);
if (args.Length() == 1)
return overloadedMethod4Callback(args);
- V8Proxy::setDOMException(SYNTAX_ERR);
+ V8Proxy::throwTypeError();
return notHandledByInterceptor();
}
@@ -666,16 +895,46 @@ static const BatchedAttribute TestObjAttrs[] = {
{"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '')
{"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'attrWithException' (Type: 'attribute' ExtAttr: '')
- {"attrWithException", TestObjInternal::attrWithExceptionAttrGetter, TestObjInternal::attrWithExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
- {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedIntegralAttr", TestObjInternal::reflectedIntegralAttrAttrGetter, TestObjInternal::reflectedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedBooleanAttr", TestObjInternal::reflectedBooleanAttrAttrGetter, TestObjInternal::reflectedBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'ReflectURL')
+ {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedCustomIntegralAttr", TestObjInternal::reflectedCustomIntegralAttrAttrGetter, TestObjInternal::reflectedCustomIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedCustomBooleanAttr", TestObjInternal::reflectedCustomBooleanAttrAttrGetter, TestObjInternal::reflectedCustomBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'ReflectURL')
+ {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '')
{"attrWithGetterException", TestObjInternal::attrWithGetterExceptionAttrGetter, TestObjInternal::attrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
+ {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: '')
+ {"stringAttrWithGetterException", TestObjInternal::stringAttrWithGetterExceptionAttrGetter, TestObjInternal::stringAttrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: '')
+ {"stringAttrWithSetterException", TestObjInternal::stringAttrWithSetterExceptionAttrGetter, TestObjInternal::stringAttrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom')
{"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'scriptStringAttr' (Type: 'readonly attribute' ExtAttr: 'ConvertScriptString')
{"scriptStringAttr", TestObjInternal::scriptStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#if ENABLE(Condition1)
+ // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional')
+ {"conditionalAttr1", TestObjInternal::conditionalAttr1AttrGetter, TestObjInternal::conditionalAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition1)
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional')
+ {"conditionalAttr2", TestObjInternal::conditionalAttr2AttrGetter, TestObjInternal::conditionalAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition1) && ENABLE(Condition2)
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional')
+ {"conditionalAttr3", TestObjInternal::conditionalAttr3AttrGetter, TestObjInternal::conditionalAttr3AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
// Attribute 'description' (Type: 'readonly attribute' ExtAttr: '')
{"description", TestObjInternal::descriptionAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'id' (Type: 'attribute' ExtAttr: '')