Changeset 70223 in webkit
- Timestamp:
- Oct 21, 2010 3:25:25 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 60 added
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70221 r70223 1 2010-10-20 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Redesign SVGAnimatedProperty concept to share "POD type wrappers" between all bindings (-> add ObjC SVG bindings) 6 https://bugs.webkit.org/show_bug.cgi?id=47905 7 8 Add extensive set of SVGLengthList tests, that all PASS now. 9 10 * platform/mac-leopard/svg/dom: Added. 11 * platform/mac-leopard/svg/dom/SVGLengthList-appendItem-expected.checksum: Added. 12 * platform/mac-leopard/svg/dom/SVGLengthList-appendItem-expected.png: Added. 13 * platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.checksum: Added. 14 * platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.png: Added. 15 * platform/mac-leopard/svg/dom/SVGLengthList-getItem-expected.checksum: Added. 16 * platform/mac-leopard/svg/dom/SVGLengthList-getItem-expected.png: Added. 17 * platform/mac-leopard/svg/dom/SVGLengthList-initialize-expected.checksum: Added. 18 * platform/mac-leopard/svg/dom/SVGLengthList-initialize-expected.png: Added. 19 * platform/mac-leopard/svg/dom/SVGLengthList-insertItemBefore-expected.checksum: Added. 20 * platform/mac-leopard/svg/dom/SVGLengthList-insertItemBefore-expected.png: Added. 21 * platform/mac-leopard/svg/dom/SVGLengthList-removeItem-expected.checksum: Added. 22 * platform/mac-leopard/svg/dom/SVGLengthList-removeItem-expected.png: Added. 23 * platform/mac-leopard/svg/dom/SVGLengthList-replaceItem-expected.checksum: Added. 24 * platform/mac-leopard/svg/dom/SVGLengthList-replaceItem-expected.png: Added. 25 * platform/mac-leopard/svg/dom/SVGLengthList-xml-dom-modifications-expected.checksum: Added. 26 * platform/mac-leopard/svg/dom/SVGLengthList-xml-dom-modifications-expected.png: Added. 27 * platform/mac/svg/dom/SVGLengthList-appendItem-expected.checksum: Added. 28 * platform/mac/svg/dom/SVGLengthList-appendItem-expected.png: Added. 29 * platform/mac/svg/dom/SVGLengthList-basics-expected.checksum: Added. 30 * platform/mac/svg/dom/SVGLengthList-basics-expected.png: Added. 31 * platform/mac/svg/dom/SVGLengthList-getItem-expected.checksum: Added. 32 * platform/mac/svg/dom/SVGLengthList-getItem-expected.png: Added. 33 * platform/mac/svg/dom/SVGLengthList-initialize-expected.checksum: Added. 34 * platform/mac/svg/dom/SVGLengthList-initialize-expected.png: Added. 35 * platform/mac/svg/dom/SVGLengthList-insertItemBefore-expected.checksum: Added. 36 * platform/mac/svg/dom/SVGLengthList-insertItemBefore-expected.png: Added. 37 * platform/mac/svg/dom/SVGLengthList-removeItem-expected.checksum: Added. 38 * platform/mac/svg/dom/SVGLengthList-removeItem-expected.png: Added. 39 * platform/mac/svg/dom/SVGLengthList-replaceItem-expected.checksum: Added. 40 * platform/mac/svg/dom/SVGLengthList-replaceItem-expected.png: Added. 41 * platform/mac/svg/dom/SVGLengthList-xml-dom-modifications-expected.checksum: Added. 42 * platform/mac/svg/dom/SVGLengthList-xml-dom-modifications-expected.png: Added. 43 * svg/dom/SVGLengthList-appendItem-expected.txt: Added. 44 * svg/dom/SVGLengthList-appendItem.xhtml: Added. 45 * svg/dom/SVGLengthList-basics-expected.txt: Added. 46 * svg/dom/SVGLengthList-basics.xhtml: Added. 47 * svg/dom/SVGLengthList-getItem-expected.txt: Added. 48 * svg/dom/SVGLengthList-getItem.xhtml: Added. 49 * svg/dom/SVGLengthList-initialize-expected.txt: Added. 50 * svg/dom/SVGLengthList-initialize.xhtml: Added. 51 * svg/dom/SVGLengthList-insertItemBefore-expected.txt: Added. 52 * svg/dom/SVGLengthList-insertItemBefore.xhtml: Added. 53 * svg/dom/SVGLengthList-removeItem-expected.txt: Added. 54 * svg/dom/SVGLengthList-removeItem.xhtml: Added. 55 * svg/dom/SVGLengthList-replaceItem-expected.txt: Added. 56 * svg/dom/SVGLengthList-replaceItem.xhtml: Added. 57 * svg/dom/SVGLengthList-xml-dom-modifications-expected.txt: Added. 58 * svg/dom/SVGLengthList-xml-dom-modifications.xhtml: Added. 59 1 60 2010-10-21 Alex Milowski <alex@milowski.com> 2 61 -
trunk/WebCore/ChangeLog
r70221 r70223 1 2010-10-20 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Redesign SVGAnimatedProperty concept to share "POD type wrappers" between all bindings (-> add ObjC SVG bindings) 6 https://bugs.webkit.org/show_bug.cgi?id=47905 7 8 Tests: svg/dom/SVGLengthList-appendItem.xhtml 9 svg/dom/SVGLengthList-basics.xhtml 10 svg/dom/SVGLengthList-getItem.xhtml 11 svg/dom/SVGLengthList-initialize.xhtml 12 svg/dom/SVGLengthList-insertItemBefore.xhtml 13 svg/dom/SVGLengthList-removeItem.xhtml 14 svg/dom/SVGLengthList-replaceItem.xhtml 15 svg/dom/SVGLengthList-xml-dom-modifications.xhtml 16 17 Introduce a more lightweight, less intrusive way to expose SVGAnimated* DOM bindings. 18 19 Concrete example: 20 The SVG DOM defines a 'SVGAnimatedLength' object, that's used to represent the x / y / width / height attributes of a 'SVGRectElement'. 21 Each 'SVGAnimatedLength' object exposes a baseVal (markup defined attribute value) and an animVal (reflects the current state during animations), 22 both of type 'SVGLength'. These objects are all _live_. That means you can do: 23 var foobar = rect.x.baseVal; foobar.value += 150; 24 25 If we'd implement the SVG DOM straightforward, we'd have to store a refcounted SVGAnimatedLength object, containing two refcounted SVGLength objects 26 in SVGRectElement, for each of the x/y/width/height attributes. Our solution, to reduce memory footprint and increase performance is to store 27 SVGLength stack-allocated, non refcounted types in SVGRectElement for x/y/width/height, and don't implement the SVGAnimatedLength object at all. 28 29 In the past the JS bindings had to expose wrappers for SVGAnimatedLength on their own, and wrap each SVGLength object in an object called JSSVGPODTypeWrapper<SVGLength>. 30 When JS changed the 'value' of the 'SVGLength', we constructed a copy of the SVGLength object, modified it, and called rectElement->setXBaseValue(newLength). 31 This is not efficient at all, as we have to construct several copies of the SVGLength object, utilize callbacks to propagate the value changes in the SVG DOM. 32 Furthermore, all bindings had to expose a similar concept, otherwhise SVG DOM wouldn't work. Up until now, only JSC and V8 bindings were available, that worked properly. 33 34 The new SVGAnimatedProperty concept removes the need for JSSVGPODTypeWrapper (and friends like JSSVGContextCache, that associated a SVGLength with its SVGRectElement). 35 Instead a solution is offered, that all bindings can use simultaneously, without adding new types or special concepts like JSSVGPODTypeWrapper. 36 37 It works like this: 38 A new refcounted SVGAnimatedProperty<PropertyType> template class is available, that stores a QualifiedName to associate the SVG DOM property with a XML DOM attribute. 39 It also stores a RefPtr to the SVGElement that created it. 40 41 In SVGRectElement we still store SVGLength m_x/m_y/m_width/m_height members, and offer a new "xAnimated()" method which looks up or creates a SVGAnimatedProperty<SVGLength> 42 object. The JS/V8/ObjC bindings call this method whenever someone requests "rect.x/y/width/height", and a new wrapper is created, and stored in a HashMap. 43 44 The SVGAnimatedProperty<PropertyType> is a base class for SVGAnimatedPropertyTearOff and SVGAnimatedListPropertyTearOff, the latter is used for all types of lists (SVGLengthList). 45 SVGAnimatedProperty contains two methods used in the bindings: SVGProperty* baseVal and SVGProperty* animVal. SVGProperty is a base class for SVGPropertyTearOff and 46 SVGListPropertyTearOff. Upon invocation of the baseVal/animVal methods a new SVG(List)PropertyTearOff object is created and stored in a RefPtr. 47 The SVGPropertyTearOff objects stores a _reference_ to the type it wraps. Concrete example: 48 When calling rect.x, a SVGAnimatedPropertyTearOff<SVGLength> is created, that stores a pointer to the SVGRectElement, and a SVGNames::xAttr. 49 When calling rect.x.baseVal, a SVGPropertyTearOf<SVGLength> is created, that stores a reference to the "m_x" member variable of the SVGRectElement. 50 Any changes applied to the SVGLength object, through the wrapper, are immediately live, as no copies are involved anymore, nor the need to fire any callback methods. 51 This is the key concept of the new tear offs, no copies, no callbacks, no virtual methods (except one, needed for lists, but it's a detail). 52 53 The SVGAnimatedListPropertyTearOff and SVGListPropertyTearOff work the same, but for SVG*List objects. The whole SVG*List API is _removed_ from the SVG DOM classes 54 like SVGLengthList. It now inherits from Vector<SVGLength>, where it used to store a Vector<RefPtr<SVGListItem<SVGLength> > >. The SVGList API (insertItemBefore, appendItem, etc.) 55 is exposed through SVGListPropertyTearOff, and there's no need anymore for SVGLengthList to deal with it at all. 56 SVGLengthList is live just like most other SVG DOM object. Concrete example: 57 var item0 = text.x.baseVal.getItem(0); item0.value += 150; 58 59 Previously we chose to store a refcounted SVGListItem object, which wrapped the SVGLength object, to achieve liveness. We could change a single list item from DOM 60 w/o copying the whole list. The drawback is that a simple type likeSVGLengthList, was heavy to store, as it contained a list of RefPtrs around a wrapper object 61 around the real object 'SVGLength'. This complexity is completly gone. 62 63 The SVGListPropertyTearOff<SVGLengthList> stores a reference to the SVGLengthList object (eg. SVGTextElement::m_x) and maintains a list of SVGPropertyTearOff<SVGLength> 64 wrappers, that are created when necessary (getItem(2), will create a wrapper around the third list item), and cached. These SVGPropertyTearOff<SVGLength> objects 65 store references to the SVGLength object _in the SVGLengthList_. One has to be extra carefully, to keep those lists synchronized. 66 The SVGLengthList API is fully implemented for the first time, including moving items between lists, and is extensively tested with 8 new testcases. 67 68 This patch only changed SVGLength/SVGLengthList to the new concept. All other types remain using the old DeprecatedSVGAnimatedProperty* concept. 69 This will change in follow-up patches. 70 71 * GNUmakefile.am: Add new files from svg/properties to build. 72 * WebCore.gypi: Ditto. 73 * WebCore.pro: Ditto. 74 * WebCore.vcproj/WebCore.vcproj: Ditto. 75 * WebCore.xcodeproj/project.pbxproj: Ditto. 76 * bindings/js/JSSVGLengthCustom.cpp: Adapt to context cache removal for SVGLength. 77 (WebCore::JSSVGLength::value): 78 (WebCore::JSSVGLength::convertToSpecifiedUnits): 79 * bindings/scripts/CodeGenerator.pm: Add new isSVGNewStyleAnimatedProperty() helper method, return true for "SVGAnimatedLength" and "SVGAnimatedLengthList". 80 * bindings/scripts/CodeGeneratorJS.pm: Generate new style SVG JS bindings, that don't need JSSVGContextCache / JSSVGPODTypeWrapper. 81 * bindings/scripts/CodeGeneratorObjC.pm: Ditto. (+ Finally expose a working set of SVG DOM API for Objective C). 82 * bindings/scripts/CodeGeneratorV8.pm: Ditto. 83 * bindings/v8/custom/V8SVGLengthCustom.cpp: Adapt to context cache removal for SVGLength. 84 (WebCore::V8SVGLength::valueAccessorGetter): 85 (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback): 86 * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: 87 (WebCore::extractFloatValuesFromSVGLengthList): SVGLengthList is a POD type now, passed as const reference. 88 * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove handling for SVGLength/SVGLengthList, those are converted to the new SVGAnimatedProperty design now. 89 * svg/DeprecatedSVGAnimatedTemplate.h: Ditto. 90 * svg/SVGAnimatedLength.h: Added. 91 * svg/SVGAnimatedLength.idl: Mark as [SVGAnimatedProperty]. 92 * svg/SVGAnimatedLengthList.h: Added. 93 * svg/SVGAnimatedLengthList.idl: Mark as [SVGAnimatedProperty]. 94 * svg/SVGCircleElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished. 95 * svg/SVGCursorElement.h: Ditto. 96 * svg/SVGEllipseElement.h: Ditto. 97 * svg/SVGFilterElement.h: Ditto. 98 * svg/SVGFilterPrimitiveStandardAttributes.h: Ditto. 99 * svg/SVGForeignObjectElement.h: Ditto. 100 * svg/SVGImageElement.h: Ditto. 101 * svg/SVGLength.idl: Mark as [SVGProperty]. 102 * svg/SVGLengthList.cpp: Use Vector API (appendItem -> append). No need to ever use the SVGList API internally. SVGLengthList is a Vector<SVGLength> now. 103 (WebCore::SVGLengthList::parse): 104 (WebCore::SVGLengthList::valueAsString): 105 * svg/SVGLengthList.h: Inherit from Vector<SVGLength> - not from the SVGList base class. It's a simple, non-refcounted POD type now. 106 (WebCore::SVGLengthList::SVGLengthList): 107 * svg/SVGLengthList.idl: Mark as [SVGListProperty]. 108 * svg/SVGLineElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished. 109 * svg/SVGLinearGradientElement.h: Ditto. 110 * svg/SVGMarkerElement.h: Ditto. 111 * svg/SVGMaskElement.h: Ditto. 112 * svg/SVGPatternElement.h: Ditto. 113 * svg/SVGRadialGradientElement.h: Ditto. 114 * svg/SVGRectElement.h: Ditto. 115 * svg/SVGSVGElement.h: Ditto. 116 * svg/SVGSVGElement.idl: Mark createSVGLength() as [SVGLiveProperty] - a wrapper for the returned object has to be created. 117 * svg/SVGTextContentElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished. 118 * svg/SVGTextPathElement.h: Ditto. 119 * svg/SVGTextPositioningElement.cpp: 120 (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): 121 (WebCore::SVGTextPositioningElement::parseMappedAttribute): Detach wrappers pointing to the old x/y/dx/dy list, if the underlying list changes via XML DOM. 122 (WebCore::listContainsRelativeValue): Adapt to SVGLengthList interface changes, it's a POD type now. 123 * svg/SVGTextPositioningElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_LIST_PROPERTY_NEW/ until the transition to the new concept is finished. 124 * svg/SVGUseElement.h: 125 * svg/properties/SVGAnimatedListPropertyTearOff.h: Added. 126 * svg/properties/SVGAnimatedProperty.h: Added. This is the base class for SVGAnimatedPropertyTearOff and SVGAnimatedListPropertyTearOff. 127 * svg/properties/SVGAnimatedPropertyDescription.h: Added. Refactored from DeprecatedSVGAnimatedProperty.h. 128 * svg/properties/SVGAnimatedPropertyMacros.h: Added. These macros will be _removed_ as soon as the transition to the new concept is finished. 129 * svg/properties/SVGAnimatedPropertyTearOff.h: Added. 130 * svg/properties/SVGListPropertyTearOff.h: Added. 131 * svg/properties/SVGProperty.h: Added. This is the base class for SVGPropertyTearOff and SVGListPropertyTearOff. 132 * svg/properties/SVGPropertyTearOff.h: Added. 133 * svg/properties/SVGPropertyTraits.h: Added. 134 1 135 2010-10-21 Alex Milowski <alex@milowski.com> 2 136 -
trunk/WebCore/GNUmakefile.am
r70140 r70223 3008 3008 WebCore/svg/LinearGradientAttributes.h \ 3009 3009 WebCore/svg/PatternAttributes.h \ 3010 WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h \ 3011 WebCore/svg/properties/SVGAnimatedProperty.h \ 3012 WebCore/svg/properties/SVGAnimatedPropertyDescription.h \ 3013 WebCore/svg/properties/SVGAnimatedPropertyMacros.h \ 3010 3014 WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h \ 3015 WebCore/svg/properties/SVGAnimatedPropertyTearOff.h \ 3016 WebCore/svg/properties/SVGListPropertyTearOff.h \ 3017 WebCore/svg/properties/SVGProperty.h \ 3018 WebCore/svg/properties/SVGPropertyTearOff.h \ 3019 WebCore/svg/properties/SVGPropertyTraits.h \ 3011 3020 WebCore/svg/RadialGradientAttributes.h \ 3012 3021 WebCore/svg/SVGAElement.cpp \ … … 3018 3027 WebCore/svg/SVGAnimateColorElement.cpp \ 3019 3028 WebCore/svg/SVGAnimateColorElement.h \ 3029 WebCore/svg/SVGAnimatedLength.h \ 3030 WebCore/svg/SVGAnimatedLengthList.h \ 3020 3031 WebCore/svg/SVGAnimatedPathData.cpp \ 3021 3032 WebCore/svg/SVGAnimatedPathData.h \ -
trunk/WebCore/WebCore.gypi
r70140 r70223 3922 3922 'svg/graphics/SVGImage.h', 3923 3923 'svg/properties/SVGAnimatedPropertySynchronizer.h', 3924 'svg/properties/SVGAnimatedListPropertyTearOff.h', 3925 'svg/properties/SVGAnimatedProperty.h', 3926 'svg/properties/SVGAnimatedPropertyDescription.h', 3927 'svg/properties/SVGAnimatedPropertyMacros.h', 3928 'svg/properties/SVGAnimatedPropertySynchronizer.h', 3929 'svg/properties/SVGAnimatedPropertyTearOff.h', 3930 'svg/properties/SVGListPropertyTearOff.h', 3931 'svg/properties/SVGProperty.h', 3932 'svg/properties/SVGPropertyTearOff.h', 3933 'svg/properties/SVGPropertyTraits.h', 3924 3934 'svg/ColorDistance.cpp', 3925 3935 'svg/ColorDistance.h', … … 3947 3957 'svg/SVGAnimateTransformElement.cpp', 3948 3958 'svg/SVGAnimateTransformElement.h', 3959 'svg/SVGAnimatedLength.h', 3960 'svg/SVGAnimatedLengthList.h', 3949 3961 'svg/SVGAnimatedPathData.cpp', 3950 3962 'svg/SVGAnimatedPathData.h', -
trunk/WebCore/WebCore.pro
r70136 r70223 2344 2344 svg/graphics/filters/SVGFilter.h \ 2345 2345 svg/graphics/SVGImage.h \ 2346 svg/properties/SVGAnimatedListPropertyTearOff.h \ 2347 svg/properties/SVGAnimatedProperty.h \ 2348 svg/properties/SVGAnimatedPropertyDescription.h \ 2349 svg/properties/SVGAnimatedPropertyMacros.h \ 2346 2350 svg/properties/SVGAnimatedPropertySynchronizer.h \ 2351 svg/properties/SVGAnimatedPropertyTearOff.h \ 2352 svg/properties/SVGListPropertyTearOff.h \ 2353 svg/properties/SVGProperty.h \ 2354 svg/properties/SVGPropertyTearOff.h \ 2355 svg/properties/SVGPropertyTraits.h \ 2347 2356 svg/SVGAElement.h \ 2348 2357 svg/SVGAltGlyphElement.h \ 2349 2358 svg/SVGAngle.h \ 2350 2359 svg/SVGAnimateColorElement.h \ 2360 svg/SVGAnimatedLength.h \ 2361 svg/SVGAnimatedLengthList.h \ 2351 2362 svg/SVGAnimatedPathData.h \ 2352 2363 svg/SVGAnimatedPoints.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r70140 r70223 61180 61180 </File> 61181 61181 <File 61182 RelativePath="..\svg\SVGAnimatedLength.h" 61183 > 61184 </File> 61185 <File 61186 RelativePath="..\svg\SVGAnimatedLengthList.h" 61187 > 61188 </File> 61189 <File 61182 61190 RelativePath="..\svg\SVGAnimatedPathData.h" 61183 61191 > … … 62207 62215 > 62208 62216 <File 62217 RelativePath="..\svg\properties\SVGAnimatedListPropertyTearOff.h" 62218 > 62219 </File> 62220 <File 62221 RelativePath="..\svg\properties\SVGAnimatedProperty.h" 62222 > 62223 </File> 62224 <File 62225 RelativePath="..\svg\properties\SVGAnimatedPropertyDescription.h" 62226 > 62227 </File> 62228 <File 62229 RelativePath="..\svg\properties\SVGAnimatedPropertyMacros.h" 62230 > 62231 </File> 62232 <File 62209 62233 RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h" 62234 > 62235 </File> 62236 <File 62237 RelativePath="..\svg\properties\SVGAnimatedPropertyTearOff.h" 62238 > 62239 </File> 62240 <File 62241 RelativePath="..\svg\properties\SVGListPropertyTearOff.h" 62242 > 62243 </File> 62244 <File 62245 RelativePath="..\svg\properties\SVGProperty.h" 62246 > 62247 </File> 62248 <File 62249 RelativePath="..\svg\properties\SVGPropertyTearOff.h" 62250 > 62251 </File> 62252 <File 62253 RelativePath="..\svg\properties\SVGPropertyTraits.h" 62210 62254 > 62211 62255 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r70135 r70223 174 174 0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 175 175 0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 176 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 177 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */; settings = {ATTRIBUTES = (Private, ); }; }; 178 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */; settings = {ATTRIBUTES = (Private, ); }; }; 179 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */; settings = {ATTRIBUTES = (Private, ); }; }; 180 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 181 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 182 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E01126EF1DB00978F7A /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; }; 183 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; 184 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; 176 185 088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */; }; 177 186 088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */; }; … … 190 199 088C976E0ECB6E29000534BA /* WMLPElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B99350E52E37300487BB7 /* WMLPElement.cpp */; }; 191 200 088C976F0ECB6E29000534BA /* WMLPElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C6B99360E52E37300487BB7 /* WMLPElement.h */; }; 201 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */; settings = {ATTRIBUTES = (Private, ); }; }; 202 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 192 203 089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 089582530E857A7E00F82C83 /* ImageLoader.cpp */; }; 193 204 089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; }; … … 6158 6169 0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; }; 6159 6170 0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; }; 6171 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedListPropertyTearOff.h; sourceTree = "<group>"; }; 6172 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; }; 6173 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyDescription.h; sourceTree = "<group>"; }; 6174 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyMacros.h; sourceTree = "<group>"; }; 6175 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTearOff.h; sourceTree = "<group>"; }; 6176 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGListPropertyTearOff.h; sourceTree = "<group>"; }; 6177 088A0E01126EF1DB00978F7A /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; }; 6178 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTearOff.h; sourceTree = "<group>"; }; 6179 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTraits.h; sourceTree = "<group>"; }; 6160 6180 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributes.cpp; sourceTree = "<group>"; }; 6161 6181 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributes.h; sourceTree = "<group>"; }; 6182 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLength.h; sourceTree = "<group>"; }; 6183 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLengthList.h; sourceTree = "<group>"; }; 6162 6184 0893E4650ECB68F400A28563 /* WMLPageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLPageState.cpp; sourceTree = "<group>"; }; 6163 6185 0893E4660ECB68F400A28563 /* WMLPageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPageState.h; sourceTree = "<group>"; }; … … 11664 11686 isa = PBXGroup; 11665 11687 children = ( 11688 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */, 11689 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */, 11690 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */, 11691 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */, 11666 11692 081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */, 11693 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */, 11694 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */, 11695 088A0E01126EF1DB00978F7A /* SVGProperty.h */, 11696 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */, 11697 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */, 11667 11698 ); 11668 11699 path = properties; … … 15905 15936 B22277E80D00BF1F0071B782 /* SVGAnimatedEnumeration.idl */, 15906 15937 B22277E90D00BF1F0071B782 /* SVGAnimatedInteger.idl */, 15938 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */, 15907 15939 B22277EA0D00BF1F0071B782 /* SVGAnimatedLength.idl */, 15940 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */, 15908 15941 B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */, 15909 15942 B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */, … … 21094 21127 081CDFBA126ECFDB00D215CA /* DeprecatedSVGAnimatedTemplate.h in Headers */, 21095 21128 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */, 21129 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */, 21130 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */, 21131 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */, 21132 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */, 21133 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */, 21134 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */, 21135 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */, 21136 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */, 21137 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */, 21138 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */, 21139 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */, 21096 21140 ); 21097 21141 runOnlyForDeploymentPostprocessing = 0; … … 21153 21197 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 21154 21198 compatibilityVersion = "Xcode 2.4"; 21155 developmentRegion = English;21156 21199 hasScannedForEncodings = 1; 21157 21200 knownRegions = ( -
trunk/WebCore/bindings/js/JSSVGLengthCustom.cpp
r60392 r70223 23 23 #include "JSSVGLength.h" 24 24 25 #include "SVGAnimatedProperty.h" 26 25 27 using namespace JSC; 26 28 … … 29 31 JSValue JSSVGLength::value(ExecState* exec) const 30 32 { 31 JSSVGPODTypeWrapper<SVGLength>* imp = impl(); 32 SVGElement* context = JSSVGContextCache::svgContextForDOMObject(const_cast<JSSVGLength*>(this)); 33 34 SVGLength podImp(*imp); 35 return jsNumber(exec, podImp.value(context)); 33 SVGLength& podImp = impl()->propertyReference(); 34 return jsNumber(exec, podImp.value(impl()->contextElement())); 36 35 } 37 36 38 37 JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec) 39 38 { 40 JSSVGPODTypeWrapper<SVGLength>* imp = impl();41 SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);39 SVGLength& podImp = impl()->propertyReference(); 40 podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), impl()->contextElement()); 42 41 43 SVGLength podImp(*imp); 44 podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), context); 45 46 imp->commitChange(podImp, this); 42 impl()->commitChange(); 47 43 return jsUndefined(); 48 44 } -
trunk/WebCore/bindings/scripts/CodeGenerator.pm
r67421 r70223 51 51 52 52 my %podTypeHash = ("SVGNumber" => 1, "SVGTransform" => 1); 53 my %podTypesWithWritablePropertiesHash = ("SVGAngle" => 1, "SVG Length" => 1, "SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1, "SVGRect" => 1);53 my %podTypesWithWritablePropertiesHash = ("SVGAngle" => 1, "SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1, "SVGRect" => 1); 54 54 my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1); 55 55 56 56 my %nonPointerTypeHash = ("DOMTimeStamp" => 1, "CompareHow" => 1, "SVGPaintType" => 1); 57 58 my %svgNewStyleAnimatedTypeHash = ("SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1); 57 59 58 60 my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1, … … 325 327 326 328 return 1 if $nonPointerTypeHash{$type} or $primitiveTypeHash{$type}; 329 return 0; 330 } 331 332 # FIXME: This method will go away once all SVG animated properties are converted to the new scheme. 333 sub IsSVGNewStyleAnimatedType 334 { 335 my $object = shift; 336 my $type = shift; 337 338 return 1 if $svgNewStyleAnimatedTypeHash{$type}; 327 339 return 0; 328 340 } -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r70047 r70223 331 331 return 0 unless $implClassName =~ /SVG/; 332 332 return 0 if $implClassName =~ /Element/; 333 my @noContextNeeded = ("SVGPaint", "SVGColor", "SVGDocument", "SVGZoomEvent"); 333 return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName); 334 335 my @noContextNeeded = ("SVGLength", "SVGLengthList", "SVGPaint", "SVGColor", "SVGDocument", "SVGZoomEvent"); 334 336 foreach (@noContextNeeded) { 335 337 return 0 if $implClassName eq $_; … … 673 675 674 676 # Get correct pass/store types respecting PODType flag 677 my $implType = $implClassName; 678 679 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 680 if ($svgPropertyType) { 681 $implType = "SVGPropertyTearOff<$svgPropertyType> "; 682 $headerIncludes{"SVGAnimatedProperty.h"} = 1; 683 $headerIncludes{"SVGPropertyTearOff.h"} = 1; 684 $headerIncludes{"$svgPropertyType.h"} = 1 if $svgPropertyType ne "float"; 685 } 686 687 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 688 if ($svgListPropertyType) { 689 $implType = "SVGListPropertyTearOff<$svgListPropertyType> "; 690 $headerIncludes{"SVGAnimatedProperty.h"} = 1; 691 $headerIncludes{"SVGListPropertyTearOff.h"} = 1; 692 $headerIncludes{"$svgListPropertyType.h"} = 1; 693 } 694 695 # FIXME: Old style SVG JS bindings, will vanish soon. 675 696 my $podType = $dataNode->extendedAttributes->{"PODType"}; 676 my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName; 677 678 $headerIncludes{"$podType.h"} = 1 if $podType and $podType ne "float"; 679 680 $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1 if $podType; 697 if ($podType) { 698 $implType = "JSSVGPODTypeWrapper<$podType> "; 699 $headerIncludes{"$podType.h"} = 1 if $podType ne "float"; 700 $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1; 701 } 702 703 my $svgPropertyOrPodType; 704 $svgPropertyOrPodType = $podType if $podType; 705 $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType; 706 $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType; 681 707 682 708 my $numConstants = @{$dataNode->constants}; … … 686 712 push(@headerContent, "\nnamespace WebCore {\n\n"); 687 713 714 my $svgAnimatedPropertyType = $dataNode->extendedAttributes->{"SVGAnimatedProperty"}; 715 $headerIncludes{"$implClassName.h"} = 1 if $svgAnimatedPropertyType; 716 688 717 # Implementation class forward declaration 689 AddClassForwardIfNeeded($implClassName) unless $ podType;718 AddClassForwardIfNeeded($implClassName) unless $svgPropertyOrPodType or $svgAnimatedPropertyType; 690 719 AddClassForwardIfNeeded("JSDOMWindowShell") if $interfaceName eq "DOMWindow"; 691 720 … … 876 905 877 906 if (!$hasParent) { 878 # Extra space after JSSVGPODTypeWrapper<> to make RefPtr<Wrapper<> > compile.879 my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;880 907 push(@headerContent, " $implType* impl() const { return m_impl.get(); }\n\n"); 881 908 push(@headerContent, "private:\n"); … … 937 964 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"} || $dataNode->extendedAttributes->{"CustomToJS"}) { 938 965 if ($podType) { 939 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSSVGPODTypeWrapper<$podType>*, SVGElement*);\n"); 966 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement*);\n"); 967 } elsif ($svgPropertyType) { 968 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n"); 940 969 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { 941 970 push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement* context);\n"); … … 945 974 } 946 975 if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"}) { 976 947 977 if ($podType) { 948 978 push(@headerContent, "$podType to${interfaceName}(JSC::JSValue);\n"); … … 950 980 push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSValue);\n"); 951 981 } else { 952 push(@headerContent, "$impl ClassName* to${interfaceName}(JSC::JSValue);\n");982 push(@headerContent, "$implType* to${interfaceName}(JSC::JSValue);\n"); 953 983 } 954 984 } … … 1416 1446 1417 1447 # Get correct pass/store types respecting PODType flag 1448 my $implType = $implClassName; 1449 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 1450 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 1418 1451 my $podType = $dataNode->extendedAttributes->{"PODType"}; 1419 my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName; 1452 if ($svgPropertyType) { 1453 $implType = "SVGPropertyTearOff<$svgPropertyType> "; 1454 } elsif ($svgListPropertyType) { 1455 $implType = "SVGListPropertyTearOff<$svgListPropertyType> "; 1456 } elsif ($podType) { 1457 $implType = "JSSVGPODTypeWrapper<$podType> "; 1458 } 1459 1460 my $svgPropertyOrPodType; 1461 $svgPropertyOrPodType = $podType if $podType; 1462 $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType; 1463 $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType; 1420 1464 1421 1465 # Constructor … … 1541 1585 1542 1586 my $implClassNameForValueConversion = ""; 1543 if (!$ podType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {1587 if (!$svgPropertyOrPodType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) { 1544 1588 $implClassNameForValueConversion = $implClassName; 1545 1589 } … … 1593 1637 push(@implContent, " return cachedValue;\n"); 1594 1638 } 1595 if ($podType) { 1596 push(@implContent, " $podType imp(*castedThis->impl());\n"); 1597 if ($podType eq "float") { # Special case for JSSVGNumber 1639 1640 if ($svgListPropertyType) { 1641 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "castedThis->impl()->$implGetterFunctionName()", "castedThis") . ";\n"); 1642 } elsif ($svgPropertyOrPodType) { 1643 push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n") if $podType; 1644 push(@implContent, " $svgPropertyOrPodType& imp = castedThis->impl()->propertyReference();\n") if !$podType; 1645 if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber 1598 1646 push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp", "castedThis") . ";\n"); 1599 1647 } else { … … 1606 1654 if ($codeGenerator->IsSVGAnimatedType($type)) { 1607 1655 push(@implContent, " RefPtr<$type> obj = $jsType;\n"); 1608 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n"); 1656 1657 if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) { 1658 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n"); 1659 } else { 1660 push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n"); 1661 } 1609 1662 } else { 1610 1663 push(@implContent, " JSValue result = $jsType;\n"); … … 1617 1670 } else { 1618 1671 push(@implContent, " ExceptionCode ec = 0;\n"); 1619 if ($ podType) {1620 push(@implContent, " $ podType imp(*castedThis->impl());\n");1672 if ($svgPropertyOrPodType) { 1673 push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n"); 1621 1674 push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName(ec)", "castedThis") . ";\n"); 1622 1675 } else { … … 1750 1803 push(@implContent, " $className* castedThis = static_cast<$className*>(thisObject);\n"); 1751 1804 push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n"); 1752 if ($podType) { 1753 push(@implContent, " $podType podImp(*imp);\n"); 1754 if ($podType eq "float") { # Special case for JSSVGNumber 1805 if ($svgPropertyOrPodType) { 1806 push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType; 1807 push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType; 1808 if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber 1755 1809 push(@implContent, " podImp = " . JSValueToNative($attribute->signature, "value") . ";\n"); 1756 1810 } else { 1757 1811 push(@implContent, " podImp.set$implSetterFunctionName(" . JSValueToNative($attribute->signature, "value") . ");\n"); 1758 1812 } 1759 push(@implContent, " imp->commitChange(podImp, castedThis);\n"); 1813 push(@implContent, " imp->commitChange(podImp, castedThis);\n") if $podType; 1814 push(@implContent, " imp->commitChange();\n") if $svgPropertyType; 1760 1815 } else { 1761 1816 my $nativeValue = JSValueToNative($attribute->signature, "value"); … … 1849 1904 # duplicated code for the JSSVG*List classes mentioned above. 1850 1905 my $svgPODListType; 1851 if ($implClassName =~ /SVG.*List/ ) {1906 if ($implClassName =~ /SVG.*List/ and !$svgListPropertyType) { 1852 1907 $svgPODListType = $implClassName; 1853 1908 $svgPODListType =~ s/List$//; … … 1868 1923 } else { 1869 1924 push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n"); 1870 push(@implContent, " $podType podImp(*imp);\n") if $podType; 1925 push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType; 1926 push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType and $svgPropertyType; 1871 1927 1872 1928 my $numParameters = @{$function->parameters}; … … 1907 1963 my $argsIndex = 0; 1908 1964 my $paramIndex = 0; 1909 my $functionString = ($podType ? "podImp." : "imp->") . $functionImplementationName . "("; 1910 1965 my $functionString = (($svgPropertyOrPodType and !$svgListPropertyType) ? "podImp." : "imp->") . $functionImplementationName . "("; 1911 1966 my $hasOptionalArguments = 0; 1912 1967 … … 1949 2004 } 1950 2005 push(@implContent, " if (argsCount <= $argsIndex) {\n"); 1951 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $ implClassName);2006 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $svgPropertyType, $implClassName); 1952 2007 push(@implContent, " }\n\n"); 1953 2008 } … … 2033 2088 2034 2089 push(@implContent, "\n"); 2035 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $podType, $ implClassName);2090 GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $podType, $svgPropertyType, $implClassName); 2036 2091 } 2037 2092 } … … 2092 2147 2093 2148 if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !$dataNode->extendedAttributes->{"CustomToJS"}) { 2094 if ($ podType) {2095 push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSSVGPODTypeWrapper<$podType>* object, SVGElement* context)\n");2096 } elsif ( IsSVGTypeNeedingContextParameter($implClassName)) {2149 if ($svgPropertyType) { 2150 push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object)\n"); 2151 } elsif ($podType or IsSVGTypeNeedingContextParameter($implClassName)) { 2097 2152 push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object, SVGElement* context)\n"); 2098 2153 } else { … … 2100 2155 } 2101 2156 push(@implContent, "{\n"); 2102 if ($podType) { 2103 push(@implContent, " return getDOMObjectWrapper<$className, JSSVGPODTypeWrapper<$podType> >(exec, globalObject, object, context);\n"); 2157 if ($svgPropertyType) { 2158 push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object);\n"); 2159 } elsif ($podType) { 2160 push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object, context);\n"); 2104 2161 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { 2105 2162 push(@implContent, " return getDOMObjectWrapper<$className>(exec, globalObject, object, context);\n"); … … 2113 2170 if ($podType) { 2114 2171 push(@implContent, "$podType to${interfaceName}(JSC::JSValue value)\n"); 2172 push(@implContent, "{\n"); 2173 push(@implContent, " return value.inherits(&${className}::s_info) ? ($podType) *static_cast<$className*>(asObject(value))->impl() : $podType()"); 2115 2174 } else { 2116 push(@implContent, "$implClassName* to${interfaceName}(JSC::JSValue value)\n"); 2117 } 2118 2119 push(@implContent, "{\n"); 2120 2121 push(@implContent, " return value.inherits(&${className}::s_info) ? " . ($podType ? "($podType) *" : "") . "static_cast<$className*>(asObject(value))->impl() : "); 2122 if ($podType and $podType ne "float") { 2123 push(@implContent, "$podType();\n}\n"); 2124 } else { 2125 push(@implContent, "0;\n}\n"); 2126 } 2175 push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n"); 2176 push(@implContent, "{\n"); 2177 push(@implContent, " return value.inherits(&${className}::s_info) ? static_cast<$className*>(asObject(value))->impl() : 0"); 2178 } 2179 2180 push(@implContent, ";\n}\n"); 2127 2181 } 2128 2182 … … 2299 2353 my $indent = shift; 2300 2354 my $podType = shift; 2355 my $svgPropertyType = shift; 2301 2356 my $implClassName = shift; 2302 2357 … … 2317 2372 push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; 2318 2373 push(@implContent, $indent . "imp->commitChange(podImp, castedThis);\n") if $podType; 2374 push(@implContent, $indent . "imp->commitChange();\n") if $svgPropertyType; 2319 2375 push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n"); 2320 2376 } else { … … 2359 2415 "IDBKey" => "RefPtr<IDBKey>", 2360 2416 "SVGAngle" => "SVGAngle", 2361 "SVGLength" => "SVG Length",2417 "SVGLength" => "SVGPropertyTearOff<SVGLength>*", 2362 2418 "SVGMatrix" => "AffineTransform", 2363 2419 "SVGNumber" => "float", … … 2510 2566 return "toJS(exec, $globalObject, JSSVGDynamicPODTypeWrapperCache<$nativeType, $implClassNameForValueConversion>::lookupOrCreateWrapper(imp, &${implClassNameForValueConversion}::$getter, &${implClassNameForValueConversion}::$setter).get(), JSSVGContextCache::svgContextForDOMObject(castedThis));" 2511 2567 } 2568 } 2569 2570 my $svgLivePropertyType = $signature->extendedAttributes->{"SVGLiveProperty"}; 2571 if ($svgLivePropertyType) { 2572 $implIncludes{"JS$type.h"} = 1; 2573 return "toJS(exec, $globalObject, SVGPropertyTearOff<$type>::create($value).get())"; 2512 2574 } 2513 2575 … … 2549 2611 if ($signature->extendedAttributes->{"ReturnsNew"}) { 2550 2612 return "toJSNewlyCreated(exec, $globalObject, WTF::getPtr($value))"; 2613 } 2614 2615 # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked. 2616 if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) { 2617 if ($implClassName =~ /List$/) { 2618 $value = "static_cast<SVGListPropertyTearOff<$type>*>($value)"; 2619 } else { 2620 $value = "static_cast<SVGPropertyTearOff<$type>*>($value)"; 2621 } 2551 2622 } 2552 2623 -
trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r70135 r70223 588 588 } 589 589 590 if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) { 591 $implIncludes{"${type}.h"} = 1; 592 $implIncludes{"DOM${type}Internal.h"} = 1; 593 return; 594 } 595 590 596 if ($codeGenerator->IsSVGAnimatedType($type)) { 591 597 $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1; … … 968 974 # Generate internal interfaces 969 975 my $podType = $dataNode->extendedAttributes->{"PODType"}; 970 976 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 977 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 978 my $podTypeWithNamespace; 979 my $svgPropertyTypeWithNamespace; 980 my $svgListPropertyTypeWithNamespace; 981 my $implClassName = GetImplClassName($interfaceName); 982 my $implClassNameWithNamespace = "WebCore::" . $implClassName; 983 984 my $implType = $implClassNameWithNamespace; 985 if ($podType) { 986 $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType"; 987 } elsif ($svgPropertyType) { 988 $implType = "WebCore::SVGPropertyTearOff<$implType>"; 989 $svgPropertyTypeWithNamespace = ($svgPropertyType eq "float") ? "$svgPropertyType" : "WebCore::$svgPropertyType"; 990 } elsif ($svgListPropertyType) { 991 $implType = "WebCore::SVGListPropertyTearOff<$implType>"; 992 $svgListPropertyTypeWithNamespace = "WebCore::$svgListPropertyType"; 993 } 994 971 995 # Generate interface definitions. 972 996 @internalHeaderContent = split("\r", $implementationLicenseTemplate); 973 997 974 998 push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n"); 999 push(@internalHeaderContent, "#import <WebCore/SVGAnimatedProperty.h>\n\n") if $svgPropertyType or $svgListPropertyType; 1000 push(@internalHeaderContent, "#import <WebCore/SVGPropertyTearOff.h>\n\n") if $svgPropertyType; 1001 push(@internalHeaderContent, "#import <WebCore/SVGListPropertyTearOff.h>\n\n") if $svgListPropertyType; 975 1002 push(@internalHeaderContent, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion; 976 1003 … … 981 1008 my $startedNamespace = 0; 982 1009 983 my $implClassName = GetImplClassName($interfaceName);984 985 if ($codeGenerator->IsSVGAnimatedType($interfaceName)) {1010 if ($codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) { 1011 push(@internalHeaderContent, "#import <WebCore/$implClassName.h>\n\n"); 1012 } elsif ($codeGenerator->IsSVGAnimatedType($interfaceName)) { 986 1013 push(@internalHeaderContent, "#import <WebCore/DeprecatedSVGAnimatedTemplate.h>\n\n"); 987 1014 } else { … … 990 1017 if ($podType and $podType ne "float") { 991 1018 push(@internalHeaderContent, " class $podType;\n"); 1019 } elsif ($svgPropertyType and $svgPropertyType ne "float") { 1020 push(@internalHeaderContent, " class $svgPropertyType;\n"); 1021 } elsif ($svgListPropertyType) { 1022 push(@internalHeaderContent, " class $svgListPropertyType;\n"); 992 1023 } elsif ($interfaceName eq "Node") { 993 1024 push(@internalHeaderContent, " class EventTarget;\n class Node;\n"); … … 999 1030 1000 1031 if ($podType) { 1001 if ($podType eq "float") { 1002 push(@internalHeaderContent, "float core($className *);\n"); 1003 } else { 1004 push(@internalHeaderContent, "WebCore::$podType core($className *);\n"); 1005 } 1032 push(@internalHeaderContent, "$podTypeWithNamespace core($className *);\n"); 1033 push(@internalHeaderContent, "$className *kit($podTypeWithNamespace);\n"); 1006 1034 } else { 1007 push(@internalHeaderContent, "WebCore::$implClassName* core($className *);\n"); 1008 } 1009 1010 if ($podType) { 1011 if ($podType eq "float") { 1012 push(@internalHeaderContent, "$className *kit($podType);\n"); 1013 } else { 1014 push(@internalHeaderContent, "$className *kit(WebCore::$podType);\n"); 1015 } 1016 } else { 1017 push(@internalHeaderContent, "$className *kit(WebCore::$implClassName*);\n"); 1035 push(@internalHeaderContent, "$implType* core($className *);\n"); 1036 push(@internalHeaderContent, "$className *kit($implType*);\n"); 1018 1037 } 1019 1038 1020 1039 if ($dataNode->extendedAttributes->{Polymorphic}) { 1021 push(@internalHeaderContent, "Class kitClass( WebCore::$implClassName*);\n");1040 push(@internalHeaderContent, "Class kitClass($implType*);\n"); 1022 1041 } 1023 1042 … … 1053 1072 1054 1073 my $podType = $dataNode->extendedAttributes->{"PODType"}; 1074 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 1075 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 1055 1076 my $podTypeWithNamespace; 1077 my $svgPropertyTypeWithNamespace; 1078 my $svgListPropertyTypeWithNamespace; 1079 my $implType = $implClassNameWithNamespace; 1056 1080 1057 1081 if ($podType) { 1058 1082 $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType"; 1083 } elsif ($svgPropertyType) { 1084 $implType = "WebCore::SVGPropertyTearOff<$implType>"; 1085 $svgPropertyTypeWithNamespace = ($svgPropertyType eq "float") ? "$svgPropertyType" : "WebCore::$svgPropertyType"; 1086 } elsif ($svgListPropertyType) { 1087 $implType = "WebCore::SVGListPropertyTearOff<$implType>"; 1088 $svgListPropertyTypeWithNamespace = "WebCore::$svgListPropertyType"; 1059 1089 } 1060 1090 … … 1087 1117 $implIncludes{"DOMSVGPathSegInternal.h"} = 1 if $interfaceName =~ /^SVGPathSeg.+/; 1088 1118 1089 if ($codeGenerator->IsSVGAnimatedType($interfaceName) ) {1119 if ($codeGenerator->IsSVGAnimatedType($interfaceName) and !$codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) { 1090 1120 $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1; 1091 1121 } elsif ($interfaceName =~ /(\w+)(Abs|Rel)$/) { … … 1107 1137 push(@implContent, "#define IMPL reinterpret_cast<$podTypeWithNamespace*>(_internal)\n\n"); 1108 1138 } elsif ($parentImplClassName eq "Object") { 1109 push(@implContent, "#define IMPL reinterpret_cast<$impl ClassNameWithNamespace*>(_internal)\n\n");1139 push(@implContent, "#define IMPL reinterpret_cast<$implType*>(_internal)\n\n"); 1110 1140 } else { 1111 1141 my $baseClassWithNamespace = "WebCore::$baseClass"; … … 1197 1227 my $getterContentTail = ")"; 1198 1228 1199 # Special case for DOMSVGNumber 1200 if ($podType and $podType eq "float") { 1201 $getterContentHead = "*IMPL"; 1202 $getterContentTail = ""; 1203 } 1204 1205 # TODO: Handle special case for DOMSVGLength 1206 if ($podType and $podType eq "SVGLength" and $attributeName eq "value") { 1207 $getterContentHead = "IMPL->value(0 /* FIXME */"; 1229 my $svgAnimatedPropertyType = $dataNode->extendedAttributes->{"SVGAnimatedProperty"}; 1230 if ($svgPropertyType) { 1231 $getterContentHead = "$getterExpressionPrefix"; 1232 1233 # TODO: Handle special case for DOMSVGLength. We do need Custom code support for this. 1234 if ($svgPropertyType eq "SVGLength" and $attributeName eq "value") { 1235 $getterContentHead = "value(0 /* FIXME */"; 1236 } 1237 } else { 1238 # Special case for DOMSVGNumber 1239 if ($podType and $podType eq "float") { 1240 $getterContentHead = "*IMPL"; 1241 $getterContentTail = ""; 1242 } 1208 1243 } 1209 1244 … … 1248 1283 $getterContentHead = "kit($getterContentHead"; 1249 1284 $getterContentTail .= ")"; 1285 } elsif ($svgPropertyType) { 1286 $getterContentHead = "IMPL->propertyReference().$getterContentHead"; 1287 } elsif ($svgAnimatedPropertyType) { 1288 if ($idlType =~ /List$/) { 1289 $getterContentHead = "kit(static_cast<WebCore::SVGListPropertyTearOff<WebCore::$idlType>*>($getterContentHead)"; 1290 } else { 1291 $getterContentHead = "kit(static_cast<WebCore::SVGPropertyTearOff<WebCore::$idlType>*>($getterContentHead)"; 1292 } 1293 $getterContentTail .= ")"; 1250 1294 } elsif (IsProtocolType($idlType) and $idlType ne "EventTarget") { 1251 1295 $getterContentHead = "kit($getterContentHead"; … … 1323 1367 } 1324 1368 1325 if ($podType) { 1369 if ($svgPropertyType) { 1370 $getterContentHead = "$getterExpressionPrefix"; 1371 push(@implContent, " $svgPropertyTypeWithNamespace& podImpl = IMPL->propertyReference();\n"); 1372 push(@implContent, " podImpl.$coreSetterName($arg);\n"); 1373 push(@implContent, " IMPL->commitChange();\n"); 1374 } elsif ($svgListPropertyType) { 1375 $getterContentHead = "$getterExpressionPrefix"; 1376 push(@implContent, " IMPL->$coreSetterName($arg);\n"); 1377 } elsif ($podType) { 1326 1378 # Special case for DOMSVGNumber 1327 1379 if ($podType eq "float") { … … 1448 1500 my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector"); 1449 1501 my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse"); 1450 my $svgLengthConvertToSpecifiedUnits = ($ podType and $podType eq "SVGLength" and $functionName eq "convertToSpecifiedUnits");1502 my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "SVGLength" and $functionName eq "convertToSpecifiedUnits"); 1451 1503 1452 1504 push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse); 1453 my $content = $caller . "->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; 1505 push(@parameterNames, "0 /* FIXME */") if $svgLengthConvertToSpecifiedUnits; 1506 my $content = $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")"; 1507 1508 if ($svgPropertyType) { 1509 push(@functionContent, " $svgPropertyTypeWithNamespace& podImpl = IMPL->propertyReference();\n"); 1510 $content = "podImpl.$content;\n IMPL->commitChange()"; 1511 } else { 1512 $content = $caller . "->$content"; 1513 } 1454 1514 1455 1515 if ($svgMatrixRotateFromVector) { … … 1467 1527 push(@functionContent, " $exceptionRaiseOnError\n"); 1468 1528 push(@functionContent, " return kit($content);\n"); 1469 } elsif ($svgLengthConvertToSpecifiedUnits) {1470 push(@functionContent, " IMPL->convertToSpecifiedUnits(inUnitType, 0 /* FIXME */);\n");1471 1529 } elsif ($returnType eq "void") { 1472 1530 # Special case 'void' return type. … … 1497 1555 } else { 1498 1556 if (ConversionNeeded($function->signature->type)) { 1499 if ($codeGenerator->IsPodType($function->signature->type)) { 1557 my $svgLiveProperty = $function->signature->extendedAttributes->{"SVGLiveProperty"}; 1558 if ($svgLiveProperty) { 1559 $content = "kit(WebCore::SVGPropertyTearOff<WebCore::" . $function->signature->type . ">::create($content).get())"; 1560 } elsif ($codeGenerator->IsPodType($function->signature->type)) { 1500 1561 $content = "kit($content)"; 1501 1562 } else { … … 1550 1611 # Generate internal interfaces 1551 1612 if ($podType) { 1552 my $prefixedPodType = $podType eq "float" ? $podType : "WebCore::$podType"; 1553 push(@implContent, "\n$prefixedPodType core($className *wrapper)\n"); 1613 push(@implContent, "\n$podTypeWithNamespace core($className *wrapper)\n"); 1554 1614 push(@implContent, "{\n"); 1555 push(@implContent, " return wrapper ? *reinterpret_cast<$p refixedPodType*>(wrapper->_internal) : $prefixedPodType();\n");1615 push(@implContent, " return wrapper ? *reinterpret_cast<$podTypeWithNamespace*>(wrapper->_internal) : $podTypeWithNamespace();\n"); 1556 1616 push(@implContent, "}\n\n"); 1557 1617 } else { 1558 push(@implContent, "\n WebCore::$implClassName* core($className *wrapper)\n");1618 push(@implContent, "\n$implType* core($className *wrapper)\n"); 1559 1619 push(@implContent, "{\n"); 1560 push(@implContent, " return wrapper ? reinterpret_cast< WebCore::$implClassName*>(wrapper->_internal) : 0;\n");1620 push(@implContent, " return wrapper ? reinterpret_cast<$implType*>(wrapper->_internal) : 0;\n"); 1561 1621 push(@implContent, "}\n\n"); 1562 1622 } … … 1564 1624 if ($podType) { 1565 1625 # FIXME: Implement caching. 1566 my $prefixedPodType = $podType eq "float" ? $podType : "WebCore::$podType"; 1567 push(@implContent, "$className *kit($prefixedPodType value)\n"); 1626 push(@implContent, "$className *kit($podTypeWithNamespace value)\n"); 1568 1627 push(@implContent, "{\n"); 1569 1628 push(@implContent, " $assertMainThread;\n"); 1570 1629 push(@implContent, " $className *wrapper = [[$className alloc] _init];\n"); 1571 push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $p refixedPodType(value));\n");1630 push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $podTypeWithNamespace(value));\n"); 1572 1631 push(@implContent, " return [wrapper autorelease];\n"); 1573 1632 push(@implContent, "}\n"); 1574 1633 } elsif ($parentImplClassName eq "Object") { 1575 push(@implContent, "$className *kit( WebCore::$implClassName* value)\n");1634 push(@implContent, "$className *kit($implType* value)\n"); 1576 1635 push(@implContent, "{\n"); 1577 1636 push(@implContent, " $assertMainThread;\n"); … … 1593 1652 push(@implContent, "}\n"); 1594 1653 } else { 1595 push(@implContent, "$className *kit( WebCore::$implClassName* value)\n");1654 push(@implContent, "$className *kit($implType* value)\n"); 1596 1655 push(@implContent, "{\n"); 1597 1656 push(@implContent, " $assertMainThread;\n"); -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r70135 r70223 180 180 { 181 181 my $type = shift; 182 return if $codeGenerator->IsSVGNewStyleAnimatedType($type); 183 182 184 $type =~ s/SVGAnimated//; 183 185 … … 229 231 # Get correct pass/store types respecting PODType flag 230 232 my $podType = $dataNode->extendedAttributes->{"PODType"}; 233 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 234 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 231 235 232 236 my %headerInclues = (); 233 237 $headerIncludes{"$podType.h"} = 1 if $podType and ($podType ne "double" and $podType ne "float" and $podType ne "RGBA32"); 238 $headerIncludes{"$svgPropertyType.h"} = 1 if $svgPropertyType and $svgPropertyType ne "float"; 239 $headerIncludes{"$svgListPropertyType.h"} = 1 if $svgListPropertyType; 240 $headerIncludes{"SVGAnimatedProperty.h"} = 1 if $svgPropertyType or $svgListPropertyType; 234 241 $headerIncludes{"wtf/text/StringHash.h"} = 1; 235 242 $headerIncludes{"WrapperTypeInfo.h"} = 1; … … 246 253 247 254 push(@headerContent, "\nnamespace WebCore {\n"); 248 if ($podType) {249 push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n");250 }255 push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n") if $podType; 256 push(@headerContent, "\ntemplate<typename PropertyType> class SVGPropertyTearOff;\n") if $svgPropertyType; 257 push(@headerContent, "\ntemplate<typename PropertyType> class SVGListPropertyTearOff;\n") if $svgListPropertyType; 251 258 push(@headerContent, "\nclass $className {\n"); 252 259 253 my $nativeType = GetNativeTypeForConversions($interfaceName); 254 if ($podType) { 255 $nativeType = "V8SVGPODTypeWrapper<${nativeType} >"; 256 } 257 260 my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName); 258 261 my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName); 259 262 my $forceNewObjectParameter = IsDOMNodeType($interfaceName) ? ", bool forceNewObject = false" : ""; … … 451 454 } 452 455 return "" if (AvoidInclusionOfType($className)); 453 return "DeprecatedSVGAnimatedTemplate.h" if ($codeGenerator->IsSVGAnimatedType($className));456 return "DeprecatedSVGAnimatedTemplate.h" if $codeGenerator->IsSVGAnimatedType($className) and !$codeGenerator->IsSVGNewStyleAnimatedType($className); 454 457 return "${className}.h"; 455 458 } … … 681 684 my $nativeType = GetNativeTypeFromSignature($attribute->signature, -1); 682 685 my $isPodType = IsPodType($implClassName); 686 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 687 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 683 688 my $skipContext = 0; 684 689 … … 687 692 $implIncludes{"V8SVGPODTypeWrapper.h"} = 1; 688 693 } 694 695 $implIncludes{"SVGPropertyTearOff.h"} = 1 if $svgPropertyType;; 696 $implIncludes{"SVGListPropertyTearOff.h"} = 1 if $svgListPropertyType; 689 697 690 698 # Special case: SVGZoomEvent's attributes are all read-only … … 728 736 } 729 737 730 } elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) { 738 } elsif ($svgPropertyType) { 739 push(@implContentDecls, <<END); 740 SVGPropertyTearOff<$svgPropertyType>* wrapper = V8${implClassName}::toNative(info.Holder()); 741 $svgPropertyType& impInstance = wrapper->propertyReference(); 742 $svgPropertyType* imp = &impInstance; 743 END 744 } elsif ($svgListPropertyType) { 745 push(@implContentDecls, <<END); 746 SVGListPropertyTearOff<$svgListPropertyType>* imp = V8${implClassName}::toNative(info.Holder()); 747 END 748 } elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) { 731 749 if ($interfaceName eq "DOMWindow") { 732 750 push(@implContentDecls, <<END); … … 884 902 } 885 903 886 if ($attrIsPodType) { 904 if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) { 905 $implIncludes{"V8${attrType}.h"} = 1; 906 if ($implClassName =~ /List$/) { 907 push(@implContentDecls, " return toV8(static_cast<SVGListPropertyTearOff<$attrType>*>($result));\n"); 908 } else { 909 push(@implContentDecls, " return toV8(static_cast<SVGPropertyTearOff<$attrType>*>($result));\n"); 910 } 911 } elsif ($attrIsPodType) { 887 912 $implIncludes{"V8${attrType}.h"} = 1; 888 913 push(@implContentDecls, " return toV8(wrapper.release().get());\n"); … … 913 938 914 939 my $isPodType = IsPodType($implClassName); 940 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 941 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 915 942 916 943 if ($isPodType) { … … 920 947 push(@implContentDecls, " $implClassName impInstance = *wrapper;\n"); 921 948 push(@implContentDecls, " $implClassName* imp = &impInstance;\n"); 922 949 } elsif ($svgPropertyType) { 950 push(@implContentDecls, <<END); 951 SVGPropertyTearOff<$svgPropertyType>* wrapper = V8${implClassName}::toNative(info.Holder()); 952 $svgPropertyType& impInstance = wrapper->propertyReference(); 953 $svgPropertyType* imp = &impInstance; 954 END 955 } elsif ($svgListPropertyType) { 956 push(@implContentDecls, <<END); 957 SVGListPropertyTearOff<$svgListPropertyType>* imp = V8${implClassName}::toNative(info.Holder()); 958 END 923 959 } elsif ($attrExt->{"v8OnProto"}) { 924 960 if ($interfaceName eq "DOMWindow") { … … 1014 1050 if ($isPodType) { 1015 1051 push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::svgContext(wrapper));\n"); 1052 } elsif ($svgPropertyType) { 1053 push(@implContentDecls, " wrapper->commitChange();\n"); 1016 1054 } elsif (IsSVGTypeNeedingContextParameter($implClassName)) { 1017 1055 $implIncludes{"SVGElement.h"} = 1; … … 1025 1063 push(@implContentDecls, " context->svgAttributeChanged(imp->associatedAttributeName());\n"); 1026 1064 } 1027 1065 1028 1066 push(@implContentDecls, " return;\n"); 1029 1067 push(@implContentDecls, "}\n\n"); # end of setter … … 1214 1252 } 1215 1253 1254 my $svgPropertyType = $dataNode->extendedAttributes->{"SVGProperty"}; 1255 my $svgListPropertyType = $dataNode->extendedAttributes->{"SVGListProperty"}; 1256 1216 1257 if (IsPodType($implClassName)) { 1217 1258 my $nativeClassName = GetNativeType($implClassName); … … 1219 1260 push(@implContentDecls, " $nativeClassName impInstance = *impWrapper;\n"); 1220 1261 push(@implContentDecls, " $nativeClassName* imp = &impInstance;\n"); 1262 } elsif ($svgPropertyType) { 1263 my $nativeClassName = GetNativeType($implClassName); 1264 push(@implContentDecls, " $nativeClassName wrapper = V8${svgPropertyType}::toNative(args.Holder());\n"); 1265 push(@implContentDecls, " $svgPropertyType& impInstance = wrapper->propertyReference();\n"); 1266 push(@implContentDecls, " $svgPropertyType* imp = &impInstance;\n"); 1267 } elsif ($svgListPropertyType) { 1268 my $nativeClassName = GetNativeType($implClassName); 1269 push(@implContentDecls, " $nativeClassName imp = V8${svgListPropertyType}::toNative(args.Holder());\n"); 1221 1270 } elsif (!$function->signature->extendedAttributes->{"ClassMethod"}) { 1222 1271 push(@implContentDecls, <<END); … … 2131 2180 } 2132 2181 2133 my $nativeType = GetNativeTypeForConversions($interfaceName); 2134 if ($dataNode->extendedAttributes->{"PODType"}) { 2135 $nativeType = "V8SVGPODTypeWrapper<${nativeType}>"; 2136 } 2182 my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName); 2137 2183 push(@implContent, <<END); 2138 2184 … … 2539 2585 return "getDOMNodeMap()" if ($dataNode && IsNodeSubType($dataNode)); 2540 2586 # Only use getDOMSVGObjectWithContextMap() for non-node svg objects 2541 return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/ ;2587 return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/ and $type ne "SVGLength" and $type ne "SVGLengthList" and not $codeGenerator->IsSVGNewStyleAnimatedType($type); 2542 2588 return "" if $type eq "DOMImplementation"; 2543 2589 return "getActiveDOMObjectMap()" if IsActiveDomType($type); … … 2563 2609 sub GetNativeTypeForConversions 2564 2610 { 2611 my $dataNode = shift; 2565 2612 my $type = shift; 2566 return "FloatRect" if $type eq "SVGRect"; 2567 return "FloatPoint" if $type eq "SVGPoint"; 2568 return "AffineTransform" if $type eq "SVGMatrix"; 2569 return "float" if $type eq "SVGNumber"; 2613 2614 $type = "FloatRect" if $type eq "SVGRect"; 2615 $type = "FloatPoint" if $type eq "SVGPoint"; 2616 $type = "AffineTransform" if $type eq "SVGMatrix"; 2617 $type = "float" if $type eq "SVGNumber"; 2618 $type = "V8SVGPODTypeWrapper<$type>" if $dataNode->extendedAttributes->{"PODType"}; 2619 $type = "SVGPropertyTearOff<$type>" if $dataNode->extendedAttributes->{"SVGProperty"}; 2620 $type = "SVGListPropertyTearOff<$type>" if $dataNode->extendedAttributes->{"SVGListProperty"}; 2570 2621 return $type; 2571 2622 } … … 2725 2776 $return = "wrapper"; 2726 2777 } 2778 2779 my $svgLivePropertyType = $function->signature->extendedAttributes->{"SVGLiveProperty"}; 2780 if ($svgLivePropertyType) { 2781 $implIncludes{"V8$returnType.h"} = 1; 2782 $implIncludes{"SVGPropertyTearOff.h"} = 1; 2783 return $indent . "return toV8(SVGPropertyTearOff<$returnType>::create($return).get());\n"; 2784 } 2727 2785 2728 2786 my $generatedSVGContextRetrieval = 0; … … 2751 2809 2752 2810 $result .= $indent . "impWrapper->commitChange(impInstance, context);\n"; 2811 } elsif ($dataNode->extendedAttributes->{"SVGProperty"}) { 2812 $result .= $indent . "wrapper->commitChange();\n"; 2753 2813 } 2754 2814 … … 2843 2903 return "AffineTransform" if $type eq "SVGMatrix"; 2844 2904 return "SVGTransform" if $type eq "SVGTransform"; 2845 return "SVGLength" if $type eq "SVGLength";2846 2905 return "SVGAngle" if $type eq "SVGAngle"; 2906 return "RefPtr<SVGPropertyTearOff<SVGLength> >" if $type eq "SVGLength"; 2907 return "SVGListPropertyTearOff<SVGLengthList>*" if $type eq "SVGLengthList"; 2847 2908 return "float" if $type eq "SVGNumber"; 2848 2909 return "SVGPreserveAspectRatio" if $type eq "SVGPreserveAspectRatio"; … … 2897 2958 2898 2959 return 1 if $type eq "SVGAngle"; 2899 return 1 if $type eq "SVGLength";2900 2960 return 1 if $type eq "SVGMatrix"; 2901 2961 return 1 if $type eq "SVGPoint"; … … 3279 3339 my $implClassName = shift; 3280 3340 3341 return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName); 3281 3342 if ($implClassName =~ /SVG/ and not $implClassName =~ /Element/) { 3282 return 1 unless $implClassName =~ /SVGPaint/ or $implClassName =~ /SVGColor/ or $implClassName =~ /SVGDocument/ ;3343 return 1 unless $implClassName =~ /SVGPaint/ or $implClassName =~ /SVGColor/ or $implClassName =~ /SVGDocument/ or $implClassName =~ /SVGLength/ or $implClassName =~/SVGLengthList/; 3283 3344 } 3284 3345 -
trunk/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
r54349 r70223 34 34 #include "V8SVGLength.h" 35 35 36 #include "SVG Length.h"36 #include "SVGPropertyTearOff.h" 37 37 #include "V8Binding.h" 38 #include "V8SVGPODTypeWrapper.h"39 #include "V8Proxy.h"40 38 41 39 namespace WebCore { … … 44 42 { 45 43 INC_STATS("DOM.SVGLength.value"); 46 V8SVGPODTypeWrapper<SVGLength>* wrapper = V8SVGPODTypeWrapper<SVGLength>::toNative(info.Holder());47 SVGLength imp = *wrapper;48 return v8::Number::New(imp.value( V8Proxy::svgContext(wrapper)));44 SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder()); 45 SVGLength& imp = wrapper->propertyReference(); 46 return v8::Number::New(imp.value(wrapper->contextElement())); 49 47 } 50 48 … … 52 50 { 53 51 INC_STATS("DOM.SVGLength.convertToSpecifiedUnits"); 54 V8SVGPODTypeWrapper<SVGLength>* wrapper = V8SVGPODTypeWrapper<SVGLength>::toNative(args.Holder()); 55 SVGLength imp = *wrapper; 56 SVGElement* context = V8Proxy::svgContext(wrapper); 57 imp.convertToSpecifiedUnits(toInt32(args[0]), context); 58 wrapper->commitChange(imp, context); 52 SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder()); 53 SVGLength& imp = wrapper->propertyReference(); 54 imp.convertToSpecifiedUnits(toInt32(args[0]), wrapper->contextElement()); 55 wrapper->commitChange(); 59 56 return v8::Undefined(); 60 57 } -
trunk/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
r69399 r70223 58 58 } 59 59 60 static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, SVGLengthList*list, Vector<float>& floatValues, unsigned textContentLength)60 static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, const SVGLengthList& list, Vector<float>& floatValues, unsigned textContentLength) 61 61 { 62 62 ASSERT(lengthContext); 63 ASSERT(list); 64 65 unsigned length = list->numberOfItems(); 63 64 unsigned length = list.size(); 66 65 if (length > textContentLength) 67 66 length = textContentLength; 68 67 floatValues.reserveCapacity(length); 69 68 70 ExceptionCode ec = 0;71 69 for (unsigned i = 0; i < length; ++i) { 72 SVGLength length = list->getItem(i, ec); 73 ASSERT(!ec); 70 const SVGLength& length = list.at(i); 74 71 floatValues.append(length.value(lengthContext)); 75 72 } -
trunk/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
r70135 r70223 26 26 #include "PlatformString.h" 27 27 #include "SVGAngle.h" 28 #include "SVGLength.h"29 #include "SVGLengthList.h"30 28 #include "SVGNumberList.h" 31 29 #include "SVGPreserveAspectRatio.h" … … 83 81 static ReturnType toReturnType(const StoredType& type) { return type; } 84 82 static String toString(PassType type) { return String::number(type); } 85 };86 87 // SVGAnimatedLength88 template<>89 struct DeprecatedSVGAnimatedPropertyTraits<SVGLength> : public Noncopyable {90 typedef const SVGLength& PassType;91 typedef SVGLength ReturnType;92 typedef SVGLength StoredType;93 94 static ReturnType null() { return SVGLength(); }95 static ReturnType toReturnType(const StoredType& type) { return type; }96 static String toString(PassType type) { return type.valueAsString(); }97 };98 99 // SVGAnimatedLengthList100 template<>101 struct DeprecatedSVGAnimatedPropertyTraits<SVGLengthList*> : public Noncopyable {102 typedef SVGLengthList* PassType;103 typedef SVGLengthList* ReturnType;104 typedef RefPtr<SVGLengthList> StoredType;105 106 static ReturnType null() { return 0; }107 static ReturnType toReturnType(const StoredType& type) { return type.get(); }108 static String toString(PassType type) { return type ? type->valueAsString() : String(); }109 83 }; 110 84 -
trunk/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
r70135 r70223 31 31 class SVGAngle; 32 32 class SVGElement; 33 class SVGLengthList;34 33 class SVGNumberList; 35 34 class SVGPreserveAspectRatio; … … 161 160 typedef DeprecatedSVGAnimatedTemplate<int> SVGAnimatedEnumeration; 162 161 typedef DeprecatedSVGAnimatedTemplate<long> SVGAnimatedInteger; 163 typedef DeprecatedSVGAnimatedTemplate<SVGLength> SVGAnimatedLength;164 typedef DeprecatedSVGAnimatedTemplate<SVGLengthList*> SVGAnimatedLengthList;165 162 typedef DeprecatedSVGAnimatedTemplate<float> SVGAnimatedNumber; 166 163 typedef DeprecatedSVGAnimatedTemplate<SVGNumberList*> SVGAnimatedNumberList; -
trunk/WebCore/svg/SVGAnimatedLength.idl
r64579 r70223 26 26 module svg { 27 27 28 interface [Conditional=SVG ] SVGAnimatedLength {28 interface [Conditional=SVG, SVGAnimatedProperty] SVGAnimatedLength { 29 29 readonly attribute SVGLength baseVal; 30 30 readonly attribute SVGLength animVal; -
trunk/WebCore/svg/SVGAnimatedLengthList.idl
r64579 r70223 26 26 module svg { 27 27 28 interface [Conditional=SVG ] SVGAnimatedLengthList {28 interface [Conditional=SVG, SVGAnimatedProperty] SVGAnimatedLengthList { 29 29 readonly attribute SVGLengthList baseVal; 30 30 readonly attribute SVGLengthList animVal; -
trunk/WebCore/svg/SVGCircleElement.h
r69517 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 50 52 virtual bool selfHasRelativeLengths() const; 51 53 52 DECLARE_ANIMATED_PROPERTY (SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx)53 DECLARE_ANIMATED_PROPERTY (SVGCircleElement, SVGNames::cyAttr, SVGLength, Cy, cy)54 DECLARE_ANIMATED_PROPERTY (SVGCircleElement, SVGNames::rAttr, SVGLength, R, r)54 DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx) 55 DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::cyAttr, SVGLength, Cy, cy) 56 DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::rAttr, SVGLength, R, r) 55 57 56 58 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGCursorElement.h
r66397 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGLength.h" 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 26 27 #include "SVGElement.h" 27 28 #include "SVGTests.h" … … 54 55 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 55 56 56 DECLARE_ANIMATED_PROPERTY (SVGCursorElement, SVGNames::xAttr, SVGLength, X, x)57 DECLARE_ANIMATED_PROPERTY (SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y)57 DECLARE_ANIMATED_PROPERTY_NEW(SVGCursorElement, SVGNames::xAttr, SVGLength, X, x) 58 DECLARE_ANIMATED_PROPERTY_NEW(SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y) 58 59 59 60 // SVGURIReference -
trunk/WebCore/svg/SVGEllipseElement.h
r69517 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 50 52 virtual bool selfHasRelativeLengths() const; 51 53 52 DECLARE_ANIMATED_PROPERTY (SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx)53 DECLARE_ANIMATED_PROPERTY (SVGEllipseElement, SVGNames::cyAttr, SVGLength, Cy, cy)54 DECLARE_ANIMATED_PROPERTY (SVGEllipseElement, SVGNames::rxAttr, SVGLength, Rx, rx)55 DECLARE_ANIMATED_PROPERTY (SVGEllipseElement, SVGNames::ryAttr, SVGLength, Ry, ry)54 DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx) 55 DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::cyAttr, SVGLength, Cy, cy) 56 DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::rxAttr, SVGLength, Rx, rx) 57 DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::ryAttr, SVGLength, Ry, ry) 56 58 57 59 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGFilterElement.h
r66955 r70223 25 25 26 26 #if ENABLE(SVG) && ENABLE(FILTERS) 27 #include "SVGAnimatedLength.h" 28 #include "SVGAnimatedPropertyMacros.h" 27 29 #include "RenderObject.h" 28 30 #include "SVGExternalResourcesRequired.h" … … 62 64 DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits) 63 65 DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits) 64 DECLARE_ANIMATED_PROPERTY (SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)65 DECLARE_ANIMATED_PROPERTY (SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)66 DECLARE_ANIMATED_PROPERTY (SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)67 DECLARE_ANIMATED_PROPERTY (SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)66 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x) 67 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y) 68 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width) 69 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height) 68 70 DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResXIdentifier, long, FilterResX, filterResX) 69 71 DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResYIdentifier, long, FilterResY, filterResY) -
trunk/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
r66955 r70223 25 25 #include "FilterEffect.h" 26 26 #include "RenderSVGResource.h" 27 #include "SVGAnimatedLength.h" 28 #include "SVGAnimatedPropertyMacros.h" 27 29 #include "SVGFilterBuilder.h" 28 30 #include "SVGFilterElement.h" … … 61 63 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 62 64 63 DECLARE_ANIMATED_PROPERTY (SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)64 DECLARE_ANIMATED_PROPERTY (SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)65 DECLARE_ANIMATED_PROPERTY (SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)66 DECLARE_ANIMATED_PROPERTY (SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)65 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x) 66 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y) 67 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width) 68 DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height) 67 69 DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result) 68 70 }; -
trunk/WebCore/svg/SVGForeignObjectElement.h
r66397 r70223 22 22 23 23 #if ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT) 24 #include "SVGAnimatedLength.h" 25 #include "SVGAnimatedPropertyMacros.h" 24 26 #include "SVGTests.h" 25 27 #include "SVGLangSpace.h" … … 51 53 virtual bool selfHasRelativeLengths() const; 52 54 53 DECLARE_ANIMATED_PROPERTY (SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x)54 DECLARE_ANIMATED_PROPERTY (SVGForeignObjectElement, SVGNames::yAttr, SVGLength, Y, y)55 DECLARE_ANIMATED_PROPERTY (SVGForeignObjectElement, SVGNames::widthAttr, SVGLength, Width, width)56 DECLARE_ANIMATED_PROPERTY (SVGForeignObjectElement, SVGNames::heightAttr, SVGLength, Height, height)55 DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x) 56 DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::yAttr, SVGLength, Y, y) 57 DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::widthAttr, SVGLength, Width, width) 58 DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::heightAttr, SVGLength, Height, height) 57 59 58 60 // SVGURIReference -
trunk/WebCore/svg/SVGImageElement.h
r66397 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 65 67 virtual void willMoveToNewOwnerDocument(); 66 68 67 DECLARE_ANIMATED_PROPERTY (SVGImageElement, SVGNames::xAttr, SVGLength, X, x)68 DECLARE_ANIMATED_PROPERTY (SVGImageElement, SVGNames::yAttr, SVGLength, Y, y)69 DECLARE_ANIMATED_PROPERTY (SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width)70 DECLARE_ANIMATED_PROPERTY (SVGImageElement, SVGNames::heightAttr, SVGLength, Height, height)69 DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::xAttr, SVGLength, X, x) 70 DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::yAttr, SVGLength, Y, y) 71 DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width) 72 DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::heightAttr, SVGLength, Height, height) 71 73 DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 72 74 -
trunk/WebCore/svg/SVGLength.idl
r64579 r70223 23 23 module svg { 24 24 25 interface [Conditional=SVG, PODType=SVGLength] SVGLength {25 interface [Conditional=SVG, SVGProperty=SVGLength] SVGLength { 26 26 // Length Unit Types 27 27 const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0; -
trunk/WebCore/svg/SVGLengthList.cpp
r66397 r70223 25 25 26 26 #include "SVGParserUtilities.h" 27 #include <wtf/text/StringBuilder.h> 27 28 28 29 namespace WebCore { 29 30 30 SVGLengthList::SVGLengthList(const QualifiedName& attributeName)31 : SVGPODList<SVGLength>(attributeName)32 {33 }34 35 31 void SVGLengthList::parse(const String& value, SVGLengthMode mode) 36 32 { 37 ExceptionCode ec = 0; 38 clear(ec); 33 clear(); 39 34 40 35 const UChar* ptr = value.characters(); … … 49 44 if (!length.setValueAsString(String(start, ptr - start))) 50 45 return; 51 append Item(length, ec);46 append(length); 52 47 skipOptionalSpacesOrDelimiter(ptr, end); 53 48 } … … 56 51 String SVGLengthList::valueAsString() const 57 52 { 58 String result;53 StringBuilder builder; 59 54 60 ExceptionCode ec = 0;61 for (unsigned i nt i = 0; i < numberOfItems(); ++i) {55 unsigned size = this->size(); 56 for (unsigned i = 0; i < size; ++i) { 62 57 if (i > 0) 63 result += ", ";58 builder.append(", "); 64 59 65 result += getItem(i, ec).valueAsString(); 66 ASSERT(ec == 0); 60 builder.append(at(i).valueAsString()); 67 61 } 68 62 69 return result;63 return builder.toString(); 70 64 } 71 65 -
trunk/WebCore/svg/SVGLengthList.h
r66397 r70223 24 24 #if ENABLE(SVG) 25 25 #include "SVGLength.h" 26 #include "SVGList.h"26 #include <wtf/Vector.h> 27 27 28 28 namespace WebCore { 29 29 30 class SVGLengthList : public SVGPODList<SVGLength> {31 32 static PassRefPtr<SVGLengthList> create(const QualifiedName& attributeName) { return adoptRef(new SVGLengthList(attributeName));}30 class SVGLengthList : public Vector<SVGLength> { 31 public: 32 SVGLengthList() { } 33 33 34 void parse(const String& value, SVGLengthMode); 35 36 String valueAsString() const; 37 38 private: 39 SVGLengthList(const QualifiedName&); 40 }; 34 void parse(const String& value, SVGLengthMode); 35 String valueAsString() const; 36 }; 41 37 42 38 } // namespace WebCore -
trunk/WebCore/svg/SVGLengthList.idl
r64579 r70223 27 27 module svg { 28 28 29 interface [Conditional=SVG ] SVGLengthList {29 interface [Conditional=SVG, SVGListProperty=SVGLengthList] SVGLengthList { 30 30 readonly attribute unsigned long numberOfItems; 31 31 -
trunk/WebCore/svg/SVGLineElement.h
r69517 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 54 56 virtual bool selfHasRelativeLengths() const; 55 57 56 DECLARE_ANIMATED_PROPERTY (SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1)57 DECLARE_ANIMATED_PROPERTY (SVGLineElement, SVGNames::y1Attr, SVGLength, Y1, y1)58 DECLARE_ANIMATED_PROPERTY (SVGLineElement, SVGNames::x2Attr, SVGLength, X2, x2)59 DECLARE_ANIMATED_PROPERTY (SVGLineElement, SVGNames::y2Attr, SVGLength, Y2, y2)58 DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1) 59 DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::y1Attr, SVGLength, Y1, y1) 60 DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::x2Attr, SVGLength, X2, x2) 61 DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::y2Attr, SVGLength, Y2, y2) 60 62 61 63 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGLinearGradientElement.h
r69413 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGGradientElement.h" 26 28 … … 48 50 virtual bool selfHasRelativeLengths() const; 49 51 50 DECLARE_ANIMATED_PROPERTY (SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1)51 DECLARE_ANIMATED_PROPERTY (SVGLinearGradientElement, SVGNames::y1Attr, SVGLength, Y1, y1)52 DECLARE_ANIMATED_PROPERTY (SVGLinearGradientElement, SVGNames::x2Attr, SVGLength, X2, x2)53 DECLARE_ANIMATED_PROPERTY (SVGLinearGradientElement, SVGNames::y2Attr, SVGLength, Y2, y2)52 DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1) 53 DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::y1Attr, SVGLength, Y1, y1) 54 DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::x2Attr, SVGLength, X2, x2) 55 DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::y2Attr, SVGLength, Y2, y2) 54 56 }; 55 57 -
trunk/WebCore/svg/SVGMarkerElement.h
r66397 r70223 25 25 #include "RenderObject.h" 26 26 #include "SVGAngle.h" 27 #include "SVGAnimatedLength.h" 28 #include "SVGAnimatedPropertyMacros.h" 27 29 #include "SVGExternalResourcesRequired.h" 28 30 #include "SVGFitToViewBox.h" … … 75 77 virtual bool selfHasRelativeLengths() const; 76 78 77 DECLARE_ANIMATED_PROPERTY (SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)78 DECLARE_ANIMATED_PROPERTY (SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)79 DECLARE_ANIMATED_PROPERTY (SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)80 DECLARE_ANIMATED_PROPERTY (SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)79 DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX) 80 DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY) 81 DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth) 82 DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight) 81 83 DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits) 82 84 DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientTypeAttrIdentifier, int, OrientType, orientType) -
trunk/WebCore/svg/SVGMaskElement.h
r66397 r70223 23 23 #if ENABLE(SVG) 24 24 #include "RenderObject.h" 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 58 60 DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskUnitsAttr, int, MaskUnits, maskUnits) 59 61 DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskContentUnitsAttr, int, MaskContentUnits, maskContentUnits) 60 DECLARE_ANIMATED_PROPERTY (SVGMaskElement, SVGNames::xAttr, SVGLength, X, x)61 DECLARE_ANIMATED_PROPERTY (SVGMaskElement, SVGNames::yAttr, SVGLength, Y, y)62 DECLARE_ANIMATED_PROPERTY (SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width)63 DECLARE_ANIMATED_PROPERTY (SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height)62 DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::xAttr, SVGLength, X, x) 63 DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::yAttr, SVGLength, Y, y) 64 DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width) 65 DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height) 64 66 65 67 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGPatternElement.h
r69413 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGFitToViewBox.h" … … 63 65 virtual bool selfHasRelativeLengths() const; 64 66 65 DECLARE_ANIMATED_PROPERTY (SVGPatternElement, SVGNames::xAttr, SVGLength, X, x)66 DECLARE_ANIMATED_PROPERTY (SVGPatternElement, SVGNames::yAttr, SVGLength, Y, y)67 DECLARE_ANIMATED_PROPERTY (SVGPatternElement, SVGNames::widthAttr, SVGLength, Width, width)68 DECLARE_ANIMATED_PROPERTY (SVGPatternElement, SVGNames::heightAttr, SVGLength, Height, height)67 DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x) 68 DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::yAttr, SVGLength, Y, y) 69 DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::widthAttr, SVGLength, Width, width) 70 DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::heightAttr, SVGLength, Height, height) 69 71 DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternUnitsAttr, int, PatternUnits, patternUnits) 70 72 DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternContentUnitsAttr, int, PatternContentUnits, patternContentUnits) -
trunk/WebCore/svg/SVGRadialGradientElement.h
r69413 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGGradientElement.h" 26 28 … … 48 50 virtual bool selfHasRelativeLengths() const; 49 51 50 DECLARE_ANIMATED_PROPERTY (SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx)51 DECLARE_ANIMATED_PROPERTY (SVGRadialGradientElement, SVGNames::cyAttr, SVGLength, Cy, cy)52 DECLARE_ANIMATED_PROPERTY (SVGRadialGradientElement, SVGNames::rAttr, SVGLength, R, r)53 DECLARE_ANIMATED_PROPERTY (SVGRadialGradientElement, SVGNames::fxAttr, SVGLength, Fx, fx)54 DECLARE_ANIMATED_PROPERTY (SVGRadialGradientElement, SVGNames::fyAttr, SVGLength, Fy, fy)52 DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx) 53 DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::cyAttr, SVGLength, Cy, cy) 54 DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::rAttr, SVGLength, R, r) 55 DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::fxAttr, SVGLength, Fx, fx) 56 DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::fyAttr, SVGLength, Fy, fy) 55 57 }; 56 58 -
trunk/WebCore/svg/SVGRectElement.h
r69517 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 50 52 virtual bool selfHasRelativeLengths() const; 51 53 52 DECLARE_ANIMATED_PROPERTY (SVGRectElement, SVGNames::xAttr, SVGLength, X, x)53 DECLARE_ANIMATED_PROPERTY (SVGRectElement, SVGNames::yAttr, SVGLength, Y, y)54 DECLARE_ANIMATED_PROPERTY (SVGRectElement, SVGNames::widthAttr, SVGLength, Width, width)55 DECLARE_ANIMATED_PROPERTY (SVGRectElement, SVGNames::heightAttr, SVGLength, Height, height)56 DECLARE_ANIMATED_PROPERTY (SVGRectElement, SVGNames::rxAttr, SVGLength, Rx, rx)57 DECLARE_ANIMATED_PROPERTY (SVGRectElement, SVGNames::ryAttr, SVGLength, Ry, ry)54 DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::xAttr, SVGLength, X, x) 55 DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::yAttr, SVGLength, Y, y) 56 DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::widthAttr, SVGLength, Width, width) 57 DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::heightAttr, SVGLength, Height, height) 58 DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::rxAttr, SVGLength, Rx, rx) 59 DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::ryAttr, SVGLength, Ry, ry) 58 60 59 61 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGSVGElement.h
r66397 r70223 23 23 24 24 #if ENABLE(SVG) 25 26 25 #include "IntSize.h" 26 #include "SVGAnimatedLength.h" 27 #include "SVGAnimatedPropertyMacros.h" 27 28 #include "SVGExternalResourcesRequired.h" 28 29 #include "SVGFitToViewBox.h" … … 137 138 virtual bool selfHasRelativeLengths() const; 138 139 139 DECLARE_ANIMATED_PROPERTY (SVGSVGElement, SVGNames::xAttr, SVGLength, X, x)140 DECLARE_ANIMATED_PROPERTY (SVGSVGElement, SVGNames::yAttr, SVGLength, Y, y)141 DECLARE_ANIMATED_PROPERTY (SVGSVGElement, SVGNames::widthAttr, SVGLength, Width, width)142 DECLARE_ANIMATED_PROPERTY (SVGSVGElement, SVGNames::heightAttr, SVGLength, Height, height)140 DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::xAttr, SVGLength, X, x) 141 DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::yAttr, SVGLength, Y, y) 142 DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::widthAttr, SVGLength, Width, width) 143 DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::heightAttr, SVGLength, Height, height) 143 144 144 145 // SVGExternalResourcesRequired -
trunk/WebCore/svg/SVGSVGElement.idl
r64579 r70223 74 74 75 75 SVGNumber createSVGNumber(); 76 SVGLength createSVGLength();76 [SVGLiveProperty] SVGLength createSVGLength(); 77 77 SVGAngle createSVGAngle(); 78 78 SVGPoint createSVGPoint(); -
trunk/WebCore/svg/SVGTextContentElement.h
r68867 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 70 72 virtual bool isTextContent() const { return true; } 71 73 72 DECLARE_ANIMATED_PROPERTY (SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength)74 DECLARE_ANIMATED_PROPERTY_NEW(SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength) 73 75 DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::lengthAdjustAttr, int, LengthAdjust, lengthAdjust) 74 76 -
trunk/WebCore/svg/SVGTextPathElement.h
r66397 r70223 68 68 virtual bool selfHasRelativeLengths() const; 69 69 70 DECLARE_ANIMATED_PROPERTY (SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset)70 DECLARE_ANIMATED_PROPERTY_NEW(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset) 71 71 DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::methodAttr, int, Method, method) 72 72 DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::spacingAttr, int, Spacing, spacing) -
trunk/WebCore/svg/SVGTextPositioningElement.cpp
r69186 r70223 35 35 SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* document) 36 36 : SVGTextContentElement(tagName, document) 37 , m_x(SVGLengthList::create(SVGNames::xAttr))38 , m_y(SVGLengthList::create(SVGNames::yAttr))39 , m_dx(SVGLengthList::create(SVGNames::dxAttr))40 , m_dy(SVGLengthList::create(SVGNames::dyAttr))41 37 , m_rotate(SVGNumberList::create(SVGNames::rotateAttr)) 42 38 { … … 45 41 void SVGTextPositioningElement::parseMappedAttribute(Attribute* attr) 46 42 { 47 if (attr->name() == SVGNames::xAttr) 48 xBaseValue()->parse(attr->value(), LengthModeWidth); 49 else if (attr->name() == SVGNames::yAttr) 50 yBaseValue()->parse(attr->value(), LengthModeHeight); 51 else if (attr->name() == SVGNames::dxAttr) 52 dxBaseValue()->parse(attr->value(), LengthModeWidth); 53 else if (attr->name() == SVGNames::dyAttr) 54 dyBaseValue()->parse(attr->value(), LengthModeHeight); 55 else if (attr->name() == SVGNames::rotateAttr) 43 if (attr->name() == SVGNames::xAttr) { 44 SVGLengthList newList; 45 newList.parse(attr->value(), LengthModeWidth); 46 detachAnimatedXListWrappers(newList.size()); 47 xBaseValue() = newList; 48 } else if (attr->name() == SVGNames::yAttr) { 49 SVGLengthList newList; 50 newList.parse(attr->value(), LengthModeHeight); 51 detachAnimatedYListWrappers(newList.size()); 52 yBaseValue() = newList; 53 } else if (attr->name() == SVGNames::dxAttr) { 54 SVGLengthList newList; 55 newList.parse(attr->value(), LengthModeWidth); 56 detachAnimatedDxListWrappers(newList.size()); 57 dxBaseValue() = newList; 58 } else if (attr->name() == SVGNames::dyAttr) { 59 SVGLengthList newList; 60 newList.parse(attr->value(), LengthModeHeight); 61 detachAnimatedDyListWrappers(newList.size()); 62 dyBaseValue() = newList; 63 } else if (attr->name() == SVGNames::rotateAttr) 56 64 rotateBaseValue()->parse(attr->value()); 57 65 else … … 145 153 } 146 154 147 static inline bool listContainsRelativeValue(SVGLengthList* list) 148 { 149 if (!list) 150 return false; 151 152 ExceptionCode ec = 0; 153 int length = list->numberOfItems(); 154 for (int i = 0; i < length; ++i) { 155 SVGLength length(list->getItem(i, ec)); 156 ASSERT(!ec); 157 155 static inline bool listContainsRelativeValue(const SVGLengthList& list) 156 { 157 unsigned size = list.size(); 158 for (unsigned i = 0; i < size; ++i) { 159 const SVGLength& length = list.at(i); 158 160 if (length.isRelative()) 159 161 return true; … … 201 203 } 202 204 203 204 205 } 205 206 -
trunk/WebCore/svg/SVGTextPositioningElement.h
r69186 r70223 43 43 virtual bool selfHasRelativeLengths() const; 44 44 45 DECLARE_ANIMATED_ PROPERTY(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList*, X, x)46 DECLARE_ANIMATED_ PROPERTY(SVGTextPositioningElement, SVGNames::yAttr, SVGLengthList*, Y, y)47 DECLARE_ANIMATED_ PROPERTY(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList*, Dx, dx)48 DECLARE_ANIMATED_ PROPERTY(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList*, Dy, dy)45 DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList, X, x) 46 DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::yAttr, SVGLengthList, Y, y) 47 DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList, Dx, dx) 48 DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList, Dy, dy) 49 49 DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::rotateAttr, SVGNumberList*, Rotate, rotate) 50 50 }; -
trunk/WebCore/svg/SVGUseElement.h
r69517 r70223 23 23 24 24 #if ENABLE(SVG) 25 #include "SVGAnimatedLength.h" 26 #include "SVGAnimatedPropertyMacros.h" 25 27 #include "SVGExternalResourcesRequired.h" 26 28 #include "SVGLangSpace.h" … … 80 82 virtual bool selfHasRelativeLengths() const; 81 83 82 DECLARE_ANIMATED_PROPERTY (SVGUseElement, SVGNames::xAttr, SVGLength, X, x)83 DECLARE_ANIMATED_PROPERTY (SVGUseElement, SVGNames::yAttr, SVGLength, Y, y)84 DECLARE_ANIMATED_PROPERTY (SVGUseElement, SVGNames::widthAttr, SVGLength, Width, width)85 DECLARE_ANIMATED_PROPERTY (SVGUseElement, SVGNames::heightAttr, SVGLength, Height, height)84 DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::xAttr, SVGLength, X, x) 85 DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::yAttr, SVGLength, Y, y) 86 DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::widthAttr, SVGLength, Width, width) 87 DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::heightAttr, SVGLength, Height, height) 86 88 87 89 // SVGURIReference
Note: See TracChangeset
for help on using the changeset viewer.