Changeset 31801 in webkit


Ignore:
Timestamp:
Apr 10, 2008, 11:37:30 PM (17 years ago)
Author:
Antti Koivisto
Message:

2008-04-10 Antti Koivisto <Antti Koivisto>

Reviewed by Eric.

Redo the SVG animation support.


It does

  • Full SMIL interval timing model including syncbase and event base timing (the hard part).
  • CSS and XML attribute animation.
  • Linear, discrete and spline calcModes.
  • Values animation with keyTimes and keySplines.
  • Link activated animations.
  • Pretty good support for <animate> and <set> animations
  • Basic support for <animateColor>, <animateMotion> and <animateTransform>.

This passes some 35 of the 56 tests in W3C SVG animation test suite, a bunch more
with some subtest failures.

What is still missing

  • Additive animation with multiple animations operating on the same property. This is a major architectural feature in animation code. It shouldn't be too hard to add.
  • Only <animate> implements accumulate.
  • <animateMotion> does not do paths, keypoints, rotate.
  • <animateTransform> does not work correctly in all cases
  • calcMode paced is missing.
  • repeat, beginEvent, endEvent are missing.
  • accesskey() is missing.
  • JS does not see correct values for baseVal/animVal, changing values that are being animted for a script produces wrong results. This problem needs to be solved outside the animation code.
  • Some other stuff I forgot or do not know about.
  • GNUmakefile.am:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp:
  • history/CachedPage.cpp: (WebCore::CachedPage::CachedPage):


Use cache notification mechanism to start/stop animations.

  • svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler):


Start target animation on link activation.


  • svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::applyAnimatedValueToElement): (WebCore::SVGAnimateColorElement::updateAnimatedValue): (WebCore::SVGAnimateColorElement::calculateFromAndToValues): (WebCore::SVGAnimateColorElement::calculateFromAndByValues):
  • svg/SVGAnimateColorElement.h:
  • svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::parseNumberValueAndUnit): (WebCore::SVGAnimateElement::applyAnimatedValueToElement): (WebCore::SVGAnimateElement::updateAnimatedValue): (WebCore::isColorAttribute): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues):
  • svg/SVGAnimateElement.h: (WebCore::SVGAnimateElement::):
  • svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): (WebCore::SVGAnimateMotionElement::parseMappedAttribute): (WebCore::SVGAnimateMotionElement::updateAnimatedValue): (WebCore::parsePoint): (WebCore::SVGAnimateMotionElement::calculateFromAndToValues): (WebCore::SVGAnimateMotionElement::calculateFromAndByValues): (WebCore::SVGAnimateMotionElement::applyAnimatedValueToElement): (WebCore::SVGAnimateMotionElement::startedActiveInterval):
  • svg/SVGAnimateMotionElement.h:
  • svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::hasValidTarget): (WebCore::SVGAnimateTransformElement::updateAnimatedValue): (WebCore::transformListFor): (WebCore::SVGAnimateTransformElement::applyAnimatedValueToElement): (WebCore::SVGAnimateTransformElement::calculateFromAndToValues): (WebCore::SVGAnimateTransformElement::calculateFromAndByValues): (WebCore::SVGAnimateTransformElement::startedActiveInterval): (WebCore::SVGAnimateTransformElement::parseTransformValue):
  • svg/SVGAnimateTransformElement.h:


Concrete anmation element classes.


  • svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::SVGAnimationElement): (WebCore::SVGAnimationElement::~SVGAnimationElement): (WebCore::parseKeyTimes): (WebCore::parseKeySplines): (WebCore::SVGAnimationElement::parseMappedAttribute): (WebCore::SVGAnimationElement::attributeChanged): (WebCore::SVGAnimationElement::getStartTime): (WebCore::SVGAnimationElement::getCurrentTime): (WebCore::SVGAnimationElement::getSimpleDuration): (WebCore::SVGAnimationElement::beginElement): (WebCore::SVGAnimationElement::beginElementAt): (WebCore::SVGAnimationElement::endElement): (WebCore::SVGAnimationElement::endElementAt): (WebCore::SVGAnimationElement::animationMode): (WebCore::SVGAnimationElement::calcMode): (WebCore::SVGAnimationElement::attributeType): (WebCore::SVGAnimationElement::toValue): (WebCore::SVGAnimationElement::byValue): (WebCore::SVGAnimationElement::fromValue): (WebCore::SVGAnimationElement::attributeName): (WebCore::SVGAnimationElement::isAdditive): (WebCore::SVGAnimationElement::isAccumulated): (WebCore::SVGAnimationElement::hasValidTarget): (WebCore::SVGAnimationElement::targetAttributeIsCSS): (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue): (WebCore::SVGAnimationElement::targetAttributeBaseValue): (WebCore::solveEpsilon): (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): (WebCore::SVGAnimationElement::startedActiveInterval): (WebCore::SVGAnimationElement::applyAnimation): (WebCore::SVGAnimationElement::unapplyAnimation): (WebCore::SVGAnimationElement::endedActiveInterval):
  • svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::):


This is pretty much a complete rewrite of the SVGAnimationElement. Timing related functionality
was refactored to SMILTimingElement class that this class now inherits.


  • svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::startAnimations):
  • svg/SVGElement.cpp: (WebCore::SVGElement::ownerSVGElement):
  • svg/SVGSVGElement.cpp:


We need to reach the <svg> element from <use> too so go out from the shadow tree.


(WebCore::SVGSVGElement::SVGSVGElement):
(WebCore::SVGSVGElement::~SVGSVGElement):
(WebCore::SVGSVGElement::pauseAnimations):
(WebCore::SVGSVGElement::unpauseAnimations):
(WebCore::SVGSVGElement::animationsPaused):
(WebCore::SVGSVGElement::getCurrentTime):
(WebCore::SVGSVGElement::willSaveToCache):
(WebCore::SVGSVGElement::willRestoreFromCache):

  • svg/SVGSVGElement.h: (WebCore::SVGSVGElement::timeContainer):
  • svg/SVGSetElement.cpp: (WebCore::SVGSetElement::applyAnimatedValueToElement): (WebCore::SVGSetElement::calculateFromAndToValues): (WebCore::SVGSetElement::calculateFromAndByValues): (WebCore::SVGSetElement::updateAnimatedValue):
  • svg/SVGSetElement.h:


Concrete anmation element classes.


  • svg/SVGTimer.cpp: Removed.
  • svg/SVGTimer.h: Removed.
  • svg/SVGUseElement.cpp: (WebCore::SVGUseElement::removedFromDocument):
  • svg/TimeScheduler.cpp: Removed.
  • svg/TimeScheduler.h: Removed.


Replaced these with SMILTimeContainer class.


  • svg/animation: Added.
  • svg/animation/SMILTime.cpp: Added. (WebCore::operator+): (WebCore::operator-): (WebCore::operator*):
  • svg/animation/SMILTime.h: Added. (WebCore::SMILTime::SMILTime): (WebCore::SMILTime::unresolved): (WebCore::SMILTime::indefinite): (WebCore::SMILTime::operator=): (WebCore::SMILTime::value): (WebCore::SMILTime::isFinite): (WebCore::SMILTime::isIndefinite): (WebCore::SMILTime::isUnresolved): (WebCore::operator==): (WebCore::operator!=): (WebCore::operator>): (WebCore::operator<): (WebCore::operator>=): (WebCore::operator<=): (WebCore::max): (WebCore::min):


A floating point number with special values "indefinite" and "unresolved". Defines math for those.


  • svg/animation/SMILTimeContainer.cpp: Added. (WebCore::SMILTimeContainer::SMILTimeContainer): (WebCore::SMILTimeContainer::schedule): (WebCore::SMILTimeContainer::unschedule): (WebCore::SMILTimeContainer::elapsed): (WebCore::SMILTimeContainer::isActive): (WebCore::SMILTimeContainer::isPaused): (WebCore::SMILTimeContainer::begin): (WebCore::SMILTimeContainer::pause): (WebCore::SMILTimeContainer::resume): (WebCore::SMILTimeContainer::startTimer): (WebCore::SMILTimeContainer::timerFired): (WebCore::SMILTimeContainer::updateAnimations):
  • svg/animation/SMILTimeContainer.h: Added.


Manages the clock and time line for active animations in a document.


  • svg/animation/SVGSMILElement.cpp: Added. (WebCore::ConditionEventListener::ConditionEventListener): (WebCore::ConditionEventListener::handleEvent): (WebCore::SVGSMILElement::Condition::Condition): (WebCore::SVGSMILElement::SVGSMILElement): (WebCore::SVGSMILElement::~SVGSMILElement): (WebCore::SVGSMILElement::insertedIntoDocument): (WebCore::SVGSMILElement::removedFromDocument): (WebCore::SVGSMILElement::finishParsingChildren): (WebCore::SVGSMILElement::parseOffsetValue): (WebCore::SVGSMILElement::parseClockValue): (WebCore::smilTimeSortFunction): (WebCore::sortTimeList): (WebCore::SVGSMILElement::parseCondition): (WebCore::SVGSMILElement::isTimingElement): (WebCore::SVGSMILElement::parseBeginOrEnd): (WebCore::SVGSMILElement::parseMappedAttribute): (WebCore::SVGSMILElement::attributeChanged): (WebCore::SVGSMILElement::connectConditions): (WebCore::SVGSMILElement::disconnectConditions): (WebCore::SVGSMILElement::reschedule): (WebCore::SVGSMILElement::targetElement): (WebCore::SVGSMILElement::elapsed): (WebCore::SVGSMILElement::restart): (WebCore::SVGSMILElement::fill): (WebCore::SVGSMILElement::xlinkHref): (WebCore::SVGSMILElement::dur): (WebCore::SVGSMILElement::repeatDur): (WebCore::SVGSMILElement::repeatCount): (WebCore::SVGSMILElement::maxValue): (WebCore::SVGSMILElement::minValue): (WebCore::SVGSMILElement::simpleDuration): (WebCore::SVGSMILElement::addBeginTime): (WebCore::SVGSMILElement::addEndTime): (WebCore::SVGSMILElement::findInstanceTime): (WebCore::SVGSMILElement::repeatingDuration): (WebCore::SVGSMILElement::resolveActiveEnd): (WebCore::SVGSMILElement::resolveInterval): (WebCore::SVGSMILElement::resolveFirstInterval): (WebCore::SVGSMILElement::resolveNextInterval): (WebCore::SVGSMILElement::nextProgressTime): (WebCore::SVGSMILElement::beginListChanged): (WebCore::SVGSMILElement::endListChanged): (WebCore::SVGSMILElement::checkRestart): (WebCore::SVGSMILElement::calculateAnimationPercentAndRepeat): (WebCore::SVGSMILElement::calculateNextProgressTime): (WebCore::SVGSMILElement::determineActiveState): (WebCore::SVGSMILElement::progress): (WebCore::SVGSMILElement::notifyDependentsIntervalChanged): (WebCore::SVGSMILElement::createInstanceTimesFromSyncbase): (WebCore::SVGSMILElement::addTimeDependent): (WebCore::SVGSMILElement::removeTimeDependent): (WebCore::SVGSMILElement::handleConditionEvent): (WebCore::SVGSMILElement::beginByLinkActivation):
  • svg/animation/SVGSMILElement.h: Added. (WebCore::SVGSMILElement::timeContainer): (WebCore::SVGSMILElement::): (WebCore::SVGSMILElement::intervalBegin): (WebCore::SVGSMILElement::intervalEnd): (WebCore::SVGSMILElement::Condition::):


This abstract class implements the SMIL timing model. As an output it produces calls
to these virtual functions:


virtual void startedActiveInterval() = 0;
virtual void applyAnimation(float percent, unsigned repeat) = 0;
virtual void unapplyAnimation() = 0;
virtual void endedActiveInterval() = 0;

Location:
trunk/WebCore
Files:
7 added
4 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31797 r31801  
     12008-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
    12742008-04-10  Antti Koivisto  <antti@apple.com>
    2275
  • trunk/WebCore/GNUmakefile.am

    r31793 r31801  
    17691769        -DENABLE_SVG=1 \
    17701770        -I\$(top_srcdir)/WebCore/svg \
     1771        -I\$(top_srcdir)/WebCore/svg/animation
    17711772        -I\$(top_srcdir)/WebCore/svg/graphics \
    17721773        -I\$(top_srcdir)/WebCore/svg/graphics/filters
     
    17901791        WebCore/svg/SVGDocumentExtensions.cpp \
    17911792        WebCore/svg/SVGImageLoader.cpp \
    1792         WebCore/svg/SVGTimer.cpp \
    1793         WebCore/svg/TimeScheduler.cpp \
    17941793        WebCore/svg/ColorDistance.cpp \
    17951794        WebCore/svg/SVGAElement.cpp \
     
    19201919        WebCore/svg/SVGViewSpec.cpp \
    19211920        WebCore/svg/SVGZoomAndPan.cpp \
     1921        WebCore/svg/animation/SMILTime.cpp \
     1922        WebCore/svg/animation/SMILTimeContainer.cpp \
     1923        WebCore/svg/animation/SVGSMILElement.cpp \
    19221924        WebCore/svg/graphics/filters/SVGFEBlend.cpp \
    19231925        WebCore/svg/graphics/filters/SVGFEColorMatrix.cpp \
  • trunk/WebCore/WebCore.pro

    r31793 r31801  
    196196                $$PWD/platform/network \
    197197                $$PWD/platform/graphics \
     198                $$PWD/svg/animation \
    198199                $$PWD/svg/graphics \
    199200                $$PWD/svg/graphics/filters \
     
    14811482        svg/SVGDocumentExtensions.cpp \
    14821483        svg/SVGImageLoader.cpp \
    1483         svg/SVGTimer.cpp \
    1484         svg/TimeScheduler.cpp \
    14851484        svg/ColorDistance.cpp \
    14861485        svg/SVGAElement.cpp \
     
    16101609        svg/SVGViewSpec.cpp \
    16111610        svg/SVGZoomAndPan.cpp \
     1611        WebCore/svg/animation/SMILTime.cpp \
     1612        WebCore/svg/animation/SMILTimeContainer.cpp \
     1613        WebCore/svg/animation/SVGSMILElement.cpp \
    16121614        svg/graphics/filters/SVGFEBlend.cpp \
    16131615        svg/graphics/filters/SVGFEColorMatrix.cpp \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r31797 r31801  
    4141                        <Tool
    4242                                Name="VCCLCompilerTool"
    43                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;"
     43                                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;;&quot;$(ProjectDir)..\svg\animation&quot;"
    4444                                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"
    4545                                UsePrecompiledHeader="2"
     
    103103                        <Tool
    104104                                Name="VCCLCompilerTool"
    105                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;"
     105                                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;;&quot;$(ProjectDir)..\svg\animation&quot;"
    106106                                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"
    107107                                UsePrecompiledHeader="2"
     
    164164                        <Tool
    165165                                Name="VCCLCompilerTool"
    166                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;"
     166                                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;;&quot;$(ProjectDir)..\svg\animation&quot;"
    167167                                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"
    168168                                UsePrecompiledHeader="2"
     
    226226                        <Tool
    227227                                Name="VCCLCompilerTool"
    228                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\curl&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cairo&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;"
     228                                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\curl&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cairo&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;;&quot;$(ProjectDir)..\svg\animation&quot;"
    229229                                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"
    230230                                UsePrecompiledHeader="2"
     
    289289                        <Tool
    290290                                Name="VCCLCompilerTool"
    291                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\curl&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\caro&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;"
     291                                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\curl&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\caro&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;;&quot;$(ProjectDir)..\svg\animation&quot;"
    292292                                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"
    293293                                UsePrecompiledHeader="2"
     
    352352                                Name="VCCLCompilerTool"
    353353                                WholeProgramOptimization="false"
    354                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;"
     354                                AdditionalIncludeDirectories="&quot;$(ProjectDir)..\&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editing&quot;;&quot;$(ProjectDir)..\rendering&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir)..\html&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\loader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\icon&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\platform&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(ProjectDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&quot;;&quot;$(ProjectDir)..\platform\network\cf&quot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\graphics\cg&quot;;&quot;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\platform\cairo\pixman\src&quot;;&quot;$(ProjectDir)..\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\graphics\cg&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\kcanvas&quot;;&quot;$(ProjectDir)..\kcanvas\device&quot;;&quot;$(ProjectDir)..\kcanvas\device\quartz&quot;;&quot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\JavaScriptCore&quot;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\iconv&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitOutputDir)\include\QtMovieWin&quot;;&quot;$(ProjectDir)..\svg\animation&quot;"
    355355                                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"
    356356                                PrecompiledHeaderThrough="WebCorePrefix.h"
     
    1457514575                        </File>
    1457614576                        <File
    14577                                 RelativePath="..\svg\SVGTimer.cpp"
    14578                                 >
    14579                         </File>
    14580                         <File
    14581                                 RelativePath="..\svg\SVGTimer.h"
    14582                                 >
    14583                         </File>
    14584                         <File
    1458514577                                RelativePath="..\svg\SVGTitleElement.cpp"
    1458614578                                >
     
    1469014682                                >
    1469114683                        </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>
    1470014712                        <Filter
    1470114713                                Name="graphics"
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r31797 r31801  
    31593159                B28C6A290D00C44800334AA4 /* SVGImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28C6A200D00C44800334AA4 /* SVGImageLoader.cpp */; };
    31603160                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 */; };
    31653161                B297BC700B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */; };
    31663162                B2A015A80AF6CD53006BCE0E /* GraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015920AF6CD53006BCE0E /* GraphicsContext.cpp */; };
     
    39023898                E49626C30D80D94900E3405C /* PreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D4ABE10D7542F100F96869 /* PreloadScanner.h */; };
    39033899                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 */; };
    39043906                E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C279560CF9741900E97B98 /* RenderMedia.cpp */; };
    39053907                E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C279570CF9741900E97B98 /* RenderMedia.h */; };
     
    73857387                B28C6A200D00C44800334AA4 /* SVGImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImageLoader.cpp; sourceTree = "<group>"; };
    73867388                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>"; };
    73917389                B28C6A260D00C44800334AA4 /* xlinkattrs.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = xlinkattrs.in; sourceTree = "<group>"; };
    73927390                B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPathSegListCustom.cpp; sourceTree = "<group>"; };
     
    81458143                E44614130CD6826900FADA75 /* JSTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTimeRanges.h; sourceTree = "<group>"; };
    81468144                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>"; };
    81478151                E4B41E010CBF8EAA00AF2ECE /* ProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressEvent.cpp; sourceTree = "<group>"; };
    81488152                E4B41E020CBF8EAA00AF2ECE /* ProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgressEvent.h; sourceTree = "<group>"; };
     
    1104811052                        isa = PBXGroup;
    1104911053                        children = (
     11054                                E46E97860DAAD61B0071E894 /* animation */,
    1105011055                                B25598860D00D8B800BB825C /* graphics */,
    1105111056                                B22277CB0D00BF1F0071B782 /* ColorDistance.cpp */,
     
    1143111436                                B222793B0D00BF210071B782 /* SVGTextPositioningElement.h */,
    1143211437                                B222793C0D00BF210071B782 /* SVGTextPositioningElement.idl */,
    11433                                 B28C6A220D00C44800334AA4 /* SVGTimer.cpp */,
    11434                                 B28C6A230D00C44800334AA4 /* SVGTimer.h */,
    1143511438                                B222793D0D00BF210071B782 /* SVGTitleElement.cpp */,
    1143611439                                B222793E0D00BF210071B782 /* SVGTitleElement.h */,
     
    1147311476                                B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */,
    1147411477                                B2E4EC960D00C22B00432643 /* SVGZoomEvent.idl */,
    11475                                 B28C6A240D00C44800334AA4 /* TimeScheduler.cpp */,
    11476                                 B28C6A250D00C44800334AA4 /* TimeScheduler.h */,
    1147711478                                B28C6A260D00C44800334AA4 /* xlinkattrs.in */,
    1147811479                        );
     
    1230612307                        tabWidth = 4;
    1230712308                        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>";
    1230812322                };
    1230912323                ED501DC90B249F3900AE18D9 /* mac */ = {
     
    1447314487                                B2227ACE0D00BF220071B782 /* SVGTextPathElement.h in Headers */,
    1447414488                                B2227AD10D00BF220071B782 /* SVGTextPositioningElement.h in Headers */,
    14475                                 B28C6A2C0D00C44800334AA4 /* SVGTimer.h in Headers */,
    1447614489                                B2227AD40D00BF220071B782 /* SVGTitleElement.h in Headers */,
    1447714490                                B2227AD70D00BF220071B782 /* SVGTransform.h in Headers */,
     
    1454614559                                51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */,
    1454714560                                E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
    14548                                 B28C6A2E0D00C44800334AA4 /* TimeScheduler.h in Headers */,
    1454914561                                9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
    1455014562                                BCCFBAE80B5152ED0001F1D7 /* Tokenizer.h in Headers */,
     
    1475914771                                51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */,
    1476014772                                E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */,
     14773                                E4AFD00C0DAF335400F5F55C /* SMILTime.h in Headers */,
     14774                                E4AFD00E0DAF335500F5F55C /* SMILTimeContainer.h in Headers */,
     14775                                E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */,
    1476114776                        );
    1476214777                        runOnlyForDeploymentPostprocessing = 0;
     
    1617416189                                B2227ACD0D00BF220071B782 /* SVGTextPathElement.cpp in Sources */,
    1617516190                                B2227AD00D00BF220071B782 /* SVGTextPositioningElement.cpp in Sources */,
    16176                                 B28C6A2B0D00C44800334AA4 /* SVGTimer.cpp in Sources */,
    1617716191                                B2227AD30D00BF220071B782 /* SVGTitleElement.cpp in Sources */,
    1617816192                                B2227AD60D00BF220071B782 /* SVGTransform.cpp in Sources */,
     
    1624416258                                51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
    1624516259                                E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */,
    16246                                 B28C6A2D0D00C44800334AA4 /* TimeScheduler.cpp in Sources */,
    1624716260                                93309EA4099EB78C0056E581 /* Timer.cpp in Sources */,
    1624816261                                854FE7360A2297BE0058D7AD /* Traversal.cpp in Sources */,
     
    1644216455                                51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */,
    1644316456                                51BE37DF0DAEE00E001085FC /* StorageArea.cpp in Sources */,
     16457                                E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */,
     16458                                E4AFD00D0DAF335500F5F55C /* SMILTimeContainer.cpp in Sources */,
     16459                                E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */,
    1644416460                        );
    1644516461                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/dom/Document.cpp

    r31746 r31801  
    139139#include "SVGZoomEvent.h"
    140140#include "SVGStyleElement.h"
    141 #include "TimeScheduler.h"
    142141#endif
    143142
  • trunk/WebCore/history/CachedPage.cpp

    r31341 r31801  
    108108
    109109    m_document->setInPageCache(true);
    110 
    111 #if ENABLE(SVG)
    112     if (m_document && m_document->svgExtensions())
    113         m_document->accessSVGExtensions()->pauseAnimations();
    114 #endif
    115110}
    116111
  • trunk/WebCore/svg/SVGAElement.cpp

    r30021 r31801  
    4040#include "RenderSVGInline.h"
    4141#include "ResourceRequest.h"
     42#include "SVGSMILElement.h"
    4243#include "SVGNames.h"
    4344#include "XLinkNames.h"
     
    139140            target = (getAttribute(XLinkNames::showAttr) == "new") ? "_blank" : "_self";
    140141
    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            }
    143154            if (document()->frame())
    144155                document()->frame()->loader()->urlSelected(document()->completeURL(url), target, evt, false, true);
     156        }
    145157
    146158        evt->setDefaultHandled();
  • trunk/WebCore/svg/SVGAnimateColorElement.cpp

    r25754 r31801  
    2727
    2828#include "Document.h"
    29 #include "TimeScheduler.h"
    3029#include "PlatformString.h"
    3130#include "SVGColor.h"
     
    3534
    3635namespace WebCore {
     36   
     37// FIXME: This class needs to die. SVGAnimateElement (which has superset of the functionality) should be instantiated instead.
    3738
    3839SVGAnimateColorElement::SVGAnimateColorElement(const QualifiedName& tagName, Document* doc)
     
    4546}
    4647
    47 bool SVGAnimateColorElement::updateAnimationBaseValueFromElement()
     48void SVGAnimateColorElement::applyAnimatedValueToElement(unsigned repeat)
    4849{
    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
     57bool 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   
     64bool SVGAnimateColorElement::calculateFromAndToValues(const String& fromString, const String& toString)
     65{
     66    m_fromColor = SVGColor::colorFromRGBColorString(fromString);
     67    m_toColor = SVGColor::colorFromRGBColorString(toString);
    5268    return true;
    5369}
    5470
    55 void SVGAnimateColorElement::applyAnimatedValueToElement()
     71bool SVGAnimateColorElement::calculateFromAndByValues(const String& fromString, const String& byString)
    5672{
    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));
    9875    return true;
    9976}
  • trunk/WebCore/svg/SVGAnimateColorElement.h

    r31600 r31801  
    3838        SVGAnimateColorElement(const QualifiedName&, Document*);
    3939        virtual ~SVGAnimateColorElement();
    40        
    41         virtual bool updateAnimationBaseValueFromElement();
    42         virtual void applyAnimatedValueToElement();
    4340
    4441    protected:
    4542        virtual const SVGElement* contextElement() const { return this; }
    4643       
    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);
    4948
    5049    private:
    5150        Color m_baseColor;
    5251        Color m_animatedColor;
    53 
    5452        Color m_toColor;
    5553        Color m_fromColor;
  • trunk/WebCore/svg/SVGAnimateElement.cpp

    r28568 r31801  
    22    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
    33                  2004, 2005, 2006 Rob Buis <buis@kde.org>
     4    Copyright (C) 2008 Apple Inc. All rights reserved.
    45
    56    This file is part of the KDE project
     
    2526#include "SVGAnimateElement.h"
    2627
    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
     32using namespace std;
    3033
    3134namespace WebCore {
     
    3336SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* doc)
    3437    : 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())
    3642{
    3743}
     
    4147}
    4248
     49static 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
     75void 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
     105bool 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 
     127static bool isColorAttribute(const String& attribute)
     128{
     129    return attribute == "color" || attribute == "fill" || attribute == "stroke";
     130}
     131
     132bool 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
     154bool 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
    43174}
    44175
  • trunk/WebCore/svg/SVGAnimateElement.h

    r31600 r31801  
    22    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
    33                  2004, 2005 Rob Buis <buis@kde.org>
     4    Copyright (C) 2008 Apple Inc. All rights reserved.
    45
    56    This file is part of the KDE project
     
    3839        virtual const SVGElement* contextElement() const { return this; }
    3940       
    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);
    4245
    4346    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;
    4760    };
    4861
  • trunk/WebCore/svg/SVGAnimateMotionElement.cpp

    r29663 r31801  
    3737SVGAnimateMotionElement::SVGAnimateMotionElement(const QualifiedName& tagName, Document* doc)
    3838    : SVGAnimationElement(tagName, doc)
     39    , m_baseIndexInTransformList(0)
    3940    , m_rotateMode(AngleMode)
    4041    , m_angle(0)
    4142{
    42     m_calcMode = CALCMODE_PACED;
    4343}
    4444
     
    8787        }
    8888    } else if (attr->name() == SVGNames::keyPointsAttr) {
    89         m_keyPoints.clear();
    90         parseKeyNumbers(m_keyPoints, attr->value());
     89        // FIXME: Implement key points.
    9190    } else if (attr->name() == SVGNames::dAttr) {
    9291        m_path = Path();
     
    112111}
    113112
    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     }
     113bool 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;
    126120    return true;
    127121}
     
    147141    point = FloatPoint(x, y);
    148142   
    149     // disallow anying except spaces at the end
     143    // disallow anything except spaces at the end
    150144    return !skipOptionalSpaces(cur, end);
    151145}
    152146
    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();
     147bool SVGAnimateMotionElement::calculateFromAndToValues(const String& fromString, const String& toString)
     148{
     149    parsePoint(fromString, m_fromPoint);
     150    parsePoint(toString, m_toPoint);
    198151    return true;
    199152}
    200 
    201 void SVGAnimateMotionElement::applyAnimatedValueToElement()
     153   
     154bool 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
     163void SVGAnimateMotionElement::applyAnimatedValueToElement(unsigned repeat)
    202164{
    203165    if (!targetElement()->isStyledTransformable())
     
    209171        return;
    210172   
     173    // FIXME: Handle multiple additive animations.
    211174    ExceptionCode ec;
    212     if (!isAdditive())
     175    if (isAdditive()) {
     176        while (transformList->numberOfItems() > m_baseIndexInTransformList)
     177            transformList->removeItem(transformList->numberOfItems() - 1, ec);
     178    } else
    213179        transformList->clear(ec);
    214    
     180
    215181    AffineTransform transform;
    216182    transform.rotate(m_animatedAngle);
     
    219185        transformList->appendItem(SVGTransform(transform), ec);
    220186        transformableElement->setTransform(transformList.get());
    221         if (transformableElement->renderer())
    222             transformableElement->renderer()->setNeedsLayout(true); // should be part of setTransform
    223187    }
     188    if (transformableElement->renderer())
     189        transformableElement->renderer()->setNeedsLayout(true); // should be part of setTransform
     190}
     191
     192void 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();
    224201}
    225202
  • trunk/WebCore/svg/SVGAnimateMotionElement.h

    r31600 r31801  
    3737        virtual bool hasValidTarget() const;
    3838       
    39         virtual bool updateAnimationBaseValueFromElement();
    40         virtual void applyAnimatedValueToElement();
     39        virtual void applyAnimatedValueToElement(unsigned repeat);
    4140       
    4241        virtual void parseMappedAttribute(MappedAttribute*);
     
    4746        virtual const SVGElement* contextElement() const { return this; }
    4847       
    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();
    5153       
    5254    private:
    53         FloatPoint m_basePoint;
    5455        FloatSize m_animatedTranslation;
    5556        float m_animatedAngle;
     
    6162        float m_toAngle;
    6263       
    63         FloatSize m_pointDiff;
    64         float m_angleDiff;
    65        
     64        unsigned m_baseIndexInTransformList;
     65               
    6666        Path m_path;
    6767        Vector<float> m_keyPoints;
  • trunk/WebCore/svg/SVGAnimateTransformElement.cpp

    r28568 r31801  
    3232#include "SVGSVGElement.h"
    3333#include "SVGStyledTransformableElement.h"
     34#include "SVGTextElement.h"
    3435#include "SVGTransform.h"
    3536#include "SVGTransformList.h"
    36 #include "TimeScheduler.h"
    3737
    3838#include <math.h>
     
    4646    : SVGAnimationElement(tagName, doc)
    4747    , m_type(SVGTransform::SVG_TRANSFORM_UNKNOWN)
     48    , m_baseIndexInTransformList(0)
    4849{
    4950}
     
    5556bool SVGAnimateTransformElement::hasValidTarget() const
    5657{
    57     return (SVGAnimationElement::hasValidTarget() && targetElement()->isStyledTransformable());
     58    SVGElement* targetElement = this->targetElement();
     59    return SVGAnimationElement::hasValidTarget() && (targetElement->isStyledTransformable() || targetElement->hasTagName(SVGNames::textTag));
    5860}
    5961
     
    7577}
    7678
    77 bool SVGAnimateTransformElement::updateAnimatedValue(EAnimationMode animationMode, float timePercentage, unsigned valueIndex, float percentagePast)
     79bool SVGAnimateTransformElement::updateAnimatedValue(float percentage)
    7880{
    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   
     85static 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;
    8593}
    8694
    87 bool SVGAnimateTransformElement::updateAnimationBaseValueFromElement()
     95void SVGAnimateTransformElement::applyAnimatedValueToElement(unsigned repeat)
    8896{
    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);
    93110   
    94     if (!targetElement()->isStyledTransformable())
     111    if (targetElement->renderer())
     112        targetElement->renderer()->setNeedsLayout(true); // should really be in setTransform
     113}
     114   
     115bool SVGAnimateTransformElement::calculateFromAndToValues(const String& fromString, const String& toString)
     116{
     117    m_fromTransform = parseTransformValue(fromString);
     118    if (!m_fromTransform.isValid())
    95119        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();
    110122}
    111123
    112 void SVGAnimateTransformElement::applyAnimatedValueToElement()
     124bool SVGAnimateTransformElement::calculateFromAndByValues(const String& fromString, const String& byString)
    113125{
    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   
     134void SVGAnimateTransformElement::startedActiveInterval()
     135{
     136    // FIXME: Make multiple additive animations work.
     137    SVGAnimationElement::startedActiveInterval();
     138    if (!m_animationValid)
    115139        return;
    116140   
    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();
    158144}
    159145
    160146SVGTransform SVGAnimateTransformElement::parseTransformValue(const String& value) const
    161147{
     148    if (value.isEmpty())
     149        return SVGTransform(m_type);
    162150    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
    165155    return result;
    166156}
  • trunk/WebCore/svg/SVGAnimateTransformElement.h

    r31600 r31801  
    4242
    4343        virtual void parseMappedAttribute(MappedAttribute*);
    44        
    45         virtual bool updateAnimationBaseValueFromElement();
    46         virtual void applyAnimatedValueToElement();
     44
     45        virtual void applyAnimatedValueToElement(unsigned repeat);
    4746
    4847    protected:
    4948        virtual const SVGElement* contextElement() const { return this; }
    5049       
    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       
    5356
    5457    private:
     
    5760       
    5861        SVGTransform::SVGTransformType m_type;
     62       
     63        unsigned m_baseIndexInTransformList;
    5964
    6065        SVGTransform m_toTransform;
    6166        SVGTransform m_fromTransform;
    6267
    63         SVGTransform m_baseTransform;
    6468        SVGTransform m_animatedTransform;
    6569    };
  • trunk/WebCore/svg/SVGAnimationElement.cpp

    r31334 r31801  
    33                  2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
    44    Copyright (C) 2007 Eric Seidel <eric@webkit.org>
     5    Copyright (C) 2008 Apple Inc. All rights reserved.
    56
    67    This file is part of the KDE project
     
    2627#include "SVGAnimationElement.h"
    2728
     29#include "CSSComputedStyleDeclaration.h"
     30#include "CSSParser.h"
    2831#include "CSSPropertyNames.h"
    2932#include "Document.h"
     33#include "Event.h"
     34#include "EventListener.h"
    3035#include "FloatConversion.h"
     36#include "HTMLNames.h"
    3137#include "SVGNames.h"
    32 #include "SVGParserUtilities.h"
    33 #include "SVGSVGElement.h"
    3438#include "SVGURIReference.h"
    35 #include "TimeScheduler.h"
    3639#include "XLinkNames.h"
    37 #include <float.h>
    38 #include <math.h>
    39 #include <wtf/MathExtras.h>
    40 #include <wtf/Vector.h>
    4140
    4241using namespace std;
     
    4443namespace WebCore {
    4544   
    46 using namespace SVGNames;
    47 
    4845SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document* doc)
    49     : SVGElement(tagName, doc)
     46    : SVGSMILElement(tagName, doc)
    5047    , SVGTests()
    5148    , 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{
    7251}
    7352
     
    7554{
    7655}
    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   
     57static 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;
     76fail:
     77    result.clear();
     78}
     79
     80static 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;
    98100        }
    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;
     104fail:
     105    result.clear();
    226106}
    227107
    228108void SVGAnimationElement::parseMappedAttribute(MappedAttribute* attr)
    229109{
    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 {
    311117        if (SVGTests::parseMappedAttribute(attr))
    312118            return;
    313119        if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
    314120            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
     125void 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
     132float SVGAnimationElement::getStartTime() const
     133{
     134    return narrowPrecisionToFloat(intervalBegin().value());
     135}
     136
     137float SVGAnimationElement::getCurrentTime() const
     138{
     139    return narrowPrecisionToFloat(elapsed().value());
     140}
     141
     142float SVGAnimationElement::getSimpleDuration(ExceptionCode&) const
     143{
     144    return narrowPrecisionToFloat(simpleDuration().value());
     145}   
     146   
     147bool SVGAnimationElement::beginElement(ExceptionCode& ec)
     148{
     149    return beginElementAt(0, ec);
     150}
     151
     152bool SVGAnimationElement::beginElementAt(float offset, ExceptionCode& ec)
     153{
     154    addBeginTime(elapsed() + offset);
    629155    return true;
    630156}
    631157
    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 handling
    639     if (animationMode == TO_ANIMATION)
    640         return;
    641    
    642     // paced is special, caculates values based on distance instead of time
    643     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 time
    651     // all further calculations are based on time percentages, to allow unifying keyTimes handling & normal animation
    652     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 index
    671     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: linear
    676         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         } else
    720             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 //        else
    731 //            return false;
    732 //    }
    733    
    734     // Validate animation timing settings:
    735     // #1 (duration > 0) -> fine
    736     // #2 (duration <= 0.0 && end > 0) -> fine
    737     // 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 apply
    757 }
    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 code
    769     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     } else
    781         return false;
    782 
    783     return false;
    784 }
    785 
    786158bool SVGAnimationElement::endElement(ExceptionCode& ec)
    787159{
    788     // FIXME: Should this be synchronous?
    789160    return endElementAt(0, ec);
    790161}
     
    794165    if (offset < 0)
    795166        return false;
    796     if (!connectedToTimer())
     167   
     168    addEndTime(elapsed() + offset);
     169    return true;
     170}
     171   
     172SVGAnimationElement::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
     187SVGAnimationElement::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
     205SVGAnimationElement::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
     217String SVGAnimationElement::toValue() const
     218{   
     219    return getAttribute(SVGNames::toAttr);
     220}
     221
     222String SVGAnimationElement::byValue() const
     223{   
     224    return getAttribute(SVGNames::byAttr);
     225}
     226
     227String SVGAnimationElement::fromValue() const
     228{   
     229    return getAttribute(SVGNames::fromAttr);
     230}
     231   
     232String SVGAnimationElement::attributeName() const
     233{   
     234    return getAttribute(SVGNames::attributeNameAttr).string().stripWhiteSpace();
     235}
     236
     237bool 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
     244bool 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
     251bool SVGAnimationElement::hasValidTarget() const
     252{
     253    return targetElement();
     254}
     255   
     256bool SVGAnimationElement::targetAttributeIsCSS() const
     257{
     258    AttributeType type = attributeType();
     259    if (type == AttributeTypeCSS)
     260        return true;
     261    if (type == AttributeTypeXML)
    797262        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
     275void 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
     293String 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   
     311static inline double solveEpsilon(double duration) { return 1. / (200. * duration); }
     312   
     313void 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   
     367void 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   
     398void 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
     422void 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
     432void SVGAnimationElement::endedActiveInterval()
     433{
     434    m_savedBaseValue = String();
    800435}
    801436
  • trunk/WebCore/svg/SVGAnimationElement.h

    r31600 r31801  
    33                  2004, 2005, 2006 Rob Buis <buis@kde.org>
    44    Copyright (C) 2007 Eric Seidel <eric@webkit.org>
     5    Copyright (C) 2008 Apple Inc. All rights reserved.
    56
    67    This file is part of the KDE project
     
    2728
    2829#include "ElementTimeControl.h"
     30#include "SMILTime.h"
     31#include "SVGSMILElement.h"
    2932#include "SVGExternalResourcesRequired.h"
    3033#include "SVGStringList.h"
    3134#include "SVGTests.h"
     35#include "UnitBezier.h"
    3236
    3337namespace WebCore {
     38   
     39    class ConditionEventListener;
     40    class TimeContainer;
    3441
    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,
    8043                                public SVGTests,
    8144                                public SVGExternalResourcesRequired,
     
    8548        SVGAnimationElement(const QualifiedName&, Document*);
    8649        virtual ~SVGAnimationElement();
     50       
     51        virtual void parseMappedAttribute(MappedAttribute*);
     52        virtual void attributeChanged(Attribute*, bool preserveDecls);
    8753
    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
    9755        float getStartTime() const;
    9856        float getCurrentTime() const;
    9957        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);
    11958       
    12059        // ElementTimeControl
     
    12362        virtual bool endElement(ExceptionCode&);
    12463        virtual bool endElementAt(float offset, ExceptionCode&);
     64
     65protected:
    12566       
     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;
    12680
    127     protected:
    128         mutable SVGElement* m_targetElement;
     81        virtual bool hasValidTarget() const;
    12982       
    130         EAnimationMode detectAnimationMode() const;
     83        String targetAttributeBaseValue() const;
     84        void setTargetAttributeAnimatedValue(const String&);
     85        bool targetAttributeIsCSS() const;
    13186       
    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();
    13495       
    135         String targetAttributeAnimatedValue() const;
    136         void setTargetAttributeAnimatedValue(const String&);
     96        ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
     97private:
     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;
    137102       
    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   
     105protected:
     106        String m_savedBaseValue;
     107        bool m_animationValid;
    186108
    187109        Vector<String> m_values;
    188110        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;
    199114    };
    200115
     
    203118#endif // ENABLE(SVG)
    204119#endif // SVGAnimationElement_h
    205 
    206 // vim:ts=4:noet
  • trunk/WebCore/svg/SVGDocumentExtensions.cpp

    r30325 r31801  
    3535#include "Page.h"
    3636#include "SVGSVGElement.h"
    37 #include "TimeScheduler.h"
     37#include "SMILTimeContainer.h"
    3838#include "XMLTokenizer.h"
    3939#include "kjs_proxy.h"
     
    7777    HashSet<SVGSVGElement*>::iterator end = m_timeContainers.end();
    7878    for (HashSet<SVGSVGElement*>::iterator itr = m_timeContainers.begin(); itr != end; ++itr)
    79         (*itr)->timeScheduler()->startAnimations();
     79        (*itr)->timeContainer()->begin();
    8080#endif
    8181}
  • trunk/WebCore/svg/SVGElement.cpp

    r31600 r31801  
    8888SVGSVGElement* SVGElement::ownerSVGElement() const
    8989{
    90     Node* n = parentNode();
     90    Node* n = isShadowNode() ? const_cast<SVGElement*>(this)->shadowParentNode() : parentNode();
    9191    while (n) {
    9292        if (n->hasTagName(SVGNames::svgTag))
    9393            return static_cast<SVGSVGElement*>(n);
    9494
    95         n = n->parentNode();
     95        n = n->isShadowNode() ? n->shadowParentNode() : n->parentNode();
    9696    }
    9797
  • trunk/WebCore/svg/SVGSVGElement.cpp

    r31600 r31801  
    4949#include "SVGZoomEvent.h"
    5050#include "SelectionController.h"
    51 #include "TimeScheduler.h"
     51#include "SMILTimeContainer.h"
    5252
    5353namespace WebCore {
     
    6969    , m_height(this, LengthModeHeight)
    7070    , m_useCurrentView(false)
    71     , m_timeScheduler(new TimeScheduler(doc))
     71    , m_timeContainer(new SMILTimeContainer)
    7272    , m_viewSpec(0)
    7373    , m_containerSize(300, 150)
     
    7676    setWidthBaseValue(SVGLength(this, LengthModeWidth, "100%"));
    7777    setHeightBaseValue(SVGLength(this, LengthModeHeight, "100%"));
     78    doc->registerForCacheCallbacks(this);
    7879}
    7980
    8081SVGSVGElement::~SVGSVGElement()
    8182{
    82     delete m_timeScheduler;
    83     m_timeScheduler = 0;
    84 
     83    document()->unregisterForCacheCallbacks(this);
    8584    // There are cases where removedFromDocument() is not called.
    8685    // see ContainerNode::removeAllChildren, called by it's destructor.
     
    455454void SVGSVGElement::pauseAnimations()
    456455{
    457     if (!m_timeScheduler->animationsPaused())
    458         m_timeScheduler->toggleAnimations();
     456    if (!m_timeContainer->isPaused())
     457        m_timeContainer->pause();
    459458}
    460459
    461460void SVGSVGElement::unpauseAnimations()
    462461{
    463     if (m_timeScheduler->animationsPaused())
    464         m_timeScheduler->toggleAnimations();
     462    if (m_timeContainer->isPaused())
     463        m_timeContainer->resume();
    465464}
    466465
    467466bool SVGSVGElement::animationsPaused() const
    468467{
    469     return m_timeScheduler->animationsPaused();
     468    return m_timeContainer->isPaused();
    470469}
    471470
    472471float SVGSVGElement::getCurrentTime() const
    473472{
    474     return narrowPrecisionToFloat(m_timeScheduler->elapsed());
     473    return narrowPrecisionToFloat(m_timeContainer->elapsed().value());
    475474}
    476475
     
    531530    renderer()->setNeedsLayout(true);
    532531}
     532   
     533void SVGSVGElement::willSaveToCache()
     534{
     535    pauseAnimations();
     536}
     537
     538void SVGSVGElement::willRestoreFromCache()
     539{
     540    unpauseAnimations();
     541}
    533542
    534543}
  • trunk/WebCore/svg/SVGSVGElement.h

    r31600 r31801  
    4141    class SVGViewSpec;
    4242    class SVGViewElement;
    43     class TimeScheduler;
     43    class SMILTimeContainer;
    4444    class SVGSVGElement : public SVGStyledLocatableElement,
    4545                          public SVGTests,
     
    8888        void setCurrentTranslate(const FloatPoint&);
    8989       
    90         TimeScheduler* timeScheduler() { return m_timeScheduler; }
     90        SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); }
    9191       
    9292        void pauseAnimations();
     
    156156        ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Width, width)
    157157        ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Height, height)
     158       
     159        virtual void willSaveToCache();
     160        virtual void willRestoreFromCache();
    158161
    159162        bool m_useCurrentView;
    160         TimeScheduler* m_timeScheduler;
     163        RefPtr<SMILTimeContainer> m_timeContainer;
    161164        FloatPoint m_translation;
    162165        mutable OwnPtr<SVGViewSpec> m_viewSpec;
  • trunk/WebCore/svg/SVGSetElement.cpp

    r25754 r31801  
    2424#if ENABLE(SVG)
    2525#include "SVGSetElement.h"
    26 #include "TimeScheduler.h"
    2726#include "Document.h"
    2827#include "SVGDocumentExtensions.h"
     
    3029
    3130namespace WebCore {
     31   
     32// FIXME: This class needs to die. SVGAnimateElement should be instantiated instead.
    3233
    3334SVGSetElement::SVGSetElement(const QualifiedName& tagName, Document *doc)
     
    4041}
    4142
    42 bool SVGSetElement::updateAnimatedValue(EAnimationMode, float timePercentage, unsigned valueIndex, float percentagePast)
     43void SVGSetElement::applyAnimatedValueToElement(unsigned repeat)
    4344{
    44     m_animatedValue = m_to;
    45     return true;
     45    setTargetAttributeAnimatedValue(toValue());
     46}
     47   
     48bool SVGSetElement::calculateFromAndToValues(const String&, const String& toString)
     49{
     50    m_animatedValue = toString;
     51    return true;
    4652}
    4753
    48 bool SVGSetElement::calculateFromAndToValues(EAnimationMode, unsigned valueIndex)
     54bool SVGSetElement::calculateFromAndByValues(const String& fromString, const String& byString)
     55{
     56    return false;
     57}
     58
     59bool SVGSetElement::updateAnimatedValue(float percentage)
    4960{
    5061    return true;
  • trunk/WebCore/svg/SVGSetElement.h

    r31600 r31801  
    3838        virtual const SVGElement* contextElement() const { return this; }
    3939       
    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);
    4244
    4345    private:
    44         String m_savedTo;
     46        String m_animatedValue;
    4547    };
    4648
  • trunk/WebCore/svg/SVGUseElement.cpp

    r31600 r31801  
    120120void SVGUseElement::removedFromDocument()
    121121{
    122     SVGElement::removedFromDocument();
    123 
    124122    m_targetElementInstance = 0;
    125123    m_shadowTreeRootElement = 0;
     124    SVGElement::removedFromDocument();
    126125}
    127126
Note: See TracChangeset for help on using the changeset viewer.