Changeset 71227 in webkit
- Timestamp:
- Nov 3, 2010 4:13:10 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 54 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r71225 r71227 1 2010-11-03 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Convert SVGAnimatedString/SVGStringList to the new SVG*PropertyTearOff concept 6 https://bugs.webkit.org/show_bug.cgi?id=48898 7 8 Add a new SVGStringList test ensuring that the items returned by getItem etc. are not live (it's a plain DOMString). 9 Add a new test from SVG 1.1 2nd edition regarding SVGStringList. The list operations all pass, but because of a bug 10 in SVGTests requiredFeatures handling (see bug 40887) there's still one red rectangle in the middle. 11 12 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.checksum: Added. 13 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.png: Added. 14 * platform/mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt: Added. 15 * svg/W3C-SVG-1.1-SE/types-dom-06-f.svg: Added. 16 * svg/dom/SVGStringList-expected.txt: Added. 17 * svg/dom/SVGStringList.html: Added. 18 * svg/dom/script-tests/SVGStringList.js: Added. 19 1 20 2010-11-03 Daniel Bates <dbates@rim.com> 2 21 -
trunk/WebCore/ChangeLog
r71222 r71227 1 2010-11-03 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Convert SVGAnimatedString/SVGStringList to the new SVG*PropertyTearOff concept 6 https://bugs.webkit.org/show_bug.cgi?id=48898 7 8 Convert SVGAnimatedString/SVGStringList to the new svg animated type concept. 9 SVGStringList is special compared to all other SVG*Lists, as it returns non-live elements. 10 That means myStringList.getItem(0) = 'foobar' doesn't take effect. 11 12 When appending an item to a SVGStringList, that has been taken from another list, it's not removed from the list origin. 13 That demanded a new SVGStringListPropertyTearOff which does just that. 14 15 Tests: svg/W3C-SVG-1.1-SE/types-dom-06-f.svg 16 svg/dom/SVGStringList.html 17 18 * GNUmakefile.am: Add SVGAnimatedString.h / SVGStringListPropertyTearOff.h to build. 19 * WebCore.gypi: Ditto. 20 * WebCore.pro: Ditto. 21 * WebCore.vcproj/WebCore.vcproj: Ditto. 22 * WebCore.xcodeproj/project.pbxproj: Ditto. 23 * bindings/scripts/CodeGenerator.pm: Recognize SVGAnimatedString as new style svg animated type. Map SVGStringList to SVGStringListPropertyTearOff. 24 * bindings/scripts/CodeGeneratorJS.pm: Handle SVGStringListPropertyTearOff in GetSVGPropertyTypes. 25 * bindings/scripts/CodeGeneratorObjC.pm: Ditto. 26 * bindings/scripts/CodeGeneratorV8.pm: Ditto. 27 * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedString handling. 28 * svg/DeprecatedSVGAnimatedTemplate.h: Ditto. 29 * svg/SVGAElement.cpp: Renamed target to svgTarget() to avoid clashes with Element::target(), adjust the bindings to call svgTarget() instead of target(), when processing SVGAElement. 30 (WebCore::SVGAElement::parseMappedAttribute): 31 (WebCore::SVGAElement::synchronizeProperty): 32 * svg/SVGAElement.h: 33 * svg/SVGAltGlyphElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARED_ANIMATED_STATIC_PROPERTY_NEW/ 34 * svg/SVGAnimatedString.h: Added. 35 * svg/SVGCursorElement.h: Ditto. 36 * svg/SVGFEBlendElement.h: Ditto. 37 * svg/SVGFEColorMatrixElement.h: Ditto. 38 * svg/SVGFEComponentTransferElement.h: Ditto. 39 * svg/SVGFECompositeElement.h: Ditto. 40 * svg/SVGFEConvolveMatrixElement.h: Ditto. 41 * svg/SVGFEDiffuseLightingElement.h: Ditto. 42 * svg/SVGFEDisplacementMapElement.h: Ditto. 43 * svg/SVGFEGaussianBlurElement.h: Ditto. 44 * svg/SVGFEImageElement.h: Ditto. 45 * svg/SVGFEMergeNodeElement.h: Ditto. 46 * svg/SVGFEMorphologyElement.h: Ditto. 47 * svg/SVGFEOffsetElement.h: Ditto. 48 * svg/SVGFESpecularLightingElement.h: Ditto. 49 * svg/SVGFETileElement.h: Ditto. 50 * svg/SVGFilterElement.h: Ditto. 51 * svg/SVGFilterPrimitiveStandardAttributes.h: Ditto. 52 * svg/SVGForeignObjectElement.h: Ditto. 53 * svg/SVGGradientElement.h: Ditto. 54 * svg/SVGImageElement.h: Ditto. 55 * svg/SVGLengthList.idl: Remove leftover SVGListProperty marker. 56 * svg/SVGMPathElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARED_ANIMATED_STATIC_PROPERTY_NEW/ 57 * svg/SVGPatternElement.h: Ditto. 58 * svg/SVGScriptElement.h: Ditto. 59 * svg/SVGStringList.cpp: Make SVGStringList a plain Vector<String>. 60 (WebCore::SVGStringList::commitChange): React to SVGStringList changes. 61 (WebCore::SVGStringList::reset): 62 (WebCore::SVGStringList::parse): 63 * svg/SVGStringList.h: 64 (WebCore::SVGStringList::SVGStringList): 65 * svg/SVGStyledElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARED_ANIMATED_STATIC_PROPERTY_NEW/ 66 * svg/SVGTRefElement.h: Ditto. 67 * svg/SVGTests.cpp: Adapt to SVGStringList API changes. 68 (WebCore::SVGTests::SVGTests): 69 (WebCore::SVGTests::hasExtension): 70 (WebCore::SVGTests::isValid): 71 (WebCore::SVGTests::parseMappedAttribute): 72 (WebCore::SVGTests::isKnownAttribute): 73 * svg/SVGTests.h: Ditto. 74 (WebCore::SVGTests::requiredFeatures): 75 (WebCore::SVGTests::requiredExtensions): 76 (WebCore::SVGTests::systemLanguage): 77 * svg/SVGTextPathElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARED_ANIMATED_STATIC_PROPERTY_NEW/ 78 * svg/SVGURIReference.h: Adapt to SVGStringList API changes. 79 (WebCore::SVGURIReference::~SVGURIReference): 80 * svg/SVGUseElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARED_ANIMATED_STATIC_PROPERTY_NEW/ 81 * svg/SVGViewElement.cpp: Adapt to SVGStringList API changes. 82 (WebCore::SVGViewElement::SVGViewElement): 83 (WebCore::SVGViewElement::parseMappedAttribute): 84 * svg/SVGViewElement.h: Ditto. 85 (WebCore::SVGViewElement::viewTarget): 86 * svg/properties/SVGAnimatedPropertyMacros.h: Moved GetOwnerElementForType heleprs from SVGAnimatedPropertySynchronizer into this file. 87 * svg/properties/SVGAnimatedPropertySynchronizer.h: 88 * svg/properties/SVGPropertyTraits.h: Handle SVGStringList. 89 * svg/properties/SVGStringListPropertyTearOff.h: Added. This is a simplified version of SVGListPropertyTearOff, tied to SVGStringList and its special demands. 90 (WebCore::SVGStringListPropertyTearOff::create): 91 (WebCore::SVGStringListPropertyTearOff::clear): 92 (WebCore::SVGStringListPropertyTearOff::numberOfItems): 93 (WebCore::SVGStringListPropertyTearOff::initialize): 94 (WebCore::SVGStringListPropertyTearOff::getItem): 95 (WebCore::SVGStringListPropertyTearOff::insertItemBefore): 96 (WebCore::SVGStringListPropertyTearOff::replaceItem): 97 (WebCore::SVGStringListPropertyTearOff::removeItem): 98 (WebCore::SVGStringListPropertyTearOff::appendItem): 99 (WebCore::SVGStringListPropertyTearOff::SVGStringListPropertyTearOff): 100 1 101 2010-11-03 Zoltan Herczeg <zherczeg@webkit.org> 2 102 -
trunk/WebCore/GNUmakefile.am
r71204 r71227 3039 3039 WebCore/svg/properties/SVGPropertyTearOff.h \ 3040 3040 WebCore/svg/properties/SVGPropertyTraits.h \ 3041 WebCore/svg/properties/SVGStringListPropertyTearOff.h \ 3041 3042 WebCore/svg/RadialGradientAttributes.h \ 3042 3043 WebCore/svg/SVGAElement.cpp \ … … 3062 3063 WebCore/svg/SVGAnimatedPreserveAspectRatio.h \ 3063 3064 WebCore/svg/SVGAnimatedRect.h \ 3065 WebCore/svg/SVGAnimatedString.h \ 3064 3066 WebCore/svg/SVGAnimateElement.cpp \ 3065 3067 WebCore/svg/SVGAnimateElement.h \ -
trunk/WebCore/WebCore.gypi
r71210 r71227 3958 3958 'svg/properties/SVGPropertyTearOff.h', 3959 3959 'svg/properties/SVGPropertyTraits.h', 3960 'svg/properties/SVGStringListPropertyTearOff.h', 3960 3961 'svg/ColorDistance.cpp', 3961 3962 'svg/ColorDistance.h', … … 3997 3998 'svg/SVGAnimatedPreserveAspectRatio.h', 3998 3999 'svg/SVGAnimatedRect.h', 4000 'svg/SVGAnimatedString.h', 3999 4001 'svg/SVGAnimationElement.cpp', 4000 4002 'svg/SVGAnimationElement.h', -
trunk/WebCore/WebCore.pro
r71117 r71227 2368 2368 svg/properties/SVGPropertyTearOff.h \ 2369 2369 svg/properties/SVGPropertyTraits.h \ 2370 svg/properties/SVGStringListPropertyTearOff.h \ 2370 2371 svg/SVGAElement.h \ 2371 2372 svg/SVGAltGlyphElement.h \ … … 2384 2385 svg/SVGAnimatedPreserveAspectRatio.h \ 2385 2386 svg/SVGAnimatedRect.h \ 2387 svg/SVGAnimatedString.h \ 2386 2388 svg/SVGAnimateElement.h \ 2387 2389 svg/SVGAnimateMotionElement.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r71204 r71227 61673 61673 </File> 61674 61674 <File 61675 RelativePath="..\svg\SVGAnimatedString.h" 61676 > 61677 </File> 61678 <File 61675 61679 RelativePath="..\svg\SVGAnimateElement.h" 61676 61680 > … … 62733 62737 <File 62734 62738 RelativePath="..\svg\properties\SVGPropertyTraits.h" 62739 > 62740 </File> 62741 <File 62742 RelativePath="..\svg\properties\SVGStringListPropertyTearOff.h" 62735 62743 > 62736 62744 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r71103 r71227 114 114 084D0E3E11F5816100081E1A /* SVGResourcesCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */; }; 115 115 084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 116 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */ = {isa = PBXBuildFile; fileRef = 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */; settings = {ATTRIBUTES = (Private, ); }; }; 116 117 084DBAA10ED39D360038C226 /* WMLVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */; }; 117 118 084DBAA20ED39D360038C226 /* WMLVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 084DBA9E0ED39D360038C226 /* WMLVariables.h */; }; … … 244 245 08E192540EDE0C3A0087B780 /* WMLErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E192520EDE0C3A0087B780 /* WMLErrorHandling.h */; }; 245 246 08E4FE460E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */; }; 247 08E58FF512801CF70045903D /* SVGStringListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E58FF412801CF70045903D /* SVGStringListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 246 248 08E6A2E80EEE035200AC1206 /* WMLPostfieldElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08E6A2E60EEE035200AC1206 /* WMLPostfieldElement.cpp */; }; 247 249 08E6A2E90EEE035200AC1206 /* WMLPostfieldElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6A2E70EEE035200AC1206 /* WMLPostfieldElement.h */; }; … … 6137 6139 084D0E3A11F5816100081E1A /* SVGResourcesCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCache.cpp; sourceTree = "<group>"; }; 6138 6140 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; }; 6141 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedString.h; sourceTree = "<group>"; }; 6139 6142 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLVariables.cpp; sourceTree = "<group>"; }; 6140 6143 084DBA9E0ED39D360038C226 /* WMLVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLVariables.h; sourceTree = "<group>"; }; … … 6254 6257 08E192520EDE0C3A0087B780 /* WMLErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLErrorHandling.h; sourceTree = "<group>"; }; 6255 6258 08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGLengthCustom.cpp; sourceTree = "<group>"; }; 6259 08E58FF412801CF70045903D /* SVGStringListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStringListPropertyTearOff.h; sourceTree = "<group>"; }; 6256 6260 08E6A2E60EEE035200AC1206 /* WMLPostfieldElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLPostfieldElement.cpp; sourceTree = "<group>"; }; 6257 6261 08E6A2E70EEE035200AC1206 /* WMLPostfieldElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPostfieldElement.h; sourceTree = "<group>"; }; … … 11755 11759 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */, 11756 11760 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */, 11761 08E58FF412801CF70045903D /* SVGStringListPropertyTearOff.h */, 11757 11762 ); 11758 11763 path = properties; … … 16035 16040 08C859BF1274575300A5728D /* SVGAnimatedRect.h */, 16036 16041 B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */, 16042 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */, 16037 16043 B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */, 16038 16044 B22277F80D00BF1F0071B782 /* SVGAnimatedTransformList.idl */, … … 20831 20837 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */, 20832 20838 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */, 20839 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */, 20833 20840 B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */, 20834 20841 B22279930D00BF220071B782 /* SVGAnimateMotionElement.h in Headers */, … … 20974 20981 B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */, 20975 20982 B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */, 20983 08E58FF512801CF70045903D /* SVGStringListPropertyTearOff.h in Headers */, 20976 20984 B2227AAF0D00BF220071B782 /* SVGStylable.h in Headers */, 20977 20985 B2227AB20D00BF220071B782 /* SVGStyledElement.h in Headers */, -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r71103 r71227 61 61 "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1, 62 62 "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" => 1, 63 "SVGAnimatedPreserveAspectRatio" => 1, "SVGAnimatedRect" => 1); 63 "SVGAnimatedPreserveAspectRatio" => 1, "SVGAnimatedRect" => 1, 64 "SVGAnimatedString" => 1); 64 65 65 66 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, … … 84 85 "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>", 85 86 "SVGPreserveAspectRatio" => "SVGPropertyTearOff<SVGPreserveAspectRatio>", 86 "SVGRect" => "SVGPropertyTearOff<FloatRect>" 87 "SVGRect" => "SVGPropertyTearOff<FloatRect>", 88 "SVGStringList" => "SVGStringListPropertyTearOff" 87 89 ); 88 90 … … 481 483 482 484 my $attributeName = $attribute->signature->name; 485 my $attributeType = $generator->StripModule($attribute->signature->type); 483 486 484 487 # Avoid clash with C++ keyword. 485 488 $attributeName = "_operator" if $attributeName eq "operator"; 486 489 490 # SVGAElement defines a non-virtual "String& target() const" method which clashes with "virtual String target() const" in Element. 491 # To solve this issue the SVGAElement method was renamed to "svgTarget", take care of that when calling this method. 492 $attributeName = "svgTarget" if $attributeName eq "target" and $attributeType eq "SVGAnimatedString"; 493 487 494 # SVG animated types need to use a special attribute name. 488 495 # The rest of the special casing for SVG animated types is handled in the language-specific code generators. 489 $attributeName .= "Animated" if $generator->IsSVGAnimatedType($ generator->StripModule($attribute->signature->type));496 $attributeName .= "Animated" if $generator->IsSVGAnimatedType($attributeType); 490 497 491 498 return $attributeName; -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r71103 r71227 2507 2507 $headerIncludes{"$svgWrappedNativeType.h"} = 1; 2508 2508 $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1; 2509 } elsif ($svgNativeType =~ /SVGStringListPropertyTearOff/) { 2510 $svgListPropertyType = "SVGStringList"; 2511 $headerIncludes{"$svgWrappedNativeType.h"} = 1; 2509 2512 } 2510 2513 … … 2680 2683 $value = "static_cast<" . GetNativeType($type) . ">($value)"; 2681 2684 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $implClassName =~ /List$/) { 2682 $value = $codeGenerator->GetSVGTypeNeedingTearOff($type) . "::create($value)"; 2685 my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type); 2686 if ($tearOffType eq "SVGStringListPropertyTearOff") { 2687 my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), "; 2688 $value = $codeGenerator->GetSVGTypeNeedingTearOff($type) . "::create($extraImp$value)"; 2689 } else { 2690 $value = $codeGenerator->GetSVGTypeNeedingTearOff($type) . "::create($value)"; 2691 } 2683 2692 } 2684 2693 -
trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r71103 r71227 691 691 $svgListPropertyType = "WebCore::$svgWrappedNativeType"; 692 692 $svgListPropertyType =~ s/</\<WebCore::/; 693 } elsif ($svgNativeType =~ /SVGStringListPropertyTearOff/) { 694 $svgListPropertyType = "WebCore::SVGStringList"; 693 695 } 694 696 … … 1025 1027 push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n"); 1026 1028 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedPropertyTearOff.h>\n\n") if $svgPropertyType; 1027 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n") if $svgListPropertyType; 1029 if ($svgListPropertyType) { 1030 if ($svgListPropertyType eq "WebCore::SVGStringList") { 1031 push(@internalHeaderContent, "#import <WebCore/SVGStringListPropertyTearOff.h>\n\n"); 1032 } else { 1033 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n"); 1034 } 1035 } 1028 1036 push(@internalHeaderContent, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion; 1029 1037 … … 1320 1328 if ($codeGenerator->IsSVGTypeNeedingTearOff($attribute->signature->type) and not $implClassName =~ /List$/) { 1321 1329 my $idlTypeWithNamespace = GetSVGTypeWithNamespace($attribute->signature->type); 1322 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead"; 1330 if ($idlTypeWithNamespace eq "WebCore::SVGStringListPropertyTearOff") { 1331 my $extraImp = "WebCore::GetOwnerElementForType<$implClassNameWithNamespace, WebCore::IsDerivedFromSVGElement<$implClassNameWithNamespace>::value>::ownerElement(IMPL), "; 1332 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($extraImp$getterContentHead"; 1333 } else { 1334 $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead"; 1335 } 1323 1336 $getterContentTail .= ")))"; 1324 1337 } else { -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r71103 r71227 227 227 $svgListPropertyType = $svgWrappedNativeType; 228 228 $implIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1, 229 } elsif ($svgNativeType =~ /SVGStringListPropertyTearOff/) { 230 $svgListPropertyType = "SVGStringList"; 231 $implIncludes{"$svgWrappedNativeType.h"} = 1; 229 232 } 230 233 … … 922 925 } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $implClassName =~ /List$/) { 923 926 $implIncludes{"V8$attrType.h"} = 1; 924 my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 925 push(@implContentDecls, " return toV8(WTF::getPtr(${svgNativeType}::create($result)));\n"); 927 my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType); 928 if ($tearOffType eq "SVGStringListPropertyTearOff") { 929 my $extraImp = "GetOwnerElementForType<$implClassName, IsDerivedFromSVGElement<$implClassName>::value>::ownerElement(imp), "; 930 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create($extraImp$result)));\n"); 931 } else { 932 push(@implContentDecls, " return toV8(WTF::getPtr(${tearOffType}::create($result)));\n"); 933 } 926 934 } elsif ($attrIsPodType) { 927 935 $implIncludes{"V8${attrType}.h"} = 1; -
trunk/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
r71103 r71227 31 31 struct DeprecatedSVGAnimatedPropertyTraits : public Noncopyable { }; 32 32 33 // SVGAnimatedString34 template<>35 struct DeprecatedSVGAnimatedPropertyTraits<String> : public Noncopyable {36 typedef const String& PassType;37 typedef String ReturnType;38 typedef String StoredType;39 40 static ReturnType null() { return String(); }41 static ReturnType toReturnType(const StoredType& type) { return type; }42 static String toString(PassType type) { return type; }43 };44 45 33 // SVGAnimatedTransformList 46 34 template<> -
trunk/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
r71103 r71227 153 153 154 154 // Common type definitions, to ease IDL generation. 155 typedef DeprecatedSVGAnimatedTemplate<String> SVGAnimatedString;156 155 typedef DeprecatedSVGAnimatedTemplate<SVGTransformList*> SVGAnimatedTransformList; 157 156 -
trunk/WebCore/svg/SVGAElement.cpp
r68854 r71227 72 72 { 73 73 if (attr->name() == SVGNames::targetAttr) 74 set TargetBaseValue(attr->value());74 setSVGTargetBaseValue(attr->value()); 75 75 else { 76 76 if (SVGURIReference::parseMappedAttribute(attr)) … … 106 106 107 107 if (attrName == anyQName()) { 108 synchronize Target();108 synchronizeSVGTarget(); 109 109 synchronizeHref(); 110 110 synchronizeExternalResourcesRequired(); … … 113 113 114 114 if (attrName == SVGNames::targetAttr) 115 synchronize Target();115 synchronizeSVGTarget(); 116 116 else if (SVGURIReference::isKnownAttribute(attrName)) 117 117 synchronizeHref(); -
trunk/WebCore/svg/SVGAElement.h
r70857 r71227 47 47 48 48 virtual String title() const; 49 virtual String target() const { return svgTarget(); } 49 50 50 51 virtual void parseMappedAttribute(Attribute*); … … 63 64 virtual bool childShouldCreateRenderer(Node*) const; 64 65 65 DECLARE_ANIMATED_PROPERTY(SVGAElement, SVGNames::targetAttr, String, Target, target) 66 // This defines a non-virtual "String& target() const" method before, that would clash with "virtual String target() const" 67 // in Element. That's why it's now named "String& svgTarget() const", to avoid the clash. The CodeGenerators take care 68 // of calling svgTargetAnimated() instead of targetAnimated(), see CodeGenerator.pm. 69 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAElement, SVGNames::targetAttr, String, SVGTarget, svgTarget) 66 70 67 71 // SVGURIReference 68 DECLARE_ANIMATED_ PROPERTY(SVGAElement, XLinkNames::hrefAttr, String, Href, href)72 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAElement, XLinkNames::hrefAttr, String, Href, href) 69 73 70 74 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGAltGlyphElement.h
r66397 r71227 53 53 54 54 // SVGURIReference 55 DECLARE_ANIMATED_ PROPERTY(SVGAltGlyphElement, XLinkNames::hrefAttr, String, Href, href)55 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAltGlyphElement, XLinkNames::hrefAttr, String, Href, href) 56 56 }; 57 57 -
trunk/WebCore/svg/SVGCursorElement.h
r70857 r71227 59 59 60 60 // SVGURIReference 61 DECLARE_ANIMATED_ PROPERTY(SVGCursorElement, XLinkNames::hrefAttr, String, Href, href)61 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGCursorElement, XLinkNames::hrefAttr, String, Href, href) 62 62 63 63 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGFEBlendElement.h
r70872 r71227 39 39 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 40 40 41 DECLARE_ANIMATED_ PROPERTY(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1)42 DECLARE_ANIMATED_ PROPERTY(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2)41 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1) 42 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2) 43 43 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode) 44 44 }; -
trunk/WebCore/svg/SVGFEColorMatrixElement.h
r70979 r71227 41 41 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 42 42 43 DECLARE_ANIMATED_ PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)43 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1) 44 44 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type) 45 45 DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList, Values, values) -
trunk/WebCore/svg/SVGFEComponentTransferElement.h
r66397 r71227 39 39 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 40 40 41 DECLARE_ANIMATED_ PROPERTY(SVGFEComponentTransferElement, SVGNames::inAttr, String, In1, in1)41 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEComponentTransferElement, SVGNames::inAttr, String, In1, in1) 42 42 }; 43 43 -
trunk/WebCore/svg/SVGFECompositeElement.h
r70979 r71227 40 40 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 41 41 42 DECLARE_ANIMATED_ PROPERTY(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1)43 DECLARE_ANIMATED_ PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)42 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1) 43 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2) 44 44 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator) 45 45 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1) -
trunk/WebCore/svg/SVGFEConvolveMatrixElement.h
r70979 r71227 45 45 static const AtomicString& kernelUnitLengthYIdentifier(); 46 46 47 DECLARE_ANIMATED_ PROPERTY(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1)47 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1) 48 48 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX) 49 49 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY) -
trunk/WebCore/svg/SVGFEDiffuseLightingElement.h
r70979 r71227 47 47 static const AtomicString& kernelUnitLengthYIdentifier(); 48 48 49 DECLARE_ANIMATED_ PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1)49 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1) 50 50 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant) 51 51 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale) -
trunk/WebCore/svg/SVGFEDisplacementMapElement.h
r70979 r71227 40 40 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 41 41 42 DECLARE_ANIMATED_ PROPERTY(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1)43 DECLARE_ANIMATED_ PROPERTY(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2)42 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1) 43 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2) 44 44 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector) 45 45 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector) -
trunk/WebCore/svg/SVGFEGaussianBlurElement.h
r70979 r71227 45 45 static const AtomicString& stdDeviationYIdentifier(); 46 46 47 DECLARE_ANIMATED_ PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1)47 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1) 48 48 DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), float, StdDeviationX, stdDeviationX) 49 49 DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), float, StdDeviationY, stdDeviationY) -
trunk/WebCore/svg/SVGFEImageElement.h
r71103 r71227 60 60 61 61 // SVGURIReference 62 DECLARE_ANIMATED_ PROPERTY(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href)62 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href) 63 63 64 64 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGFEMergeNodeElement.h
r69206 r71227 23 23 24 24 #if ENABLE(SVG) && ENABLE(FILTERS) 25 #include "SVGAnimatedPropertyMacros.h" 25 26 #include "SVGElement.h" 26 #include "SVGNames.h"27 27 28 28 namespace WebCore { … … 39 39 virtual void synchronizeProperty(const QualifiedName&); 40 40 41 DECLARE_ANIMATED_ PROPERTY(SVGFEMergeNodeElement, SVGNames::inAttr, String, In1, in1)41 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEMergeNodeElement, SVGNames::inAttr, String, In1, in1) 42 42 }; 43 43 -
trunk/WebCore/svg/SVGFEMorphologyElement.h
r70979 r71227 44 44 static const AtomicString& radiusYIdentifier(); 45 45 46 DECLARE_ANIMATED_ PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1)46 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1) 47 47 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator) 48 48 DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusXIdentifier(), float, RadiusX, radiusX) -
trunk/WebCore/svg/SVGFEOffsetElement.h
r70979 r71227 40 40 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 41 41 42 DECLARE_ANIMATED_ PROPERTY(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1)42 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1) 43 43 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx) 44 44 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::dyAttr, float, Dy, dy) -
trunk/WebCore/svg/SVGFESpecularLightingElement.h
r70979 r71227 43 43 static const AtomicString& kernelUnitLengthYIdentifier(); 44 44 45 DECLARE_ANIMATED_ PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1)45 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1) 46 46 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant) 47 47 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent) -
trunk/WebCore/svg/SVGFETileElement.h
r68022 r71227 39 39 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); 40 40 41 DECLARE_ANIMATED_ PROPERTY(SVGFETileElement, SVGNames::inAttr, String, In1, in1)41 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETileElement, SVGNames::inAttr, String, In1, in1) 42 42 }; 43 43 -
trunk/WebCore/svg/SVGFilterElement.h
r70872 r71227 73 73 74 74 // SVGURIReference 75 DECLARE_ANIMATED_ PROPERTY(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href)75 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href) 76 76 77 77 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
r70223 r71227 67 67 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width) 68 68 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height) 69 DECLARE_ANIMATED_ PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result)69 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result) 70 70 }; 71 71 -
trunk/WebCore/svg/SVGForeignObjectElement.h
r70857 r71227 59 59 60 60 // SVGURIReference 61 DECLARE_ANIMATED_ PROPERTY(SVGForeignObjectElement, XLinkNames::hrefAttr, String, Href, href)61 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGForeignObjectElement, XLinkNames::hrefAttr, String, Href, href) 62 62 63 63 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGGradientElement.h
r70872 r71227 55 55 56 56 // SVGURIReference 57 DECLARE_ANIMATED_ PROPERTY(SVGGradientElement, XLinkNames::hrefAttr, String, Href, href)57 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, XLinkNames::hrefAttr, String, Href, href) 58 58 59 59 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGImageElement.h
r71103 r71227 74 74 75 75 // SVGURIReference 76 DECLARE_ANIMATED_ PROPERTY(SVGImageElement, XLinkNames::hrefAttr, String, Href, href)76 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGImageElement, XLinkNames::hrefAttr, String, Href, href) 77 77 78 78 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGLengthList.idl
r70223 r71227 27 27 module svg { 28 28 29 interface [Conditional=SVG , SVGListProperty=SVGLengthList] SVGLengthList {29 interface [Conditional=SVG] SVGLengthList { 30 30 readonly attribute unsigned long numberOfItems; 31 31 -
trunk/WebCore/svg/SVGMPathElement.h
r70857 r71227 45 45 46 46 // SVGURIReference 47 DECLARE_ANIMATED_ PROPERTY(SVGMPathElement, XLinkNames::hrefAttr, String, Href, href)47 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMPathElement, XLinkNames::hrefAttr, String, Href, href) 48 48 49 49 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGPatternElement.h
r71103 r71227 74 74 75 75 // SVGURIReference 76 DECLARE_ANIMATED_ PROPERTY(SVGPatternElement, XLinkNames::hrefAttr, String, Href, href)76 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, XLinkNames::hrefAttr, String, Href, href) 77 77 78 78 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGScriptElement.h
r70857 r71227 77 77 78 78 // SVGURIReference 79 DECLARE_ANIMATED_ PROPERTY(SVGScriptElement, XLinkNames::hrefAttr, String, Href, href)79 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGScriptElement, XLinkNames::hrefAttr, String, Href, href) 80 80 81 81 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGStringList.cpp
r66397 r71227 24 24 #include "SVGStringList.h" 25 25 26 #include "SVGElement.h" 26 27 #include "SVGParserUtilities.h" 27 28 28 29 namespace WebCore { 29 30 30 SVGStringList::SVGStringList(const QualifiedName& attributeName) 31 : SVGList<String>(attributeName) 31 void SVGStringList::commitChange(SVGElement* contextElement) 32 32 { 33 ASSERT(contextElement); 34 contextElement->invalidateSVGAttributes(); 35 contextElement->svgAttributeChanged(m_attributeName); 33 36 } 34 37 35 void SVGStringList::reset(const String& str )38 void SVGStringList::reset(const String& string) 36 39 { 37 ExceptionCode ec = 0;40 parse(string, ' '); 38 41 39 parse(str, ' ');40 if ( numberOfItems() == 0)41 append Item(String(""), ec); // Create empty string...42 // Add empty string, if list is empty. 43 if (isEmpty()) 44 append(String("")); 42 45 } 43 46 … … 45 48 { 46 49 // TODO : more error checking/reporting 47 ExceptionCode ec = 0; 48 clear(ec); 50 clear(); 49 51 50 52 const UChar* ptr = data.characters(); … … 56 58 if (ptr == start) 57 59 break; 58 append Item(String(start, ptr - start), ec);60 append(String(start, ptr - start)); 59 61 skipOptionalSpacesOrDelimiter(ptr, end, delimiter); 60 62 } -
trunk/WebCore/svg/SVGStringList.h
r66397 r71227 1 1 /* 2 * Copyright (C) 2004, 2005, 200 8 Nikolas Zimmermann <zimmermann@kde.org>2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 * … … 23 23 24 24 #if ENABLE(SVG) 25 #include "PlatformString.h" 26 #include "SVGList.h" 25 #include "QualifiedName.h" 26 #include <wtf/Vector.h> 27 #include <wtf/text/WTFString.h> 27 28 28 29 namespace WebCore { 29 30 30 class SVGStringList : public SVGList<String> { 31 public: 32 static PassRefPtr<SVGStringList> create(const QualifiedName& attributeName) { return adoptRef(new SVGStringList(attributeName)); } 31 class SVGElement; 33 32 34 void reset(const String& str); 35 void parse(const String& data, UChar delimiter = ','); 36 37 private: 38 SVGStringList(const QualifiedName&); 39 }; 33 class SVGStringList : public Vector<String> { 34 public: 35 SVGStringList(const QualifiedName& attributeName) 36 : m_attributeName(attributeName) 37 { 38 } 39 40 void reset(const String&); 41 void parse(const String&, UChar delimiter = ','); 42 43 // Only used by SVGStringListPropertyTearOff. 44 void commitChange(SVGElement* contextElement); 45 46 private: 47 const QualifiedName& m_attributeName; 48 }; 40 49 41 50 } // namespace WebCore 42 51 43 52 #endif // ENABLE(SVG) 44 #endif // SVGStringList_h53 #endif -
trunk/WebCore/svg/SVGStyledElement.h
r69437 r71227 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedPropertyMacros.h" 25 26 #include "HTMLNames.h" 26 #include "SVGElement.h"27 27 #include "SVGLocatable.h" 28 28 #include "SVGStylable.h" … … 84 84 HashSet<SVGStyledElement*> m_elementsWithRelativeLengths; 85 85 86 DECLARE_ANIMATED_ PROPERTY(SVGStyledElement, HTMLNames::classAttr, String, ClassName, className)86 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGStyledElement, HTMLNames::classAttr, String, ClassName, className) 87 87 }; 88 88 -
trunk/WebCore/svg/SVGTRefElement.h
r66397 r71227 46 46 47 47 // SVGURIReference 48 DECLARE_ANIMATED_ PROPERTY(SVGTRefElement, XLinkNames::hrefAttr, String, Href, href)48 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTRefElement, XLinkNames::hrefAttr, String, Href, href) 49 49 }; 50 50 -
trunk/WebCore/svg/SVGTests.cpp
r66397 r71227 27 27 #include "DOMImplementation.h" 28 28 #include "Language.h" 29 #include "SVGElement.h"30 29 #include "SVGNames.h" 31 30 #include "SVGStringList.h" … … 34 33 35 34 SVGTests::SVGTests() 35 : m_features(SVGNames::requiredFeaturesAttr) 36 , m_extensions(SVGNames::requiredExtensionsAttr) 37 , m_systemLanguage(SVGNames::systemLanguageAttr) 36 38 { 37 39 } 38 40 39 SVGTests::~SVGTests() 41 bool SVGTests::hasExtension(const String&) const 40 42 { 41 } 42 43 SVGStringList* SVGTests::requiredFeatures() const 44 { 45 if (!m_features) 46 m_features = SVGStringList::create(SVGNames::requiredFeaturesAttr); 47 48 return m_features.get(); 49 } 50 51 SVGStringList* SVGTests::requiredExtensions() const 52 { 53 if (!m_extensions) 54 m_extensions = SVGStringList::create(SVGNames::requiredExtensionsAttr); 55 56 return m_extensions.get(); 57 } 58 59 SVGStringList* SVGTests::systemLanguage() const 60 { 61 if (!m_systemLanguage) 62 m_systemLanguage = SVGStringList::create(SVGNames::systemLanguageAttr); 63 64 return m_systemLanguage.get(); 43 // FIXME: Implement me! 44 return false; 65 45 } 66 46 67 47 bool SVGTests::isValid() const 68 48 { 69 ExceptionCode ec = 0; 70 71 if (m_features) { 72 for (unsigned long i = 0; i < m_features->numberOfItems(); i++) { 73 String value = m_features->getItem(i, ec); 74 if (value.isEmpty() || !DOMImplementation::hasFeature(value, String())) 75 return false; 76 } 49 unsigned featuresSize = m_features.size(); 50 for (unsigned i = 0; i < featuresSize; ++i) { 51 String value = m_features.at(i); 52 if (value.isEmpty() || !DOMImplementation::hasFeature(value, String())) 53 return false; 77 54 } 78 55 79 if (m_systemLanguage) { 80 for (unsigned long i = 0; i < m_systemLanguage->numberOfItems(); i++) 81 if (m_systemLanguage->getItem(i, ec) != defaultLanguage().substring(0, 2)) 82 return false; 56 unsigned systemLanguageSize = m_systemLanguage.size(); 57 for (unsigned i = 0; i < systemLanguageSize; ++i) { 58 String value = m_systemLanguage.at(i); 59 if (value != defaultLanguage().substring(0, 2)) 60 return false; 83 61 } 84 62 85 if ( m_extensions && m_extensions->numberOfItems() > 0)63 if (!m_extensions.isEmpty()) 86 64 return false; 87 65 … … 92 70 { 93 71 if (attr->name() == SVGNames::requiredFeaturesAttr) { 94 requiredFeatures()->reset(attr->value());72 m_features.reset(attr->value()); 95 73 return true; 96 74 } else if (attr->name() == SVGNames::requiredExtensionsAttr) { 97 requiredExtensions()->reset(attr->value());75 m_extensions.reset(attr->value()); 98 76 return true; 99 77 } else if (attr->name() == SVGNames::systemLanguageAttr) { 100 systemLanguage()->reset(attr->value());78 m_systemLanguage.reset(attr->value()); 101 79 return true; 102 80 } … … 107 85 bool SVGTests::isKnownAttribute(const QualifiedName& attrName) 108 86 { 109 return (attrName == SVGNames::requiredFeaturesAttr ||110 attrName == SVGNames::requiredExtensionsAttr ||111 attrName == SVGNames::systemLanguageAttr);87 return attrName == SVGNames::requiredFeaturesAttr 88 || attrName == SVGNames::requiredExtensionsAttr 89 || attrName == SVGNames::systemLanguageAttr; 112 90 } 113 91 -
trunk/WebCore/svg/SVGTests.h
r66397 r71227 23 23 24 24 #if ENABLE(SVG) 25 #include <wtf/Forward.h> 26 #include <wtf/RefPtr.h> 25 #include "SVGStringList.h" 27 26 28 27 namespace WebCore { 29 28 30 class Attribute; 31 class QualifiedName; 32 class SVGStringList; 29 class Attribute; 30 class QualifiedName; 33 31 34 35 36 SVGStringList* requiredFeatures() const;37 SVGStringList* requiredExtensions() const;38 SVGStringList* systemLanguage() const;32 class SVGTests { 33 public: 34 SVGStringList& requiredFeatures() { return m_features; } 35 SVGStringList& requiredExtensions() { return m_extensions; } 36 SVGStringList& systemLanguage() { return m_systemLanguage; } 39 37 40 bool hasExtension(const String&) const { return false; } 38 bool hasExtension(const String&) const; 39 bool isValid() const; 41 40 42 bool isValid() const; 43 44 bool parseMappedAttribute(Attribute*); 45 bool isKnownAttribute(const QualifiedName&); 41 bool parseMappedAttribute(Attribute*); 42 bool isKnownAttribute(const QualifiedName&); 46 43 47 protected: 48 SVGTests(); 49 ~SVGTests(); 44 protected: 45 SVGTests(); 50 46 51 52 mutable RefPtr<SVGStringList>m_features;53 mutable RefPtr<SVGStringList>m_extensions;54 mutable RefPtr<SVGStringList>m_systemLanguage;55 47 private: 48 SVGStringList m_features; 49 SVGStringList m_extensions; 50 SVGStringList m_systemLanguage; 51 }; 56 52 57 53 } // namespace WebCore -
trunk/WebCore/svg/SVGTextPathElement.h
r70872 r71227 73 73 74 74 // SVGURIReference 75 DECLARE_ANIMATED_ PROPERTY(SVGTextPathElement, XLinkNames::hrefAttr, String, Href, href)75 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextPathElement, XLinkNames::hrefAttr, String, Href, href) 76 76 }; 77 77 -
trunk/WebCore/svg/SVGURIReference.h
r70135 r71227 28 28 namespace WebCore { 29 29 30 30 class Attribute; 31 31 32 33 34 32 class SVGURIReference { 33 public: 34 virtual ~SVGURIReference() { } 35 35 36 37 36 bool parseMappedAttribute(Attribute*); 37 bool isKnownAttribute(const QualifiedName&); 38 38 39 39 static String getTarget(const String& url); 40 40 41 42 virtual void setHrefBaseValue(DeprecatedSVGAnimatedPropertyTraits<String>::PassType) = 0;43 41 protected: 42 virtual void setHrefBaseValue(const String&) = 0; 43 }; 44 44 45 45 } // namespace WebCore -
trunk/WebCore/svg/SVGUseElement.h
r70857 r71227 88 88 89 89 // SVGURIReference 90 DECLARE_ANIMATED_ PROPERTY(SVGUseElement, XLinkNames::hrefAttr, String, Href, href)90 DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGUseElement, XLinkNames::hrefAttr, String, Href, href) 91 91 92 92 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGViewElement.cpp
r66498 r71227 35 35 inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document* document) 36 36 : SVGStyledElement(tagName, document) 37 , m_viewTarget(SVGNames::viewTargetAttr) 37 38 { 38 39 } … … 43 44 } 44 45 45 SVGStringList* SVGViewElement::viewTarget() const46 {47 if (!m_viewTarget)48 m_viewTarget = SVGStringList::create(SVGNames::viewTargetAttr);49 50 return m_viewTarget.get();51 }52 53 46 void SVGViewElement::parseMappedAttribute(Attribute* attr) 54 47 { 55 48 if (attr->name() == SVGNames::viewTargetAttr) 56 viewTarget() ->reset(attr->value());49 viewTarget().reset(attr->value()); 57 50 else { 58 51 if (SVGExternalResourcesRequired::parseMappedAttribute(attr) -
trunk/WebCore/svg/SVGViewElement.h
r71103 r71227 24 24 #if ENABLE(SVG) 25 25 #include "SVGAnimatedPropertyMacros.h" 26 #include "SVGStringList.h" 26 27 #include "SVGStyledElement.h" 27 28 #include "SVGExternalResourcesRequired.h" … … 31 32 namespace WebCore { 32 33 33 class SVGStringList;34 34 class SVGViewElement : public SVGStyledElement, 35 35 public SVGExternalResourcesRequired, … … 39 39 static PassRefPtr<SVGViewElement> create(const QualifiedName&, Document*); 40 40 41 SVGStringList * viewTarget() const;41 SVGStringList& viewTarget() { return m_viewTarget; } 42 42 43 43 private: … … 55 55 DECLARE_ANIMATED_PROPERTY_NEW(SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox) 56 56 DECLARE_ANIMATED_PROPERTY_NEW(SVGViewElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 57 58 mutable RefPtr<SVGStringList>m_viewTarget;57 58 SVGStringList m_viewTarget; 59 59 }; 60 60 -
trunk/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
r70872 r71227 32 32 33 33 namespace WebCore { 34 35 class SVGElement; 36 37 // GetOwnerElementForType implementation 38 template<typename OwnerType, bool isDerivedFromSVGElement> 39 struct GetOwnerElementForType; 40 41 template<typename OwnerType> 42 struct GetOwnerElementForType<OwnerType, true> { 43 static SVGElement* ownerElement(OwnerType* type) 44 { 45 return type; 46 } 47 }; 48 49 template<typename OwnerType> 50 struct GetOwnerElementForType<OwnerType, false> { 51 static SVGElement* ownerElement(OwnerType* type) 52 { 53 SVGElement* context = type->contextElement(); 54 ASSERT(context); 55 return context; 56 } 57 }; 58 59 // IsDerivedFromSVGElement implementation 60 template<typename OwnerType> 61 struct IsDerivedFromSVGElement { 62 static const bool value = true; 63 }; 64 65 class SVGViewSpec; 66 template<> 67 struct IsDerivedFromSVGElement<SVGViewSpec> { 68 static const bool value = false; 69 }; 34 70 35 71 template<typename PropertyType> -
trunk/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
r70303 r71227 23 23 #if ENABLE(SVG) 24 24 namespace WebCore { 25 26 class SVGElement;27 28 // GetOwnerElementForType implementation29 template<typename OwnerType, bool isDerivedFromSVGElement>30 struct GetOwnerElementForType;31 32 template<typename OwnerType>33 struct GetOwnerElementForType<OwnerType, true> : public Noncopyable {34 static SVGElement* ownerElement(OwnerType* type)35 {36 return type;37 }38 };39 40 template<typename OwnerType>41 struct GetOwnerElementForType<OwnerType, false> : public Noncopyable {42 static SVGElement* ownerElement(OwnerType* type)43 {44 SVGElement* context = type->contextElement();45 ASSERT(context);46 return context;47 }48 };49 50 // IsDerivedFromSVGElement implementation51 template<typename OwnerType>52 struct IsDerivedFromSVGElement : public Noncopyable {53 static const bool value = true;54 };55 56 class SVGViewSpec;57 template<>58 struct IsDerivedFromSVGElement<SVGViewSpec> : public Noncopyable {59 static const bool value = false;60 };61 25 62 26 // Helper template used for synchronizing SVG <-> XML properties -
trunk/WebCore/svg/properties/SVGPropertyTraits.h
r70979 r71227 29 29 #include "SVGNumberList.h" 30 30 #include "SVGPreserveAspectRatio.h" 31 #include "SVGStringList.h" 31 32 #include <wtf/text/StringBuilder.h> 32 33 … … 118 119 }; 119 120 121 template<> 122 struct SVGPropertyTraits<SVGStringList> { 123 typedef String ListItemType; 124 }; 125 120 126 } 121 127
Note: See TracChangeset
for help on using the changeset viewer.