| OLD | NEW |
| 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> | 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> |
| 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
| 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
| 5 # Copyright (C) 2006 Apple Computer, Inc. | 5 # Copyright (C) 2006 Apple Computer, Inc. |
| 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. | 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. |
| 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
| 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 # Copyright (C) 2012 Ericsson AB. All rights reserved. | 10 # Copyright (C) 2012 Ericsson AB. All rights reserved. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 "SVGColor" => 1, | 89 "SVGColor" => 1, |
| 90 "SVGPaint" => 1, | 90 "SVGPaint" => 1, |
| 91 "CSSValueList" => 1, | 91 "CSSValueList" => 1, |
| 92 "StyleSheetList" => 1, | 92 "StyleSheetList" => 1, |
| 93 "DOMWindowCSS" => 1, | 93 "DOMWindowCSS" => 1, |
| 94 "StyleMedia" => 1, | 94 "StyleMedia" => 1, |
| 95 "ViewportStyleResolver" => 1, | 95 "ViewportStyleResolver" => 1, |
| 96 "WebKitCSSMatrix" => 1, | 96 "WebKitCSSMatrix" => 1, |
| 97 ); | 97 ); |
| 98 | 98 |
| 99 my %partiallyHandlifiedTypeHash = (); | 99 my %partiallyHandlifiedTypeHash = ( |
| 100 "HTMLKeygenElement" => 1, |
| 101 "HTMLOutputElement" => 1, |
| 102 "HTMLSelectElement" => 1, |
| 103 "HTMLInputElement" => 1, |
| 104 "HTMLTextAreaElement" => 1, |
| 105 "HTMLButtonElement" => 1, |
| 106 ); |
| 100 | 107 |
| 101 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, | 108 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, |
| 102 "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" =
> 1, | 109 "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" =
> 1, |
| 103 "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" =>
1, | 110 "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" =>
1, |
| 104 "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" =>
1, | 111 "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" =>
1, |
| 105 "SVGAnimatedPreserveAspectRatio" => 1, | 112 "SVGAnimatedPreserveAspectRatio" => 1, |
| 106 "SVGAnimatedRect" => 1, "SVGAnimatedString" => 1, | 113 "SVGAnimatedRect" => 1, "SVGAnimatedString" => 1, |
| 107 "SVGAnimatedTransformList" => 1); | 114 "SVGAnimatedTransformList" => 1); |
| 108 | 115 |
| 109 my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick
" => 1, | 116 my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick
" => 1, |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 my $handlifiedReturnType = IsHandlifiedType($returnType) || IsPartiallyHandl
ifiedType($returnType); | 1314 my $handlifiedReturnType = IsHandlifiedType($returnType) || IsPartiallyHandl
ifiedType($returnType); |
| 1308 my $getterString; | 1315 my $getterString; |
| 1309 | 1316 |
| 1310 if ($getterStringUsesImp) { | 1317 if ($getterStringUsesImp) { |
| 1311 my ($functionName, @arguments) = GetterExpression(\%implIncludes, $inter
faceName, $attribute); | 1318 my ($functionName, @arguments) = GetterExpression(\%implIncludes, $inter
faceName, $attribute); |
| 1312 push(@arguments, "isNull") if $isNullable; | 1319 push(@arguments, "isNull") if $isNullable; |
| 1313 push(@arguments, "ec") if $useExceptions; | 1320 push(@arguments, "ec") if $useExceptions; |
| 1314 if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { | 1321 if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { |
| 1315 my $implementedBy = $attribute->signature->extendedAttributes->{"Imp
lementedBy"}; | 1322 my $implementedBy = $attribute->signature->extendedAttributes->{"Imp
lementedBy"}; |
| 1316 AddInterfaceToImplIncludes($implementedBy); | 1323 AddInterfaceToImplIncludes($implementedBy); |
| 1317 unshift(@arguments, "imp") if !$attribute->isStatic; | 1324 unshift(@arguments, $handlified ? "imp.raw()" : "imp") if !$attribut
e->isStatic; |
| 1318 $functionName = "${implementedBy}::${functionName}"; | 1325 $functionName = "${implementedBy}::${functionName}"; |
| 1319 } elsif ($attribute->isStatic) { | 1326 } elsif ($attribute->isStatic) { |
| 1320 $functionName = "${interfaceName}::${functionName}"; | 1327 $functionName = "${interfaceName}::${functionName}"; |
| 1321 } else { | 1328 } else { |
| 1322 $functionName = "imp->${functionName}"; | 1329 $functionName = "imp->${functionName}"; |
| 1323 } | 1330 } |
| 1324 my ($arg, $subCode) = GenerateCallWith($attribute->signature->extendedAt
tributes->{"CallWith"}, " ", 0); | 1331 my ($arg, $subCode) = GenerateCallWith($attribute->signature->extendedAt
tributes->{"CallWith"}, " ", 0); |
| 1325 $code .= $subCode; | 1332 $code .= $subCode; |
| 1326 unshift(@arguments, @$arg); | 1333 unshift(@arguments, @$arg); |
| 1327 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; | 1334 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 END | 1485 END |
| 1479 } elsif ($attribute->signature->type eq "SerializedScriptValue" && $attrExt-
>{"CachedAttribute"}) { | 1486 } elsif ($attribute->signature->type eq "SerializedScriptValue" && $attrExt-
>{"CachedAttribute"}) { |
| 1480 my $getterFunc = WK_lcfirst($attribute->signature->name); | 1487 my $getterFunc = WK_lcfirst($attribute->signature->name); |
| 1481 $code .= <<END; | 1488 $code .= <<END; |
| 1482 RefPtr<SerializedScriptValue> serialized = imp->${getterFunc}(); | 1489 RefPtr<SerializedScriptValue> serialized = imp->${getterFunc}(); |
| 1483 value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Nul
l(info.GetIsolate())); | 1490 value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Nul
l(info.GetIsolate())); |
| 1484 info.Holder()->SetHiddenValue(propertyName, value); | 1491 info.Holder()->SetHiddenValue(propertyName, value); |
| 1485 return value; | 1492 return value; |
| 1486 END | 1493 END |
| 1487 } else { | 1494 } else { |
| 1488 $code .= " return " . NativeToJSValue($attribute->signature, $express
ion, "info.Holder()", "info.GetIsolate()", "info", "imp", "ReturnUnsafeHandle",
$forMainWorldSuffix).";\n"; | 1495 $code .= " return " . NativeToJSValue($attribute->signature, $express
ion, "info.Holder()", "info.GetIsolate()", "info", $handlified ? "imp.raw()" : "
imp", "ReturnUnsafeHandle", $forMainWorldSuffix).";\n"; |
| 1489 } | 1496 } |
| 1490 | 1497 |
| 1491 $code .= "}\n\n"; # end of getter | 1498 $code .= "}\n\n"; # end of getter |
| 1492 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; | 1499 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; |
| 1493 AddToImplContentInternals($code); | 1500 AddToImplContentInternals($code); |
| 1494 } | 1501 } |
| 1495 | 1502 |
| 1496 sub GenerateReplaceableAttrSetterCallback | 1503 sub GenerateReplaceableAttrSetterCallback |
| 1497 { | 1504 { |
| 1498 my $interface = shift; | 1505 my $interface = shift; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 $code .= " $svgWrappedNativeType& impInstance = wrapper->property
Reference();\n"; | 1654 $code .= " $svgWrappedNativeType& impInstance = wrapper->property
Reference();\n"; |
| 1648 $code .= " $svgWrappedNativeType* imp = &impInstance;\n"; | 1655 $code .= " $svgWrappedNativeType* imp = &impInstance;\n"; |
| 1649 } | 1656 } |
| 1650 } elsif ($attrExt->{"OnProto"}) { | 1657 } elsif ($attrExt->{"OnProto"}) { |
| 1651 $code .= <<END; | 1658 $code .= <<END; |
| 1652 ${pointerType} imp(${v8InterfaceName}::toNative(info.Holder())); | 1659 ${pointerType} imp(${v8InterfaceName}::toNative(info.Holder())); |
| 1653 END | 1660 END |
| 1654 } else { | 1661 } else { |
| 1655 my $reflect = $attribute->signature->extendedAttributes->{"Reflect"}; | 1662 my $reflect = $attribute->signature->extendedAttributes->{"Reflect"}; |
| 1656 if ($reflect && InheritsInterface($interface, "Node") && IsStringType($a
ttrType)) { | 1663 if ($reflect && InheritsInterface($interface, "Node") && IsStringType($a
ttrType)) { |
| 1657 # Generate super-compact call for regular attribute setter: | |
| 1658 my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attr
Name : $reflect; | 1664 my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attr
Name : $reflect; |
| 1659 my $namespace = NamespaceForAttributeName($interfaceName, $contentAt
tributeName); | 1665 my $namespace = NamespaceForAttributeName($interfaceName, $contentAt
tributeName); |
| 1660 AddToImplIncludes("${namespace}.h"); | 1666 AddToImplIncludes("${namespace}.h"); |
| 1661 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; | 1667 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; |
| 1662 $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<
WithNullCheck>, stringResource, value);\n"; | 1668 $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<
WithNullCheck>, stringResource, value);\n"; |
| 1663 $code .= " imp->setAttribute(${namespace}::${contentAttributeName
}Attr, stringResource);\n"; | 1669 $code .= " imp->setAttribute(${namespace}::${contentAttributeName
}Attr, stringResource);\n"; |
| 1664 $code .= "}\n\n"; | 1670 $code .= "}\n\n"; |
| 1665 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; | 1671 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; |
| 1666 AddToImplContentInternals($code); | 1672 AddToImplContentInternals($code); |
| 1667 return; | 1673 return; |
| (...skipping 3982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5650 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 5656 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
| 5651 $found = 1; | 5657 $found = 1; |
| 5652 } | 5658 } |
| 5653 return 1 if $found; | 5659 return 1 if $found; |
| 5654 }, 0); | 5660 }, 0); |
| 5655 | 5661 |
| 5656 return $found; | 5662 return $found; |
| 5657 } | 5663 } |
| 5658 | 5664 |
| 5659 1; | 5665 1; |
| OLD | NEW |