Changeset 31801 in webkit
- Timestamp:
- Apr 10, 2008, 11:37:30 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 added
- 4 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31797 r31801 1 2008-04-10 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Eric. 4 5 Redo the SVG animation support. 6 7 It does 8 - Full SMIL interval timing model including syncbase and event base timing (the hard part). 9 - CSS and XML attribute animation. 10 - Linear, discrete and spline calcModes. 11 - Values animation with keyTimes and keySplines. 12 - Link activated animations. 13 - Pretty good support for <animate> and <set> animations 14 - Basic support for <animateColor>, <animateMotion> and <animateTransform>. 15 16 This passes some 35 of the 56 tests in W3C SVG animation test suite, a bunch more 17 with some subtest failures. 18 19 What is still missing 20 - Additive animation with multiple animations operating on the same property. This is a 21 major architectural feature in animation code. It shouldn't be too hard to add. 22 - Only <animate> implements accumulate. 23 - <animateMotion> does not do paths, keypoints, rotate. 24 - <animateTransform> does not work correctly in all cases 25 - calcMode paced is missing. 26 - repeat, beginEvent, endEvent are missing. 27 - accesskey() is missing. 28 - JS does not see correct values for baseVal/animVal, changing values that are being 29 animted for a script produces wrong results. This problem needs to be solved outside 30 the animation code. 31 - Some other stuff I forgot or do not know about. 32 33 * GNUmakefile.am: 34 * WebCore.pro: 35 * WebCore.vcproj/WebCore.vcproj: 36 * WebCore.xcodeproj/project.pbxproj: 37 * dom/Document.cpp: 38 * history/CachedPage.cpp: 39 (WebCore::CachedPage::CachedPage): 40 41 Use cache notification mechanism to start/stop animations. 42 43 * svg/SVGAElement.cpp: 44 (WebCore::SVGAElement::defaultEventHandler): 45 46 Start target animation on link activation. 47 48 * svg/SVGAnimateColorElement.cpp: 49 (WebCore::SVGAnimateColorElement::applyAnimatedValueToElement): 50 (WebCore::SVGAnimateColorElement::updateAnimatedValue): 51 (WebCore::SVGAnimateColorElement::calculateFromAndToValues): 52 (WebCore::SVGAnimateColorElement::calculateFromAndByValues): 53 * svg/SVGAnimateColorElement.h: 54 * svg/SVGAnimateElement.cpp: 55 (WebCore::SVGAnimateElement::SVGAnimateElement): 56 (WebCore::parseNumberValueAndUnit): 57 (WebCore::SVGAnimateElement::applyAnimatedValueToElement): 58 (WebCore::SVGAnimateElement::updateAnimatedValue): 59 (WebCore::isColorAttribute): 60 (WebCore::SVGAnimateElement::calculateFromAndToValues): 61 (WebCore::SVGAnimateElement::calculateFromAndByValues): 62 * svg/SVGAnimateElement.h: 63 (WebCore::SVGAnimateElement::): 64 * svg/SVGAnimateMotionElement.cpp: 65 (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): 66 (WebCore::SVGAnimateMotionElement::parseMappedAttribute): 67 (WebCore::SVGAnimateMotionElement::updateAnimatedValue): 68 (WebCore::parsePoint): 69 (WebCore::SVGAnimateMotionElement::calculateFromAndToValues): 70 (WebCore::SVGAnimateMotionElement::calculateFromAndByValues): 71 (WebCore::SVGAnimateMotionElement::applyAnimatedValueToElement): 72 (WebCore::SVGAnimateMotionElement::startedActiveInterval): 73 * svg/SVGAnimateMotionElement.h: 74 * svg/SVGAnimateTransformElement.cpp: 75 (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): 76 (WebCore::SVGAnimateTransformElement::hasValidTarget): 77 (WebCore::SVGAnimateTransformElement::updateAnimatedValue): 78 (WebCore::transformListFor): 79 (WebCore::SVGAnimateTransformElement::applyAnimatedValueToElement): 80 (WebCore::SVGAnimateTransformElement::calculateFromAndToValues): 81 (WebCore::SVGAnimateTransformElement::calculateFromAndByValues): 82 (WebCore::SVGAnimateTransformElement::startedActiveInterval): 83 (WebCore::SVGAnimateTransformElement::parseTransformValue): 84 * svg/SVGAnimateTransformElement.h: 85 86 Concrete anmation element classes. 87 88 * svg/SVGAnimationElement.cpp: 89 (WebCore::SVGAnimationElement::SVGAnimationElement): 90 (WebCore::SVGAnimationElement::~SVGAnimationElement): 91 (WebCore::parseKeyTimes): 92 (WebCore::parseKeySplines): 93 (WebCore::SVGAnimationElement::parseMappedAttribute): 94 (WebCore::SVGAnimationElement::attributeChanged): 95 (WebCore::SVGAnimationElement::getStartTime): 96 (WebCore::SVGAnimationElement::getCurrentTime): 97 (WebCore::SVGAnimationElement::getSimpleDuration): 98 (WebCore::SVGAnimationElement::beginElement): 99 (WebCore::SVGAnimationElement::beginElementAt): 100 (WebCore::SVGAnimationElement::endElement): 101 (WebCore::SVGAnimationElement::endElementAt): 102 (WebCore::SVGAnimationElement::animationMode): 103 (WebCore::SVGAnimationElement::calcMode): 104 (WebCore::SVGAnimationElement::attributeType): 105 (WebCore::SVGAnimationElement::toValue): 106 (WebCore::SVGAnimationElement::byValue): 107 (WebCore::SVGAnimationElement::fromValue): 108 (WebCore::SVGAnimationElement::attributeName): 109 (WebCore::SVGAnimationElement::isAdditive): 110 (WebCore::SVGAnimationElement::isAccumulated): 111 (WebCore::SVGAnimationElement::hasValidTarget): 112 (WebCore::SVGAnimationElement::targetAttributeIsCSS): 113 (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue): 114 (WebCore::SVGAnimationElement::targetAttributeBaseValue): 115 (WebCore::solveEpsilon): 116 (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): 117 (WebCore::SVGAnimationElement::startedActiveInterval): 118 (WebCore::SVGAnimationElement::applyAnimation): 119 (WebCore::SVGAnimationElement::unapplyAnimation): 120 (WebCore::SVGAnimationElement::endedActiveInterval): 121 * svg/SVGAnimationElement.h: 122 (WebCore::SVGAnimationElement::): 123 124 This is pretty much a complete rewrite of the SVGAnimationElement. Timing related functionality 125 was refactored to SMILTimingElement class that this class now inherits. 126 127 * svg/SVGDocumentExtensions.cpp: 128 (WebCore::SVGDocumentExtensions::startAnimations): 129 * svg/SVGElement.cpp: 130 (WebCore::SVGElement::ownerSVGElement): 131 * svg/SVGSVGElement.cpp: 132 133 We need to reach the <svg> element from <use> too so go out from the shadow tree. 134 135 (WebCore::SVGSVGElement::SVGSVGElement): 136 (WebCore::SVGSVGElement::~SVGSVGElement): 137 (WebCore::SVGSVGElement::pauseAnimations): 138 (WebCore::SVGSVGElement::unpauseAnimations): 139 (WebCore::SVGSVGElement::animationsPaused): 140 (WebCore::SVGSVGElement::getCurrentTime): 141 (WebCore::SVGSVGElement::willSaveToCache): 142 (WebCore::SVGSVGElement::willRestoreFromCache): 143 * svg/SVGSVGElement.h: 144 (WebCore::SVGSVGElement::timeContainer): 145 * svg/SVGSetElement.cpp: 146 (WebCore::SVGSetElement::applyAnimatedValueToElement): 147 (WebCore::SVGSetElement::calculateFromAndToValues): 148 (WebCore::SVGSetElement::calculateFromAndByValues): 149 (WebCore::SVGSetElement::updateAnimatedValue): 150 * svg/SVGSetElement.h: 151 152 Concrete anmation element classes. 153 154 * svg/SVGTimer.cpp: Removed. 155 * svg/SVGTimer.h: Removed. 156 * svg/SVGUseElement.cpp: 157 (WebCore::SVGUseElement::removedFromDocument): 158 * svg/TimeScheduler.cpp: Removed. 159 * svg/TimeScheduler.h: Removed. 160 161 Replaced these with SMILTimeContainer class. 162 163 * svg/animation: Added. 164 * svg/animation/SMILTime.cpp: Added. 165 (WebCore::operator+): 166 (WebCore::operator-): 167 (WebCore::operator*): 168 * svg/animation/SMILTime.h: Added. 169 (WebCore::SMILTime::SMILTime): 170 (WebCore::SMILTime::unresolved): 171 (WebCore::SMILTime::indefinite): 172 (WebCore::SMILTime::operator=): 173 (WebCore::SMILTime::value): 174 (WebCore::SMILTime::isFinite): 175 (WebCore::SMILTime::isIndefinite): 176 (WebCore::SMILTime::isUnresolved): 177 (WebCore::operator==): 178 (WebCore::operator!=): 179 (WebCore::operator>): 180 (WebCore::operator<): 181 (WebCore::operator>=): 182 (WebCore::operator<=): 183 (WebCore::max): 184 (WebCore::min): 185 186 A floating point number with special values "indefinite" and "unresolved". Defines math for those. 187 188 * svg/animation/SMILTimeContainer.cpp: Added. 189 (WebCore::SMILTimeContainer::SMILTimeContainer): 190 (WebCore::SMILTimeContainer::schedule): 191 (WebCore::SMILTimeContainer::unschedule): 192 (WebCore::SMILTimeContainer::elapsed): 193 (WebCore::SMILTimeContainer::isActive): 194 (WebCore::SMILTimeContainer::isPaused): 195 (WebCore::SMILTimeContainer::begin): 196 (WebCore::SMILTimeContainer::pause): 197 (WebCore::SMILTimeContainer::resume): 198 (WebCore::SMILTimeContainer::startTimer): 199 (WebCore::SMILTimeContainer::timerFired): 200 (WebCore::SMILTimeContainer::updateAnimations): 201 * svg/animation/SMILTimeContainer.h: Added. 202 203 Manages the clock and time line for active animations in a document. 204 205 * svg/animation/SVGSMILElement.cpp: Added. 206 (WebCore::ConditionEventListener::ConditionEventListener): 207 (WebCore::ConditionEventListener::handleEvent): 208 (WebCore::SVGSMILElement::Condition::Condition): 209 (WebCore::SVGSMILElement::SVGSMILElement): 210 (WebCore::SVGSMILElement::~SVGSMILElement): 211 (WebCore::SVGSMILElement::insertedIntoDocument): 212 (WebCore::SVGSMILElement::removedFromDocument): 213 (WebCore::SVGSMILElement::finishParsingChildren): 214 (WebCore::SVGSMILElement::parseOffsetValue): 215 (WebCore::SVGSMILElement::parseClockValue): 216 (WebCore::smilTimeSortFunction): 217 (WebCore::sortTimeList): 218 (WebCore::SVGSMILElement::parseCondition): 219 (WebCore::SVGSMILElement::isTimingElement): 220 (WebCore::SVGSMILElement::parseBeginOrEnd): 221 (WebCore::SVGSMILElement::parseMappedAttribute): 222 (WebCore::SVGSMILElement::attributeChanged): 223 (WebCore::SVGSMILElement::connectConditions): 224 (WebCore::SVGSMILElement::disconnectConditions): 225 (WebCore::SVGSMILElement::reschedule): 226 (WebCore::SVGSMILElement::targetElement): 227 (WebCore::SVGSMILElement::elapsed): 228 (WebCore::SVGSMILElement::restart): 229 (WebCore::SVGSMILElement::fill): 230 (WebCore::SVGSMILElement::xlinkHref): 231 (WebCore::SVGSMILElement::dur): 232 (WebCore::SVGSMILElement::repeatDur): 233 (WebCore::SVGSMILElement::repeatCount): 234 (WebCore::SVGSMILElement::maxValue): 235 (WebCore::SVGSMILElement::minValue): 236 (WebCore::SVGSMILElement::simpleDuration): 237 (WebCore::SVGSMILElement::addBeginTime): 238 (WebCore::SVGSMILElement::addEndTime): 239 (WebCore::SVGSMILElement::findInstanceTime): 240 (WebCore::SVGSMILElement::repeatingDuration): 241 (WebCore::SVGSMILElement::resolveActiveEnd): 242 (WebCore::SVGSMILElement::resolveInterval): 243 (WebCore::SVGSMILElement::resolveFirstInterval): 244 (WebCore::SVGSMILElement::resolveNextInterval): 245 (WebCore::SVGSMILElement::nextProgressTime): 246 (WebCore::SVGSMILElement::beginListChanged): 247 (WebCore::SVGSMILElement::endListChanged): 248 (WebCore::SVGSMILElement::checkRestart): 249 (WebCore::SVGSMILElement::calculateAnimationPercentAndRepeat): 250 (WebCore::SVGSMILElement::calculateNextProgressTime): 251 (WebCore::SVGSMILElement::determineActiveState): 252 (WebCore::SVGSMILElement::progress): 253 (WebCore::SVGSMILElement::notifyDependentsIntervalChanged): 254 (WebCore::SVGSMILElement::createInstanceTimesFromSyncbase): 255 (WebCore::SVGSMILElement::addTimeDependent): 256 (WebCore::SVGSMILElement::removeTimeDependent): 257 (WebCore::SVGSMILElement::handleConditionEvent): 258 (WebCore::SVGSMILElement::beginByLinkActivation): 259 * svg/animation/SVGSMILElement.h: Added. 260 (WebCore::SVGSMILElement::timeContainer): 261 (WebCore::SVGSMILElement::): 262 (WebCore::SVGSMILElement::intervalBegin): 263 (WebCore::SVGSMILElement::intervalEnd): 264 (WebCore::SVGSMILElement::Condition::): 265 266 This abstract class implements the SMIL timing model. As an output it produces calls 267 to these virtual functions: 268 269 virtual void startedActiveInterval() = 0; 270 virtual void applyAnimation(float percent, unsigned repeat) = 0; 271 virtual void unapplyAnimation() = 0; 272 virtual void endedActiveInterval() = 0; 273 1 274 2008-04-10 Antti Koivisto <antti@apple.com> 2 275 -
trunk/WebCore/GNUmakefile.am
r31793 r31801 1769 1769 -DENABLE_SVG=1 \ 1770 1770 -I\$(top_srcdir)/WebCore/svg \ 1771 -I\$(top_srcdir)/WebCore/svg/animation 1771 1772 -I\$(top_srcdir)/WebCore/svg/graphics \ 1772 1773 -I\$(top_srcdir)/WebCore/svg/graphics/filters … … 1790 1791 WebCore/svg/SVGDocumentExtensions.cpp \ 1791 1792 WebCore/svg/SVGImageLoader.cpp \ 1792 WebCore/svg/SVGTimer.cpp \1793 WebCore/svg/TimeScheduler.cpp \1794 1793 WebCore/svg/ColorDistance.cpp \ 1795 1794 WebCore/svg/SVGAElement.cpp \ … … 1920 1919 WebCore/svg/SVGViewSpec.cpp \ 1921 1920 WebCore/svg/SVGZoomAndPan.cpp \ 1921 WebCore/svg/animation/SMILTime.cpp \ 1922 WebCore/svg/animation/SMILTimeContainer.cpp \ 1923 WebCore/svg/animation/SVGSMILElement.cpp \ 1922 1924 WebCore/svg/graphics/filters/SVGFEBlend.cpp \ 1923 1925 WebCore/svg/graphics/filters/SVGFEColorMatrix.cpp \ -
trunk/WebCore/WebCore.pro
r31793 r31801 196 196 $$PWD/platform/network \ 197 197 $$PWD/platform/graphics \ 198 $$PWD/svg/animation \ 198 199 $$PWD/svg/graphics \ 199 200 $$PWD/svg/graphics/filters \ … … 1481 1482 svg/SVGDocumentExtensions.cpp \ 1482 1483 svg/SVGImageLoader.cpp \ 1483 svg/SVGTimer.cpp \1484 svg/TimeScheduler.cpp \1485 1484 svg/ColorDistance.cpp \ 1486 1485 svg/SVGAElement.cpp \ … … 1610 1609 svg/SVGViewSpec.cpp \ 1611 1610 svg/SVGZoomAndPan.cpp \ 1611 WebCore/svg/animation/SMILTime.cpp \ 1612 WebCore/svg/animation/SMILTimeContainer.cpp \ 1613 WebCore/svg/animation/SVGSMILElement.cpp \ 1612 1614 svg/graphics/filters/SVGFEBlend.cpp \ 1613 1615 svg/graphics/filters/SVGFEColorMatrix.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r31797 r31801 41 41 <Tool 42 42 Name="VCCLCompilerTool" 43 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin" "43 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin";"$(ProjectDir)..\svg\animation"" 44 44 PreprocessorDefinitions="__WIN32__;ENABLE_CROSS_DOCUMENT_MESSAGING;ENABLE_DOM_STORAGE;ENABLE_XSLT;ENABLE_XPATH;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_USE;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_FONTS;WEBCORE_CONTEXT_MENUS;ENABLE_VIDEO" 45 45 UsePrecompiledHeader="2" … … 103 103 <Tool 104 104 Name="VCCLCompilerTool" 105 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin" "105 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin";"$(ProjectDir)..\svg\animation"" 106 106 PreprocessorDefinitions="__WIN32__;ENABLE_CROSS_DOCUMENT_MESSAGING;ENABLE_DOM_STORAGE;ENABLE_XSLT;ENABLE_XPATH;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_USE;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_FONTS;WEBCORE_CONTEXT_MENUS;ENABLE_VIDEO" 107 107 UsePrecompiledHeader="2" … … 164 164 <Tool 165 165 Name="VCCLCompilerTool" 166 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin" "166 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin";"$(ProjectDir)..\svg\animation"" 167 167 PreprocessorDefinitions="__WIN32__;ENABLE_CROSS_DOCUMENT_MESSAGING;ENABLE_DOM_STORAGE;ENABLE_XSLT;ENABLE_XPATH;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_USE;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_FONTS;WEBCORE_CONTEXT_MENUS;ENABLE_VIDEO" 168 168 UsePrecompiledHeader="2" … … 226 226 <Tool 227 227 Name="VCCLCompilerTool" 228 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\curl";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cairo";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin" "228 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\curl";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cairo";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin";"$(ProjectDir)..\svg\animation"" 229 229 PreprocessorDefinitions="__WIN32__;ENABLE_CROSS_DOCUMENT_MESSAGING;ENABLE_DOM_STORAGE;ENABLE_XSLT;ENABLE_XPATH;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_USE;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_FONTS;WEBCORE_CONTEXT_MENUS;ENABLE_VIDEO" 230 230 UsePrecompiledHeader="2" … … 289 289 <Tool 290 290 Name="VCCLCompilerTool" 291 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\curl";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\caro";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin" "291 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\curl";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\caro";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin";"$(ProjectDir)..\svg\animation"" 292 292 PreprocessorDefinitions="__WIN32__;ENABLE_CROSS_DOCUMENT_MESSAGING;ENABLE_DOM_STORAGE;ENABLE_XSLT;ENABLE_XPATH;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_USE;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_FONTS;WEBCORE_CONTEXT_MENUS;ENABLE_VIDEO" 293 293 UsePrecompiledHeader="2" … … 352 352 Name="VCCLCompilerTool" 353 353 WholeProgramOptimization="false" 354 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin" "354 AdditionalIncludeDirectories=""$(ProjectDir)..\";"$(ProjectDir)..";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\page";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\network\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\graphics\cairo";"$(ProjectDir)..\platform\graphics\cg";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\platform\image-decoders";"$(ProjectDir)..\platform\image-decoders\bmp";"$(ProjectDir)..\platform\image-decoders\gif";"$(ProjectDir)..\platform\image-decoders\ico";"$(ProjectDir)..\platform\image-decoders\jpeg";"$(ProjectDir)..\platform\image-decoders\png";"$(ProjectDir)..\platform\image-decoders\xbm";"$(ProjectDir)..\platform\image-decoders\zlib";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\platform\cairo\pixman\src";"$(ProjectDir)..\platform\cairo\cairo\src";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\cg";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\kcanvas";"$(ProjectDir)..\kcanvas\device";"$(ProjectDir)..\kcanvas\device\quartz";"$(ProjectDir)..\svg";"$(ProjectDir)..\storage";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\icu";"$(WebKitLibrariesDir)\include\iconv";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitOutputDir)\include\QtMovieWin";"$(ProjectDir)..\svg\animation"" 355 355 PreprocessorDefinitions="__WIN32__;ENABLE_CROSS_DOCUMENT_MESSAGING;ENABLE_DOM_STORAGE;ENABLE_XSLT;ENABLE_XPATH;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_USE;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_FONTS;WEBCORE_CONTEXT_MENUS;ENABLE_VIDEO" 356 356 PrecompiledHeaderThrough="WebCorePrefix.h" … … 14575 14575 </File> 14576 14576 <File 14577 RelativePath="..\svg\SVGTimer.cpp"14578 >14579 </File>14580 <File14581 RelativePath="..\svg\SVGTimer.h"14582 >14583 </File>14584 <File14585 14577 RelativePath="..\svg\SVGTitleElement.cpp" 14586 14578 > … … 14690 14682 > 14691 14683 </File> 14692 <File 14693 RelativePath="..\svg\TimeScheduler.cpp" 14694 > 14695 </File> 14696 <File 14697 RelativePath="..\svg\TimeScheduler.h" 14698 > 14699 </File> 14684 <Filter 14685 Name="animation" 14686 > 14687 <File 14688 RelativePath="..\svg\animation\SMILTime.cpp" 14689 > 14690 </File> 14691 <File 14692 RelativePath="..\svg\animation\SMILTime.h" 14693 > 14694 </File> 14695 <File 14696 RelativePath="..\svg\animation\SMILTimeContainer.cpp" 14697 > 14698 </File> 14699 <File 14700 RelativePath="..\svg\animation\SMILTimeContainer.h" 14701 > 14702 </File> 14703 <File 14704 RelativePath="..\svg\animation\SVGSMILElement.cpp" 14705 > 14706 </File> 14707 <File 14708 RelativePath="..\svg\animation\SVGSMILElement.h" 14709 > 14710 </File> 14711 </Filter> 14700 14712 <Filter 14701 14713 Name="graphics" -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r31797 r31801 3159 3159 B28C6A290D00C44800334AA4 /* SVGImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28C6A200D00C44800334AA4 /* SVGImageLoader.cpp */; }; 3160 3160 B28C6A2A0D00C44800334AA4 /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = B28C6A210D00C44800334AA4 /* SVGImageLoader.h */; }; 3161 B28C6A2B0D00C44800334AA4 /* SVGTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28C6A220D00C44800334AA4 /* SVGTimer.cpp */; };3162 B28C6A2C0D00C44800334AA4 /* SVGTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = B28C6A230D00C44800334AA4 /* SVGTimer.h */; };3163 B28C6A2D0D00C44800334AA4 /* TimeScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28C6A240D00C44800334AA4 /* TimeScheduler.cpp */; };3164 B28C6A2E0D00C44800334AA4 /* TimeScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = B28C6A250D00C44800334AA4 /* TimeScheduler.h */; };3165 3161 B297BC700B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */; }; 3166 3162 B2A015A80AF6CD53006BCE0E /* GraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */; }; … … 3902 3898 E49626C30D80D94900E3405C /* PreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D4ABE10D7542F100F96869 /* PreloadScanner.h */; }; 3903 3899 E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */; }; 3900 E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0050DAF335400F5F55C /* SMILTime.cpp */; }; 3901 E4AFD00C0DAF335400F5F55C /* SMILTime.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD0060DAF335400F5F55C /* SMILTime.h */; }; 3902 E4AFD00D0DAF335500F5F55C /* SMILTimeContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0070DAF335400F5F55C /* SMILTimeContainer.cpp */; }; 3903 E4AFD00E0DAF335500F5F55C /* SMILTimeContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD0080DAF335400F5F55C /* SMILTimeContainer.h */; }; 3904 E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0090DAF335400F5F55C /* SVGSMILElement.cpp */; }; 3905 E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD00A0DAF335400F5F55C /* SVGSMILElement.h */; }; 3904 3906 E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C279560CF9741900E97B98 /* RenderMedia.cpp */; }; 3905 3907 E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C279570CF9741900E97B98 /* RenderMedia.h */; }; … … 7385 7387 B28C6A200D00C44800334AA4 /* SVGImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImageLoader.cpp; sourceTree = "<group>"; }; 7386 7388 B28C6A210D00C44800334AA4 /* SVGImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImageLoader.h; sourceTree = "<group>"; }; 7387 B28C6A220D00C44800334AA4 /* SVGTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTimer.cpp; sourceTree = "<group>"; };7388 B28C6A230D00C44800334AA4 /* SVGTimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGTimer.h; sourceTree = "<group>"; };7389 B28C6A240D00C44800334AA4 /* TimeScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TimeScheduler.cpp; sourceTree = "<group>"; };7390 B28C6A250D00C44800334AA4 /* TimeScheduler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TimeScheduler.h; sourceTree = "<group>"; };7391 7389 B28C6A260D00C44800334AA4 /* xlinkattrs.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = xlinkattrs.in; sourceTree = "<group>"; }; 7392 7390 B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPathSegListCustom.cpp; sourceTree = "<group>"; }; … … 8145 8143 E44614130CD6826900FADA75 /* JSTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTimeRanges.h; sourceTree = "<group>"; }; 8146 8144 E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnitBezier.h; sourceTree = "<group>"; }; 8145 E4AFD0050DAF335400F5F55C /* SMILTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SMILTime.cpp; sourceTree = "<group>"; }; 8146 E4AFD0060DAF335400F5F55C /* SMILTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMILTime.h; sourceTree = "<group>"; }; 8147 E4AFD0070DAF335400F5F55C /* SMILTimeContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SMILTimeContainer.cpp; sourceTree = "<group>"; }; 8148 E4AFD0080DAF335400F5F55C /* SMILTimeContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMILTimeContainer.h; sourceTree = "<group>"; }; 8149 E4AFD0090DAF335400F5F55C /* SVGSMILElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGSMILElement.cpp; sourceTree = "<group>"; }; 8150 E4AFD00A0DAF335400F5F55C /* SVGSMILElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGSMILElement.h; sourceTree = "<group>"; }; 8147 8151 E4B41E010CBF8EAA00AF2ECE /* ProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressEvent.cpp; sourceTree = "<group>"; }; 8148 8152 E4B41E020CBF8EAA00AF2ECE /* ProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressEvent.h; sourceTree = "<group>"; }; … … 11048 11052 isa = PBXGroup; 11049 11053 children = ( 11054 E46E97860DAAD61B0071E894 /* animation */, 11050 11055 B25598860D00D8B800BB825C /* graphics */, 11051 11056 B22277CB0D00BF1F0071B782 /* ColorDistance.cpp */, … … 11431 11436 B222793B0D00BF210071B782 /* SVGTextPositioningElement.h */, 11432 11437 B222793C0D00BF210071B782 /* SVGTextPositioningElement.idl */, 11433 B28C6A220D00C44800334AA4 /* SVGTimer.cpp */,11434 B28C6A230D00C44800334AA4 /* SVGTimer.h */,11435 11438 B222793D0D00BF210071B782 /* SVGTitleElement.cpp */, 11436 11439 B222793E0D00BF210071B782 /* SVGTitleElement.h */, … … 11473 11476 B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */, 11474 11477 B2E4EC960D00C22B00432643 /* SVGZoomEvent.idl */, 11475 B28C6A240D00C44800334AA4 /* TimeScheduler.cpp */,11476 B28C6A250D00C44800334AA4 /* TimeScheduler.h */,11477 11478 B28C6A260D00C44800334AA4 /* xlinkattrs.in */, 11478 11479 ); … … 12306 12307 tabWidth = 4; 12307 12308 usesTabs = 0; 12309 }; 12310 E46E97860DAAD61B0071E894 /* animation */ = { 12311 isa = PBXGroup; 12312 children = ( 12313 E4AFD0050DAF335400F5F55C /* SMILTime.cpp */, 12314 E4AFD0060DAF335400F5F55C /* SMILTime.h */, 12315 E4AFD0070DAF335400F5F55C /* SMILTimeContainer.cpp */, 12316 E4AFD0080DAF335400F5F55C /* SMILTimeContainer.h */, 12317 E4AFD0090DAF335400F5F55C /* SVGSMILElement.cpp */, 12318 E4AFD00A0DAF335400F5F55C /* SVGSMILElement.h */, 12319 ); 12320 path = animation; 12321 sourceTree = "<group>"; 12308 12322 }; 12309 12323 ED501DC90B249F3900AE18D9 /* mac */ = { … … 14473 14487 B2227ACE0D00BF220071B782 /* SVGTextPathElement.h in Headers */, 14474 14488 B2227AD10D00BF220071B782 /* SVGTextPositioningElement.h in Headers */, 14475 B28C6A2C0D00C44800334AA4 /* SVGTimer.h in Headers */,14476 14489 B2227AD40D00BF220071B782 /* SVGTitleElement.h in Headers */, 14477 14490 B2227AD70D00BF220071B782 /* SVGTransform.h in Headers */, … … 14546 14559 51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */, 14547 14560 E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */, 14548 B28C6A2E0D00C44800334AA4 /* TimeScheduler.h in Headers */,14549 14561 9305B24D098F1B6B00C28855 /* Timer.h in Headers */, 14550 14562 BCCFBAE80B5152ED0001F1D7 /* Tokenizer.h in Headers */, … … 14759 14771 51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */, 14760 14772 E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */, 14773 E4AFD00C0DAF335400F5F55C /* SMILTime.h in Headers */, 14774 E4AFD00E0DAF335500F5F55C /* SMILTimeContainer.h in Headers */, 14775 E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */, 14761 14776 ); 14762 14777 runOnlyForDeploymentPostprocessing = 0; … … 16174 16189 B2227ACD0D00BF220071B782 /* SVGTextPathElement.cpp in Sources */, 16175 16190 B2227AD00D00BF220071B782 /* SVGTextPositioningElement.cpp in Sources */, 16176 B28C6A2B0D00C44800334AA4 /* SVGTimer.cpp in Sources */,16177 16191 B2227AD30D00BF220071B782 /* SVGTitleElement.cpp in Sources */, 16178 16192 B2227AD60D00BF220071B782 /* SVGTransform.cpp in Sources */, … … 16244 16258 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, 16245 16259 E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */, 16246 B28C6A2D0D00C44800334AA4 /* TimeScheduler.cpp in Sources */,16247 16260 93309EA4099EB78C0056E581 /* Timer.cpp in Sources */, 16248 16261 854FE7360A2297BE0058D7AD /* Traversal.cpp in Sources */, … … 16442 16455 51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */, 16443 16456 51BE37DF0DAEE00E001085FC /* StorageArea.cpp in Sources */, 16457 E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */, 16458 E4AFD00D0DAF335500F5F55C /* SMILTimeContainer.cpp in Sources */, 16459 E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */, 16444 16460 ); 16445 16461 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/dom/Document.cpp
r31746 r31801 139 139 #include "SVGZoomEvent.h" 140 140 #include "SVGStyleElement.h" 141 #include "TimeScheduler.h"142 141 #endif 143 142 -
trunk/WebCore/history/CachedPage.cpp
r31341 r31801 108 108 109 109 m_document->setInPageCache(true); 110 111 #if ENABLE(SVG)112 if (m_document && m_document->svgExtensions())113 m_document->accessSVGExtensions()->pauseAnimations();114 #endif115 110 } 116 111 -
trunk/WebCore/svg/SVGAElement.cpp
r30021 r31801 40 40 #include "RenderSVGInline.h" 41 41 #include "ResourceRequest.h" 42 #include "SVGSMILElement.h" 42 43 #include "SVGNames.h" 43 44 #include "XLinkNames.h" … … 139 140 target = (getAttribute(XLinkNames::showAttr) == "new") ? "_blank" : "_self"; 140 141 141 String url = parseURL(href()); 142 if (!evt->defaultPrevented()) 142 if (!evt->defaultPrevented()) { 143 String url = parseURL(href()); 144 if (url.startsWith("#")) { 145 Element* targetElement = document()->getElementById(url.substring(1)); 146 if (SVGSMILElement::isTimingElement(targetElement)) { 147 SVGSMILElement* timed = static_cast<SVGSMILElement*>(targetElement); 148 timed->beginByLinkActivation(); 149 evt->setDefaultHandled(); 150 SVGStyledTransformableElement::defaultEventHandler(evt); 151 return; 152 } 153 } 143 154 if (document()->frame()) 144 155 document()->frame()->loader()->urlSelected(document()->completeURL(url), target, evt, false, true); 156 } 145 157 146 158 evt->setDefaultHandled(); -
trunk/WebCore/svg/SVGAnimateColorElement.cpp
r25754 r31801 27 27 28 28 #include "Document.h" 29 #include "TimeScheduler.h"30 29 #include "PlatformString.h" 31 30 #include "SVGColor.h" … … 35 34 36 35 namespace WebCore { 36 37 // FIXME: This class needs to die. SVGAnimateElement (which has superset of the functionality) should be instantiated instead. 37 38 38 39 SVGAnimateColorElement::SVGAnimateColorElement(const QualifiedName& tagName, Document* doc) … … 45 46 } 46 47 47 bool SVGAnimateColorElement::updateAnimationBaseValueFromElement()48 void SVGAnimateColorElement::applyAnimatedValueToElement(unsigned repeat) 48 49 { 49 m_baseColor = SVGColor::colorFromRGBColorString(targetAttributeAnimatedValue()); 50 m_fromColor = Color(); 51 m_toColor = Color(); 50 if (isAdditive()) { 51 Color baseColor = SVGColor::colorFromRGBColorString(m_savedBaseValue); 52 setTargetAttributeAnimatedValue(ColorDistance::addColorsAndClamp(baseColor, m_animatedColor).name()); 53 } else 54 setTargetAttributeAnimatedValue(m_animatedColor.name()); 55 } 56 57 bool SVGAnimateColorElement::updateAnimatedValue(float percentage) 58 { 59 Color oldColor = m_animatedColor; 60 m_animatedColor = ColorDistance(m_fromColor, m_toColor).scaledDistance(percentage).addToColorAndClamp(m_fromColor); 61 return m_animatedColor != oldColor; 62 } 63 64 bool SVGAnimateColorElement::calculateFromAndToValues(const String& fromString, const String& toString) 65 { 66 m_fromColor = SVGColor::colorFromRGBColorString(fromString); 67 m_toColor = SVGColor::colorFromRGBColorString(toString); 52 68 return true; 53 69 } 54 70 55 void SVGAnimateColorElement::applyAnimatedValueToElement()71 bool SVGAnimateColorElement::calculateFromAndByValues(const String& fromString, const String& byString) 56 72 { 57 if (isAdditive()) 58 setTargetAttributeAnimatedValue(ColorDistance::addColorsAndClamp(m_baseColor, m_animatedColor).name()); 59 else 60 setTargetAttributeAnimatedValue(m_animatedColor.name()); 61 } 62 63 bool SVGAnimateColorElement::updateAnimatedValue(EAnimationMode animationMode, float timePercentage, unsigned valueIndex, float percentagePast) 64 { 65 if (animationMode == TO_ANIMATION) 66 // to-animations have a special equation: value = (to - base) * (time/duration) + base 67 m_animatedColor = ColorDistance(m_baseColor, m_toColor).scaledDistance(timePercentage).addToColorAndClamp(m_baseColor); 68 else 69 m_animatedColor = ColorDistance(m_fromColor, m_toColor).scaledDistance(percentagePast).addToColorAndClamp(m_fromColor); 70 return (m_animatedColor != m_baseColor); 71 } 72 73 bool SVGAnimateColorElement::calculateFromAndToValues(EAnimationMode animationMode, unsigned valueIndex) 74 { 75 switch (animationMode) { 76 case FROM_TO_ANIMATION: 77 m_fromColor = SVGColor::colorFromRGBColorString(m_from); 78 // fall through 79 case TO_ANIMATION: 80 m_toColor = SVGColor::colorFromRGBColorString(m_to); 81 break; 82 case FROM_BY_ANIMATION: 83 m_fromColor = SVGColor::colorFromRGBColorString(m_from); 84 m_toColor = SVGColor::colorFromRGBColorString(m_by); 85 break; 86 case BY_ANIMATION: 87 m_fromColor = SVGColor::colorFromRGBColorString(m_from); 88 m_toColor = ColorDistance::addColorsAndClamp(m_fromColor, SVGColor::colorFromRGBColorString(m_by)); 89 break; 90 case VALUES_ANIMATION: 91 m_fromColor = SVGColor::colorFromRGBColorString(m_values[valueIndex]); 92 m_toColor = ((valueIndex + 1) < m_values.size()) ? SVGColor::colorFromRGBColorString(m_values[valueIndex + 1]) : m_fromColor; 93 break; 94 case NO_ANIMATION: 95 ASSERT_NOT_REACHED(); 96 } 97 73 m_fromColor = SVGColor::colorFromRGBColorString(fromString); 74 m_toColor = ColorDistance::addColorsAndClamp(m_fromColor, SVGColor::colorFromRGBColorString(byString)); 98 75 return true; 99 76 } -
trunk/WebCore/svg/SVGAnimateColorElement.h
r31600 r31801 38 38 SVGAnimateColorElement(const QualifiedName&, Document*); 39 39 virtual ~SVGAnimateColorElement(); 40 41 virtual bool updateAnimationBaseValueFromElement();42 virtual void applyAnimatedValueToElement();43 40 44 41 protected: 45 42 virtual const SVGElement* contextElement() const { return this; } 46 43 47 virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast); 48 virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex); 44 virtual void applyAnimatedValueToElement(unsigned repeat); 45 virtual bool updateAnimatedValue(float percent); 46 virtual bool calculateFromAndToValues(const String& fromString, const String& toString); 47 virtual bool calculateFromAndByValues(const String& fromString, const String& byString); 49 48 50 49 private: 51 50 Color m_baseColor; 52 51 Color m_animatedColor; 53 54 52 Color m_toColor; 55 53 Color m_fromColor; -
trunk/WebCore/svg/SVGAnimateElement.cpp
r28568 r31801 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 3 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 Copyright (C) 2008 Apple Inc. All rights reserved. 4 5 5 6 This file is part of the KDE project … … 25 26 #include "SVGAnimateElement.h" 26 27 27 #include "TimeScheduler.h" 28 #include "SVGDocumentExtensions.h" 29 #include "SVGSVGElement.h" 28 #include "ColorDistance.h" 29 #include "SVGColor.h" 30 #include "SVGParserUtilities.h" 31 32 using namespace std; 30 33 31 34 namespace WebCore { … … 33 36 SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* doc) 34 37 : SVGAnimationElement(tagName, doc) 35 , m_currentItem(-1) 38 , m_propertyType(StringProperty) 39 , m_fromNumber(0) 40 , m_toNumber(0) 41 , m_animatedNumber(numeric_limits<double>::infinity()) 36 42 { 37 43 } … … 41 47 } 42 48 49 static bool parseNumberValueAndUnit(const String& in, double& value, String& unit) 50 { 51 // FIXME: These are from top of my head, figure out all property types that can be animated as numbers. 52 unsigned unitLength = 0; 53 String parse = in.stripWhiteSpace(); 54 if (parse.endsWith("%")) 55 unitLength = 1; 56 else if (parse.endsWith("px") || parse.endsWith("pt") || parse.endsWith("em")) 57 unitLength = 2; 58 else if (parse.endsWith("deg") || parse.endsWith("rad")) 59 unitLength = 3; 60 else if (parse.endsWith("grad")) 61 unitLength = 4; 62 String newUnit = parse.right(unitLength); 63 String number = parse.left(parse.length() - unitLength); 64 if (!unit.isEmpty() && newUnit != unit || number.isEmpty()) 65 return false; 66 UChar last = number[number.length() - 1]; 67 if (last < '0' || last > '9') 68 return false; 69 unit = newUnit; 70 bool ok; 71 value = number.toDouble(&ok); 72 return ok; 73 } 74 75 void SVGAnimateElement::applyAnimatedValueToElement(unsigned repeat) 76 { 77 // FIXME: This is entirely wrong way to do additive. It won't work with 78 // multiple animations on the same element. 79 // We need to add together all animation contributions per property and 80 // then apply in one go. 81 String valueToApply; 82 if (m_propertyType == NumberProperty) { 83 double number = m_animatedNumber; 84 // FIXME: This does not work for values animation. 85 if (isAccumulated() && repeat) 86 number += m_toNumber * repeat; 87 if (isAdditive()) { 88 double base; 89 if (!parseNumberValueAndUnit(m_savedBaseValue, base, m_numberUnit)) 90 return; 91 number += base; 92 } 93 valueToApply = String::number(number) + m_numberUnit; 94 } else if (m_propertyType == ColorProperty) { 95 Color base = SVGColor::colorFromRGBColorString(m_savedBaseValue); 96 if (isAdditive()) 97 valueToApply = ColorDistance::addColorsAndClamp(base, m_animatedColor).name(); 98 else 99 valueToApply = m_animatedColor.name(); 100 } else 101 valueToApply = m_animatedString; 102 setTargetAttributeAnimatedValue(valueToApply); 103 } 104 105 bool SVGAnimateElement::updateAnimatedValue(float percentage) 106 { 107 if (m_propertyType == NumberProperty) { 108 double oldValue = m_animatedNumber; 109 m_animatedNumber = (m_toNumber - m_fromNumber) * percentage + m_fromNumber; 110 return oldValue == m_animatedNumber; 111 } 112 if (m_propertyType == ColorProperty) { 113 m_animatedColor = ColorDistance(m_fromColor, m_toColor).scaledDistance(percentage).addToColorAndClamp(m_fromColor); 114 return true; 115 } 116 117 AnimationMode animationMode = this->animationMode(); 118 ASSERT(animationMode == FromToAnimation || animationMode == ToAnimation || animationMode == ValuesAnimation); 119 String oldValue = m_animatedString; 120 if ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f) 121 m_animatedString = m_toString; 122 else 123 m_animatedString = m_fromString; 124 return oldValue == m_animatedString; 125 } 126 127 static bool isColorAttribute(const String& attribute) 128 { 129 return attribute == "color" || attribute == "fill" || attribute == "stroke"; 130 } 131 132 bool SVGAnimateElement::calculateFromAndToValues(const String& fromString, const String& toString) 133 { 134 // FIXME: Needs more solid way determine target attribute type. 135 m_propertyType = isColorAttribute(attributeName()) ? ColorProperty : NumberProperty; 136 if (m_propertyType == ColorProperty) { 137 m_fromColor = SVGColor::colorFromRGBColorString(fromString); 138 m_toColor = SVGColor::colorFromRGBColorString(toString); 139 if (m_fromColor.isValid() && m_toColor.isValid()) 140 return true; 141 } else { 142 m_numberUnit = String(); 143 if (parseNumberValueAndUnit(fromString, m_fromNumber, m_numberUnit)) { 144 if (parseNumberValueAndUnit(toString, m_toNumber, m_numberUnit)) 145 return true; 146 } 147 } 148 m_fromString = fromString; 149 m_toString = toString; 150 m_propertyType = StringProperty; 151 return true; 152 } 153 154 bool SVGAnimateElement::calculateFromAndByValues(const String& fromString, const String& byString) 155 { 156 m_propertyType = isColorAttribute(attributeName()) ? ColorProperty : NumberProperty; 157 if (m_propertyType == ColorProperty) { 158 m_fromColor = fromString.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(fromString); 159 m_toColor = ColorDistance::addColorsAndClamp(m_fromColor, SVGColor::colorFromRGBColorString(byString)); 160 if (!m_fromColor.isValid() || !m_toColor.isValid()) 161 return false; 162 } else { 163 m_numberUnit = String(); 164 m_fromNumber = 0; 165 if (!fromString.isEmpty() && !parseNumberValueAndUnit(fromString, m_fromNumber, m_numberUnit)) 166 return false; 167 if (!parseNumberValueAndUnit(byString, m_toNumber, m_numberUnit)) 168 return false; 169 m_toNumber += m_fromNumber; 170 } 171 return true; 172 } 173 43 174 } 44 175 -
trunk/WebCore/svg/SVGAnimateElement.h
r31600 r31801 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 3 2004, 2005 Rob Buis <buis@kde.org> 4 Copyright (C) 2008 Apple Inc. All rights reserved. 4 5 5 6 This file is part of the KDE project … … 38 39 virtual const SVGElement* contextElement() const { return this; } 39 40 40 virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast) { return false; } 41 virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex) { return false; } 41 virtual bool calculateFromAndToValues(const String& fromString, const String& toString); 42 virtual bool calculateFromAndByValues(const String& fromString, const String& byString); 43 virtual bool updateAnimatedValue(float percentage); 44 virtual void applyAnimatedValueToElement(unsigned repeat); 42 45 43 46 private: 44 int m_currentItem; 45 46 String m_savedTo; 47 enum PropertyType { NumberProperty, ColorProperty, StringProperty }; 48 PropertyType m_propertyType; 49 50 double m_fromNumber; 51 double m_toNumber; 52 double m_animatedNumber; 53 String m_numberUnit; 54 Color m_fromColor; 55 Color m_toColor; 56 Color m_animatedColor; 57 String m_fromString; 58 String m_toString; 59 String m_animatedString; 47 60 }; 48 61 -
trunk/WebCore/svg/SVGAnimateMotionElement.cpp
r29663 r31801 37 37 SVGAnimateMotionElement::SVGAnimateMotionElement(const QualifiedName& tagName, Document* doc) 38 38 : SVGAnimationElement(tagName, doc) 39 , m_baseIndexInTransformList(0) 39 40 , m_rotateMode(AngleMode) 40 41 , m_angle(0) 41 42 { 42 m_calcMode = CALCMODE_PACED;43 43 } 44 44 … … 87 87 } 88 88 } else if (attr->name() == SVGNames::keyPointsAttr) { 89 m_keyPoints.clear(); 90 parseKeyNumbers(m_keyPoints, attr->value()); 89 // FIXME: Implement key points. 91 90 } else if (attr->name() == SVGNames::dAttr) { 92 91 m_path = Path(); … … 112 111 } 113 112 114 bool SVGAnimateMotionElement::updateAnimatedValue(EAnimationMode animationMode, float timePercentage, unsigned valueIndex, float percentagePast) 115 { 116 if (animationMode == TO_ANIMATION) { 117 // to-animations have a special equation: value = (to - base) * (time/duration) + base 118 m_animatedTranslation.setWidth((m_toPoint.x() - m_basePoint.x()) * timePercentage + m_basePoint.x()); 119 m_animatedTranslation.setHeight((m_toPoint.y() - m_basePoint.y()) * timePercentage + m_basePoint.y()); 120 m_animatedAngle = 0.0f; 121 } else { 122 m_animatedTranslation.setWidth(m_pointDiff.width() * percentagePast + m_fromPoint.x()); 123 m_animatedTranslation.setHeight(m_pointDiff.height() * percentagePast + m_fromPoint.y()); 124 m_animatedAngle = m_angleDiff * percentagePast + m_fromAngle; 125 } 113 bool SVGAnimateMotionElement::updateAnimatedValue(float percentage) 114 { 115 FloatSize diff = m_toPoint - m_fromPoint; 116 m_animatedTranslation.setWidth(diff.width() * percentage + m_fromPoint.x()); 117 m_animatedTranslation.setHeight(diff.height() * percentage + m_fromPoint.y()); 118 // FIXME: Animate angles 119 m_animatedAngle = 0; 126 120 return true; 127 121 } … … 147 141 point = FloatPoint(x, y); 148 142 149 // disallow any ing except spaces at the end143 // disallow anything except spaces at the end 150 144 return !skipOptionalSpaces(cur, end); 151 145 } 152 146 153 bool SVGAnimateMotionElement::calculateFromAndToValues(EAnimationMode animationMode, unsigned valueIndex) 154 { 155 m_fromAngle = 0.0f; 156 m_toAngle = 0.0f; 157 switch (animationMode) { 158 case FROM_TO_ANIMATION: 159 parsePoint(m_from, m_fromPoint); 160 // fall through 161 case TO_ANIMATION: 162 parsePoint(m_to, m_toPoint); 163 break; 164 case FROM_BY_ANIMATION: 165 parsePoint(m_from, m_fromPoint); 166 parsePoint(m_to, m_toPoint); 167 break; 168 case BY_ANIMATION: 169 { 170 parsePoint(m_from, m_fromPoint); 171 FloatPoint byPoint; 172 parsePoint(m_by, byPoint); 173 m_toPoint = FloatPoint(m_fromPoint.x() + byPoint.x(), m_fromPoint.y() + byPoint.y()); 174 break; 175 } 176 case VALUES_ANIMATION: 177 parsePoint(m_values[valueIndex], m_fromPoint); 178 if ((valueIndex + 1) < m_values.size()) 179 parsePoint(m_values[valueIndex + 1], m_toPoint); 180 else 181 m_toPoint = m_fromPoint; 182 break; 183 case NO_ANIMATION: 184 ASSERT_NOT_REACHED(); 185 } 186 187 m_pointDiff = m_toPoint - m_fromPoint; 188 m_angleDiff = 0.0f; 189 return (m_pointDiff.width() != 0 || m_pointDiff.height() != 0); 190 } 191 192 bool SVGAnimateMotionElement::updateAnimationBaseValueFromElement() 193 { 194 if (!targetElement()->isStyledTransformable()) 195 return false; 196 197 m_basePoint = static_cast<SVGStyledTransformableElement*>(targetElement())->getBBox().location(); 147 bool SVGAnimateMotionElement::calculateFromAndToValues(const String& fromString, const String& toString) 148 { 149 parsePoint(fromString, m_fromPoint); 150 parsePoint(toString, m_toPoint); 198 151 return true; 199 152 } 200 201 void SVGAnimateMotionElement::applyAnimatedValueToElement() 153 154 bool SVGAnimateMotionElement::calculateFromAndByValues(const String& fromString, const String& byString) 155 { 156 parsePoint(fromString, m_fromPoint); 157 FloatPoint byPoint; 158 parsePoint(byString, byPoint); 159 m_toPoint = FloatPoint(m_fromPoint.x() + byPoint.x(), m_fromPoint.y() + byPoint.y()); 160 return true; 161 } 162 163 void SVGAnimateMotionElement::applyAnimatedValueToElement(unsigned repeat) 202 164 { 203 165 if (!targetElement()->isStyledTransformable()) … … 209 171 return; 210 172 173 // FIXME: Handle multiple additive animations. 211 174 ExceptionCode ec; 212 if (!isAdditive()) 175 if (isAdditive()) { 176 while (transformList->numberOfItems() > m_baseIndexInTransformList) 177 transformList->removeItem(transformList->numberOfItems() - 1, ec); 178 } else 213 179 transformList->clear(ec); 214 180 215 181 AffineTransform transform; 216 182 transform.rotate(m_animatedAngle); … … 219 185 transformList->appendItem(SVGTransform(transform), ec); 220 186 transformableElement->setTransform(transformList.get()); 221 if (transformableElement->renderer())222 transformableElement->renderer()->setNeedsLayout(true); // should be part of setTransform223 187 } 188 if (transformableElement->renderer()) 189 transformableElement->renderer()->setNeedsLayout(true); // should be part of setTransform 190 } 191 192 void SVGAnimateMotionElement::startedActiveInterval() 193 { 194 // FIXME: Make multiple additive animations work. 195 SVGAnimationElement::startedActiveInterval(); 196 if (!m_animationValid) 197 return; 198 199 SVGStyledTransformableElement* transformableElement = static_cast<SVGStyledTransformableElement*>(targetElement()); 200 m_baseIndexInTransformList = transformableElement->transform()->numberOfItems(); 224 201 } 225 202 -
trunk/WebCore/svg/SVGAnimateMotionElement.h
r31600 r31801 37 37 virtual bool hasValidTarget() const; 38 38 39 virtual bool updateAnimationBaseValueFromElement(); 40 virtual void applyAnimatedValueToElement(); 39 virtual void applyAnimatedValueToElement(unsigned repeat); 41 40 42 41 virtual void parseMappedAttribute(MappedAttribute*); … … 47 46 virtual const SVGElement* contextElement() const { return this; } 48 47 49 virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast); 50 virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex); 48 virtual bool updateAnimatedValue(float percent); 49 virtual bool calculateFromAndToValues(const String& fromString, const String& toString); 50 virtual bool calculateFromAndByValues(const String& fromString, const String& byString); 51 52 virtual void startedActiveInterval(); 51 53 52 54 private: 53 FloatPoint m_basePoint;54 55 FloatSize m_animatedTranslation; 55 56 float m_animatedAngle; … … 61 62 float m_toAngle; 62 63 63 FloatSize m_pointDiff; 64 float m_angleDiff; 65 64 unsigned m_baseIndexInTransformList; 65 66 66 Path m_path; 67 67 Vector<float> m_keyPoints; -
trunk/WebCore/svg/SVGAnimateTransformElement.cpp
r28568 r31801 32 32 #include "SVGSVGElement.h" 33 33 #include "SVGStyledTransformableElement.h" 34 #include "SVGTextElement.h" 34 35 #include "SVGTransform.h" 35 36 #include "SVGTransformList.h" 36 #include "TimeScheduler.h"37 37 38 38 #include <math.h> … … 46 46 : SVGAnimationElement(tagName, doc) 47 47 , m_type(SVGTransform::SVG_TRANSFORM_UNKNOWN) 48 , m_baseIndexInTransformList(0) 48 49 { 49 50 } … … 55 56 bool SVGAnimateTransformElement::hasValidTarget() const 56 57 { 57 return (SVGAnimationElement::hasValidTarget() && targetElement()->isStyledTransformable()); 58 SVGElement* targetElement = this->targetElement(); 59 return SVGAnimationElement::hasValidTarget() && (targetElement->isStyledTransformable() || targetElement->hasTagName(SVGNames::textTag)); 58 60 } 59 61 … … 75 77 } 76 78 77 bool SVGAnimateTransformElement::updateAnimatedValue( EAnimationMode animationMode, float timePercentage, unsigned valueIndex, float percentagePast)79 bool SVGAnimateTransformElement::updateAnimatedValue(float percentage) 78 80 { 79 if (animationMode == TO_ANIMATION) 80 // to-animations have a special equation: value = (to - base) * (time/duration) + base 81 m_animatedTransform = SVGTransformDistance(m_baseTransform, m_toTransform).scaledDistance(timePercentage).addToSVGTransform(m_baseTransform); 82 else 83 m_animatedTransform = SVGTransformDistance(m_fromTransform, m_toTransform).scaledDistance(percentagePast).addToSVGTransform(m_fromTransform); 84 return (m_animatedTransform != m_baseTransform); 81 m_animatedTransform = SVGTransformDistance(m_fromTransform, m_toTransform).scaledDistance(percentage).addToSVGTransform(m_fromTransform); 82 return true; 83 } 84 85 static PassRefPtr<SVGTransformList> transformListFor(SVGElement* element) 86 { 87 ASSERT(element); 88 if (element->isStyledTransformable()) 89 return static_cast<SVGStyledTransformableElement*>(element)->transform(); 90 if (element->hasTagName(SVGNames::textTag)) 91 return static_cast<SVGTextElement*>(element)->transform(); 92 return 0; 85 93 } 86 94 87 bool SVGAnimateTransformElement::updateAnimationBaseValueFromElement()95 void SVGAnimateTransformElement::applyAnimatedValueToElement(unsigned repeat) 88 96 { 89 m_baseTransform = SVGTransform(); 90 m_toTransform = SVGTransform(); 91 m_fromTransform = SVGTransform(); 92 m_animatedTransform = SVGTransform(); 97 SVGElement* targetElement = this->targetElement(); 98 RefPtr<SVGTransformList> transformList = transformListFor(targetElement); 99 ASSERT(transformList); 100 101 // FIXME: Handle multiple additive tranforms. 102 // FIXME: Handle accumulate. 103 ExceptionCode ec; 104 if (isAdditive()) { 105 while (transformList->numberOfItems() > m_baseIndexInTransformList) 106 transformList->removeItem(transformList->numberOfItems() - 1, ec); 107 } else 108 transformList->clear(ec); 109 transformList->appendItem(m_animatedTransform, ec); 93 110 94 if (!targetElement()->isStyledTransformable()) 111 if (targetElement->renderer()) 112 targetElement->renderer()->setNeedsLayout(true); // should really be in setTransform 113 } 114 115 bool SVGAnimateTransformElement::calculateFromAndToValues(const String& fromString, const String& toString) 116 { 117 m_fromTransform = parseTransformValue(fromString); 118 if (!m_fromTransform.isValid()) 95 119 return false; 96 97 SVGStyledTransformableElement* transform = static_cast<SVGStyledTransformableElement*>(targetElement()); 98 RefPtr<SVGTransformList> transformList = transform->transform(); 99 if (!transformList) 100 return false; 101 102 m_baseTransform = transformList->concatenateForType(m_type); 103 104 // If a base value is empty, its type should match m_type instead of being unknown. 105 // It's not certain whether this should be part of SVGTransformList or not -- cying 106 if (m_baseTransform.type() == SVGTransform::SVG_TRANSFORM_UNKNOWN) 107 m_baseTransform = SVGTransform(m_type); 108 109 return true; 120 m_toTransform = parseTransformValue(toString); 121 return m_toTransform.isValid(); 110 122 } 111 123 112 void SVGAnimateTransformElement::applyAnimatedValueToElement()124 bool SVGAnimateTransformElement::calculateFromAndByValues(const String& fromString, const String& byString) 113 125 { 114 if (!targetElement()->isStyledTransformable()) 126 127 m_fromTransform = parseTransformValue(fromString); 128 if (!m_fromTransform.isValid()) 129 return false; 130 m_toTransform = SVGTransformDistance::addSVGTransforms(m_fromTransform, parseTransformValue(byString)); 131 return m_toTransform.isValid(); 132 } 133 134 void SVGAnimateTransformElement::startedActiveInterval() 135 { 136 // FIXME: Make multiple additive animations work. 137 SVGAnimationElement::startedActiveInterval(); 138 if (!m_animationValid) 115 139 return; 116 140 117 SVGStyledTransformableElement* transform = static_cast<SVGStyledTransformableElement*>(targetElement()); 118 RefPtr<SVGTransformList> transformList = transform->transform(); 119 if (!transformList) 120 return; 121 122 ExceptionCode ec; 123 if (!isAdditive()) 124 transformList->clear(ec); 125 126 transformList->appendItem(m_animatedTransform, ec); 127 transform->setTransform(transformList.get()); 128 if (transform->renderer()) 129 transform->renderer()->setNeedsLayout(true); // should really be in setTransform 130 } 131 132 bool SVGAnimateTransformElement::calculateFromAndToValues(EAnimationMode animationMode, unsigned valueIndex) 133 { 134 switch (animationMode) { 135 case FROM_TO_ANIMATION: 136 m_fromTransform = parseTransformValue(m_from); 137 // fall through 138 case TO_ANIMATION: 139 m_toTransform = parseTransformValue(m_to); 140 break; 141 case FROM_BY_ANIMATION: 142 m_fromTransform = parseTransformValue(m_from); 143 m_toTransform = parseTransformValue(m_by); 144 break; 145 case BY_ANIMATION: 146 m_fromTransform = parseTransformValue(m_from); 147 m_toTransform = SVGTransformDistance::addSVGTransforms(m_fromTransform, parseTransformValue(m_by)); 148 break; 149 case VALUES_ANIMATION: 150 m_fromTransform = parseTransformValue(m_values[valueIndex]); 151 m_toTransform = ((valueIndex + 1) < m_values.size()) ? parseTransformValue(m_values[valueIndex + 1]) : m_fromTransform; 152 break; 153 case NO_ANIMATION: 154 ASSERT_NOT_REACHED(); 155 } 156 157 return true; 141 RefPtr<SVGTransformList> transformList = transformListFor(targetElement()); 142 ASSERT(transformList); 143 m_baseIndexInTransformList = transformList->numberOfItems(); 158 144 } 159 145 160 146 SVGTransform SVGAnimateTransformElement::parseTransformValue(const String& value) const 161 147 { 148 if (value.isEmpty()) 149 return SVGTransform(m_type); 162 150 SVGTransform result; 163 const UChar* ptr = value.characters(); 164 SVGTransformable::parseTransformValue(m_type, ptr, ptr + value.length(), result); // ignoring return value 151 // FIXME: This is pretty dumb but parseTransformValue() wants those parenthesis. 152 String parseString("(" + value + ")"); 153 const UChar* ptr = parseString.characters(); 154 SVGTransformable::parseTransformValue(m_type, ptr, ptr + parseString.length(), result); // ignoring return value 165 155 return result; 166 156 } -
trunk/WebCore/svg/SVGAnimateTransformElement.h
r31600 r31801 42 42 43 43 virtual void parseMappedAttribute(MappedAttribute*); 44 45 virtual bool updateAnimationBaseValueFromElement(); 46 virtual void applyAnimatedValueToElement(); 44 45 virtual void applyAnimatedValueToElement(unsigned repeat); 47 46 48 47 protected: 49 48 virtual const SVGElement* contextElement() const { return this; } 50 49 51 virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast); 52 virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex); 50 virtual bool updateAnimatedValue(float percent); 51 virtual bool calculateFromAndToValues(const String& fromString, const String& toString); 52 virtual bool calculateFromAndByValues(const String& fromString, const String& byString); 53 54 virtual void startedActiveInterval(); 55 53 56 54 57 private: … … 57 60 58 61 SVGTransform::SVGTransformType m_type; 62 63 unsigned m_baseIndexInTransformList; 59 64 60 65 SVGTransform m_toTransform; 61 66 SVGTransform m_fromTransform; 62 67 63 SVGTransform m_baseTransform;64 68 SVGTransform m_animatedTransform; 65 69 }; -
trunk/WebCore/svg/SVGAnimationElement.cpp
r31334 r31801 3 3 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 4 4 Copyright (C) 2007 Eric Seidel <eric@webkit.org> 5 Copyright (C) 2008 Apple Inc. All rights reserved. 5 6 6 7 This file is part of the KDE project … … 26 27 #include "SVGAnimationElement.h" 27 28 29 #include "CSSComputedStyleDeclaration.h" 30 #include "CSSParser.h" 28 31 #include "CSSPropertyNames.h" 29 32 #include "Document.h" 33 #include "Event.h" 34 #include "EventListener.h" 30 35 #include "FloatConversion.h" 36 #include "HTMLNames.h" 31 37 #include "SVGNames.h" 32 #include "SVGParserUtilities.h"33 #include "SVGSVGElement.h"34 38 #include "SVGURIReference.h" 35 #include "TimeScheduler.h"36 39 #include "XLinkNames.h" 37 #include <float.h>38 #include <math.h>39 #include <wtf/MathExtras.h>40 #include <wtf/Vector.h>41 40 42 41 using namespace std; … … 44 43 namespace WebCore { 45 44 46 using namespace SVGNames;47 48 45 SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document* doc) 49 : SVG Element(tagName, doc)46 : SVGSMILElement(tagName, doc) 50 47 , SVGTests() 51 48 , SVGExternalResourcesRequired() 52 , m_targetElement(0) 53 , m_connectedToTimer(false) 54 , m_currentTime(0.0) 55 , m_simpleDuration(0.0) 56 , m_fill(FILL_REMOVE) 57 , m_restart(RESTART_ALWAYS) 58 , m_calcMode(CALCMODE_LINEAR) 59 , m_additive(ADDITIVE_REPLACE) 60 , m_accumulate(ACCUMULATE_NONE) 61 , m_attributeType(ATTRIBUTETYPE_AUTO) 62 , m_max(0.0) 63 , m_min(0.0) 64 , m_end(0.0) 65 , m_begin(0.0) 66 , m_repetitions(0) 67 , m_repeatCount(0) 68 , m_animationBegin(DBL_MAX) 69 , m_animationEnd(DBL_MAX) 70 { 71 49 , m_animationValid(false) 50 { 72 51 } 73 52 … … 75 54 { 76 55 } 77 78 bool SVGAnimationElement::hasValidTarget() const 79 { 80 return targetElement(); 81 } 82 83 SVGElement* SVGAnimationElement::targetElement() const 84 { 85 if (!m_targetElement) { 86 Node *target = 0; 87 if (!m_href.isEmpty()) { 88 target = document()->getElementById(SVGURIReference::getTarget(m_href)); 89 } else if (parentNode()) { 90 // TODO : do we really need to skip non element nodes? Can that happen at all? 91 target = parentNode(); 92 while (target) { 93 if (target->nodeType() != ELEMENT_NODE) 94 target = target->parentNode(); 95 else 96 break; 97 } 56 57 static void parseKeyTimes(const String& parse, Vector<float>& result) 58 { 59 result.clear(); 60 Vector<String> parseList; 61 parse.split(';', parseList); 62 for (unsigned n = 0; n < parseList.size(); ++n) { 63 String timeString = parseList[n]; 64 bool ok; 65 float time = timeString.toFloat(&ok); 66 if (!ok || time < 0 || time > 1.f) 67 goto fail; 68 if (!n) { 69 if (time != 0) 70 goto fail; 71 } else if (time <= result.last()) 72 goto fail; 73 result.append(time); 74 } 75 return; 76 fail: 77 result.clear(); 78 } 79 80 static void parseKeySplines(const String& parse, Vector<UnitBezier>& result) 81 { 82 result.clear(); 83 Vector<String> parseList; 84 parse.split(';', parseList); 85 for (unsigned n = 0; n < parseList.size(); ++n) { 86 Vector<String> parseSpline; 87 parseList[n].split(',', parseSpline); 88 // The spec says the sepator is a space, all tests use commas. Weird. 89 if (parseSpline.size() == 1) 90 parseList[n].split(' ', parseSpline); 91 if (parseSpline.size() != 4) 92 goto fail; 93 double curveValues[4]; 94 for (unsigned i = 0; i < 4; ++i) { 95 String parseNumber = parseSpline[i]; 96 bool ok; 97 curveValues[i] = parseNumber.toDouble(&ok); 98 if (!ok || curveValues[i] < 0.0 || curveValues[i] > 1.0) 99 goto fail; 98 100 } 99 if (target && target->isSVGElement()) 100 m_targetElement = static_cast<SVGElement*>(target); 101 } 102 103 return m_targetElement; 104 } 105 106 float SVGAnimationElement::getEndTime() const 107 { 108 return narrowPrecisionToFloat(m_end); 109 } 110 111 float SVGAnimationElement::getStartTime() const 112 { 113 return narrowPrecisionToFloat(m_begin); 114 } 115 116 float SVGAnimationElement::getCurrentTime() const 117 { 118 return narrowPrecisionToFloat(m_currentTime); 119 } 120 121 float SVGAnimationElement::getSimpleDuration(ExceptionCode&) const 122 { 123 return narrowPrecisionToFloat(m_simpleDuration); 124 } 125 126 void SVGAnimationElement::parseKeyNumbers(Vector<float>& keyNumbers, const String& value) 127 { 128 float number = 0.0f; 129 130 const UChar* ptr = value.characters(); 131 const UChar* end = ptr + value.length(); 132 skipOptionalSpaces(ptr, end); 133 while (ptr < end) { 134 if (!parseNumber(ptr, end, number, false)) 135 return; 136 keyNumbers.append(number); 137 138 if (!skipOptionalSpaces(ptr, end) || *ptr != ';') 139 return; 140 ptr++; 141 skipOptionalSpaces(ptr, end); 142 } 143 } 144 145 static void parseKeySplines(Vector<SVGAnimationElement::KeySpline>& keySplines, const String& value) 146 { 147 float number = 0.0f; 148 SVGAnimationElement::KeySpline keySpline; 149 150 const UChar* ptr = value.characters(); 151 const UChar* end = ptr + value.length(); 152 skipOptionalSpaces(ptr, end); 153 while (ptr < end) { 154 if (!(parseNumber(ptr, end, number, false) && skipOptionalSpaces(ptr, end))) 155 return; 156 keySpline.control1.setX(number); 157 if (!(parseNumber(ptr, end, number, false) && skipOptionalSpaces(ptr, end))) 158 return; 159 keySpline.control1.setY(number); 160 if (!(parseNumber(ptr, end, number, false) && skipOptionalSpaces(ptr, end))) 161 return; 162 keySpline.control2.setX(number); 163 if (!parseNumber(ptr, end, number, false)) 164 return; 165 keySpline.control2.setY(number); 166 keySplines.append(keySpline); 167 168 if (!skipOptionalSpaces(ptr, end) || *ptr != ';') 169 return; 170 ptr++; 171 skipOptionalSpaces(ptr, end); 172 } 173 } 174 175 void SVGAnimationElement::parseBeginOrEndValue(double& number, const String& value) 176 { 177 // TODO: Don't use SVGStringList for parsing. 178 AtomicString dummy; 179 RefPtr<SVGStringList> valueList = SVGStringList::create(QualifiedName(dummy, dummy, dummy)); 180 valueList->parse(value, ';'); 181 182 ExceptionCode ec = 0; 183 for (unsigned int i = 0; i < valueList->numberOfItems(); i++) { 184 String current = valueList->getItem(i, ec); 185 186 if (current.startsWith("accessKey")) { 187 // Register keyDownEventListener for the character 188 String character = current.substring(current.length() - 2, 1); 189 // FIXME: Not implemented! Supposed to register accessKey character 190 } else if (current.startsWith("wallclock")) { 191 int firstBrace = current.find('('); 192 int secondBrace = current.find(')'); 193 194 String wallclockValue = current.substring(firstBrace + 1, secondBrace - firstBrace - 2); 195 // FIXME: Not implemented! Supposed to use wallClock value 196 } else if (current.contains('.')) { 197 int dotPosition = current.find('.'); 198 199 String element = current.substring(0, dotPosition); 200 String clockValue; 201 if (current.contains("begin")) 202 clockValue = current.substring(dotPosition + 6); 203 else if (current.contains("end")) 204 clockValue = current.substring(dotPosition + 4); 205 else if (current.contains("repeat")) 206 clockValue = current.substring(dotPosition + 7); 207 else { // DOM2 Event Reference 208 int plusMinusPosition = -1; 209 210 if (current.contains('+')) 211 plusMinusPosition = current.find('+'); 212 else if (current.contains('-')) 213 plusMinusPosition = current.find('-'); 214 215 String event = current.substring(dotPosition + 1, plusMinusPosition - dotPosition - 1); 216 clockValue = current.substring(dotPosition + event.length() + 1); 217 // FIXME: supposed to use DOM Event 218 } 219 } else { 220 number = parseClockValue(current); 221 if (!isIndefinite(number)) 222 number *= 1000.0; 223 // FIXME: supposed to set begin/end time 224 } 225 } 101 result.append(UnitBezier(curveValues[0], curveValues[1], curveValues[2], curveValues[3])); 102 } 103 return; 104 fail: 105 result.clear(); 226 106 } 227 107 228 108 void SVGAnimationElement::parseMappedAttribute(MappedAttribute* attr) 229 109 { 230 if (attr->name().matches(XLinkNames::hrefAttr)) 231 m_href = attr->value(); 232 else if (attr->name() == SVGNames::attributeNameAttr) 233 m_attributeName = attr->value(); 234 else if (attr->name() == SVGNames::attributeTypeAttr) { 235 if (attr->value() == "CSS") 236 m_attributeType = ATTRIBUTETYPE_CSS; 237 else if (attr->value() == "XML") 238 m_attributeType = ATTRIBUTETYPE_XML; 239 else if (attr->value() == "auto") 240 m_attributeType = ATTRIBUTETYPE_AUTO; 241 } else if (attr->name() == SVGNames::beginAttr) 242 parseBeginOrEndValue(m_begin, attr->value()); 243 else if (attr->name() == SVGNames::endAttr) 244 parseBeginOrEndValue(m_end, attr->value()); 245 else if (attr->name() == SVGNames::durAttr) { 246 m_simpleDuration = parseClockValue(attr->value()); 247 if (!isIndefinite(m_simpleDuration)) 248 m_simpleDuration *= 1000.0; 249 } else if (attr->name() == SVGNames::minAttr) { 250 m_min = parseClockValue(attr->value()); 251 if (!isIndefinite(m_min)) 252 m_min *= 1000.0; 253 } else if (attr->name() == SVGNames::maxAttr) { 254 m_max = parseClockValue(attr->value()); 255 if (!isIndefinite(m_max)) 256 m_max *= 1000.0; 257 } else if (attr->name() == SVGNames::restartAttr) { 258 if (attr->value() == "whenNotActive") 259 m_restart = RESTART_WHENNOTACTIVE; 260 else if (attr->value() == "never") 261 m_restart = RESTART_NEVER; 262 else if (attr->value() == "always") 263 m_restart = RESTART_ALWAYS; 264 } else if (attr->name() == SVGNames::repeatCountAttr) { 265 if (attr->value() == "indefinite") 266 m_repeatCount = DBL_MAX; 267 else 268 m_repeatCount = attr->value().toDouble(); 269 } else if (attr->name() == SVGNames::repeatDurAttr) 270 m_repeatDur = attr->value(); 271 else if (attr->name() == SVGNames::fillAttr) { 272 if (attr->value() == "freeze") 273 m_fill = FILL_FREEZE; 274 else if (attr->value() == "remove") 275 m_fill = FILL_REMOVE; 276 } else if (attr->name() == SVGNames::calcModeAttr) { 277 if (attr->value() == "discrete") 278 m_calcMode = CALCMODE_DISCRETE; 279 else if (attr->value() == "linear") 280 m_calcMode = CALCMODE_LINEAR; 281 else if (attr->value() == "spline") 282 m_calcMode = CALCMODE_SPLINE; 283 else if (attr->value() == "paced") 284 m_calcMode = CALCMODE_PACED; 285 } else if (attr->name() == SVGNames::valuesAttr) { 286 m_values.clear(); 287 m_values = parseDelimitedString(attr->value(), ';'); 288 } else if (attr->name() == SVGNames::keyTimesAttr) { 289 m_keyTimes.clear(); 290 parseKeyNumbers(m_keyTimes, attr->value()); 291 } else if (attr->name() == SVGNames::keySplinesAttr) { 292 m_keySplines.clear(); 293 parseKeySplines(m_keySplines, attr->value()); 294 } else if (attr->name() == SVGNames::fromAttr) 295 m_from = attr->value(); 296 else if (attr->name() == SVGNames::toAttr) 297 m_to = attr->value(); 298 else if (attr->name() == SVGNames::byAttr) 299 m_by = attr->value(); 300 else if (attr->name() == SVGNames::additiveAttr) { 301 if (attr->value() == "sum") 302 m_additive = ADDITIVE_SUM; 303 else if (attr->value() == "replace") 304 m_additive = ADDITIVE_REPLACE; 305 } else if (attr->name() == SVGNames::accumulateAttr) { 306 if (attr->value() == "sum") 307 m_accumulate = ACCUMULATE_SUM; 308 else if (attr->value() == "none") 309 m_accumulate = ACCUMULATE_NONE; 310 } else { 110 if (attr->name() == SVGNames::valuesAttr) 111 attr->value().string().split(';', m_values); 112 else if (attr->name() == SVGNames::keyTimesAttr) 113 parseKeyTimes(attr->value(), m_keyTimes); 114 else if (attr->name() == SVGNames::keySplinesAttr) 115 parseKeySplines(attr->value(), m_keySplines); 116 else { 311 117 if (SVGTests::parseMappedAttribute(attr)) 312 118 return; 313 119 if (SVGExternalResourcesRequired::parseMappedAttribute(attr)) 314 120 return; 315 SVGElement::parseMappedAttribute(attr); 316 } 317 } 318 319 double SVGAnimationElement::parseClockValue(const String& data) 320 { 321 String parse = data.stripWhiteSpace(); 322 323 if (parse == "indefinite") 324 return DBL_MAX; 325 326 double result; 327 328 int doublePointOne = parse.find(':'); 329 int doublePointTwo = parse.find(':', doublePointOne + 1); 330 331 if (doublePointOne != -1 && doublePointTwo != -1) { // Spec: "Full clock values" 332 unsigned hours = parse.substring(0, 2).toUIntStrict(); 333 unsigned minutes = parse.substring(3, 2).toUIntStrict(); 334 unsigned seconds = parse.substring(6, 2).toUIntStrict(); 335 unsigned milliseconds = 0; 336 337 result = (3600 * hours) + (60 * minutes) + seconds; 338 339 if (parse.find('.') != -1) { 340 String temp = parse.substring(9, 2); 341 milliseconds = temp.toUIntStrict(); 342 result += (milliseconds * (1 / pow(10.0, int(temp.length())))); 343 } 344 } else if (doublePointOne != -1 && doublePointTwo == -1) { // Spec: "Partial clock values" 345 unsigned minutes = parse.substring(0, 2).toUIntStrict(); 346 unsigned seconds = parse.substring(3, 2).toUIntStrict(); 347 unsigned milliseconds = 0; 348 349 result = (60 * minutes) + seconds; 350 351 if (parse.find('.') != -1) { 352 String temp = parse.substring(6, 2); 353 milliseconds = temp.toUIntStrict(); 354 result += (milliseconds * (1 / pow(10.0, int(temp.length())))); 355 } 356 } else { // Spec: "Timecount values" 357 int dotPosition = parse.find('.'); 358 359 if (parse.endsWith("h")) { 360 if (dotPosition == -1) 361 result = parse.substring(0, parse.length() - 1).toUIntStrict() * 3600; 362 else { 363 result = parse.substring(0, dotPosition).toUIntStrict() * 3600; 364 String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 2); 365 result += (3600.0 * temp.toUIntStrict()) * (1 / pow(10.0, int(temp.length()))); 366 } 367 } else if (parse.endsWith("min")) { 368 if (dotPosition == -1) 369 result = parse.substring(0, parse.length() - 3).toUIntStrict() * 60; 370 else { 371 result = parse.substring(0, dotPosition).toUIntStrict() * 60; 372 String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 4); 373 result += (60.0 * temp.toUIntStrict()) * (1 / pow(10.0, int(temp.length()))); 374 } 375 } else if (parse.endsWith("ms")) { 376 if (dotPosition == -1) 377 result = parse.substring(0, parse.length() - 2).toUIntStrict() / 1000.0; 378 else { 379 result = parse.substring(0, dotPosition).toUIntStrict() / 1000.0; 380 String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 3); 381 result += (temp.toUIntStrict() / 1000.0) * (1 / pow(10.0, int(temp.length()))); 382 } 383 } else if (parse.endsWith("s")) { 384 if (dotPosition == -1) 385 result = parse.substring(0, parse.length() - 1).toUIntStrict(); 386 else { 387 result = parse.substring(0, dotPosition).toUIntStrict(); 388 String temp = parse.substring(dotPosition + 1, parse.length() - dotPosition - 2); 389 result += temp.toUIntStrict() * (1 / pow(10.0, int(temp.length()))); 390 } 391 } else 392 result = parse.toDouble(); 393 } 394 395 return result; 396 } 397 398 void SVGAnimationElement::finishParsingChildren() 399 { 400 if (ownerSVGElement()) 401 ownerSVGElement()->timeScheduler()->addTimer(this, lround(getStartTime())); 402 SVGElement::finishParsingChildren(); 403 } 404 405 String SVGAnimationElement::targetAttributeAnimatedValue() const 406 { 407 // FIXME: This method is not entirely correct 408 // It does not properly grab the true "animVal" instead grabs the baseVal (or something very close) 409 410 if (!targetElement()) 411 return String(); 412 413 SVGElement* target = targetElement(); 414 SVGStyledElement* styled = 0; 415 if (target && target->isStyled()) 416 styled = static_cast<SVGStyledElement*>(target); 417 418 String ret; 419 420 EAttributeType attributeType = static_cast<EAttributeType>(m_attributeType); 421 if (attributeType == ATTRIBUTETYPE_AUTO) { 422 attributeType = ATTRIBUTETYPE_XML; 423 424 // Spec: The implementation should match the attributeName to an attribute 425 // for the target element. The implementation must first search through the 426 // list of CSS properties for a matching property name, and if none is found, 427 // search the default XML namespace for the element. 428 if (styled && styled->style()) { 429 if (styled->style()->getPropertyCSSValue(m_attributeName)) 430 attributeType = ATTRIBUTETYPE_CSS; 431 } 432 } 433 434 if (attributeType == ATTRIBUTETYPE_CSS) { 435 if (styled && styled->style()) 436 ret = styled->style()->getPropertyValue(m_attributeName); 437 } 438 439 if (attributeType == ATTRIBUTETYPE_XML || ret.isEmpty()) 440 ret = targetElement()->getAttribute(m_attributeName); 441 442 return ret; 443 } 444 445 void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value) 446 { 447 // FIXME: This method is not entirely correct 448 // It does not properly set the "animVal", rather it sets the "baseVal" 449 SVGAnimationElement::setTargetAttribute(targetElement(), m_attributeName, value, static_cast<EAttributeType>(m_attributeType)); 450 } 451 452 void SVGAnimationElement::setTargetAttribute(SVGElement* target, const String& name, const String& value, EAttributeType type) 453 { 454 if (!target || name.isNull() || value.isNull()) 455 return; 456 457 SVGStyledElement* styled = (target && target->isStyled()) ? static_cast<SVGStyledElement*>(target) : 0; 458 459 EAttributeType attributeType = type; 460 if (type == ATTRIBUTETYPE_AUTO) { 461 // Spec: The implementation should match the attributeName to an attribute 462 // for the target element. The implementation must first search through the 463 // list of CSS properties for a matching property name, and if none is found, 464 // search the default XML namespace for the element. 465 if (styled && styled->style() && styled->style()->getPropertyCSSValue(name)) 466 attributeType = ATTRIBUTETYPE_CSS; 467 else 468 attributeType = ATTRIBUTETYPE_XML; 469 } 470 ExceptionCode ec = 0; 471 if (attributeType == ATTRIBUTETYPE_CSS && styled && styled->style()) 472 styled->style()->setProperty(name, value, "", ec); 473 else if (attributeType == ATTRIBUTETYPE_XML) 474 target->setAttribute(name, value, ec); 475 } 476 477 String SVGAnimationElement::attributeName() const 478 { 479 return m_attributeName; 480 } 481 482 bool SVGAnimationElement::connectedToTimer() const 483 { 484 return m_connectedToTimer; 485 } 486 487 bool SVGAnimationElement::isFrozen() const 488 { 489 return (m_fill == FILL_FREEZE); 490 } 491 492 bool SVGAnimationElement::isAdditive() const 493 { 494 return (m_additive == ADDITIVE_SUM) || (detectAnimationMode() == BY_ANIMATION); 495 } 496 497 bool SVGAnimationElement::isAccumulated() const 498 { 499 return (m_accumulate == ACCUMULATE_SUM) && (detectAnimationMode() != TO_ANIMATION); 500 } 501 502 EAnimationMode SVGAnimationElement::detectAnimationMode() const 503 { 504 if (hasAttribute(SVGNames::valuesAttr)) 505 return VALUES_ANIMATION; 506 else if ((!m_from.isEmpty() && !m_to.isEmpty()) || (!m_to.isEmpty())) { // to/from-to animation 507 if (!m_from.isEmpty()) // from-to animation 508 return FROM_TO_ANIMATION; 509 else 510 return TO_ANIMATION; 511 } else if ((m_from.isEmpty() && m_to.isEmpty() && !m_by.isEmpty()) || 512 (!m_from.isEmpty() && !m_by.isEmpty())) { // by/from-by animation 513 if (!m_from.isEmpty()) // from-by animation 514 return FROM_BY_ANIMATION; 515 else 516 return BY_ANIMATION; 517 } 518 519 return NO_ANIMATION; 520 } 521 522 double SVGAnimationElement::repeations() const 523 { 524 return m_repetitions; 525 } 526 527 bool SVGAnimationElement::isIndefinite(double value) 528 { 529 return (value == DBL_MAX); 530 } 531 532 void SVGAnimationElement::connectTimer() 533 { 534 ASSERT(!m_connectedToTimer); 535 ownerSVGElement()->timeScheduler()->connectIntervalTimer(this); 536 m_connectedToTimer = true; 537 } 538 539 void SVGAnimationElement::disconnectTimer() 540 { 541 ASSERT(m_connectedToTimer); 542 ownerSVGElement()->timeScheduler()->disconnectIntervalTimer(this); 543 m_connectedToTimer = false; 544 } 545 546 static double calculateTimePercentage(double elapsedSeconds, double start, double end, double duration, double repetitions) 547 { 548 double percentage = 0.0; 549 double useElapsed = elapsedSeconds - (duration * repetitions); 550 551 if (duration > 0.0 && end == 0.0) 552 percentage = 1.0 - (((start + duration) - useElapsed) / duration); 553 else if (duration > 0.0 && end != 0.0) { 554 if (duration > end) 555 percentage = 1.0 - (((start + end) - useElapsed) / end); 556 else 557 percentage = 1.0 - (((start + duration) - useElapsed) / duration); 558 } else if (duration == 0.0 && end != 0.0) 559 percentage = 1.0 - (((start + end) - useElapsed) / end); 560 561 return percentage; 562 } 563 564 static inline void adjustPercentagePastForKeySplines(const Vector<SVGAnimationElement::KeySpline>& keySplines, unsigned valueIndex, float& percentagePast) 565 { 566 if (percentagePast == 0.0f) // values at key times need no spline adjustment 567 return; 568 const SVGAnimationElement::KeySpline& keySpline = keySplines[valueIndex]; 569 Path path; 570 path.moveTo(FloatPoint()); 571 path.addBezierCurveTo(keySpline.control1, keySpline.control2, FloatPoint(1.0f, 1.0f)); 572 // FIXME: This needs to use a y-at-x function on path, to compute the y value then multiply percentagePast by that value 573 } 574 575 void SVGAnimationElement::valueIndexAndPercentagePastForDistance(float distancePercentage, unsigned& valueIndex, float& percentagePast) 576 { 577 // Unspecified: animation elements which do not support CALCMODE_PACED, we just always show the first value 578 valueIndex = 0; 579 percentagePast = 0; 580 } 581 582 float SVGAnimationElement::calculateTotalDistance() 583 { 584 return 0; 585 } 586 587 static inline void caculateValueIndexForKeyTimes(float timePercentage, const Vector<float>& keyTimes, unsigned& valueIndex, float& lastKeyTime, float& nextKeyTime) 588 { 589 unsigned keyTimesCountMinusOne = keyTimes.size() - 1; 590 valueIndex = 0; 591 ASSERT(timePercentage >= keyTimes.first()); 592 while ((valueIndex < keyTimesCountMinusOne) && (timePercentage >= keyTimes[valueIndex + 1])) 593 valueIndex++; 594 595 lastKeyTime = keyTimes[valueIndex]; 596 if (valueIndex < keyTimesCountMinusOne) 597 nextKeyTime = keyTimes[valueIndex + 1]; 598 else 599 nextKeyTime = lastKeyTime; 600 } 601 602 bool SVGAnimationElement::isValidAnimation() const 603 { 604 EAnimationMode animationMode = detectAnimationMode(); 605 if (!hasValidTarget() || (animationMode == NO_ANIMATION)) 606 return false; 607 if (animationMode == VALUES_ANIMATION) { 608 if (!m_values.size()) 609 return false; 610 if (m_keyTimes.size()) { 611 if ((m_values.size() != m_keyTimes.size()) || (m_keyTimes.first() != 0)) 612 return false; 613 if (((m_calcMode == CALCMODE_SPLINE) || (m_calcMode == CALCMODE_LINEAR)) && (m_keyTimes.last() != 1)) 614 return false; 615 float lastKeyTime = 0; 616 for (unsigned x = 0; x < m_keyTimes.size(); x++) { 617 if (m_keyTimes[x] < lastKeyTime || m_keyTimes[x] > 1) 618 return false; 619 } 620 } 621 if (m_keySplines.size()) { 622 if ((m_values.size() - 1) != m_keySplines.size()) 623 return false; 624 for (unsigned x = 0; x < m_keyTimes.size(); x++) 625 if (m_keyTimes[x] < 0 || m_keyTimes[x] > 1) 626 return false; 627 } 628 } 121 SVGSMILElement::parseMappedAttribute(attr); 122 } 123 } 124 125 void SVGAnimationElement::attributeChanged(Attribute* attr, bool preserveDecls) 126 { 127 // Assumptions may not hold after an attribute change. 128 m_animationValid = false; 129 SVGSMILElement::attributeChanged(attr, preserveDecls); 130 } 131 132 float SVGAnimationElement::getStartTime() const 133 { 134 return narrowPrecisionToFloat(intervalBegin().value()); 135 } 136 137 float SVGAnimationElement::getCurrentTime() const 138 { 139 return narrowPrecisionToFloat(elapsed().value()); 140 } 141 142 float SVGAnimationElement::getSimpleDuration(ExceptionCode&) const 143 { 144 return narrowPrecisionToFloat(simpleDuration().value()); 145 } 146 147 bool SVGAnimationElement::beginElement(ExceptionCode& ec) 148 { 149 return beginElementAt(0, ec); 150 } 151 152 bool SVGAnimationElement::beginElementAt(float offset, ExceptionCode& ec) 153 { 154 addBeginTime(elapsed() + offset); 629 155 return true; 630 156 } 631 157 632 void SVGAnimationElement::calculateValueIndexAndPercentagePast(float timePercentage, unsigned& valueIndex, float& percentagePast)633 {634 ASSERT(timePercentage <= 1.0f);635 ASSERT(isValidAnimation());636 EAnimationMode animationMode = detectAnimationMode();637 638 // to-animations have their own special handling639 if (animationMode == TO_ANIMATION)640 return;641 642 // paced is special, caculates values based on distance instead of time643 if (m_calcMode == CALCMODE_PACED) {644 float totalDistance = calculateTotalDistance();645 float distancePercentage = totalDistance * timePercentage;646 valueIndexAndPercentagePastForDistance(distancePercentage, valueIndex, percentagePast);647 return;648 }649 650 // Figure out what our current index is based on on time651 // all further calculations are based on time percentages, to allow unifying keyTimes handling & normal animation652 float lastKeyTimePercentage = 0;653 float nextKeyTimePercentage = 0;654 if (m_keyTimes.size() && (m_keyTimes.size() == m_values.size()))655 caculateValueIndexForKeyTimes(timePercentage, m_keyTimes, valueIndex, lastKeyTimePercentage, nextKeyTimePercentage);656 else {657 unsigned lastPossibleIndex = (m_values.size() ? m_values.size() - 1: 1);658 unsigned flooredValueIndex = static_cast<unsigned>(timePercentage * lastPossibleIndex);659 valueIndex = flooredValueIndex;660 lastKeyTimePercentage = flooredValueIndex / (float)lastPossibleIndex;661 nextKeyTimePercentage = (flooredValueIndex + 1) / (float)lastPossibleIndex;662 }663 664 // No further caculation is needed if we're exactly on an index.665 if (timePercentage == lastKeyTimePercentage || lastKeyTimePercentage == nextKeyTimePercentage) {666 percentagePast = 0.0f;667 return;668 }669 670 // otherwise we decide what percent after that index671 if ((m_calcMode == CALCMODE_SPLINE) && (m_keySplines.size() == (m_values.size() - 1)))672 adjustPercentagePastForKeySplines(m_keySplines, valueIndex, percentagePast);673 else if (m_calcMode == CALCMODE_DISCRETE)674 percentagePast = 0.0f;675 else { // default (and fallback) mode: linear676 float keyTimeSpan = nextKeyTimePercentage - lastKeyTimePercentage;677 float timeSinceLastKeyTime = timePercentage - lastKeyTimePercentage;678 percentagePast = (timeSinceLastKeyTime / keyTimeSpan);679 }680 }681 682 bool SVGAnimationElement::updateAnimationBaseValueFromElement()683 {684 m_baseValue = targetAttributeAnimatedValue();685 return true;686 }687 688 void SVGAnimationElement::applyAnimatedValueToElement()689 {690 setTargetAttributeAnimatedValue(m_animatedValue);691 }692 693 void SVGAnimationElement::handleTimerEvent(double elapsedSeconds, double timePercentage)694 {695 timePercentage = min(timePercentage, 1.0);696 if (!connectedToTimer()) {697 connectTimer();698 return;699 }700 701 // FIXME: accumulate="sum" will not work w/o code similar to this:702 // if (isAccumulated() && repeations() != 0.0)703 // accumulateForRepetitions(m_repetitions);704 705 EAnimationMode animationMode = detectAnimationMode();706 707 unsigned valueIndex = 0;708 float percentagePast = 0;709 calculateValueIndexAndPercentagePast(narrowPrecisionToFloat(timePercentage), valueIndex, percentagePast);710 711 calculateFromAndToValues(animationMode, valueIndex);712 713 updateAnimatedValue(animationMode, narrowPrecisionToFloat(timePercentage), valueIndex, percentagePast);714 715 if (timePercentage == 1.0) {716 if ((m_repeatCount > 0 && m_repetitions < m_repeatCount - 1) || isIndefinite(m_repeatCount)) {717 m_repetitions++;718 return;719 } else720 disconnectTimer();721 }722 }723 724 bool SVGAnimationElement::updateAnimatedValueForElapsedSeconds(double elapsedSeconds)725 {726 // FIXME: fill="freeze" will not work without saving off the m_stoppedTime in a stop() method and having code similar to this:727 // if (isStopped()) {728 // if (m_fill == FILL_FREEZE)729 // elapsedSeconds = m_stoppedTime;730 // else731 // return false;732 // }733 734 // Validate animation timing settings:735 // #1 (duration > 0) -> fine736 // #2 (duration <= 0.0 && end > 0) -> fine737 // FIXME: This allows indefinite duration for the <set> element, not sure if it should be allowed for others too.738 // FIXME: Value won't naturally animate in this case so keeping the timer repeating is sort of pointless.739 if ((m_simpleDuration <= 0.0 && m_end <= 0.0) || (isIndefinite(m_simpleDuration) && m_end <= 0.0 && !hasTagName(setTag)))740 return false; // Ignore dur="0" or dur="-neg"741 742 if (isIndefinite(m_animationBegin))743 m_animationBegin = m_begin;744 745 double percentage = calculateTimePercentage(elapsedSeconds, m_animationBegin, m_end, m_simpleDuration, m_repetitions);746 747 if (percentage <= 1.0 || connectedToTimer())748 handleTimerEvent(elapsedSeconds, percentage);749 750 if (elapsedSeconds > m_animationEnd) {751 if (connectedToTimer())752 disconnectTimer();753 m_animationEnd = DBL_MAX;754 }755 756 return true; // value was updated, need to apply757 }758 759 bool SVGAnimationElement::beginElement(ExceptionCode& ec)760 {761 // FIXME: Should this be synchronous?762 return beginElementAt(0, ec);763 }764 765 bool SVGAnimationElement::beginElementAt(float offset, ExceptionCode& ec)766 {767 // FIXME: Handle negative offsets correctly.768 // In general we need to make SMIL concepts like "active duration" explicit in the code769 if (offset < 0)770 offset = 0;771 772 if (connectedToTimer())773 return false;774 775 m_animationBegin = offset;776 if (ownerSVGElement()) {777 ownerSVGElement()->timeScheduler()->addTimer(this, offset);778 ownerSVGElement()->timeScheduler()->startAnimations();779 connectTimer();780 } else781 return false;782 783 return false;784 }785 786 158 bool SVGAnimationElement::endElement(ExceptionCode& ec) 787 159 { 788 // FIXME: Should this be synchronous?789 160 return endElementAt(0, ec); 790 161 } … … 794 165 if (offset < 0) 795 166 return false; 796 if (!connectedToTimer()) 167 168 addEndTime(elapsed() + offset); 169 return true; 170 } 171 172 SVGAnimationElement::AnimationMode SVGAnimationElement::animationMode() const 173 { 174 // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues 175 176 if (hasTagName(SVGNames::setTag)) 177 return ToAnimation; 178 if (hasAttribute(SVGNames::valuesAttr)) 179 return ValuesAnimation; 180 if (!toValue().isEmpty()) 181 return fromValue().isEmpty() ? ToAnimation : FromToAnimation; 182 if (!byValue().isEmpty()) 183 return fromValue().isEmpty() ? ByAnimation : FromByAnimation; 184 return NoAnimation; 185 } 186 187 SVGAnimationElement::CalcMode SVGAnimationElement::calcMode() const 188 { 189 static const AtomicString discrete("discrete"); 190 static const AtomicString linear("linear"); 191 static const AtomicString paced("paced"); 192 static const AtomicString spline("spline"); 193 const AtomicString& value = getAttribute(SVGNames::calcModeAttr); 194 if (value == discrete) 195 return CalcModeDiscrete; 196 if (value == linear) 197 return CalcModeLinear; 198 if (value == paced) 199 return CalcModePaced; 200 if (value == spline) 201 return CalcModeSpline; 202 return hasTagName(SVGNames::animateMotionTag) ? CalcModePaced : CalcModeLinear; 203 } 204 205 SVGAnimationElement::AttributeType SVGAnimationElement::attributeType() const 206 { 207 static const AtomicString css("CSS"); 208 static const AtomicString xml("XML"); 209 const AtomicString& value = getAttribute(SVGNames::attributeTypeAttr); 210 if (value == css) 211 return AttributeTypeCSS; 212 if (value == xml) 213 return AttributeTypeXML; 214 return AttributeTypeAuto; 215 } 216 217 String SVGAnimationElement::toValue() const 218 { 219 return getAttribute(SVGNames::toAttr); 220 } 221 222 String SVGAnimationElement::byValue() const 223 { 224 return getAttribute(SVGNames::byAttr); 225 } 226 227 String SVGAnimationElement::fromValue() const 228 { 229 return getAttribute(SVGNames::fromAttr); 230 } 231 232 String SVGAnimationElement::attributeName() const 233 { 234 return getAttribute(SVGNames::attributeNameAttr).string().stripWhiteSpace(); 235 } 236 237 bool SVGAnimationElement::isAdditive() const 238 { 239 static const AtomicString sum("sum"); 240 const AtomicString& value = getAttribute(SVGNames::additiveAttr); 241 return value == sum || animationMode() == ByAnimation; 242 } 243 244 bool SVGAnimationElement::isAccumulated() const 245 { 246 static const AtomicString sum("sum"); 247 const AtomicString& value = getAttribute(SVGNames::accumulateAttr); 248 return value == sum && animationMode() != ToAnimation; 249 } 250 251 bool SVGAnimationElement::hasValidTarget() const 252 { 253 return targetElement(); 254 } 255 256 bool SVGAnimationElement::targetAttributeIsCSS() const 257 { 258 AttributeType type = attributeType(); 259 if (type == AttributeTypeCSS) 260 return true; 261 if (type == AttributeTypeXML) 797 262 return false; 798 m_animationEnd = ownerSVGElement()->timeScheduler()->elapsed() + offset; 799 return true; 263 // FIXME: We should have a map of all SVG properties and their attribute types so we 264 // could validate animations better. The spec is very vague about this. 265 unsigned id = cssPropertyID(attributeName()); 266 // SVG range 267 if (id >= CSSPropertyClipPath && id <= CSSPropertyWritingMode) 268 return true; 269 // Regular CSS properties also in SVG 270 return id == CSSPropertyColor || id == CSSPropertyDisplay || id == CSSPropertyOpacity 271 || (id >= CSSPropertyFont && id <= CSSPropertyFontWeight) 272 || id == CSSPropertyOverflow || id == CSSPropertyVisibility; 273 } 274 275 void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value) 276 { 277 SVGElement* target = targetElement(); 278 String attributeName = this->attributeName(); 279 if (!target || attributeName.isEmpty() || value.isNull()) 280 return; 281 ExceptionCode ec; 282 if (targetAttributeIsCSS()) { 283 // FIXME: This should set the override style, not the inline style. 284 // Sadly override styles are not yet implemented. 285 target->style()->setProperty(attributeName, value, "", ec); 286 } else { 287 // FIXME: This should set the 'presentation' value, not the actual 288 // attribute value. Whatever that means in practice. 289 target->setAttribute(attributeName, value, ec); 290 } 291 } 292 293 String SVGAnimationElement::targetAttributeBaseValue() const 294 { 295 String attributeName = this->attributeName(); 296 if (!targetElement() || attributeName.isEmpty()) 297 return String(); 298 299 SVGElement* target = targetElement(); 300 String result; 301 302 if (targetAttributeIsCSS()) { 303 CSSComputedStyleDeclaration computedStyle(target); 304 return computedStyle.getPropertyValue(cssPropertyID(attributeName)); 305 } else 306 result = targetElement()->getAttribute(attributeName); 307 308 return result; 309 } 310 311 static inline double solveEpsilon(double duration) { return 1. / (200. * duration); } 312 313 void SVGAnimationElement::currentValuesForValuesAnimation(float percent, float& effectivePercent, String& from, String& to) 314 { 315 unsigned keyTimesCount = m_keyTimes.size(); 316 unsigned valuesCount = m_values.size(); 317 ASSERT(m_animationValid); 318 ASSERT(valuesCount > 1); 319 ASSERT(!keyTimesCount || valuesCount == keyTimesCount); 320 ASSERT(!keyTimesCount || (keyTimesCount > 1 && m_keyTimes[0] == 0)); 321 322 unsigned index; 323 for (index = 1; index < keyTimesCount; ++index) { 324 if (m_keyTimes[index] >= percent) 325 break; 326 } 327 --index; 328 329 if (calcMode() == CalcModeDiscrete) { 330 if (!keyTimesCount) 331 index = percent == 1.0f ? valuesCount - 1 : static_cast<unsigned>(percent * valuesCount); 332 from = m_values[index]; 333 to = m_values[index]; 334 effectivePercent = 0.0f; 335 return; 336 } 337 338 float fromPercent; 339 float toPercent; 340 if (keyTimesCount) { 341 fromPercent = m_keyTimes[index]; 342 toPercent = m_keyTimes[index + 1]; 343 } else { 344 index = static_cast<unsigned>(percent * (valuesCount - 1)); 345 fromPercent = static_cast<float>(index) / (valuesCount - 1); 346 toPercent = static_cast<float>(index + 1) / (valuesCount - 1); 347 } 348 349 if (index == valuesCount - 1) 350 --index; 351 from = m_values[index]; 352 to = m_values[index + 1]; 353 ASSERT(toPercent > fromPercent); 354 effectivePercent = percent == 1.0f ? 1.0f : (percent - fromPercent) / (toPercent - fromPercent); 355 356 if (calcMode() == CalcModeSpline) { 357 ASSERT(m_keySplines.size() == m_values.size() - 1); 358 UnitBezier bezier = m_keySplines[index]; 359 SMILTime duration = simpleDuration(); 360 if (!duration.isFinite()) 361 duration = 100.0; 362 double t = bezier.solve(effectivePercent, solveEpsilon(duration.value())); 363 effectivePercent = narrowPrecisionToFloat(t); 364 } 365 } 366 367 void SVGAnimationElement::startedActiveInterval() 368 { 369 m_animationValid = false; 370 371 if (!hasValidTarget()) 372 return; 373 374 // FIXME: This is not correct if there are multiple animations on the same target or if 375 // the timing attibutes change during animation due to DOM manipulation. 376 m_savedBaseValue = targetAttributeBaseValue(); 377 378 AnimationMode animationMode = this->animationMode(); 379 if (animationMode == NoAnimation) 380 return; 381 if (animationMode == FromToAnimation) 382 m_animationValid = calculateFromAndToValues(fromValue(), toValue()); 383 else if (animationMode == ToAnimation) 384 m_animationValid = calculateFromAndToValues(m_savedBaseValue, toValue()); 385 else if (animationMode == FromByAnimation) 386 m_animationValid = calculateFromAndByValues(fromValue(), byValue()); 387 else if (animationMode == ByAnimation) 388 m_animationValid = calculateFromAndByValues(String(), byValue()); 389 else if (animationMode == ValuesAnimation) { 390 CalcMode calcMode = this->calcMode(); 391 m_animationValid = m_values.size() > 1 392 && (calcMode == CalcModePaced || !hasAttribute(SVGNames::keyTimesAttr) || (m_values.size() == m_keyTimes.size())) 393 && (calcMode == CalcModeDiscrete || !m_keyTimes.size() || m_keyTimes.last() == 1.0) 394 && (calcMode != CalcModeSpline || (m_keySplines.size() && m_keySplines.size() == m_values.size() - 1)); 395 } 396 } 397 398 void SVGAnimationElement::applyAnimation(float percent, unsigned repeat) 399 { 400 if (!m_animationValid) 401 return; 402 403 if (animationMode() == ValuesAnimation) { 404 String from; 405 String to; 406 float effectivePercent; 407 currentValuesForValuesAnimation(percent, effectivePercent, from, to); 408 if (from != m_lastValuesAnimationFrom || to != m_lastValuesAnimationTo ) { 409 m_animationValid = calculateFromAndToValues(from, to); 410 if (!m_animationValid) 411 return; 412 m_lastValuesAnimationFrom = from; 413 m_lastValuesAnimationTo = to; 414 } 415 updateAnimatedValue(effectivePercent); 416 } else 417 updateAnimatedValue(percent); 418 419 applyAnimatedValueToElement(repeat); 420 } 421 422 void SVGAnimationElement::unapplyAnimation() 423 { 424 // FIXME: This is not correct if there are multiple animations on the same target or if 425 // the timing attibutes change during animation due to DOM manipulation. 426 if (m_savedBaseValue.isNull()) 427 return; 428 setTargetAttributeAnimatedValue(m_savedBaseValue); 429 m_savedBaseValue = String(); 430 } 431 432 void SVGAnimationElement::endedActiveInterval() 433 { 434 m_savedBaseValue = String(); 800 435 } 801 436 -
trunk/WebCore/svg/SVGAnimationElement.h
r31600 r31801 3 3 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 Copyright (C) 2007 Eric Seidel <eric@webkit.org> 5 Copyright (C) 2008 Apple Inc. All rights reserved. 5 6 6 7 This file is part of the KDE project … … 27 28 28 29 #include "ElementTimeControl.h" 30 #include "SMILTime.h" 31 #include "SVGSMILElement.h" 29 32 #include "SVGExternalResourcesRequired.h" 30 33 #include "SVGStringList.h" 31 34 #include "SVGTests.h" 35 #include "UnitBezier.h" 32 36 33 37 namespace WebCore { 38 39 class ConditionEventListener; 40 class TimeContainer; 34 41 35 enum EFillMode { 36 FILL_REMOVE = 0, 37 FILL_FREEZE 38 }; 39 40 enum EAdditiveMode { 41 ADDITIVE_REPLACE = 0, 42 ADDITIVE_SUM 43 }; 44 45 enum EAccumulateMode { 46 ACCUMULATE_NONE = 0, 47 ACCUMULATE_SUM 48 }; 49 50 enum ECalcMode { 51 CALCMODE_DISCRETE = 0, 52 CALCMODE_LINEAR, 53 CALCMODE_PACED, 54 CALCMODE_SPLINE 55 }; 56 57 enum ERestart { 58 RESTART_ALWAYS = 0, 59 RESTART_WHENNOTACTIVE, 60 RESTART_NEVER 61 }; 62 63 enum EAttributeType { 64 ATTRIBUTETYPE_CSS = 0, 65 ATTRIBUTETYPE_XML, 66 ATTRIBUTETYPE_AUTO 67 }; 68 69 // internal 70 enum EAnimationMode { 71 NO_ANIMATION = 0, 72 TO_ANIMATION, 73 BY_ANIMATION, 74 VALUES_ANIMATION, 75 FROM_TO_ANIMATION, 76 FROM_BY_ANIMATION 77 }; 78 79 class SVGAnimationElement : public SVGElement, 42 class SVGAnimationElement : public SVGSMILElement, 80 43 public SVGTests, 81 44 public SVGExternalResourcesRequired, … … 85 48 SVGAnimationElement(const QualifiedName&, Document*); 86 49 virtual ~SVGAnimationElement(); 50 51 virtual void parseMappedAttribute(MappedAttribute*); 52 virtual void attributeChanged(Attribute*, bool preserveDecls); 87 53 88 // 'SVGAnimationElement' functions 89 SVGElement* targetElement() const; 90 91 virtual bool hasValidTarget() const; 92 bool isValidAnimation() const; 93 94 virtual bool isValid() const { return SVGTests::isValid(); } 95 96 float getEndTime() const; 54 // SVGAnimationElement 97 55 float getStartTime() const; 98 56 float getCurrentTime() const; 99 57 float getSimpleDuration(ExceptionCode&) const; 100 101 virtual void parseMappedAttribute(MappedAttribute* attr);102 103 virtual void finishParsingChildren();104 105 virtual bool updateAnimationBaseValueFromElement();106 bool updateAnimatedValueForElapsedSeconds(double elapsedSeconds);107 virtual void applyAnimatedValueToElement();108 109 String attributeName() const;110 111 bool connectedToTimer() const;112 113 bool isFrozen() const;114 bool isAdditive() const;115 bool isAccumulated() const;116 117 double repeations() const;118 static bool isIndefinite(double value);119 58 120 59 // ElementTimeControl … … 123 62 virtual bool endElement(ExceptionCode&); 124 63 virtual bool endElementAt(float offset, ExceptionCode&); 64 65 protected: 125 66 67 enum CalcMode { CalcModeDiscrete, CalcModeLinear, CalcModePaced, CalcModeSpline }; 68 CalcMode calcMode() const; 69 70 enum AttributeType { AttributeTypeCSS, AttributeTypeXML, AttributeTypeAuto }; 71 AttributeType attributeType() const; 72 73 String toValue() const; 74 String byValue() const; 75 String fromValue() const; 76 String attributeName() const; 77 78 enum AnimationMode { NoAnimation, ToAnimation, ByAnimation, ValuesAnimation, FromToAnimation, FromByAnimation }; 79 AnimationMode animationMode() const; 126 80 127 protected: 128 mutable SVGElement* m_targetElement; 81 virtual bool hasValidTarget() const; 129 82 130 EAnimationMode detectAnimationMode() const; 83 String targetAttributeBaseValue() const; 84 void setTargetAttributeAnimatedValue(const String&); 85 bool targetAttributeIsCSS() const; 131 86 132 static double parseClockValue(const String&); 133 static void setTargetAttribute(SVGElement* target, const String& name, const String& value, EAttributeType = ATTRIBUTETYPE_AUTO); 87 bool isAdditive() const; 88 bool isAccumulated() const; 89 90 // from SVGSMILElement 91 virtual void startedActiveInterval(); 92 virtual void applyAnimation(float percent, unsigned repeat); 93 virtual void unapplyAnimation(); 94 virtual void endedActiveInterval(); 134 95 135 String targetAttributeAnimatedValue() const; 136 void setTargetAttributeAnimatedValue(const String&); 96 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired) 97 private: 98 virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0; 99 virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0; 100 virtual bool updateAnimatedValue(float percentage) = 0; 101 virtual void applyAnimatedValueToElement(unsigned repeat) = 0; 137 102 138 void connectTimer(); 139 void disconnectTimer(); 140 141 virtual float calculateTotalDistance(); 142 virtual void valueIndexAndPercentagePastForDistance(float distancePercentage, unsigned& valueIndex, float& percentagePast); 143 144 void calculateValueIndexAndPercentagePast(float timePercentage, unsigned& valueIndex, float& percentagePast); 145 146 void handleTimerEvent(double elapsedSeconds, double timePercentage); 147 148 virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast) = 0; 149 virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex) = 0; 150 151 static void parseKeyNumbers(Vector<float>& keyNumbers, const String& value); 152 static void parseBeginOrEndValue(double& number, const String& value); 153 154 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired) 155 156 bool m_connectedToTimer : 1; 157 158 double m_currentTime; 159 double m_simpleDuration; 160 161 // Shared animation properties 162 unsigned m_fill : 1; // EFillMode m_fill 163 unsigned m_restart : 2; // ERestart 164 unsigned m_calcMode : 2; // ECalcMode 165 unsigned m_additive : 1; // EAdditiveMode 166 unsigned m_accumulate : 1; // EAccumulateMode 167 unsigned m_attributeType : 2; // EAttributeType 168 169 String m_to; 170 String m_by; 171 String m_from; 172 String m_href; 173 String m_repeatDur; 174 String m_attributeName; 175 176 String m_baseValue; 177 String m_animatedValue; 178 179 double m_max; 180 double m_min; 181 double m_end; 182 double m_begin; 183 184 double m_repetitions; 185 double m_repeatCount; 103 void currentValuesForValuesAnimation(float percent, float& effectivePercent, String& from, String& to); 104 105 protected: 106 String m_savedBaseValue; 107 bool m_animationValid; 186 108 187 109 Vector<String> m_values; 188 110 Vector<float> m_keyTimes; 189 190 struct KeySpline { 191 FloatPoint control1; 192 FloatPoint control2; 193 }; 194 195 double m_animationBegin; 196 double m_animationEnd; 197 198 Vector<KeySpline> m_keySplines; 111 Vector<UnitBezier> m_keySplines; 112 String m_lastValuesAnimationFrom; 113 String m_lastValuesAnimationTo; 199 114 }; 200 115 … … 203 118 #endif // ENABLE(SVG) 204 119 #endif // SVGAnimationElement_h 205 206 // vim:ts=4:noet -
trunk/WebCore/svg/SVGDocumentExtensions.cpp
r30325 r31801 35 35 #include "Page.h" 36 36 #include "SVGSVGElement.h" 37 #include " TimeScheduler.h"37 #include "SMILTimeContainer.h" 38 38 #include "XMLTokenizer.h" 39 39 #include "kjs_proxy.h" … … 77 77 HashSet<SVGSVGElement*>::iterator end = m_timeContainers.end(); 78 78 for (HashSet<SVGSVGElement*>::iterator itr = m_timeContainers.begin(); itr != end; ++itr) 79 (*itr)->time Scheduler()->startAnimations();79 (*itr)->timeContainer()->begin(); 80 80 #endif 81 81 } -
trunk/WebCore/svg/SVGElement.cpp
r31600 r31801 88 88 SVGSVGElement* SVGElement::ownerSVGElement() const 89 89 { 90 Node* n = parentNode();90 Node* n = isShadowNode() ? const_cast<SVGElement*>(this)->shadowParentNode() : parentNode(); 91 91 while (n) { 92 92 if (n->hasTagName(SVGNames::svgTag)) 93 93 return static_cast<SVGSVGElement*>(n); 94 94 95 n = n-> parentNode();95 n = n->isShadowNode() ? n->shadowParentNode() : n->parentNode(); 96 96 } 97 97 -
trunk/WebCore/svg/SVGSVGElement.cpp
r31600 r31801 49 49 #include "SVGZoomEvent.h" 50 50 #include "SelectionController.h" 51 #include " TimeScheduler.h"51 #include "SMILTimeContainer.h" 52 52 53 53 namespace WebCore { … … 69 69 , m_height(this, LengthModeHeight) 70 70 , m_useCurrentView(false) 71 , m_time Scheduler(new TimeScheduler(doc))71 , m_timeContainer(new SMILTimeContainer) 72 72 , m_viewSpec(0) 73 73 , m_containerSize(300, 150) … … 76 76 setWidthBaseValue(SVGLength(this, LengthModeWidth, "100%")); 77 77 setHeightBaseValue(SVGLength(this, LengthModeHeight, "100%")); 78 doc->registerForCacheCallbacks(this); 78 79 } 79 80 80 81 SVGSVGElement::~SVGSVGElement() 81 82 { 82 delete m_timeScheduler; 83 m_timeScheduler = 0; 84 83 document()->unregisterForCacheCallbacks(this); 85 84 // There are cases where removedFromDocument() is not called. 86 85 // see ContainerNode::removeAllChildren, called by it's destructor. … … 455 454 void SVGSVGElement::pauseAnimations() 456 455 { 457 if (!m_time Scheduler->animationsPaused())458 m_time Scheduler->toggleAnimations();456 if (!m_timeContainer->isPaused()) 457 m_timeContainer->pause(); 459 458 } 460 459 461 460 void SVGSVGElement::unpauseAnimations() 462 461 { 463 if (m_time Scheduler->animationsPaused())464 m_time Scheduler->toggleAnimations();462 if (m_timeContainer->isPaused()) 463 m_timeContainer->resume(); 465 464 } 466 465 467 466 bool SVGSVGElement::animationsPaused() const 468 467 { 469 return m_time Scheduler->animationsPaused();468 return m_timeContainer->isPaused(); 470 469 } 471 470 472 471 float SVGSVGElement::getCurrentTime() const 473 472 { 474 return narrowPrecisionToFloat(m_time Scheduler->elapsed());473 return narrowPrecisionToFloat(m_timeContainer->elapsed().value()); 475 474 } 476 475 … … 531 530 renderer()->setNeedsLayout(true); 532 531 } 532 533 void SVGSVGElement::willSaveToCache() 534 { 535 pauseAnimations(); 536 } 537 538 void SVGSVGElement::willRestoreFromCache() 539 { 540 unpauseAnimations(); 541 } 533 542 534 543 } -
trunk/WebCore/svg/SVGSVGElement.h
r31600 r31801 41 41 class SVGViewSpec; 42 42 class SVGViewElement; 43 class TimeScheduler;43 class SMILTimeContainer; 44 44 class SVGSVGElement : public SVGStyledLocatableElement, 45 45 public SVGTests, … … 88 88 void setCurrentTranslate(const FloatPoint&); 89 89 90 TimeScheduler* timeScheduler() { return m_timeScheduler; }90 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } 91 91 92 92 void pauseAnimations(); … … 156 156 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Width, width) 157 157 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Height, height) 158 159 virtual void willSaveToCache(); 160 virtual void willRestoreFromCache(); 158 161 159 162 bool m_useCurrentView; 160 TimeScheduler* m_timeScheduler;163 RefPtr<SMILTimeContainer> m_timeContainer; 161 164 FloatPoint m_translation; 162 165 mutable OwnPtr<SVGViewSpec> m_viewSpec; -
trunk/WebCore/svg/SVGSetElement.cpp
r25754 r31801 24 24 #if ENABLE(SVG) 25 25 #include "SVGSetElement.h" 26 #include "TimeScheduler.h"27 26 #include "Document.h" 28 27 #include "SVGDocumentExtensions.h" … … 30 29 31 30 namespace WebCore { 31 32 // FIXME: This class needs to die. SVGAnimateElement should be instantiated instead. 32 33 33 34 SVGSetElement::SVGSetElement(const QualifiedName& tagName, Document *doc) … … 40 41 } 41 42 42 bool SVGSetElement::updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast)43 void SVGSetElement::applyAnimatedValueToElement(unsigned repeat) 43 44 { 44 m_animatedValue = m_to; 45 return true; 45 setTargetAttributeAnimatedValue(toValue()); 46 } 47 48 bool SVGSetElement::calculateFromAndToValues(const String&, const String& toString) 49 { 50 m_animatedValue = toString; 51 return true; 46 52 } 47 53 48 bool SVGSetElement::calculateFromAndToValues(EAnimationMode, unsigned valueIndex) 54 bool SVGSetElement::calculateFromAndByValues(const String& fromString, const String& byString) 55 { 56 return false; 57 } 58 59 bool SVGSetElement::updateAnimatedValue(float percentage) 49 60 { 50 61 return true; -
trunk/WebCore/svg/SVGSetElement.h
r31600 r31801 38 38 virtual const SVGElement* contextElement() const { return this; } 39 39 40 virtual bool updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast); 41 virtual bool calculateFromAndToValues(EAnimationMode, unsigned valueIndex); 40 virtual bool calculateFromAndToValues(const String& fromString, const String& toString); 41 virtual bool calculateFromAndByValues(const String& fromString, const String& byString); 42 virtual bool updateAnimatedValue(float percentage); 43 virtual void applyAnimatedValueToElement(unsigned repeat); 42 44 43 45 private: 44 String m_ savedTo;46 String m_animatedValue; 45 47 }; 46 48 -
trunk/WebCore/svg/SVGUseElement.cpp
r31600 r31801 120 120 void SVGUseElement::removedFromDocument() 121 121 { 122 SVGElement::removedFromDocument();123 124 122 m_targetElementInstance = 0; 125 123 m_shadowTreeRootElement = 0; 124 SVGElement::removedFromDocument(); 126 125 } 127 126
Note:
See TracChangeset
for help on using the changeset viewer.