Changeset 89833 in webkit
- Timestamp:
- Jun 27, 2011 10:33:59 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89831 r89833 1 2011-06-27 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVGAnimatedType should support SVGPreserveAspectRatio animation 6 https://bugs.webkit.org/show_bug.cgi?id=63456 7 8 Test for animation of SVGPreserveAspectRatio. 9 10 * svg/animations/script-tests/svgPreserveAspectRatio-animation-1.js: Added. 11 (sample1): 12 (sample2): 13 (sample3): 14 (executeTest): 15 * svg/animations/svgPreserveAspectRatio-animation-1-expected.txt: Added. 16 * svg/animations/svgPreserveAspectRatio-animation-1.html: Added. 17 1 18 2011-06-27 Ryosuke Niwa <rniwa@webkit.org> 2 19 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r89829 r89833 486 486 svg/animations/svgpointlist-animation-1.html 487 487 svg/animations/svgpointlist-animation-2.html 488 svg/animations/svgPreserveAspectRatio-animation-1.html 488 489 svg/animations/svgrect-animation-1.html 489 490 svg/animations/svgrect-animation-2.html -
trunk/Source/WebCore/CMakeLists.txt
r89783 r89833 1666 1666 svg/SVGAnimatedPath.cpp 1667 1667 svg/SVGAnimatedPointList.cpp 1668 svg/SVGAnimatedPreserveAspectRatio.cpp 1668 1669 svg/SVGAnimatedRect.cpp 1669 1670 svg/SVGAnimatedString.cpp -
trunk/Source/WebCore/ChangeLog
r89832 r89833 1 2011-06-27 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 SVGAnimatedType should support SVGPreserveAspectRatio animation 6 https://bugs.webkit.org/show_bug.cgi?id=63456 7 8 Follow up of "SVGAnimation should use direct unit animation for SVGLength": https://bugs.webkit.org/show_bug.cgi?id=61368 9 This patch continues the conversion to the new concept of SVGAnimatorFactory with SVGAnimatedPreserveAspectRatio. 10 11 The new animator does not affect any behavior, since it was animated with SVGAnimatedString before. The new animator is still needed 12 to support animVal and baseVal later. 13 14 Test: svg/animations/svgPreserveAspectRatio-animation-1.html 15 16 * CMakeLists.txt: Added new file. 17 * GNUmakefile.list.am: Ditto. 18 * WebCore.gypi: Ditto. 19 * WebCore.pro: Ditto. 20 * WebCore.xcodeproj/project.pbxproj: Ditto. 21 * svg/SVGAllInOne.cpp: Ditto. 22 * svg/SVGAnimateElement.cpp: Handle AnimatedPreserveAspectRatio. 23 (WebCore::SVGAnimateElement::determineAnimatedAttributeType): 24 (WebCore::SVGAnimateElement::calculateAnimatedValue): 25 (WebCore::SVGAnimateElement::calculateFromAndToValues): 26 (WebCore::SVGAnimateElement::calculateFromAndByValues): 27 (WebCore::SVGAnimateElement::resetToBaseValue): 28 (WebCore::SVGAnimateElement::applyResultsToTarget): 29 (WebCore::SVGAnimateElement::calculateDistance): 30 * svg/SVGAnimatedPreserveAspectRatio.cpp: Added. New animator for SVGAnimatedPreserveAspectRatio. 31 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::SVGAnimatedPreserveAspectRatioAnimator): 32 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::constructFromString): 33 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateFromAndToValues): 34 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateFromAndByValues): 35 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue): 36 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateDistance): 37 * svg/SVGAnimatedPreserveAspectRatio.h: 38 (WebCore::SVGAnimatedPreserveAspectRatioAnimator::~SVGAnimatedPreserveAspectRatioAnimator): 39 * svg/SVGAnimatedType.cpp: Support for SVGPreserveAspectRatio. 40 (WebCore::SVGAnimatedType::~SVGAnimatedType): 41 (WebCore::SVGAnimatedType::createPreserveAspectRatio): 42 (WebCore::SVGAnimatedType::preserveAspectRatio): 43 (WebCore::SVGAnimatedType::valueAsString): 44 (WebCore::SVGAnimatedType::setValueAsString): 45 (WebCore::SVGAnimatedType::setPreserveAspectRatioBaseValue): 46 * svg/SVGAnimatedType.h: 47 * svg/SVGAnimatorFactory.h: 48 (WebCore::SVGAnimatorFactory::create): 49 1 50 2011-06-27 Alexis Menard <alexis.menard@openbossa.org> 2 51 -
trunk/Source/WebCore/GNUmakefile.list.am
r89828 r89833 3443 3443 Source/WebCore/svg/SVGAnimatedPointList.cpp \ 3444 3444 Source/WebCore/svg/SVGAnimatedPointList.h \ 3445 Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp \ 3445 3446 Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h \ 3446 3447 Source/WebCore/svg/SVGAnimatedRect.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r89832 r89833 5717 5717 'svg/SVGAnimatedPath.cpp', 5718 5718 'svg/SVGAnimatedPointList.cpp', 5719 'svg/SVGAnimatedPreserveAspectRatio.cpp', 5719 5720 'svg/SVGAnimatedRect.cpp', 5720 5721 'svg/SVGAnimatedString.cpp', -
trunk/Source/WebCore/WebCore.pro
r89832 r89833 3340 3340 svg/SVGAnimatedPath.cpp \ 3341 3341 svg/SVGAnimatedPointList.cpp \ 3342 svg/SVGAnimatedPreserveAspectRatio.cpp \ 3342 3343 svg/SVGAnimatedRect.cpp \ 3343 3344 svg/SVGAnimatedString.cpp \ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r89783 r89833 935 935 431A2F9D13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */; }; 936 936 431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */; }; 937 431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */; }; 937 938 4331AC7813B6870000A9E5AE /* SVGAnimatedNumberList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */; }; 938 939 4358E86A1360A21600E4748C /* DOMSVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E8671360A21600E4748C /* DOMSVGFEDropShadowElement.h */; }; … … 7398 7399 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; }; 7399 7400 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; }; 7401 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPreserveAspectRatio.cpp; sourceTree = "<group>"; }; 7400 7402 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; }; 7401 7403 4358E8671360A21600E4748C /* DOMSVGFEDropShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGFEDropShadowElement.h; sourceTree = "<group>"; }; … … 17424 17426 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */, 17425 17427 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */, 17428 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */, 17426 17429 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */, 17427 17430 B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */, … … 25844 25847 431A2F9D13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp in Sources */, 25845 25848 431A2FD713B7707A007791E4 /* SVGAnimatedLengthList.cpp in Sources */, 25849 431A302113B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp in Sources */, 25846 25850 ); 25847 25851 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/svg/SVGAllInOne.cpp
r89783 r89833 40 40 #include "SVGAnimatedPath.cpp" 41 41 #include "SVGAnimatedPointList.cpp" 42 #include "SVGAnimatedPreserveAspectRatio.cpp" 42 43 #include "SVGAnimatedRect.cpp" 43 44 #include "SVGAnimatedString.cpp" -
trunk/Source/WebCore/svg/SVGAnimateElement.cpp
r89783 r89833 105 105 return AnimatedUnknown; 106 106 107 // FIXME: We need type specific animations in the future. Many animations marked as AnimatedString today will 108 // support continuous animations. 107 // FIXME: Animator for AnimatedBoolean and AnimatedEnumeration missing. 109 108 switch (type) { 110 109 case AnimatedAngle: … … 112 111 case AnimatedBoolean: 113 112 case AnimatedEnumeration: 114 case AnimatedPreserveAspectRatio:115 113 case AnimatedString: 116 114 return AnimatedString; … … 132 130 case AnimatedPoints: 133 131 return AnimatedPoints; 132 case AnimatedPreserveAspectRatio: 133 return AnimatedPreserveAspectRatio; 134 134 case AnimatedRect: 135 135 return AnimatedRect; … … 172 172 case AnimatedPath: 173 173 case AnimatedPoints: 174 case AnimatedPreserveAspectRatio: 174 175 case AnimatedRect: 175 176 case AnimatedString: { … … 240 241 case AnimatedPath: 241 242 case AnimatedPoints: 243 case AnimatedPreserveAspectRatio: 242 244 case AnimatedRect: 243 245 case AnimatedString: … … 268 270 case AnimatedNumberOptionalNumber: 269 271 case AnimatedPoints: 272 case AnimatedPreserveAspectRatio: 270 273 case AnimatedRect: 271 274 case AnimatedString: … … 297 300 case AnimatedPath: 298 301 case AnimatedPoints: 302 case AnimatedPreserveAspectRatio: 299 303 case AnimatedRect: 300 304 case AnimatedString: { … … 324 328 case AnimatedPath: 325 329 case AnimatedPoints: 330 case AnimatedPreserveAspectRatio: 326 331 case AnimatedRect: 327 332 case AnimatedString: … … 351 356 case AnimatedPath: 352 357 case AnimatedPoints: 358 case AnimatedPreserveAspectRatio: 353 359 case AnimatedRect: 354 360 case AnimatedString: -
trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h
r73254 r89833 23 23 #if ENABLE(SVG) 24 24 #include "SVGAnimatedPropertyTearOff.h" 25 #include "SVGAnimatedTypeAnimator.h" 25 26 #include "SVGPreserveAspectRatio.h" 26 27 … … 36 37 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedPreserveAspectRatio, SVGPreserveAspectRatio, UpperProperty, LowerProperty) 37 38 39 40 #if ENABLE(SVG_ANIMATION) 41 class SVGAnimationElement; 42 43 class SVGAnimatedPreserveAspectRatioAnimator : public SVGAnimatedTypeAnimator { 44 45 public: 46 SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement*, SVGElement*); 47 virtual ~SVGAnimatedPreserveAspectRatioAnimator() { } 48 49 virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&); 50 51 virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString); 52 virtual void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& byString); 53 virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, 54 OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, OwnPtr<SVGAnimatedType>& animatedValue); 55 virtual float calculateDistance(const String& fromString, const String& toString); 56 }; 57 #endif // ENABLE(SVG_ANIMATION) 58 38 59 } // namespace WebCore 39 60 -
trunk/Source/WebCore/svg/SVGAnimatedType.cpp
r89783 r89833 32 32 #include "SVGPathParserFactory.h" 33 33 #include "SVGPointList.h" 34 #include "SVGPreserveAspectRatio.h" 34 35 35 36 using namespace std; … … 72 73 delete m_data.pointList; 73 74 break; 75 case AnimatedPreserveAspectRatio: 76 delete m_data.preserveAspectRatio; 77 break; 74 78 case AnimatedRect: 75 79 delete m_data.rect; … … 156 160 } 157 161 162 PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createPreserveAspectRatio(SVGPreserveAspectRatio* preserveAspectRatio) 163 { 164 ASSERT(preserveAspectRatio); 165 OwnPtr<SVGAnimatedType> animatedType = adoptPtr(new SVGAnimatedType(AnimatedPreserveAspectRatio)); 166 animatedType->m_data.preserveAspectRatio = preserveAspectRatio; 167 return animatedType.release(); 168 } 169 158 170 PassOwnPtr<SVGAnimatedType> SVGAnimatedType::createRect(FloatRect* rect) 159 171 { … … 224 236 ASSERT(m_type == AnimatedPoints); 225 237 return *m_data.pointList; 238 } 239 240 SVGPreserveAspectRatio& SVGAnimatedType::preserveAspectRatio() 241 { 242 ASSERT(m_type == AnimatedPreserveAspectRatio); 243 return *m_data.preserveAspectRatio; 226 244 } 227 245 … … 271 289 ASSERT(m_data.pointList); 272 290 return m_data.pointList->valueAsString(); 291 case AnimatedPreserveAspectRatio: 292 ASSERT(m_data.preserveAspectRatio); 293 return m_data.preserveAspectRatio->valueAsString(); 273 294 case AnimatedRect: 274 295 ASSERT(m_data.rect); … … 330 351 pointsListFromSVGData(*m_data.pointList, value); 331 352 break; 353 case AnimatedPreserveAspectRatio: 354 ASSERT(m_data.preserveAspectRatio); 355 SVGPreserveAspectRatio::parsePreserveAspectRatio(this, value); 356 break; 332 357 case AnimatedRect: 333 358 ASSERT(m_data.rect); … … 345 370 } 346 371 372 void SVGAnimatedType::setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio& preserveAspectRatio) 373 { 374 ASSERT(m_type == AnimatedPreserveAspectRatio); 375 *m_data.preserveAspectRatio = preserveAspectRatio; 376 } 377 378 347 379 } // namespace WebCore 348 380 -
trunk/Source/WebCore/svg/SVGAnimatedType.h
r89786 r89833 34 34 class SVGPathByteStream; 35 35 class SVGPointList; 36 class SVGPreserveAspectRatio; 36 37 37 38 class SVGAnimatedType { … … 49 50 static PassOwnPtr<SVGAnimatedType> createPath(PassOwnPtr<SVGPathByteStream>); 50 51 static PassOwnPtr<SVGAnimatedType> createPointList(SVGPointList*); 52 static PassOwnPtr<SVGAnimatedType> createPreserveAspectRatio(SVGPreserveAspectRatio*); 51 53 static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*); 52 54 static PassOwnPtr<SVGAnimatedType> createString(String*); … … 63 65 SVGPathByteStream* path(); 64 66 SVGPointList& pointList(); 67 SVGPreserveAspectRatio& preserveAspectRatio(); 65 68 FloatRect& rect(); 66 69 String& string(); … … 68 71 String valueAsString(); 69 72 bool setValueAsString(const QualifiedName&, const String&); 73 74 // Used for parsing a String to a SVGPreserveAspectRatio object. 75 void setPreserveAspectRatioBaseValue(const SVGPreserveAspectRatio&); 70 76 71 77 private: … … 80 86 } 81 87 82 // FIXME: More SVG primitive types need to be added step by step.83 88 SVGAngle* angle; 84 89 Color* color; … … 89 94 std::pair<float, float>* numberOptionalNumber; 90 95 SVGPathByteStream* path; 96 SVGPreserveAspectRatio* preserveAspectRatio; 91 97 SVGPointList* pointList; 92 98 FloatRect* rect; -
trunk/Source/WebCore/svg/SVGAnimatorFactory.h
r89783 r89833 31 31 #include "SVGAnimatedPath.h" 32 32 #include "SVGAnimatedPointList.h" 33 #include "SVGAnimatedPreserveAspectRatio.h" 33 34 #include "SVGAnimatedRect.h" 34 35 #include "SVGAnimatedString.h" … … 65 66 case AnimatedPoints: 66 67 return adoptPtr(new SVGAnimatedPointListAnimator(animationElement, contextElement)); 68 case AnimatedPreserveAspectRatio: 69 return adoptPtr(new SVGAnimatedPreserveAspectRatioAnimator(animationElement, contextElement)); 67 70 case AnimatedRect: 68 71 return adoptPtr(new SVGAnimatedRectAnimator(animationElement, contextElement));
Note: See TracChangeset
for help on using the changeset viewer.