| Index: Source/bindings/scripts/CodeGeneratorV8.pm
|
| diff --git a/Source/bindings/scripts/CodeGeneratorV8.pm b/Source/bindings/scripts/CodeGeneratorV8.pm
|
| index 70dc7c851f524a990c3b6e22adde008e33b29cf0..808067a164e00d21cf3099df2bbef137afbfd975 100644
|
| --- a/Source/bindings/scripts/CodeGeneratorV8.pm
|
| +++ b/Source/bindings/scripts/CodeGeneratorV8.pm
|
| @@ -726,9 +726,9 @@ END
|
|
|
| my @enabledPerContextAttributes;
|
| foreach my $attribute (@{$interface->attributes}) {
|
| - my $name = $attribute->signature->name;
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| - my $conditionalString = GenerateConditionalString($attribute->signature);
|
| + my $name = $attribute->name;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| + my $conditionalString = GenerateConditionalString($attribute);
|
| if (HasCustomGetter($attrExt) && !$attrExt->{"ImplementedBy"}) {
|
| $header{classPublic}->add("#if ${conditionalString}\n") if $conditionalString;
|
| $header{classPublic}->add(<<END);
|
| @@ -1103,7 +1103,7 @@ sub HasCustomMethod
|
| sub IsReadonly
|
| {
|
| my $attribute = shift;
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| return $attribute->isReadOnly && !$attrExt->{"Replaceable"};
|
| }
|
|
|
| @@ -1296,10 +1296,10 @@ sub GenerateNormalAttrGetterCallback
|
|
|
| my $implClassName = GetImplName($interface);
|
| my $v8ClassName = GetV8ClassName($interface);
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| - my $attrName = $attribute->signature->name;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| + my $attrName = $attribute->name;
|
|
|
| - my $conditionalString = GenerateConditionalString($attribute->signature);
|
| + my $conditionalString = GenerateConditionalString($attribute);
|
| my $code = "";
|
| $code .= "#if ${conditionalString}\n\n" if $conditionalString;
|
|
|
| @@ -1330,9 +1330,9 @@ sub GenerateNormalAttrGetter
|
| my $interfaceName = $interface->name;
|
| my $implClassName = GetImplName($interface);
|
| my $v8ClassName = GetV8ClassName($interface);
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| - my $attrName = $attribute->signature->name;
|
| - my $attrType = $attribute->signature->type;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| + my $attrName = $attribute->name;
|
| + my $attrType = $attribute->type;
|
|
|
| if (HasCustomGetter($attrExt)) {
|
| return;
|
| @@ -1340,10 +1340,10 @@ sub GenerateNormalAttrGetter
|
|
|
| AssertNotSequenceType($attrType);
|
| my $getterStringUsesImp = $interfaceName ne "SVGNumber";
|
| - my $nativeType = GetNativeTypeFromSignature($attribute->signature, -1);
|
| + my $nativeType = GetNativeTypeFromSignature($attribute, -1);
|
| my $svgNativeType = GetSVGTypeNeedingTearOff($interfaceName);
|
|
|
| - my $conditionalString = GenerateConditionalString($attribute->signature);
|
| + my $conditionalString = GenerateConditionalString($attribute);
|
| my $code = "";
|
| $code .= "#if ${conditionalString}\n\n" if $conditionalString;
|
| $code .= <<END;
|
| @@ -1384,8 +1384,8 @@ END
|
| ${implClassName}* imp = ${v8ClassName}::toNative(holder);
|
| END
|
| } else {
|
| - my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
|
| - my $url = $attribute->signature->extendedAttributes->{"URL"};
|
| + my $reflect = $attribute->extendedAttributes->{"Reflect"};
|
| + my $url = $attribute->extendedAttributes->{"URL"};
|
| if ($getterStringUsesImp && $reflect && !$url && InheritsInterface($interface, "Node") && $attrType eq "DOMString") {
|
| # Generate super-compact call for regular attribute getter:
|
| my ($functionName, @arguments) = GetterExpression($interfaceName, $attribute);
|
| @@ -1398,7 +1398,7 @@ END
|
| return;
|
| # Skip the rest of the function!
|
| }
|
| - if ($attribute->signature->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) {
|
| + if ($attribute->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) {
|
| $code .= <<END;
|
| v8::Handle<v8::String> propertyName = v8::String::NewSymbol("${attrName}");
|
| v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName);
|
| @@ -1416,16 +1416,16 @@ END
|
| }
|
|
|
| # Generate security checks if necessary
|
| - if ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
|
| + if ($attribute->extendedAttributes->{"CheckSecurityForNode"}) {
|
| AddToImplIncludes("bindings/v8/BindingSecurity.h");
|
| - $code .= " if (!BindingSecurity::shouldAllowAccessToNode(imp->" . GetImplName($attribute->signature) . "())) {\n";
|
| + $code .= " if (!BindingSecurity::shouldAllowAccessToNode(imp->" . GetImplName($attribute) . "())) {\n";
|
| $code .= " v8SetReturnValueNull(info);\n";
|
| $code .= " return;\n";
|
| $code .= " }\n";
|
| }
|
|
|
| - my $useExceptions = 1 if $attribute->signature->extendedAttributes->{"GetterRaisesException"} || $attribute->signature->extendedAttributes->{"RaisesException"};
|
| - my $isNullable = $attribute->signature->isNullable;
|
| + my $useExceptions = 1 if $attribute->extendedAttributes->{"GetterRaisesException"} || $attribute->extendedAttributes->{"RaisesException"};
|
| + my $isNullable = $attribute->isNullable;
|
| if ($useExceptions) {
|
| AddToImplIncludes("core/dom/ExceptionCode.h");
|
| $code .= " ExceptionCode ec = 0;\n";
|
| @@ -1435,15 +1435,15 @@ END
|
| $code .= " bool isNull = false;\n";
|
| }
|
|
|
| - my $returnType = $attribute->signature->type;
|
| + my $returnType = $attribute->type;
|
| my $getterString;
|
|
|
| if ($getterStringUsesImp) {
|
| my ($functionName, @arguments) = GetterExpression($interfaceName, $attribute);
|
| push(@arguments, "isNull") if $isNullable;
|
| push(@arguments, "ec") if $useExceptions;
|
| - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
|
| - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
|
| + if ($attribute->extendedAttributes->{"ImplementedBy"}) {
|
| + my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"};
|
| AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implementedBy));
|
| unshift(@arguments, "imp") if !$attribute->isStatic;
|
| $functionName = "${implementedBy}::${functionName}";
|
| @@ -1452,7 +1452,7 @@ END
|
| } else {
|
| $functionName = "imp->${functionName}";
|
| }
|
| - my ($arg, $subCode) = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, " ", 0);
|
| + my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{"CallWith"}, " ", 0);
|
| $code .= $subCode;
|
| unshift(@arguments, @$arg);
|
| $getterString = "${functionName}(" . join(", ", @arguments) . ")";
|
| @@ -1461,14 +1461,14 @@ END
|
| }
|
|
|
| my $expression;
|
| - if ($attribute->signature->type eq "EventListener" && $interface->name eq "DOMWindow") {
|
| + if ($attribute->type eq "EventListener" && $interface->name eq "DOMWindow") {
|
| $code .= " if (!imp->document())\n";
|
| $code .= " return;\n";
|
| }
|
|
|
| if ($useExceptions || $isNullable) {
|
| if ($nativeType =~ /^V8StringResource/) {
|
| - $code .= " " . ConvertToV8StringResource($attribute->signature, $nativeType, "v", $getterString) . ";\n";
|
| + $code .= " " . ConvertToV8StringResource($attribute, $nativeType, "v", $getterString) . ";\n";
|
| } else {
|
| $code .= " $nativeType v = $getterString;\n";
|
| }
|
| @@ -1486,7 +1486,7 @@ END
|
| $code .= " return;\n";
|
| $code .= " };\n";
|
|
|
| - if (ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
|
| + if (ExtendedAttributeContains($attribute->extendedAttributes->{"CallWith"}, "ScriptState")) {
|
| $code .= " if (state.hadException()) {\n";
|
| $code .= " throwError(state.exception(), info.GetIsolate());\n";
|
| $code .= " return;\n";
|
| @@ -1549,7 +1549,7 @@ END
|
| AddToImplIncludes("core/svg/properties/SVGPropertyTearOff.h");
|
| my $tearOffType = GetSVGTypeNeedingTearOff($attrType);
|
| my $wrappedValue;
|
| - if (IsSVGTypeWithWritablePropertiesNeedingTearOff($attrType) and not defined $attribute->signature->extendedAttributes->{"Immutable"}) {
|
| + if (IsSVGTypeWithWritablePropertiesNeedingTearOff($attrType) and not defined $attribute->extendedAttributes->{"Immutable"}) {
|
| my $getter = $expression;
|
| $getter =~ s/imp->//;
|
| $getter =~ s/\(\)//;
|
| @@ -1583,8 +1583,8 @@ END
|
| }
|
| $code .= " v8SetReturnValue(info, toV8Fast$forMainWorldSuffix($wrappedValue, info, imp));\n";
|
| $code .= " return;\n";
|
| - } elsif ($attribute->signature->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) {
|
| - my $getterFunc = ToMethodName($attribute->signature->name);
|
| + } elsif ($attribute->type eq "SerializedScriptValue" && $attrExt->{"CachedAttribute"}) {
|
| + my $getterFunc = ToMethodName($attribute->name);
|
| $code .= <<END;
|
| RefPtr<SerializedScriptValue> serialized = imp->${getterFunc}();
|
| value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Null(info.GetIsolate()));
|
| @@ -1592,15 +1592,15 @@ END
|
| v8SetReturnValue(info, value);
|
| return;
|
| END
|
| - } elsif ($attribute->signature->type eq "EventListener") {
|
| + } elsif ($attribute->type eq "EventListener") {
|
| AddToImplIncludes("bindings/v8/V8AbstractEventListener.h");
|
| - my $getterFunc = ToMethodName($attribute->signature->name);
|
| + my $getterFunc = ToMethodName($attribute->name);
|
| # FIXME: Pass the main world ID for main-world-only getters.
|
| $code .= " EventListener* listener = imp->${getterFunc}(isolatedWorldForIsolate(info.GetIsolate()));\n";
|
| $code .= " v8SetReturnValue(info, listener ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(listener)->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(v8Null(info.GetIsolate())));\n";
|
| $code .= " return;\n";
|
| } else {
|
| - my $nativeValue = NativeToJSValue($attribute->signature->type, $attribute->signature->extendedAttributes, $expression, " ", "", "info.Holder()", "info.GetIsolate()", "info", "imp", "ReturnUnsafeHandle", $forMainWorldSuffix, "return");
|
| + my $nativeValue = NativeToJSValue($attribute->type, $attribute->extendedAttributes, $expression, " ", "", "info.Holder()", "info.GetIsolate()", "info", "imp", "ReturnUnsafeHandle", $forMainWorldSuffix, "return");
|
| $code .= "${nativeValue}\n";
|
| $code .= " return;\n";
|
| }
|
| @@ -1613,15 +1613,15 @@ END
|
| sub ShouldKeepAttributeAlive
|
| {
|
| my ($interface, $attribute, $returnType) = @_;
|
| - my $attrName = $attribute->signature->name;
|
| + my $attrName = $attribute->name;
|
|
|
| - return 1 if $attribute->signature->extendedAttributes->{"KeepAttributeAliveForGC"};
|
| + return 1 if $attribute->extendedAttributes->{"KeepAttributeAliveForGC"};
|
|
|
| # Basically, for readonly or replaceable attributes, we have to guarantee
|
| # that JS wrappers don't get garbage-collected prematually when their
|
| # lifetime is strongly tied to their owner.
|
| return 0 if !IsWrapperType($returnType);
|
| - return 0 if !IsReadonly($attribute) && !$attribute->signature->extendedAttributes->{"Replaceable"};
|
| + return 0 if !IsReadonly($attribute) && !$attribute->extendedAttributes->{"Replaceable"};
|
|
|
| # However, there are a couple of exceptions.
|
|
|
| @@ -1718,10 +1718,10 @@ sub GenerateNormalAttrSetterCallback
|
|
|
| my $implClassName = GetImplName($interface);
|
| my $v8ClassName = GetV8ClassName($interface);
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| - my $attrName = $attribute->signature->name;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| + my $attrName = $attribute->name;
|
|
|
| - my $conditionalString = GenerateConditionalString($attribute->signature);
|
| + my $conditionalString = GenerateConditionalString($attribute);
|
| my $code = "";
|
| $code .= "#if ${conditionalString}\n\n" if $conditionalString;
|
|
|
| @@ -1751,15 +1751,15 @@ sub GenerateNormalAttrSetter
|
| my $interfaceName = $interface->name;
|
| my $implClassName = GetImplName($interface);
|
| my $v8ClassName = GetV8ClassName($interface);
|
| - my $attrName = $attribute->signature->name;
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| - my $attrType = $attribute->signature->type;
|
| + my $attrName = $attribute->name;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| + my $attrType = $attribute->type;
|
|
|
| if (HasCustomSetter($attrExt)) {
|
| return;
|
| }
|
|
|
| - my $conditionalString = GenerateConditionalString($attribute->signature);
|
| + my $conditionalString = GenerateConditionalString($attribute);
|
| my $code = "";
|
| $code .= "#if ${conditionalString}\n\n" if $conditionalString;
|
| $code .= "static void ${attrName}AttrSetter${forMainWorldSuffix}(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)\n";
|
| @@ -1770,8 +1770,8 @@ sub GenerateNormalAttrSetter
|
| # thrown rather than silently passing NULL to the C++ code.
|
| # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to both
|
| # strings and numbers, so do not throw TypeError if the attribute is of these types.
|
| - if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
|
| - my $argType = $attribute->signature->type;
|
| + if ($attribute->extendedAttributes->{"StrictTypeChecking"}) {
|
| + my $argType = $attribute->type;
|
| if (IsWrapperType($argType)) {
|
| $code .= " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate()))) {\n";
|
| $code .= " throwTypeError(0, info.GetIsolate());\n";
|
| @@ -1802,7 +1802,7 @@ END
|
| ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());
|
| END
|
| } else {
|
| - my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
|
| + my $reflect = $attribute->extendedAttributes->{"Reflect"};
|
| if ($reflect && InheritsInterface($interface, "Node") && $attrType eq "DOMString") {
|
| # Generate super-compact call for regular attribute setter:
|
| my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attrName : $reflect;
|
| @@ -1825,21 +1825,21 @@ END
|
| }
|
| }
|
|
|
| - my $nativeType = GetNativeTypeFromSignature($attribute->signature, 0);
|
| - if ($attribute->signature->type eq "EventListener") {
|
| + my $nativeType = GetNativeTypeFromSignature($attribute, 0);
|
| + if ($attribute->type eq "EventListener") {
|
| if ($interface->name eq "DOMWindow") {
|
| $code .= " if (!imp->document())\n";
|
| $code .= " return;\n";
|
| }
|
| } else {
|
| - my $value = JSValueToNative($attribute->signature->type, $attribute->signature->extendedAttributes, "value", "info.GetIsolate()");
|
| + my $value = JSValueToNative($attribute->type, $attribute->extendedAttributes, "value", "info.GetIsolate()");
|
| my $arrayType = GetArrayType($nativeType);
|
|
|
| if ($nativeType =~ /^V8StringResource/) {
|
| - $code .= " " . ConvertToV8StringResource($attribute->signature, $nativeType, "v", $value) . "\n";
|
| + $code .= " " . ConvertToV8StringResource($attribute, $nativeType, "v", $value) . "\n";
|
| } elsif ($arrayType) {
|
| $code .= " Vector<$arrayType> v = $value;\n";
|
| - } elsif ($attribute->signature->extendedAttributes->{"EnforceRange"}) {
|
| + } elsif ($attribute->extendedAttributes->{"EnforceRange"}) {
|
| $code .= " V8TRYCATCH_WITH_TYPECHECK_VOID($nativeType, v, $value, info.GetIsolate());\n";
|
| } else {
|
| $code .= " V8TRYCATCH_VOID($nativeType, v, $value);\n";
|
| @@ -1862,14 +1862,14 @@ END
|
| }
|
|
|
| my $expression = "v";
|
| - my $returnType = $attribute->signature->type;
|
| + my $returnType = $attribute->type;
|
| if (IsRefPtrType($returnType) && !GetArrayType($returnType)) {
|
| $expression = "WTF::getPtr(" . $expression . ")";
|
| }
|
|
|
| - $code .= GenerateCustomElementInvocationScopeIfNeeded($attribute->signature->extendedAttributes);
|
| + $code .= GenerateCustomElementInvocationScopeIfNeeded($attribute->extendedAttributes);
|
|
|
| - my $useExceptions = 1 if $attribute->signature->extendedAttributes->{"SetterRaisesException"} || $attribute->signature->extendedAttributes->{"RaisesException"};
|
| + my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesException"} || $attribute->extendedAttributes->{"RaisesException"};
|
|
|
| if ($useExceptions) {
|
| AddToImplIncludes("core/dom/ExceptionCode.h");
|
| @@ -1879,15 +1879,15 @@ END
|
| if ($interfaceName eq "SVGNumber") {
|
| $code .= " *imp = $expression;\n";
|
| } else {
|
| - if ($attribute->signature->type eq "EventListener") {
|
| + if ($attribute->type eq "EventListener") {
|
| my $implSetterFunctionName = FirstLetterToUpperCase($attrName);
|
| AddToImplIncludes("bindings/v8/V8AbstractEventListener.h");
|
| if (!InheritsInterface($interface, "Node")) {
|
| - my $attrImplName = GetImplName($attribute->signature);
|
| + my $attrImplName = GetImplName($attribute);
|
| $code .= " transferHiddenDependency(info.Holder(), imp->${attrImplName}(isolatedWorldForIsolate(info.GetIsolate())), value, ${v8ClassName}::eventListenerCacheIndex, info.GetIsolate());\n";
|
| }
|
| AddToImplIncludes("bindings/v8/V8EventListenerList.h");
|
| - if (($interfaceName eq "DOMWindow" or $interfaceName eq "WorkerContext") and $attribute->signature->name eq "onerror") {
|
| + if (($interfaceName eq "DOMWindow" or $interfaceName eq "WorkerContext") and $attribute->name eq "onerror") {
|
| AddToImplIncludes("bindings/v8/V8ErrorHandler.h");
|
| $code .= " imp->set$implSetterFunctionName(V8EventListenerList::findOrCreateWrapper<V8ErrorHandler>(value, true), isolatedWorldForIsolate(info.GetIsolate()));\n";
|
| } else {
|
| @@ -1897,8 +1897,8 @@ END
|
| my ($functionName, @arguments) = SetterExpression($interfaceName, $attribute);
|
| push(@arguments, $expression);
|
| push(@arguments, "ec") if $useExceptions;
|
| - if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
|
| - my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
|
| + if ($attribute->extendedAttributes->{"ImplementedBy"}) {
|
| + my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"};
|
| AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implementedBy));
|
| unshift(@arguments, "imp") if !$attribute->isStatic;
|
| $functionName = "${implementedBy}::${functionName}";
|
| @@ -1907,7 +1907,7 @@ END
|
| } else {
|
| $functionName = "imp->${functionName}";
|
| }
|
| - my ($arg, $subCode) = GenerateCallWith($attribute->signature->extendedAttributes->{"SetterCallWith"} || $attribute->signature->extendedAttributes->{"CallWith"}, " ", 1);
|
| + my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{"SetterCallWith"} || $attribute->extendedAttributes->{"CallWith"}, " ", 1);
|
| $code .= $subCode;
|
| unshift(@arguments, @$arg);
|
| $code .= " ${functionName}(" . join(", ", @arguments) . ");\n";
|
| @@ -1919,7 +1919,7 @@ END
|
| $code .= " setDOMException(ec, info.GetIsolate());\n";
|
| }
|
|
|
| - if (ExtendedAttributeContains($attribute->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
|
| + if (ExtendedAttributeContains($attribute->extendedAttributes->{"CallWith"}, "ScriptState")) {
|
| $code .= " if (state.hadException())\n";
|
| $code .= " throwError(state.exception(), info.GetIsolate());\n";
|
| }
|
| @@ -1933,7 +1933,7 @@ END
|
| }
|
| }
|
|
|
| - if ($attribute->signature->type eq "SerializedScriptValue" && $attribute->signature->extendedAttributes->{"CachedAttribute"}) {
|
| + if ($attribute->type eq "SerializedScriptValue" && $attribute->extendedAttributes->{"CachedAttribute"}) {
|
| $code .= <<END;
|
| info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("${attrName}")); // Invalidate the cached value.
|
| END
|
| @@ -2692,8 +2692,8 @@ END
|
|
|
| for (my $index = 0; $index < @{$interface->attributes}; $index++) {
|
| my $attribute = @{$interface->attributes}[$index];
|
| - if ($attribute->signature->extendedAttributes->{"InitializedByEventConstructor"}) {
|
| - my $attributeName = $attribute->signature->name;
|
| + if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) {
|
| + my $attributeName = $attribute->name;
|
| $code .= " options.get(\"$attributeName\", eventInit.$attributeName);\n";
|
| }
|
| }
|
| @@ -2880,7 +2880,7 @@ sub GenerateBatchedAttributeData
|
| my $code = "";
|
|
|
| foreach my $attribute (@$attributes) {
|
| - my $conditionalString = GenerateConditionalString($attribute->signature);
|
| + my $conditionalString = GenerateConditionalString($attribute);
|
| my $subCode = "";
|
| $subCode .= "#if ${conditionalString}\n" if $conditionalString;
|
| $subCode .= GenerateSingleBatchedAttribute($interface, $attribute, ",", "");
|
| @@ -2897,8 +2897,8 @@ sub GenerateSingleBatchedAttribute
|
| my $delimiter = shift;
|
| my $indent = shift;
|
| my $code = "";
|
| - my $attrName = $attribute->signature->name;
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| + my $attrName = $attribute->name;
|
| + my $attrExt = $attribute->extendedAttributes;
|
| my $implClassName = GetImplName($interface);
|
|
|
| my $accessControl = "v8::DEFAULT";
|
| @@ -2929,7 +2929,7 @@ sub GenerateSingleBatchedAttribute
|
| my $setterForMainWorld;
|
| my $propAttr = "v8::None";
|
|
|
| - my $isConstructor = ($attribute->signature->type =~ /Constructor$/);
|
| + my $isConstructor = ($attribute->type =~ /Constructor$/);
|
|
|
| # Check attributes.
|
| # As per Web IDL specification, constructor properties on the ECMAScript global object should be
|
| @@ -2946,12 +2946,12 @@ sub GenerateSingleBatchedAttribute
|
|
|
| # Constructor
|
| if ($isConstructor) {
|
| - my $constructorType = $attribute->signature->type;
|
| + my $constructorType = $attribute->type;
|
| $constructorType =~ s/Constructor$//;
|
| # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
|
| # We do not generate the header file for NamedConstructor of class XXXX,
|
| # since we generate the NamedConstructor declaration into the header file of class XXXX.
|
| - if ($constructorType !~ /Constructor$/ || $attribute->signature->extendedAttributes->{"CustomConstructor"}) {
|
| + if ($constructorType !~ /Constructor$/ || $attribute->extendedAttributes->{"CustomConstructor"}) {
|
| AddToImplIncludes("V8${constructorType}.h");
|
| }
|
| $data = "&V8${constructorType}::info";
|
| @@ -3740,8 +3740,8 @@ END
|
| # Generate property accessors for attributes.
|
| for (my $index = 0; $index < @{$interface->attributes}; $index++) {
|
| my $attribute = @{$interface->attributes}[$index];
|
| - my $attrType = $attribute->signature->type;
|
| - my $attrExt = $attribute->signature->extendedAttributes;
|
| + my $attrType = $attribute->type;
|
| + my $attrExt = $attribute->extendedAttributes;
|
|
|
| # Generate special code for the constructor attributes.
|
| if ($attrType =~ /Constructor$/) {
|
| @@ -3868,13 +3868,13 @@ END
|
| my @normalAttributes;
|
| foreach my $attribute (@$attributes) {
|
|
|
| - if ($interfaceName eq "DOMWindow" && $attribute->signature->extendedAttributes->{"Unforgeable"}) {
|
| + if ($interfaceName eq "DOMWindow" && $attribute->extendedAttributes->{"Unforgeable"}) {
|
| push(@disallowsShadowing, $attribute);
|
| - } elsif ($attribute->signature->extendedAttributes->{"EnabledAtRuntime"} || $attribute->signature->extendedAttributes->{"EnabledPerContext"}) {
|
| - if ($attribute->signature->extendedAttributes->{"EnabledPerContext"}) {
|
| + } elsif ($attribute->extendedAttributes->{"EnabledAtRuntime"} || $attribute->extendedAttributes->{"EnabledPerContext"}) {
|
| + if ($attribute->extendedAttributes->{"EnabledPerContext"}) {
|
| push(@enabledPerContextAttributes, $attribute);
|
| }
|
| - if ($attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
|
| + if ($attribute->extendedAttributes->{"EnabledAtRuntime"}) {
|
| push(@enabledAtRuntimeAttributes, $attribute);
|
| }
|
| } else {
|
| @@ -4077,8 +4077,8 @@ END
|
| # Setup the enable-at-runtime attrs if we have them
|
| foreach my $runtime_attr (@enabledAtRuntimeAttributes) {
|
| next if grep { $_ eq $runtime_attr } @enabledPerContextAttributes;
|
| - my $enable_function = GetRuntimeEnableFunctionName($runtime_attr->signature);
|
| - my $conditionalString = GenerateConditionalString($runtime_attr->signature);
|
| + my $enable_function = GetRuntimeEnableFunctionName($runtime_attr);
|
| + my $conditionalString = GenerateConditionalString($runtime_attr);
|
| $code .= "\n#if ${conditionalString}\n" if $conditionalString;
|
| $code .= " if (${enable_function}()) {\n";
|
| $code .= " static const V8DOMConfiguration::BatchedAttribute attrData =\\\n";
|
| @@ -4204,11 +4204,11 @@ END
|
|
|
| # Setup the enable-by-settings attrs if we have them
|
| foreach my $runtimeAttr (@enabledPerContextAttributes) {
|
| - my $enableFunction = GetContextEnableFunction($runtimeAttr->signature);
|
| - my $conditionalString = GenerateConditionalString($runtimeAttr->signature);
|
| + my $enableFunction = GetContextEnableFunction($runtimeAttr);
|
| + my $conditionalString = GenerateConditionalString($runtimeAttr);
|
| $code .= "\n#if ${conditionalString}\n" if $conditionalString;
|
| if (grep { $_ eq $runtimeAttr } @enabledAtRuntimeAttributes) {
|
| - my $runtimeEnableFunction = GetRuntimeEnableFunctionName($runtimeAttr->signature);
|
| + my $runtimeEnableFunction = GetRuntimeEnableFunctionName($runtimeAttr);
|
| $code .= " if (${enableFunction}(impl->document()) && ${runtimeEnableFunction}()) {\n";
|
| } else {
|
| $code .= " if (${enableFunction}(impl->document())) {\n";
|
| @@ -5653,11 +5653,11 @@ sub AttributeNameForGetterAndSetter
|
| {
|
| my $attribute = shift;
|
|
|
| - my $attributeName = GetImplName($attribute->signature);
|
| - if ($attribute->signature->extendedAttributes->{"ImplementedAs"}) {
|
| - $attributeName = $attribute->signature->extendedAttributes->{"ImplementedAs"};
|
| + my $attributeName = GetImplName($attribute);
|
| + if ($attribute->extendedAttributes->{"ImplementedAs"}) {
|
| + $attributeName = $attribute->extendedAttributes->{"ImplementedAs"};
|
| }
|
| - my $attributeType = $attribute->signature->type;
|
| + my $attributeType = $attribute->type;
|
|
|
| # Avoid clash with C++ keyword.
|
| $attributeName = "_operator" if $attributeName eq "operator";
|
| @@ -5677,7 +5677,7 @@ sub ContentAttributeName
|
| {
|
| my ($interfaceName, $attribute) = @_;
|
|
|
| - my $contentAttributeName = $attribute->signature->extendedAttributes->{"Reflect"};
|
| + my $contentAttributeName = $attribute->extendedAttributes->{"Reflect"};
|
| return undef if !$contentAttributeName;
|
|
|
| $contentAttributeName = lc AttributeNameForGetterAndSetter($attribute) if $contentAttributeName eq "VALUE_IS_MISSING";
|
| @@ -5691,7 +5691,7 @@ sub ContentAttributeName
|
| sub CanUseFastAttribute
|
| {
|
| my $attribute = shift;
|
| - return !IsSVGAnimatedType($attribute->signature->type);
|
| + return !IsSVGAnimatedType($attribute->type);
|
| }
|
|
|
| sub GetterExpression
|
| @@ -5705,17 +5705,17 @@ sub GetterExpression
|
| }
|
|
|
| my $functionName;
|
| - if ($attribute->signature->extendedAttributes->{"URL"}) {
|
| + if ($attribute->extendedAttributes->{"URL"}) {
|
| $functionName = "getURLAttribute";
|
| - } elsif ($attribute->signature->type eq "boolean") {
|
| + } elsif ($attribute->type eq "boolean") {
|
| if (CanUseFastAttribute($attribute)) {
|
| $functionName = "fastHasAttribute";
|
| } else {
|
| $functionName = "hasAttribute";
|
| }
|
| - } elsif ($attribute->signature->type eq "long") {
|
| + } elsif ($attribute->type eq "long") {
|
| $functionName = "getIntegralAttribute";
|
| - } elsif ($attribute->signature->type eq "unsigned long") {
|
| + } elsif ($attribute->type eq "unsigned long") {
|
| $functionName = "getUnsignedIntegralAttribute";
|
| } else {
|
| if ($contentAttributeName eq "WebCore::HTMLNames::idAttr") {
|
| @@ -5748,11 +5748,11 @@ sub SetterExpression
|
| }
|
|
|
| my $functionName;
|
| - if ($attribute->signature->type eq "boolean") {
|
| + if ($attribute->type eq "boolean") {
|
| $functionName = "setBooleanAttribute";
|
| - } elsif ($attribute->signature->type eq "long") {
|
| + } elsif ($attribute->type eq "long") {
|
| $functionName = "setIntegralAttribute";
|
| - } elsif ($attribute->signature->type eq "unsigned long") {
|
| + } elsif ($attribute->type eq "unsigned long") {
|
| $functionName = "setUnsignedIntegralAttribute";
|
| } else {
|
| $functionName = "setAttribute";
|
|
|