Changeset 70631 in webkit
- Timestamp:
- Oct 27, 2010 3:26:56 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70630 r70631 1 2010-10-26 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Rob Buis. 4 5 Convert SVGRect to the new SVGPropertyTearOff concept 6 https://bugs.webkit.org/show_bug.cgi?id=48204 7 8 Added new test verifying that StrictTypeChecking is enabled for SVGRect. 9 10 * svg/dom/SVGRect-expected.txt: Added. 11 * svg/dom/SVGRect.html: Added. 12 * svg/dom/script-tests/SVGRect.js: Added. 13 1 14 2010-10-27 Adam Roben <aroben@apple.com> 2 15 -
trunk/WebCore/ChangeLog
r70624 r70631 1 2010-10-26 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Rob Buis. 4 5 Convert SVGRect to the new SVGPropertyTearOff concept 6 https://bugs.webkit.org/show_bug.cgi?id=48204 7 8 Convert the next SVG primitive type to use the SVGPropertyTearOff concept: SVGRect. 9 Added new test verifying that StrictTypeChecking is enabled for SVGRect. Refactor and share code between JSC/V8/ObjC generators. 10 11 Test: svg/dom/SVGRect.html 12 13 * GNUmakefile.am: Add SVGAnimatedRect.h to build. 14 * WebCore.gypi: Ditto. 15 * WebCore.pro: Ditto. 16 * WebCore.vcproj/WebCore.vcproj: Ditto. 17 * WebCore.xcodeproj/project.pbxproj: Ditto. 18 * bindings/scripts/CodeGenerator.pm: Refactor SVGPropertyTearOff handling, and share code between JSC/V8/ObjC generators. 19 * bindings/scripts/CodeGeneratorJS.pm: Ditto. 20 * bindings/scripts/CodeGeneratorObjC.pm: Ditto. 21 * bindings/scripts/CodeGeneratorV8.pm: Ditto. 22 * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedRect handling. 23 * svg/DeprecatedSVGAnimatedTemplate.h: Ditto. 24 * svg/SVGAngle.idl: Remove [SVGProperty] flag. 25 * svg/SVGAnimatedAngle.idl: Remove [SVGAnimatedProperty] flag. 26 * svg/SVGAnimatedLength.idl: Ditto. 27 * svg/SVGAnimatedLengthList.idl: Ditto. 28 * svg/SVGAnimatedRect.h: Added. 29 * svg/SVGFitToViewBox.h: SVGRect now uses the new tear off concept, adapt code. 30 * svg/SVGLength.idl: Remove [SVGProperty] flag. 31 * svg/SVGMarkerElement.h: 32 * svg/SVGPatternElement.h: 33 * svg/SVGRect.idl: Remove [PODType] flag, add StrictTypeChecking to all attributes. 34 * svg/SVGSVGElement.cpp: s/setViewBox/setViewBoxBaseValue/. 35 (WebCore::SVGSVGElement::currentView): 36 (WebCore::SVGSVGElement::inheritViewAttributes): 37 * svg/SVGSVGElement.h: 38 * svg/SVGSVGElement.idl: Remove [Immutable] flags for SVGRect types, no longer needed. 39 * svg/SVGSymbolElement.h: 40 * svg/SVGViewElement.h: 41 * svg/SVGViewSpec.cpp: Take a SVGElement as context element. 42 (WebCore::SVGViewSpec::SVGViewSpec): 43 * svg/SVGViewSpec.h: Ditto. 44 (WebCore::SVGViewSpec::contextElement): 45 * svg/SVGZoomEvent.idl: Remove [Immutable] flags for SVGRect types, no longer needed. 46 * svg/properties/SVGAnimatedPropertyMacros.h: Support declaring animated properties on non-SVGElement types (here: SVGViewSpec), just like the old macros handled it. 47 1 48 2010-10-27 Pavel Podivilov <podivilov@chromium.org> 2 49 -
trunk/WebCore/GNUmakefile.am
r70581 r70631 3042 3042 WebCore/svg/SVGAnimatedPoints.cpp \ 3043 3043 WebCore/svg/SVGAnimatedPoints.h \ 3044 WebCore/svg/SVGAnimatedRect.h \ 3044 3045 WebCore/svg/SVGAnimateElement.cpp \ 3045 3046 WebCore/svg/SVGAnimateElement.h \ -
trunk/WebCore/WebCore.gypi
r70581 r70631 3974 3974 'svg/SVGAnimatedPoints.cpp', 3975 3975 'svg/SVGAnimatedPoints.h', 3976 'svg/SVGAnimatedRect.h', 3976 3977 'svg/SVGAnimationElement.cpp', 3977 3978 'svg/SVGAnimationElement.h', -
trunk/WebCore/WebCore.pro
r70581 r70631 2366 2366 svg/SVGAnimatedPathData.h \ 2367 2367 svg/SVGAnimatedPoints.h \ 2368 svg/SVGAnimatedRect.h \ 2368 2369 svg/SVGAnimateElement.h \ 2369 2370 svg/SVGAnimateMotionElement.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r70597 r70631 61497 61497 </File> 61498 61498 <File 61499 RelativePath="..\svg\SVGAnimatedRect.h" 61500 > 61501 </File> 61502 <File 61499 61503 RelativePath="..\svg\SVGAnimateElement.h" 61500 61504 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r70581 r70631 226 226 08C6A7AC117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */; }; 227 227 08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; }; 228 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C859BF1274575300A5728D /* SVGAnimatedRect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 228 229 08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */; }; 229 230 08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; }; … … 6219 6220 08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceSolidColor.cpp; sourceTree = "<group>"; }; 6220 6221 08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceSolidColor.h; sourceTree = "<group>"; }; 6222 08C859BF1274575300A5728D /* SVGAnimatedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedRect.h; sourceTree = "<group>"; }; 6221 6223 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FilterEffect.cpp; path = filters/FilterEffect.cpp; sourceTree = "<group>"; }; 6222 6224 08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FilterEffect.h; path = filters/FilterEffect.h; sourceTree = "<group>"; }; … … 15980 15982 B22277F30D00BF1F0071B782 /* SVGAnimatedPoints.idl */, 15981 15983 B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */, 15984 08C859BF1274575300A5728D /* SVGAnimatedRect.h */, 15982 15985 B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */, 15983 15986 B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */, … … 21176 21179 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */, 21177 21180 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */, 21181 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */, 21178 21182 758978ED127090D60076D5A9 /* SpeechInputResult.h in Headers */, 21179 21183 ); … … 21236 21240 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 21237 21241 compatibilityVersion = "Xcode 2.4"; 21238 developmentRegion = English;21239 21242 hasScannedForEncodings = 1; 21240 21243 knownRegions = ( -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r70581 r70631 52 52 53 53 my %podTypeHash = ("SVGNumber" => 1, "SVGTransform" => 1); 54 my %podTypesWithWritablePropertiesHash = ("SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1 , "SVGRect" => 1);54 my %podTypesWithWritablePropertiesHash = ("SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1); 55 55 my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1); 56 56 57 57 my %nonPointerTypeHash = ("DOMTimeStamp" => 1, "CompareHow" => 1, "SVGPaintType" => 1); 58 58 59 my %svgTypeNeedingTearOffHash = ("SVGLength" => 1, "SVGAngle" => 1); 60 61 my %svgNewStyleAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1); 59 my %svgNewStyleAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1, "SVGAnimatedRect" => 1); 62 60 63 61 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, … … 74 72 "onmouseup" => 1, "onresize" => 1, "onscroll" => 1, 75 73 "onunload" => 1); 74 75 my %svgNativeType = ( 76 "SVGAngle" => "SVGPropertyTearOff<SVGAngle>", 77 "SVGLength" => "SVGPropertyTearOff<SVGLength>", 78 "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>", 79 "SVGRect" => "SVGPropertyTearOff<FloatRect>" 80 ); 76 81 77 82 # Cache of IDL file pathnames. … … 288 293 # Helpers for all CodeGenerator***.pm modules 289 294 295 sub AvoidInclusionOfType 296 { 297 my $object = shift; 298 my $type = shift; 299 300 # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist. 301 return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix"; 302 return 0; 303 } 304 290 305 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme. 291 306 sub IsPodType … … 345 360 } 346 361 347 348 362 sub IsSVGTypeNeedingTearOff 349 363 { … … 351 365 my $type = shift; 352 366 353 return 1 if $svgTypeNeedingTearOffHash{$type}; 354 return 0; 367 return 1 if exists $svgNativeType{$type}; 368 return 0; 369 } 370 371 sub GetSVGTypeNeedingTearOff 372 { 373 my $object = shift; 374 my $type = shift; 375 376 return $svgNativeType{$type} if exists $svgNativeType{$type}; 377 return undef; 378 } 379 380 sub GetSVGWrappedTypeNeedingTearOff 381 { 382 my $object = shift; 383 my $type = shift; 384 385 my $svgNativeType = $object->GetSVGTypeNeedingTearOff($type); 386 return $svgNativeType if not $svgNativeType; 387 388 if ($svgNativeType =~ /SVGPropertyTearOff/) { 389 $svgNativeType =~ s/SVGPropertyTearOff<//; 390 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) { 391 $svgNativeType =~ s/SVGListPropertyTearOff<//; 392 } 393 $svgNativeType =~ s/>//; 394 return $svgNativeType; 355 395 } 356 396 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r70581 r70631 228 228 } 229 229 230 sub AvoidInclusionOfType231 {232 my $type = shift;233 234 # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist.235 return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix";236 return 0;237 }238 239 230 sub IndexGetterReturnsStrings 240 231 { … … 252 243 # When we're finished with the one-file-per-class 253 244 # reorganization, we won't need these special cases. 254 if ($codeGenerator->IsPrimitiveType($type) or AvoidInclusionOfType($type)245 if ($codeGenerator->IsPrimitiveType($type) or $codeGenerator->AvoidInclusionOfType($type) 255 246 or $type eq "DOMString" or $type eq "DOMObject" or $type eq "Array") { 256 247 } elsif ($type =~ /SVGPathSeg/) { … … 285 276 } 286 277 278 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme. 287 279 sub AddIncludesForSVGAnimatedType 288 280 { … … 335 327 return 0 if $implClassName =~ /Element/; 336 328 return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName); 337 338 my @noContextNeeded = ("SVGAngle", "SVGLength", "SVGLengthList", "SVGPaint", "SVGColor", "SVGDocument", "SVGZoomEvent"); 329 return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 330 331 my @noContextNeeded = ("SVGColor", "SVGDocument", "SVGPaint", "SVGZoomEvent"); 339 332 foreach (@noContextNeeded) { 340 333 return 0 if $implClassName eq $_; … … 674 667 675 668 $headerIncludes{"<runtime/JSObjectWithGlobalObject.h>"} = 1; 676 677 669 $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; 678 670 679 # Get correct pass/store types respecting PODType flag680 671 my $implType = $implClassName; 681 682 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 683 if ($svgPropertyType) { 684 $implType = "SVGPropertyTearOff<$svgPropertyType> "; 685 $headerIncludes{"SVGAnimatedProperty.h"} = 1; 686 $headerIncludes{"SVGPropertyTearOff.h"} = 1; 687 $headerIncludes{"$svgPropertyType.h"} = 1 if $svgPropertyType ne "float"; 688 } 689 690 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 691 if ($svgListPropertyType) { 692 $implType = "SVGListPropertyTearOff<$svgListPropertyType> "; 693 $headerIncludes{"SVGAnimatedProperty.h"} = 1; 694 $headerIncludes{"SVGListPropertyTearOff.h"} = 1; 695 $headerIncludes{"$svgListPropertyType.h"} = 1; 696 } 672 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType); 673 $implType = $svgNativeType if $svgNativeType; 697 674 698 675 # FIXME: Old style SVG JS bindings, will vanish soon. … … 715 692 push(@headerContent, "\nnamespace WebCore {\n\n"); 716 693 717 my $svgAnimatedPropertyType = $dataNode->extendedAttributes->{"SVGAnimatedProperty"}; 718 $headerIncludes{"$implClassName.h"} = 1 if $svgAnimatedPropertyType; 719 720 # Implementation class forward declaration 721 AddClassForwardIfNeeded($implClassName) unless $svgPropertyOrPodType or $svgAnimatedPropertyType; 694 if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) { 695 $headerIncludes{"$implClassName.h"} = 1; 696 } else { 697 # Implementation class forward declaration 698 AddClassForwardIfNeeded($implClassName) unless $svgPropertyOrPodType; 699 } 700 722 701 AddClassForwardIfNeeded("JSDOMWindowShell") if $interfaceName eq "DOMWindow"; 723 702 … … 1448 1427 push(@implContent, "};\n\n"); 1449 1428 1450 # Get correct pass/store types respecting PODType flag1451 1429 my $implType = $implClassName; 1452 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 1453 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 1430 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType); 1431 $implType = $svgNativeType if $svgNativeType; 1432 1454 1433 my $podType = $dataNode->extendedAttributes->{"PODType"}; 1455 if ($svgPropertyType) { 1456 $implType = "SVGPropertyTearOff<$svgPropertyType> "; 1457 } elsif ($svgListPropertyType) { 1458 $implType = "SVGListPropertyTearOff<$svgListPropertyType> "; 1459 } elsif ($podType) { 1434 if ($podType) { 1460 1435 $implType = "JSSVGPODTypeWrapper<$podType> "; 1461 1436 } … … 1811 1786 # a TypeError is thrown instead of casting to null. 1812 1787 if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) { 1788 $implIncludes{"<runtime/Error.h>"} = 1; 1789 1813 1790 my $argType = $attribute->signature->type; 1814 1791 if (!IsNativeType($argType)) { … … 2078 2055 # a TypeError is thrown instead of casting to null. 2079 2056 if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) { 2057 $implIncludes{"<runtime/Error.h>"} = 1; 2058 2080 2059 my $argValue = "exec->argument($argsIndex)"; 2081 2060 if (!IsNativeType($argType)) { … … 2471 2450 "SerializedScriptValue" => "RefPtr<SerializedScriptValue>", 2472 2451 "IDBKey" => "RefPtr<IDBKey>", 2473 "SVGAngle" => "SVGPropertyTearOff<SVGAngle>*",2474 "SVGLength" => "SVGPropertyTearOff<SVGLength>*",2475 2452 "SVGMatrix" => "AffineTransform", 2476 2453 "SVGNumber" => "float", … … 2494 2471 my $type = shift; 2495 2472 2473 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type); 2474 return "${svgNativeType}*" if $svgNativeType; 2496 2475 return $nativeType{$type} if exists $nativeType{$type}; 2497 2476 2498 2477 # For all other types, the native type is a pointer with same type name as the IDL type. 2499 2478 return "${type}*"; 2479 } 2480 2481 sub GetSVGPropertyTypes 2482 { 2483 my $implType = shift; 2484 2485 my $svgPropertyType; 2486 my $svgListPropertyType; 2487 my $svgNativeType; 2488 2489 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/; 2490 2491 $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); 2492 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType; 2493 2494 # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType> 2495 $svgNativeType = "$svgNativeType "; 2496 2497 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); 2498 if ($svgNativeType =~ /SVGPropertyTearOff/) { 2499 $svgPropertyType = $svgWrappedNativeType; 2500 $headerIncludes{"$svgWrappedNativeType.h"} = 1; 2501 $headerIncludes{"SVGPropertyTearOff.h"} = 1; 2502 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) { 2503 $svgListPropertyType = $svgWrappedNativeType; 2504 $headerIncludes{"$svgWrappedNativeType.h"} = 1; 2505 $headerIncludes{"SVGListPropertyTearOff.h"} = 1; 2506 } 2507 2508 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); 2500 2509 } 2501 2510 … … 2650 2659 # Default, include header with same name. 2651 2660 $implIncludes{"JS$type.h"} = 1; 2652 $implIncludes{"$type.h"} = 1 ;2661 $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type); 2653 2662 } 2654 2663 … … 2666 2675 if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) { 2667 2676 # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. 2668 if ($implClassName =~ /List$/) { 2669 $value = "static_cast<SVGListPropertyTearOff<$type>*>($value)"; 2670 } else { 2671 $value = "static_cast<SVGPropertyTearOff<$type>*>($value)"; 2672 } 2677 $value = "static_cast<" . GetNativeType($type) . ">($value)"; 2673 2678 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $implClassName =~ /List$/) { 2674 $value = "SVGPropertyTearOff<$type>::create($value)";2679 $value = $codeGenerator->GetSVGTypeNeedingTearOff($type) . "::create($value)"; 2675 2680 } 2676 2681 -
trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r70581 r70631 601 601 } 602 602 603 if ($type eq "SVGRect") {604 $implIncludes{"FloatRect.h"} = 1;605 $implIncludes{"DOMSVGRectInternal.h"} = 1;606 return;607 }608 609 603 if ($type eq "SVGPoint") { 610 604 $implIncludes{"FloatPoint.h"} = 1; … … 659 653 660 654 # Default, include the same named file (the implementation) and the same name prefixed with "DOM". 661 $implIncludes{"$type.h"} = 1 ;655 $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type); 662 656 $implIncludes{"DOM${type}Internal.h"} = 1; 657 } 658 659 sub GetSVGPropertyTypes 660 { 661 my $implType = shift; 662 663 my $svgPropertyType; 664 my $svgListPropertyType; 665 my $svgNativeType; 666 667 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/; 668 669 $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); 670 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType; 671 672 # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType> 673 $svgNativeType = "WebCore::$svgNativeType "; 674 $svgNativeType =~ s/</\<WebCore::/; 675 676 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); 677 if ($svgNativeType =~ /SVGPropertyTearOff/) { 678 $svgPropertyType = "WebCore::$svgWrappedNativeType"; 679 $svgPropertyType =~ s/</\<WebCore::/; 680 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) { 681 $svgListPropertyType = "WebCore::$svgWrappedNativeType"; 682 $svgListPropertyType =~ s/</\<WebCore::/; 683 } 684 685 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); 663 686 } 664 687 … … 975 998 # Generate internal interfaces 976 999 my $podType = $dataNode->extendedAttributes->{"PODType"}; 977 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"};978 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"};979 1000 my $podTypeWithNamespace; 980 my $svgPropertyTypeWithNamespace;981 my $svgListPropertyTypeWithNamespace;982 1001 my $implClassName = GetImplClassName($interfaceName); 983 1002 my $implClassNameWithNamespace = "WebCore::" . $implClassName; 984 1003 985 1004 my $implType = $implClassNameWithNamespace; 1005 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); 1006 $implType = $svgNativeType if $svgNativeType; 1007 986 1008 if ($podType) { 987 1009 $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType"; 988 } elsif ($svgPropertyType) {989 $implType = "WebCore::SVGPropertyTearOff<$implType>";990 $svgPropertyTypeWithNamespace = ($svgPropertyType eq "float") ? "$svgPropertyType" : "WebCore::$svgPropertyType";991 } elsif ($svgListPropertyType) {992 $implType = "WebCore::SVGListPropertyTearOff<$implType>";993 $svgListPropertyTypeWithNamespace = "WebCore::$svgListPropertyType";994 1010 } 995 1011 … … 1018 1034 if ($podType and $podType ne "float") { 1019 1035 push(@internalHeaderContent, " class $podType;\n"); 1020 } elsif ($svgPropertyType and $svgPropertyType ne "float") {1021 push(@internalHeaderContent, " class $svgPropertyType;\n");1022 } elsif ($svgListPropertyType) {1023 push(@internalHeaderContent, " class $svgListPropertyType;\n");1024 1036 } elsif ($interfaceName eq "Node") { 1025 1037 push(@internalHeaderContent, " class EventTarget;\n class Node;\n"); … … 1073 1085 1074 1086 my $podType = $dataNode->extendedAttributes->{"PODType"}; 1075 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"};1076 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"};1077 1087 my $podTypeWithNamespace; 1078 my $svgPropertyTypeWithNamespace;1079 my $svgListPropertyTypeWithNamespace;1080 1088 my $implType = $implClassNameWithNamespace; 1089 1090 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); 1091 $implType = $svgNativeType if $svgNativeType; 1081 1092 1082 1093 if ($podType) { 1083 1094 $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType"; 1084 } elsif ($svgPropertyType) {1085 $implType = "WebCore::SVGPropertyTearOff<$implType>";1086 $svgPropertyTypeWithNamespace = ($svgPropertyType eq "float") ? "$svgPropertyType" : "WebCore::$svgPropertyType";1087 } elsif ($svgListPropertyType) {1088 $implType = "WebCore::SVGListPropertyTearOff<$implType>";1089 $svgListPropertyTypeWithNamespace = "WebCore::$svgListPropertyType";1090 1095 } 1091 1096 … … 1124 1129 } else { 1125 1130 if (!$podType) { 1126 $implIncludes{"$implClassName.h"} = 1 ;1131 $implIncludes{"$implClassName.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($implClassName); 1127 1132 } else { 1128 1133 $implIncludes{"$podType.h"} = 1 unless $podType eq "float"; … … 1228 1233 my $getterContentTail = ")"; 1229 1234 1230 my $svgAnimatedPropertyType = $dataNode->extendedAttributes->{"SVGAnimatedProperty"};1231 1235 if ($svgPropertyType) { 1232 1236 $getterContentHead = "$getterExpressionPrefix"; 1233 1237 1234 1238 # TODO: Handle special case for DOMSVGLength. We do need Custom code support for this. 1235 if ($svgPropertyType eq " SVGLength" and $attributeName eq "value") {1239 if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") { 1236 1240 $getterContentHead = "value(0 /* FIXME */"; 1237 1241 } … … 1286 1290 } elsif ($svgPropertyType) { 1287 1291 $getterContentHead = "IMPL->propertyReference().$getterContentHead"; 1288 } elsif ($svgAnimatedPropertyType) { 1289 if ($idlType =~ /List$/) { 1290 $getterContentHead = "kit(static_cast<WebCore::SVGListPropertyTearOff<WebCore::$idlType>*>($getterContentHead)"; 1291 } else { 1292 $getterContentHead = "kit(static_cast<WebCore::SVGPropertyTearOff<WebCore::$idlType>*>($getterContentHead)"; 1293 } 1292 } elsif ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) { 1293 my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType); 1294 $idlTypeWithNamespace =~ s/</\<WebCore::/; 1295 $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)"; 1294 1296 $getterContentTail .= ")"; 1295 1297 } elsif (IsProtocolType($idlType) and $idlType ne "EventTarget") { … … 1303 1305 $getterContentTail .= "->toString()"; 1304 1306 } elsif (ConversionNeeded($attribute->signature->type)) { 1305 $getterContentHead = "kit(WTF::getPtr($getterContentHead"; 1306 $getterContentTail .= "))"; 1307 if ($codeGenerator->IsSVGTypeNeedingTearOff($attribute->signature->type) and not $implClassName =~ /List$/) { 1308 my $idlType = $attribute->signature->type; 1309 my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType); 1310 $idlTypeWithNamespace =~ s/</\<WebCore::/; 1311 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead"; 1312 $getterContentTail .= ")))"; 1313 } else { 1314 $getterContentHead = "kit(WTF::getPtr($getterContentHead"; 1315 $getterContentTail .= "))"; 1316 } 1307 1317 } 1308 1318 … … 1370 1380 if ($svgPropertyType) { 1371 1381 $getterContentHead = "$getterExpressionPrefix"; 1372 push(@implContent, " $svgPropertyType WithNamespace& podImpl = IMPL->propertyReference();\n");1382 push(@implContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n"); 1373 1383 my $ec = $hasSetterException ? ", ec" : ""; 1374 1384 push(@implContent, " $exceptionInit\n") if $hasSetterException; … … 1509 1519 my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector"); 1510 1520 my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse"); 1511 my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq " SVGLength" and $functionName eq "convertToSpecifiedUnits");1521 my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "WebCore::SVGLength" and $functionName eq "convertToSpecifiedUnits"); 1512 1522 1513 1523 push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse); … … 1525 1535 1526 1536 my $implGetter = GetObjCTypeGetter($paramName, $idlType); 1527 my $idlTypeWithNamespace = ($idlType eq "float") ? "$idlType" : "WebCore::$idlType"; 1528 1529 push(@functionContent, " WebCore::SVGPropertyTearOff<$idlTypeWithNamespace>* ${paramName}Core = $implGetter;\n"); 1537 my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType); 1538 $idlTypeWithNamespace =~ s/</\<WebCore::/; 1539 1540 push(@functionContent, " $idlTypeWithNamespace* ${paramName}Core = $implGetter;\n"); 1530 1541 push(@functionContent, " if (!${paramName}Core) {\n"); 1531 1542 push(@functionContent, " WebCore::ExceptionCode ec = WebCore::TYPE_MISMATCH_ERR;\n"); … … 1545 1556 1546 1557 if ($svgPropertyType) { 1547 push(@functionContent, " $svgPropertyType WithNamespace& podImpl = IMPL->propertyReference();\n");1558 push(@functionContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n"); 1548 1559 $content = "podImpl.$content;\n IMPL->commitChange()"; 1549 1560 } else { … … 1594 1605 if (ConversionNeeded($function->signature->type)) { 1595 1606 if ($codeGenerator->IsSVGTypeNeedingTearOff($function->signature->type) and not $implClassName =~ /List$/) { 1596 $content = "kit(WTF::getPtr(WebCore::SVGPropertyTearOff<WebCore::" . $function->signature->type . ">::create($content)))"; 1607 my $idlType = $function->signature->type; 1608 my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType); 1609 $idlTypeWithNamespace =~ s/</\<WebCore::/; 1610 $content = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($content)))"; 1597 1611 } elsif ($codeGenerator->IsPodType($function->signature->type)) { 1598 1612 $content = "kit($content)"; -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r70581 r70631 213 213 } 214 214 215 sub GetSVGPropertyTypes 216 { 217 my $implType = shift; 218 219 my $svgPropertyType; 220 my $svgListPropertyType; 221 my $svgNativeType; 222 223 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/; 224 225 $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType); 226 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType; 227 228 # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType> 229 $svgNativeType = "$svgNativeType "; 230 231 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType); 232 if ($svgNativeType =~ /SVGPropertyTearOff/) { 233 $svgPropertyType = $svgWrappedNativeType; 234 $implIncludes{"SVGPropertyTearOff.h"} = 1, 235 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) { 236 $svgListPropertyType = $svgWrappedNativeType; 237 $implIncludes{"SVGListPropertyTearOff.h"} = 1, 238 } 239 240 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); 241 } 242 215 243 sub GenerateHeader 216 244 { … … 230 258 # - Add default header template 231 259 push(@headerContent, GenerateHeaderContentHeader($dataNode)); 232 233 # Get correct pass/store types respecting PODType flag234 260 my $podType = $dataNode->extendedAttributes->{"PODType"}; 235 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"};236 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"};237 261 238 262 my %headerInclues = (); 239 263 $headerIncludes{"$podType.h"} = 1 if $podType and ($podType ne "double" and $podType ne "float" and $podType ne "RGBA32"); 240 $headerIncludes{"$svgPropertyType.h"} = 1 if $svgPropertyType and $svgPropertyType ne "float";241 $headerIncludes{"$svgListPropertyType.h"} = 1 if $svgListPropertyType;242 $headerIncludes{"SVGAnimatedProperty.h"} = 1 if $svgPropertyType or $svgListPropertyType;243 264 $headerIncludes{"wtf/text/StringHash.h"} = 1; 244 265 $headerIncludes{"WrapperTypeInfo.h"} = 1; 245 266 $headerIncludes{"V8DOMWrapper.h"} = 1; 267 246 268 my $headerClassInclude = GetHeaderClassInclude($implClassName); 247 269 $headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne ""; 270 271 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); 248 272 249 273 foreach my $headerInclude (sort keys(%headerIncludes)) { … … 686 710 my $nativeType = GetNativeTypeFromSignature($attribute->signature, -1); 687 711 my $isPodType = IsPodType($implClassName); 688 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"};689 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"};690 712 my $skipContext = 0; 691 713 … … 694 716 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1; 695 717 } 696 697 $implIncludes{"SVGPropertyTearOff.h"} = 1 if $svgPropertyType;;698 $implIncludes{"SVGListPropertyTearOff.h"} = 1 if $svgListPropertyType;699 718 700 719 # Special case: SVGZoomEvent's attributes are all read-only … … 704 723 } 705 724 706 # Special case: SVGSVGEelement::viewport is read-only707 if (($implClassName eq "SVGSVGElement") and ($attrName eq "viewport")) {708 $attrIsPodType = 0;709 $skipContext = 1;710 }711 712 725 # Special case for SVGColor 713 726 if (($implClassName eq "SVGColor") and ($attrName eq "rgbColor")) { … … 716 729 717 730 my $getterStringUsesImp = $implClassName ne "float"; 731 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName); 718 732 719 733 # Getter … … 737 751 END 738 752 } 739 740 } elsif ($svgPropertyType) { 741 push(@implContentDecls, <<END); 742 SVGPropertyTearOff<$svgPropertyType>* wrapper = V8${implClassName}::toNative(info.Holder()); 743 $svgPropertyType& impInstance = wrapper->propertyReference(); 744 $svgPropertyType* imp = &impInstance; 745 END 746 } elsif ($svgListPropertyType) { 747 push(@implContentDecls, <<END); 748 SVGListPropertyTearOff<$svgListPropertyType>* imp = V8${implClassName}::toNative(info.Holder()); 749 END 750 } elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) { 753 } elsif ($svgNativeType) { 754 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 755 if ($svgWrappedNativeType =~ /List$/) { 756 push(@implContentDecls, <<END); 757 $svgNativeType* imp = V8${implClassName}::toNative(info.Holder()); 758 END 759 } else { 760 push(@implContentDecls, <<END); 761 $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder()); 762 $svgWrappedNativeType& impInstance = wrapper->propertyReference(); 763 $svgWrappedNativeType* imp = &impInstance; 764 END 765 } 766 } elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) { 751 767 if ($interfaceName eq "DOMWindow") { 752 768 push(@implContentDecls, <<END); … … 905 921 906 922 if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) { 907 $implIncludes{"V8${attrType}.h"} = 1; 908 if ($implClassName =~ /List$/) { 909 push(@implContentDecls, " return toV8(static_cast<SVGListPropertyTearOff<$attrType>*>($result));\n"); 910 } else { 911 push(@implContentDecls, " return toV8(static_cast<SVGPropertyTearOff<$attrType>*>($result));\n"); 912 } 923 $implIncludes{"V8$attrType.h"} = 1; 924 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 925 # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. 926 push(@implContentDecls, " return toV8(static_cast<$svgNativeType*>($result));\n"); 927 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $implClassName =~ /List$/) { 928 $implIncludes{"V8$attrType.h"} = 1; 929 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 930 push(@implContentDecls, " return toV8(WTF::getPtr(${svgNativeType}::create($result)));\n"); 913 931 } elsif ($attrIsPodType) { 914 932 $implIncludes{"V8${attrType}.h"} = 1; … … 962 980 963 981 my $isPodType = IsPodType($implClassName); 964 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 965 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 982 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName); 966 983 967 984 if ($isPodType) { … … 971 988 push(@implContentDecls, " $implClassName impInstance = *wrapper;\n"); 972 989 push(@implContentDecls, " $implClassName* imp = &impInstance;\n"); 973 } elsif ($svgPropertyType) { 974 push(@implContentDecls, <<END); 975 SVGPropertyTearOff<$svgPropertyType>* wrapper = V8${implClassName}::toNative(info.Holder()); 976 $svgPropertyType& impInstance = wrapper->propertyReference(); 977 $svgPropertyType* imp = &impInstance; 978 END 979 } elsif ($svgListPropertyType) { 980 push(@implContentDecls, <<END); 981 SVGListPropertyTearOff<$svgListPropertyType>* imp = V8${implClassName}::toNative(info.Holder()); 982 END 990 } elsif ($svgNativeType) { 991 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 992 if ($svgWrappedNativeType =~ /List$/) { 993 push(@implContentDecls, <<END); 994 $svgNativeType* imp = V8${implClassName}::toNative(info.Holder()); 995 END 996 } else { 997 push(@implContentDecls, <<END); 998 $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder()); 999 $svgWrappedNativeType& impInstance = wrapper->propertyReference(); 1000 $svgWrappedNativeType* imp = &impInstance; 1001 END 1002 } 983 1003 } elsif ($attrExt->{"v8OnProto"}) { 984 1004 if ($interfaceName eq "DOMWindow") { … … 1074 1094 if ($isPodType) { 1075 1095 push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::svgContext(wrapper));\n"); 1076 } elsif ($svg PropertyType) {1096 } elsif ($svgNativeType) { 1077 1097 if ($useExceptions) { 1078 1098 push(@implContentDecls, " if (!ec)\n"); … … 1281 1301 } 1282 1302 1283 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 1284 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 1303 my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName); 1285 1304 1286 1305 if (IsPodType($implClassName)) { … … 1289 1308 push(@implContentDecls, " $nativeClassName impInstance = *impWrapper;\n"); 1290 1309 push(@implContentDecls, " $nativeClassName* imp = &impInstance;\n"); 1291 } elsif ($svgPropertyType) { 1292 my $nativeClassName = GetNativeType($implClassName); 1293 push(@implContentDecls, " $nativeClassName wrapper = V8${svgPropertyType}::toNative(args.Holder());\n"); 1294 push(@implContentDecls, " $svgPropertyType& impInstance = wrapper->propertyReference();\n"); 1295 push(@implContentDecls, " $svgPropertyType* imp = &impInstance;\n"); 1296 } elsif ($svgListPropertyType) { 1297 my $nativeClassName = GetNativeType($implClassName); 1298 push(@implContentDecls, " $nativeClassName imp = V8${svgListPropertyType}::toNative(args.Holder());\n"); 1310 } elsif ($svgNativeType) { 1311 my $nativeClassName = GetNativeType($implClassName); 1312 if ($implClassName =~ /List$/) { 1313 push(@implContentDecls, " $nativeClassName imp = V8${svgListPropertyType}::toNative(args.Holder());\n"); 1314 } else { 1315 my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName); 1316 push(@implContentDecls, " $nativeClassName wrapper = V8${svgPropertyType}::toNative(args.Holder());\n"); 1317 push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n"); 1318 push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n"); 1319 } 1299 1320 } elsif (!$function->signature->extendedAttributes->{"ClassMethod"}) { 1300 1321 push(@implContentDecls, <<END); … … 2646 2667 my $type = shift; 2647 2668 2648 $type = "FloatRect" if $type eq "SVGRect";2649 2669 $type = "FloatPoint" if $type eq "SVGPoint"; 2650 2670 $type = "AffineTransform" if $type eq "SVGMatrix"; 2651 2671 $type = "float" if $type eq "SVGNumber"; 2652 2672 $type = "V8SVGPODTypeWrapper<$type>" if $dataNode->extendedAttributes->{"PODType"}; 2653 $type = "SVGPropertyTearOff<$type>" if $dataNode->extendedAttributes->{"SVGProperty"}; 2654 $type = "SVGListPropertyTearOff<$type>" if $dataNode->extendedAttributes->{"SVGListProperty"}; 2673 $type = $codeGenerator->GetSVGTypeNeedingTearOff($type) if $codeGenerator->IsSVGTypeNeedingTearOff($type); 2655 2674 return $type; 2656 2675 } … … 2669 2688 my $nativeReturnType = GetNativeType($returnType, 0); 2670 2689 my $result = ""; 2690 2691 my $isSVGTearOffType = ($codeGenerator->IsSVGTypeNeedingTearOff($returnType) and not $implClassName =~ /List$/); 2692 $nativeReturnType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($returnType) if $isSVGTearOffType; 2671 2693 2672 2694 # Special case: SVG matrix transform methods should not mutate … … 2817 2839 } 2818 2840 2819 if ($ codeGenerator->IsSVGTypeNeedingTearOff($returnType) and not $implClassName =~ /List$/) {2841 if ($isSVGTearOffType) { 2820 2842 $implIncludes{"V8$returnType.h"} = 1; 2821 2843 $implIncludes{"SVGPropertyTearOff.h"} = 1; 2822 return $indent . "return toV8(WTF::getPtr(SVGPropertyTearOff<$returnType>::create($return)));\n"; 2844 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType); 2845 $result .= $indent . "return toV8(WTF::getPtr(${svgNativeType}::create($return)));\n"; 2846 return $result; 2823 2847 } 2824 2848 … … 2848 2872 2849 2873 $result .= $indent . "impWrapper->commitChange(impInstance, context);\n"; 2850 } elsif ($ dataNode->extendedAttributes->{"SVGProperty"}) {2874 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName) and not $implClassName =~ /List$/) { 2851 2875 $result .= $indent . "wrapper->commitChange();\n"; 2852 2876 } … … 2924 2948 my $isParameter = shift; 2925 2949 2950 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type); 2951 if ($svgNativeType) { 2952 if ($svgNativeType =~ /List$/) { 2953 return "${svgNativeType}*"; 2954 } else { 2955 return "RefPtr<${svgNativeType} >"; 2956 } 2957 } 2958 2926 2959 if ($type eq "float" or $type eq "double") { 2927 2960 return $type; … … 2938 2971 return "String" if $type eq "DOMString"; 2939 2972 return "Range::CompareHow" if $type eq "CompareHow"; 2940 return "FloatRect" if $type eq "SVGRect";2941 2973 return "FloatPoint" if $type eq "SVGPoint"; 2942 2974 return "AffineTransform" if $type eq "SVGMatrix"; 2943 2975 return "SVGTransform" if $type eq "SVGTransform"; 2944 return "RefPtr<SVGPropertyTearOff<SVGAngle> >" if $type eq "SVGAngle";2945 return "RefPtr<SVGPropertyTearOff<SVGLength> >" if $type eq "SVGLength";2946 return "SVGListPropertyTearOff<SVGLengthList>*" if $type eq "SVGLengthList";2947 2976 return "float" if $type eq "SVGNumber"; 2948 2977 return "SVGPreserveAspectRatio" if $type eq "SVGPreserveAspectRatio"; … … 2999 3028 return 1 if $type eq "SVGPoint"; 3000 3029 return 1 if $type eq "SVGPreserveAspectRatio"; 3001 return 1 if $type eq "SVGRect";3002 3030 return 1 if $type eq "SVGTransform"; 3003 3031 return 0; … … 3380 3408 my $implClassName = shift; 3381 3409 3410 return 0 unless $implClassName =~ /SVG/; 3411 return 0 if $implClassName =~ /Element/; 3382 3412 return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName); 3383 if ($implClassName =~ /SVG/ and not $implClassName =~ /Element/) { 3384 return 1 unless $implClassName =~ /SVGAngle/ 3385 or $implClassName =~ /SVGPaint/ 3386 or $implClassName =~ /SVGColor/ 3387 or $implClassName =~ /SVGDocument/ 3388 or $implClassName =~ /SVGLength/ 3389 or $implClassName =~ /SVGLengthList/; 3390 } 3391 3392 return 0; 3413 return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName); 3414 3415 my @noContextNeeded = ("SVGColor", "SVGDocument", "SVGPaintType", "SVGPaint", "SVGZoomEvent"); 3416 foreach (@noContextNeeded) { 3417 return 0 if $implClassName eq $_; 3418 } 3419 return 1; 3393 3420 } 3394 3421 -
trunk/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
r70581 r70631 106 106 }; 107 107 108 // SVGAnimatedRect109 template<>110 struct DeprecatedSVGAnimatedPropertyTraits<FloatRect> : public Noncopyable {111 typedef const FloatRect& PassType;112 typedef FloatRect ReturnType;113 typedef FloatRect StoredType;114 115 static ReturnType null() { return FloatRect(); }116 static ReturnType toReturnType(const StoredType& type) { return type; }117 static String toString(PassType type) { return String::format("%f %f %f %f", type.x(), type.y(), type.width(), type.height()); }118 };119 120 108 // SVGAnimatedString 121 109 template<> -
trunk/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
r70581 r70631 161 161 typedef DeprecatedSVGAnimatedTemplate<SVGNumberList*> SVGAnimatedNumberList; 162 162 typedef DeprecatedSVGAnimatedTemplate<SVGPreserveAspectRatio> SVGAnimatedPreserveAspectRatio; 163 typedef DeprecatedSVGAnimatedTemplate<FloatRect> SVGAnimatedRect;164 163 typedef DeprecatedSVGAnimatedTemplate<String> SVGAnimatedString; 165 164 typedef DeprecatedSVGAnimatedTemplate<SVGTransformList*> SVGAnimatedTransformList; -
trunk/WebCore/svg/SVGAngle.idl
r70581 r70631 23 23 module svg { 24 24 25 interface [Conditional=SVG , SVGProperty=SVGAngle] SVGAngle {25 interface [Conditional=SVG] SVGAngle { 26 26 // Angle Unit Types 27 27 const unsigned short SVG_ANGLETYPE_UNKNOWN = 0; -
trunk/WebCore/svg/SVGAnimatedAngle.idl
r70581 r70631 26 26 module svg { 27 27 28 interface [Conditional=SVG , SVGAnimatedProperty] SVGAnimatedAngle {28 interface [Conditional=SVG] SVGAnimatedAngle { 29 29 readonly attribute SVGAngle baseVal; 30 30 readonly attribute SVGAngle animVal; -
trunk/WebCore/svg/SVGAnimatedLength.idl
r70581 r70631 26 26 module svg { 27 27 28 interface [Conditional=SVG , SVGAnimatedProperty] SVGAnimatedLength {28 interface [Conditional=SVG] SVGAnimatedLength { 29 29 readonly attribute SVGLength baseVal; 30 30 readonly attribute SVGLength animVal; -
trunk/WebCore/svg/SVGAnimatedLengthList.idl
r70581 r70631 26 26 module svg { 27 27 28 interface [Conditional=SVG , SVGAnimatedProperty] SVGAnimatedLengthList {28 interface [Conditional=SVG] SVGAnimatedLengthList { 29 29 readonly attribute SVGLengthList baseVal; 30 30 readonly attribute SVGLengthList animVal; -
trunk/WebCore/svg/SVGFitToViewBox.h
r70581 r70631 40 40 bool isKnownAttribute(const QualifiedName&); 41 41 42 virtual void setViewBoxBaseValue( DeprecatedSVGAnimatedPropertyTraits<FloatRect>::PassType) = 0;42 virtual void setViewBoxBaseValue(const FloatRect&) = 0; 43 43 virtual void setPreserveAspectRatioBaseValue(DeprecatedSVGAnimatedPropertyTraits<SVGPreserveAspectRatio>::PassType) = 0; 44 44 -
trunk/WebCore/svg/SVGLength.idl
r70581 r70631 23 23 module svg { 24 24 25 interface [Conditional=SVG , SVGProperty=SVGLength] SVGLength {25 interface [Conditional=SVG] SVGLength { 26 26 // Length Unit Types 27 27 const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0; -
trunk/WebCore/svg/SVGMarkerElement.h
r70581 r70631 89 89 90 90 // SVGFitToViewBox 91 DECLARE_ANIMATED_PROPERTY (SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)91 DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 92 92 DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 93 93 }; -
trunk/WebCore/svg/SVGPatternElement.h
r70581 r70631 80 80 81 81 // SVGPatternElement 82 DECLARE_ANIMATED_PROPERTY (SVGPatternElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)82 DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 83 83 DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 84 84 }; -
trunk/WebCore/svg/SVGRect.idl
r70581 r70631 23 23 module svg { 24 24 25 interface [Conditional=SVG , PODType=FloatRect] SVGRect {26 attribute float x;27 attribute float y;28 attribute float width;29 attribute float height;25 interface [Conditional=SVG] SVGRect { 26 attribute [StrictTypeChecking] float x; 27 attribute [StrictTypeChecking] float y; 28 attribute [StrictTypeChecking] float width; 29 attribute [StrictTypeChecking] float height; 30 30 }; 31 31 -
trunk/WebCore/svg/SVGSVGElement.cpp
r70581 r70631 187 187 { 188 188 if (!m_viewSpec) 189 m_viewSpec = adoptPtr(new SVGViewSpec( this));189 m_viewSpec = adoptPtr(new SVGViewSpec(const_cast<SVGSVGElement*>(this))); 190 190 return m_viewSpec.get(); 191 191 } … … 581 581 setUseCurrentView(true); 582 582 if (viewElement->hasAttribute(SVGNames::viewBoxAttr)) 583 currentView()->setViewBox (viewElement->viewBox());583 currentView()->setViewBoxBaseValue(viewElement->viewBox()); 584 584 else 585 currentView()->setViewBox (viewBox());585 currentView()->setViewBoxBaseValue(viewBox()); 586 586 587 587 SVGPreserveAspectRatio aspectRatio; -
trunk/WebCore/svg/SVGSVGElement.h
r70581 r70631 147 147 148 148 // SVGFitToViewBox 149 DECLARE_ANIMATED_PROPERTY (SVGSVGElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)149 DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 150 150 DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 151 151 -
trunk/WebCore/svg/SVGSVGElement.idl
r70581 r70631 42 42 attribute DOMString contentStyleType 43 43 /*setter raises(DOMException)*/; 44 readonly attribute [Immutable]SVGRect viewport;44 readonly attribute SVGRect viewport; 45 45 readonly attribute float pixelUnitToMillimeterX; 46 46 readonly attribute float pixelUnitToMillimeterY; … … 49 49 attribute boolean useCurrentView 50 50 /*setter raises(DOMException)*/; 51 // TODO readonly attribute [Immutable]SVGViewSpec currentView;51 // TODO readonly attribute SVGViewSpec currentView; 52 52 attribute float currentScale 53 53 /*setter raises(DOMException)*/; -
trunk/WebCore/svg/SVGSymbolElement.h
r70581 r70631 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedPropertyMacros.h" 25 26 #include "SVGExternalResourcesRequired.h" 26 27 #include "SVGFitToViewBox.h" … … 51 52 52 53 // SVGFitToViewBox 53 DECLARE_ANIMATED_PROPERTY (SVGSymbolElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)54 DECLARE_ANIMATED_PROPERTY_NEW(SVGSymbolElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 54 55 DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 55 56 }; -
trunk/WebCore/svg/SVGViewElement.h
r70581 r70631 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedPropertyMacros.h" 25 26 #include "SVGStyledElement.h" 26 27 #include "SVGExternalResourcesRequired.h" … … 52 53 53 54 // SVGFitToViewBox 54 DECLARE_ANIMATED_PROPERTY (SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)55 DECLARE_ANIMATED_PROPERTY_NEW(SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 55 56 DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 56 57 -
trunk/WebCore/svg/SVGViewSpec.cpp
r70581 r70631 32 32 namespace WebCore { 33 33 34 SVGViewSpec::SVGViewSpec( const SVGSVGElement* contextElement)34 SVGViewSpec::SVGViewSpec(SVGElement* contextElement) 35 35 : m_contextElement(contextElement) 36 36 , m_transform(SVGTransformList::create(SVGNames::transformAttr)) -
trunk/WebCore/svg/SVGViewSpec.h
r70581 r70631 22 22 23 23 #if ENABLE(SVG) 24 #include "SVGAnimatedPropertyMacros.h" 25 #include "SVGElement.h" 24 26 #include "SVGFitToViewBox.h" 25 27 #include "SVGZoomAndPan.h" … … 30 32 31 33 class SVGElement; 32 class SVGSVGElement;33 34 class SVGTransformList; 34 35 … … 37 38 public Noncopyable { 38 39 public: 39 SVGViewSpec( const SVGSVGElement*);40 SVGViewSpec(SVGElement*); 40 41 41 42 bool parseViewSpec(const String&); … … 52 53 SVGElement* viewTarget() const; 53 54 54 SVG SVGElement* contextElement() const { return const_cast<SVGSVGElement*>(m_contextElement); }55 SVGElement* contextElement() const { return const_cast<SVGElement*>(m_contextElement); } 55 56 56 57 private: 57 const SVGSVGElement* m_contextElement;58 SVGElement* m_contextElement; 58 59 59 60 // SVGFitToViewBox 60 DECLARE_ANIMATED_PROPERTY (SVGViewSpec, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)61 DECLARE_ANIMATED_PROPERTY_NEW(SVGViewSpec, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 61 62 DECLARE_ANIMATED_PROPERTY(SVGViewSpec, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 62 63 -
trunk/WebCore/svg/SVGZoomEvent.idl
r70581 r70631 27 27 28 28 interface [Conditional=SVG] SVGZoomEvent : UIEvent { 29 readonly attribute [Immutable]SVGRect zoomRectScreen;29 readonly attribute SVGRect zoomRectScreen; 30 30 readonly attribute float previousScale; 31 31 readonly attribute [Immutable] SVGPoint previousTranslate; -
trunk/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
r70581 r70631 74 74 { \ 75 75 m_##LowerProperty.value = type; \ 76 invalidateSVGAttributes(); \ 76 SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \ 77 contextElement->invalidateSVGAttributes(); \ 77 78 } \ 78 79 \ … … 82 83 return; \ 83 84 AtomicString value(SVGPropertyTraits<PropertyType>::toString(LowerProperty##BaseValue())); \ 84 SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<OwnerType>::value>::synchronize(this, DOMAttribute, value); \ 85 SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \ 86 SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<OwnerType>::value>::synchronize(contextElement, DOMAttribute, value); \ 85 87 } \ 86 88 \ … … 88 90 { \ 89 91 m_##LowerProperty.shouldSynchronize = true; \ 90 return SVGAnimatedProperty::lookupOrCreateWrapper<TearOffType, PropertyType>(this, DOMAttribute, SVGDOMAttributeIdentifier, m_##LowerProperty.value); \ 92 SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \ 93 return SVGAnimatedProperty::lookupOrCreateWrapper<TearOffType, PropertyType>(contextElement, DOMAttribute, SVGDOMAttributeIdentifier, m_##LowerProperty.value); \ 91 94 } \ 92 95 private: \ … … 104 107 void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \ 105 108 { \ 106 SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGAnimatedListPropertyTearOff<PropertyType> >(this, DOMAttribute.localName()); \ 109 SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \ 110 SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGAnimatedListPropertyTearOff<PropertyType> >(contextElement, DOMAttribute.localName()); \ 107 111 if (!wrapper) \ 108 112 return; \
Note: See TracChangeset
for help on using the changeset viewer.