| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 "onmouseenter" => 1, "onmouseleave" => 1, | 203 "onmouseenter" => 1, "onmouseleave" => 1, |
| 204 "onmousemove" => 1, "onmouseout" => 1, "onmouseov
er" => 1, | 204 "onmousemove" => 1, "onmouseout" => 1, "onmouseov
er" => 1, |
| 205 "onmouseup" => 1, "onresize" => 1, "onscroll" =>
1, | 205 "onmouseup" => 1, "onresize" => 1, "onscroll" =>
1, |
| 206 "onunload" => 1); | 206 "onunload" => 1); |
| 207 | 207 |
| 208 my %svgTypeNeedingTearOff = ( | 208 my %svgTypeNeedingTearOff = ( |
| 209 "SVGAngle" => "SVGPropertyTearOff<SVGAngle>", | 209 "SVGAngle" => "SVGPropertyTearOff<SVGAngle>", |
| 210 "SVGLength" => "SVGPropertyTearOff<SVGLength>", | 210 "SVGLength" => "SVGPropertyTearOff<SVGLength>", |
| 211 "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>", | 211 "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>", |
| 212 "SVGMatrix" => "SVGPropertyTearOff<SVGMatrix>", | 212 "SVGMatrix" => "SVGPropertyTearOff<SVGMatrix>", |
| 213 "SVGNumber" => "SVGPropertyTearOff<float>", | 213 "SVGNumber" => "SVGPropertyTearOff<SVGNumber>", |
| 214 "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>", | 214 "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>", |
| 215 "SVGPathSegList" => "SVGPathSegListPropertyTearOff", | 215 "SVGPathSegList" => "SVGPathSegListPropertyTearOff", |
| 216 "SVGPoint" => "SVGPropertyTearOff<SVGPoint>", | 216 "SVGPoint" => "SVGPropertyTearOff<SVGPoint>", |
| 217 "SVGPointList" => "SVGListPropertyTearOff<SVGPointList>", | 217 "SVGPointList" => "SVGListPropertyTearOff<SVGPointList>", |
| 218 "SVGPreserveAspectRatio" => "SVGPropertyTearOff<SVGPreserveAspectRatio>", | 218 "SVGPreserveAspectRatio" => "SVGPropertyTearOff<SVGPreserveAspectRatio>", |
| 219 "SVGRect" => "SVGPropertyTearOff<SVGRect>", | 219 "SVGRect" => "SVGPropertyTearOff<SVGRect>", |
| 220 "SVGStringList" => "SVGStaticListPropertyTearOff<SVGStringList>", | 220 "SVGStringList" => "SVGStaticListPropertyTearOff<SVGStringList>", |
| 221 "SVGTransform" => "SVGPropertyTearOff<SVGTransform>", | 221 "SVGTransform" => "SVGPropertyTearOff<SVGTransform>", |
| 222 "SVGTransformList" => "SVGTransformListPropertyTearOff" | 222 "SVGTransformList" => "SVGTransformListPropertyTearOff" |
| 223 ); | 223 ); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 411 } |
| 412 | 412 |
| 413 sub SkipIncludeHeader | 413 sub SkipIncludeHeader |
| 414 { | 414 { |
| 415 my $type = shift; | 415 my $type = shift; |
| 416 | 416 |
| 417 return 1 if IsPrimitiveType($type); | 417 return 1 if IsPrimitiveType($type); |
| 418 return 1 if IsEnumType($type); | 418 return 1 if IsEnumType($type); |
| 419 return 1 if IsCallbackFunctionType($type); | 419 return 1 if IsCallbackFunctionType($type); |
| 420 return 1 if $type eq "DOMString"; | 420 return 1 if $type eq "DOMString"; |
| 421 | |
| 422 # Special case: SVGNumber.h does not exist. | |
| 423 return 1 if $type eq "SVGNumber"; | |
| 424 return 0; | 421 return 0; |
| 425 } | 422 } |
| 426 | 423 |
| 427 sub AddIncludesForType | 424 sub AddIncludesForType |
| 428 { | 425 { |
| 429 my $type = shift; | 426 my $type = shift; |
| 430 | 427 |
| 431 return if SkipIncludeHeader($type); | 428 return if SkipIncludeHeader($type); |
| 432 | 429 |
| 433 # Default includes | 430 # Default includes |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 508 |
| 512 $svgNativeType = GetSVGTypeNeedingTearOff($implType); | 509 $svgNativeType = GetSVGTypeNeedingTearOff($implType); |
| 513 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgN
ativeType; | 510 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgN
ativeType; |
| 514 | 511 |
| 515 # Append space to avoid compilation errors when using PassRefPtr<$svgNative
Type> | 512 # Append space to avoid compilation errors when using PassRefPtr<$svgNative
Type> |
| 516 $svgNativeType = "$svgNativeType "; | 513 $svgNativeType = "$svgNativeType "; |
| 517 | 514 |
| 518 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($implType); | 515 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($implType); |
| 519 if ($svgNativeType =~ /SVGPropertyTearOff/) { | 516 if ($svgNativeType =~ /SVGPropertyTearOff/) { |
| 520 $svgPropertyType = $svgWrappedNativeType; | 517 $svgPropertyType = $svgWrappedNativeType; |
| 521 AddToImplIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h"); | 518 AddToHeaderIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h"); |
| 522 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SV
GStaticListPropertyTearOff/ or $svgNativeType =~ /SVGTransformListPropertyTearOf
f/) { | 519 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SV
GStaticListPropertyTearOff/ or $svgNativeType =~ /SVGTransformListPropertyTearOf
f/) { |
| 523 $svgListPropertyType = $svgWrappedNativeType; | 520 $svgListPropertyType = $svgWrappedNativeType; |
| 524 AddToHeaderIncludes("core/svg/properties/SVGAnimatedListPropertyTearOff.
h"); | 521 AddToHeaderIncludes("core/svg/properties/SVGAnimatedListPropertyTearOff.
h"); |
| 525 } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { | 522 } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { |
| 526 $svgListPropertyType = $svgWrappedNativeType; | 523 $svgListPropertyType = $svgWrappedNativeType; |
| 527 AddToHeaderIncludes("core/svg/properties/SVGPathSegListPropertyTearOff.h
"); | 524 AddToHeaderIncludes("core/svg/properties/SVGPathSegListPropertyTearOff.h
"); |
| 528 } | 525 } |
| 529 | 526 |
| 530 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); | 527 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); |
| 531 } | 528 } |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 my $v8ClassName = GetV8ClassName($interface); | 1344 my $v8ClassName = GetV8ClassName($interface); |
| 1348 my $attrExt = $attribute->extendedAttributes; | 1345 my $attrExt = $attribute->extendedAttributes; |
| 1349 my $attrName = $attribute->name; | 1346 my $attrName = $attribute->name; |
| 1350 my $attrType = $attribute->type; | 1347 my $attrType = $attribute->type; |
| 1351 | 1348 |
| 1352 if (HasCustomGetter($attrExt)) { | 1349 if (HasCustomGetter($attrExt)) { |
| 1353 return; | 1350 return; |
| 1354 } | 1351 } |
| 1355 | 1352 |
| 1356 AssertNotSequenceType($attrType); | 1353 AssertNotSequenceType($attrType); |
| 1357 my $getterStringUsesImp = $interfaceName ne "SVGNumber"; | |
| 1358 my $nativeType = GetNativeType($attribute->type, $attribute->extendedAttribu
tes, ""); | 1354 my $nativeType = GetNativeType($attribute->type, $attribute->extendedAttribu
tes, ""); |
| 1359 my $svgNativeType = GetSVGTypeNeedingTearOff($interfaceName); | 1355 my $svgNativeType = GetSVGTypeNeedingTearOff($interfaceName); |
| 1360 | 1356 |
| 1361 my $conditionalString = GenerateConditionalString($attribute); | 1357 my $conditionalString = GenerateConditionalString($attribute); |
| 1362 my $code = ""; | 1358 my $code = ""; |
| 1363 $code .= "#if ${conditionalString}\n\n" if $conditionalString; | 1359 $code .= "#if ${conditionalString}\n\n" if $conditionalString; |
| 1364 $code .= <<END; | 1360 $code .= <<END; |
| 1365 static void ${attrName}AttrGetter${forMainWorldSuffix}(v8::Local<v8::String> nam
e, const v8::PropertyCallbackInfo<v8::Value>& info) | 1361 static void ${attrName}AttrGetter${forMainWorldSuffix}(v8::Local<v8::String> nam
e, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 1366 { | 1362 { |
| 1367 END | 1363 END |
| 1368 if ($svgNativeType) { | 1364 if ($svgNativeType) { |
| 1369 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($interfaceNam
e); | 1365 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($interfaceNam
e); |
| 1370 if ($svgWrappedNativeType =~ /List/) { | 1366 if ($svgWrappedNativeType =~ /List/) { |
| 1371 $code .= <<END; | 1367 $code .= <<END; |
| 1372 $svgNativeType* imp = ${v8ClassName}::toNative(info.Holder()); | 1368 $svgNativeType* imp = ${v8ClassName}::toNative(info.Holder()); |
| 1373 END | 1369 END |
| 1374 } else { | 1370 } else { |
| 1375 $code .= <<END; | 1371 $code .= <<END; |
| 1376 $svgNativeType* wrapper = ${v8ClassName}::toNative(info.Holder()); | 1372 $svgNativeType* wrapper = ${v8ClassName}::toNative(info.Holder()); |
| 1377 $svgWrappedNativeType& impInstance = wrapper->propertyReference(); | 1373 $svgWrappedNativeType& impInstance = wrapper->propertyReference(); |
| 1378 END | |
| 1379 if ($getterStringUsesImp) { | |
| 1380 $code .= <<END; | |
| 1381 $svgWrappedNativeType* imp = &impInstance; | 1374 $svgWrappedNativeType* imp = &impInstance; |
| 1382 END | 1375 END |
| 1383 } | |
| 1384 } | 1376 } |
| 1385 } elsif ($attrExt->{"OnProto"} || $attrExt->{"Unforgeable"}) { | 1377 } elsif ($attrExt->{"OnProto"} || $attrExt->{"Unforgeable"}) { |
| 1386 if ($interfaceName eq "Window") { | 1378 if ($interfaceName eq "Window") { |
| 1387 $code .= <<END; | 1379 $code .= <<END; |
| 1388 v8::Handle<v8::Object> holder = info.Holder(); | 1380 v8::Handle<v8::Object> holder = info.Holder(); |
| 1389 END | 1381 END |
| 1390 } else { | 1382 } else { |
| 1391 # perform lookup first | 1383 # perform lookup first |
| 1392 $code .= <<END; | 1384 $code .= <<END; |
| 1393 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${
v8ClassName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); | 1385 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${
v8ClassName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); |
| 1394 if (holder.IsEmpty()) | 1386 if (holder.IsEmpty()) |
| 1395 return; | 1387 return; |
| 1396 END | 1388 END |
| 1397 } | 1389 } |
| 1398 $code .= <<END; | 1390 $code .= <<END; |
| 1399 ${implClassName}* imp = ${v8ClassName}::toNative(holder); | 1391 ${implClassName}* imp = ${v8ClassName}::toNative(holder); |
| 1400 END | 1392 END |
| 1401 } else { | 1393 } else { |
| 1402 my $reflect = $attribute->extendedAttributes->{"Reflect"}; | 1394 my $reflect = $attribute->extendedAttributes->{"Reflect"}; |
| 1403 my $url = $attribute->extendedAttributes->{"URL"}; | 1395 my $url = $attribute->extendedAttributes->{"URL"}; |
| 1404 if ($getterStringUsesImp && $reflect && !$url && InheritsInterface($inte
rface, "Node") && $attrType eq "DOMString") { | 1396 if ($reflect && !$url && InheritsInterface($interface, "Node") && $attrT
ype eq "DOMString") { |
| 1405 # Generate super-compact call for regular attribute getter: | 1397 # Generate super-compact call for regular attribute getter: |
| 1406 my ($functionName, @arguments) = GetterExpression($interfaceName, $a
ttribute); | 1398 my ($functionName, @arguments) = GetterExpression($interfaceName, $a
ttribute); |
| 1407 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; | 1399 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; |
| 1408 $code .= " v8SetReturnValue(info, v8String(imp->${functionName}("
. join(", ", @arguments) . "), info.GetIsolate()));\n"; | 1400 $code .= " v8SetReturnValue(info, v8String(imp->${functionName}("
. join(", ", @arguments) . "), info.GetIsolate()));\n"; |
| 1409 $code .= " return;\n"; | 1401 $code .= " return;\n"; |
| 1410 $code .= "}\n\n"; | 1402 $code .= "}\n\n"; |
| 1411 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; | 1403 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; |
| 1412 $implementation{nameSpaceInternal}->add($code); | 1404 $implementation{nameSpaceInternal}->add($code); |
| 1413 return; | 1405 return; |
| 1414 # Skip the rest of the function! | 1406 # Skip the rest of the function! |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 $code .= " ExceptionState es(info.GetIsolate());\n"; | 1438 $code .= " ExceptionState es(info.GetIsolate());\n"; |
| 1447 } | 1439 } |
| 1448 | 1440 |
| 1449 if ($isNullable) { | 1441 if ($isNullable) { |
| 1450 $code .= " bool isNull = false;\n"; | 1442 $code .= " bool isNull = false;\n"; |
| 1451 } | 1443 } |
| 1452 | 1444 |
| 1453 my $returnType = $attribute->type; | 1445 my $returnType = $attribute->type; |
| 1454 my $getterString; | 1446 my $getterString; |
| 1455 | 1447 |
| 1456 if ($getterStringUsesImp) { | 1448 my ($functionName, @arguments) = GetterExpression($interfaceName, $attribute
); |
| 1457 my ($functionName, @arguments) = GetterExpression($interfaceName, $attri
bute); | 1449 push(@arguments, "isNull") if $isNullable; |
| 1458 push(@arguments, "isNull") if $isNullable; | 1450 push(@arguments, "es") if $useExceptions; |
| 1459 push(@arguments, "es") if $useExceptions; | 1451 if ($attribute->extendedAttributes->{"ImplementedBy"}) { |
| 1460 if ($attribute->extendedAttributes->{"ImplementedBy"}) { | 1452 my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"}; |
| 1461 my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"
}; | 1453 my $implementedByImplName = GetImplNameFromImplementedBy($implementedBy)
; |
| 1462 my $implementedByImplName = GetImplNameFromImplementedBy($implemente
dBy); | 1454 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implementedBy
ImplName)); |
| 1463 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implement
edByImplName)); | 1455 unshift(@arguments, "imp") if !$attribute->isStatic; |
| 1464 unshift(@arguments, "imp") if !$attribute->isStatic; | 1456 $functionName = "${implementedByImplName}::${functionName}"; |
| 1465 $functionName = "${implementedByImplName}::${functionName}"; | 1457 } elsif ($attribute->isStatic) { |
| 1466 } elsif ($attribute->isStatic) { | 1458 $functionName = "${implClassName}::${functionName}"; |
| 1467 $functionName = "${implClassName}::${functionName}"; | |
| 1468 } else { | |
| 1469 $functionName = "imp->${functionName}"; | |
| 1470 } | |
| 1471 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{
"CallWith"}, " ", 0); | |
| 1472 $code .= $subCode; | |
| 1473 unshift(@arguments, @$arg); | |
| 1474 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; | |
| 1475 } else { | 1459 } else { |
| 1476 $getterString = "impInstance"; | 1460 $functionName = "imp->${functionName}"; |
| 1477 } | 1461 } |
| 1462 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{"Cal
lWith"}, " ", 0); |
| 1463 $code .= $subCode; |
| 1464 unshift(@arguments, @$arg); |
| 1465 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; |
| 1478 | 1466 |
| 1479 my $expression; | 1467 my $expression; |
| 1480 if ($attribute->type eq "EventListener" && $interface->name eq "Window") { | 1468 if ($attribute->type eq "EventListener" && $interface->name eq "Window") { |
| 1481 $code .= " if (!imp->document())\n"; | 1469 $code .= " if (!imp->document())\n"; |
| 1482 $code .= " return;\n"; | 1470 $code .= " return;\n"; |
| 1483 } | 1471 } |
| 1484 | 1472 |
| 1485 if ($useExceptions || $isNullable) { | 1473 if ($useExceptions || $isNullable) { |
| 1486 if ($nativeType =~ /^V8StringResource/) { | 1474 if ($nativeType =~ /^V8StringResource/) { |
| 1487 $code .= " " . ConvertToV8StringResource($attribute, $nativeType,
"v", $getterString) . ";\n"; | 1475 $code .= " " . ConvertToV8StringResource($attribute, $nativeType,
"v", $getterString) . ";\n"; |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 | 1863 |
| 1876 $code .= GenerateCustomElementInvocationScopeIfNeeded($attribute->extendedAt
tributes); | 1864 $code .= GenerateCustomElementInvocationScopeIfNeeded($attribute->extendedAt
tributes); |
| 1877 | 1865 |
| 1878 my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesExcep
tion"} || $attribute->extendedAttributes->{"RaisesException"}; | 1866 my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesExcep
tion"} || $attribute->extendedAttributes->{"RaisesException"}; |
| 1879 | 1867 |
| 1880 if ($useExceptions) { | 1868 if ($useExceptions) { |
| 1881 AddToImplIncludes("bindings/v8/ExceptionState.h"); | 1869 AddToImplIncludes("bindings/v8/ExceptionState.h"); |
| 1882 $code .= " ExceptionState es(info.GetIsolate());\n"; | 1870 $code .= " ExceptionState es(info.GetIsolate());\n"; |
| 1883 } | 1871 } |
| 1884 | 1872 |
| 1885 if ($interfaceName eq "SVGNumber") { | 1873 if ($attribute->type eq "EventListener") { |
| 1886 $code .= " *imp = $expression;\n"; | 1874 my $implSetterFunctionName = FirstLetterToUpperCase($attrName); |
| 1875 AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| 1876 if (!InheritsInterface($interface, "Node")) { |
| 1877 my $attrImplName = GetImplName($attribute); |
| 1878 $code .= " transferHiddenDependency(info.Holder(), imp->${attrImp
lName}(isolatedWorldForIsolate(info.GetIsolate())), value, ${v8ClassName}::event
ListenerCacheIndex, info.GetIsolate());\n"; |
| 1879 } |
| 1880 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); |
| 1881 if (($interfaceName eq "Window" or $interfaceName eq "WorkerGlobalScope"
) and $attribute->name eq "onerror") { |
| 1882 AddToImplIncludes("bindings/v8/V8ErrorHandler.h"); |
| 1883 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::f
indOrCreateWrapper<V8ErrorHandler>(value, true), isolatedWorldForIsolate(info.Ge
tIsolate()));\n"; |
| 1884 } else { |
| 1885 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::g
etEventListener(value, true, ListenerFindOrCreate), isolatedWorldForIsolate(info
.GetIsolate()));\n"; |
| 1886 } |
| 1887 } else { | 1887 } else { |
| 1888 if ($attribute->type eq "EventListener") { | 1888 my ($functionName, @arguments) = SetterExpression($interfaceName, $attri
bute); |
| 1889 my $implSetterFunctionName = FirstLetterToUpperCase($attrName); | 1889 push(@arguments, $expression); |
| 1890 AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); | 1890 push(@arguments, "es") if $useExceptions; |
| 1891 if (!InheritsInterface($interface, "Node")) { | 1891 if ($attribute->extendedAttributes->{"ImplementedBy"}) { |
| 1892 my $attrImplName = GetImplName($attribute); | 1892 my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"
}; |
| 1893 $code .= " transferHiddenDependency(info.Holder(), imp->${att
rImplName}(isolatedWorldForIsolate(info.GetIsolate())), value, ${v8ClassName}::e
ventListenerCacheIndex, info.GetIsolate());\n"; | 1893 my $implementedByImplName = GetImplNameFromImplementedBy($implemente
dBy); |
| 1894 } | 1894 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implement
edByImplName)); |
| 1895 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); | 1895 unshift(@arguments, "imp") if !$attribute->isStatic; |
| 1896 if (($interfaceName eq "Window" or $interfaceName eq "WorkerGlobalSc
ope") and $attribute->name eq "onerror") { | 1896 $functionName = "${implementedByImplName}::${functionName}"; |
| 1897 AddToImplIncludes("bindings/v8/V8ErrorHandler.h"); | 1897 } elsif ($attribute->isStatic) { |
| 1898 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::findOrCreateWrapper<V8ErrorHandler>(value, true), isolatedWorldForIsolate(inf
o.GetIsolate()));\n"; | 1898 $functionName = "${implClassName}::${functionName}"; |
| 1899 } else { | |
| 1900 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::getEventListener(value, true, ListenerFindOrCreate), isolatedWorldForIsolate(
info.GetIsolate()));\n"; | |
| 1901 } | |
| 1902 } else { | 1899 } else { |
| 1903 my ($functionName, @arguments) = SetterExpression($interfaceName, $a
ttribute); | 1900 $functionName = "imp->${functionName}"; |
| 1904 push(@arguments, $expression); | |
| 1905 push(@arguments, "es") if $useExceptions; | |
| 1906 if ($attribute->extendedAttributes->{"ImplementedBy"}) { | |
| 1907 my $implementedBy = $attribute->extendedAttributes->{"Implemente
dBy"}; | |
| 1908 my $implementedByImplName = GetImplNameFromImplementedBy($implem
entedBy); | |
| 1909 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $imple
mentedByImplName)); | |
| 1910 unshift(@arguments, "imp") if !$attribute->isStatic; | |
| 1911 $functionName = "${implementedByImplName}::${functionName}"; | |
| 1912 } elsif ($attribute->isStatic) { | |
| 1913 $functionName = "${implClassName}::${functionName}"; | |
| 1914 } else { | |
| 1915 $functionName = "imp->${functionName}"; | |
| 1916 } | |
| 1917 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttribute
s->{"SetterCallWith"} || $attribute->extendedAttributes->{"CallWith"}, " ", 1
); | |
| 1918 $code .= $subCode; | |
| 1919 unshift(@arguments, @$arg); | |
| 1920 $code .= " ${functionName}(" . join(", ", @arguments) . ");\n"; | |
| 1921 } | 1901 } |
| 1902 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{
"SetterCallWith"} || $attribute->extendedAttributes->{"CallWith"}, " ", 1); |
| 1903 $code .= $subCode; |
| 1904 unshift(@arguments, @$arg); |
| 1905 $code .= " ${functionName}(" . join(", ", @arguments) . ");\n"; |
| 1922 } | 1906 } |
| 1923 | 1907 |
| 1924 if ($useExceptions) { | 1908 if ($useExceptions) { |
| 1925 $code .= " es.throwIfNeeded();\n"; | 1909 $code .= " es.throwIfNeeded();\n"; |
| 1926 } | 1910 } |
| 1927 | 1911 |
| 1928 if (ExtendedAttributeContains($attribute->extendedAttributes->{"CallWith"},
"ScriptState")) { | 1912 if (ExtendedAttributeContains($attribute->extendedAttributes->{"CallWith"},
"ScriptState")) { |
| 1929 $code .= " if (state.hadException())\n"; | 1913 $code .= " if (state.hadException())\n"; |
| 1930 $code .= " throwError(state.exception(), info.GetIsolate());\n"; | 1914 $code .= " throwError(state.exception(), info.GetIsolate());\n"; |
| 1931 } | 1915 } |
| (...skipping 4093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6025 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 6009 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
| 6026 $found = 1; | 6010 $found = 1; |
| 6027 } | 6011 } |
| 6028 return 1 if $found; | 6012 return 1 if $found; |
| 6029 }, 0); | 6013 }, 0); |
| 6030 | 6014 |
| 6031 return $found; | 6015 return $found; |
| 6032 } | 6016 } |
| 6033 | 6017 |
| 6034 1; | 6018 1; |
| OLD | NEW |