Source/WebCore/ChangeLog

 12012-03-10 Nikolas Zimmermann <nzimmermann@rim.com>
 2
 3 animations update baseVal instead of animVal
 4 https://bugs.webkit.org/show_bug.cgi?id=12437
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Begin implementing the last missing core piece of the SVG DOM: proper animVal support.
 9 Most SVG DOM interfaces exposing eg. lengths use SVGAnimatedLength. eg. from SVGRectElement:
 10 "readonly attribute SVGAnimatedLength x;" SVGAnimatedXXX contains following methods:
 11 "readonly attribute SVGLength baseVal; readonly attribute SVGLength animVal;"
 12 From SVG DOM perspective, animVal and baseVal are two distinctive objects, animVal != baseVal.
 13 Its underlying value is the same though, if no animation is running on that attribute.
 14
 15 As soon as a SMIL animation starts animating an SVGAnimated* target attribute, its
 16 baseVal and animVal may begin to differ. The animVal always reflect the current animated
 17 value (including all effects of additive/accumulated animations) which is shown on screen
 18 when eg animating the width of a <rect>. The baseVal is is equal to the underlying XML
 19 property value / SVG DOM value, but may be influenced through dynamic changes.
 20 (Consider changing rect1.width.baseVal.value while 'width' is animated)
 21
 22 During the last year we prepared our animation code to turn on animVal support.
 23 This patch adds the last missing pieces to turn on animVal support for the SVGLength.
 24 SVGLengthList and all other types will follow, one after the other.
 25
 26 I've decided to write an exhaustive ChangeLog, as this as the base for any future
 27 work in this area - hopefully making this more reviewable.
 28
 29 Tests: svg/animations/additive-from-to-width-animation.html
 30 svg/animations/additive-values-width-animation.html
 31 svg/animations/change-baseVal-while-animating-fill-freeze-2.html
 32 svg/animations/change-baseVal-while-animating-fill-freeze.html
 33 svg/animations/change-baseVal-while-animating-fill-remove-2.html
 34 svg/animations/change-baseVal-while-animating-fill-remove.html
 35 svg/animations/change-target-while-animating-SVG-property.html
 36 svg/animations/multiple-animations-fill-freeze.html
 37 svg/animations/remove-animation-element-while-animation-is-running.html
 38 svg/repaint/repainting-after-animation-element-removal.svg
 39
 40
 41 * svg/SVGAnimateElement.cpp: Remove unnecessary std namespace inclusion.
 42 (WebCore::SVGAnimateElement::SVGAnimateElement): Remove now-obsolete m_aboutToStopAnimation.
 43 (WebCore::SVGAnimateElement::calculateAnimatedValue): Swap assertion order, to test hasTagName() _before_ casting.
 44 (WebCore::SVGAnimateElement::resetToBaseValue):
 45 Stop relying on the cached baseValue (breaking additive="sum"+values animation) for SVG DOM primitive animations.
 46 Avoid any string roundtrips previously needed to reset the SVGAnimatedType to the base value. Just grab the
 47 currentBaseValue() from the associated SVGAnimatedProperty, which includes all dynamic changes to the baseVal
 48 either by SVG DOM or setAttribute() calls - this way we don't need to utilize the buggy cache in SMILTimeContainer,
 49 which can be removed once all SVG DOM primitive types switched to the new animVal concept.
 50
 51 NOTE: When multiple animations of the same attribute are applied to a target element, resetToBaseValue() will be called
 52 for the highest priority SVGSMILElement, on every animation step! Consider two <animate> elements, applied to a target
 53 <rect> which both animate the 'x' attribute, one from 0s to 2s, the other from 4s to 6s. The last <animate> element
 54 will reuse the SVGAnimatedType m_animatedType from the first <animate> element, and never create an own m_animatedType.
 55 When the animation starts the first time at 0s, we update the rect.x.animVals SVGLength* pointer, to point to the
 56 SVGAnimatedType of the first <animate> element, owning the m_animatedType. From that point on each call to rect.x.animVal
 57 will always return the same value as the SVGAnimatedType of the first <animate> element holds. Now after 2s the first
 58 <animate> element becomes inactive, but its m_animatedType remains alive. The bindings don't notice this change at all.
 59 Now at 4s, the second animation element gets active. It reuses the SVGAnimatedType of the first <animate> element, and
 60 applies its animation changes to that SVGAnimatedType, which is immediately reflected in the bindings w/o any additional
 61 work. It's very important for the understanding when animationStarted/animationEnded need to be called.
 62
 63 (WebCore::SVGAnimateElement::applyResultsToTarget): Remove now-obsolete m_aboutToStopAnimation logic. No need to know it at this point.
 64 (WebCore::SVGAnimateElement::targetElementWillChange):
 65 Renamed from targetElementDidChange(). This method is called from SVGSMILElement for following conditions:
 66 - animation element is destructed
 67 - animation element is removed from document
 68 - target element of animation is destructed
 69 - target element of animation is removed from document
 70 - target element of animation changes id
 71
 72 Whenever any of this happens, we need to reset the animVal. Resetting the animVal involves resetting the PropertyType* pointer,
 73 eg. SVGLength*, from the animVal property tear off, belonging to a certain SVGAnimatedProperty (eg. rect.x) to the initial
 74 value again, which is the 'm_x' of the SVGRectElement. This is needed as the SVGAnimatedType the animVal currently points to,
 75 if an animation is/was running, is destructed in targetElementWillChange(), to reset the SVGAnimateElement to the initial
 76 state before it received a target. This is the only place which destructed the m_animatedType, and thus the only place that
 77 needs to take care of resetting the animVal pointers.
 78
 79 * svg/SVGAnimatedLength.cpp:
 80 (WebCore::SVGAnimatedLengthAnimator::constructFromCopy):
 81 Add a new constructFromCopy(SVGGenericAnimatedType) function to SVGAnimatedLengthAnimator.
 82 It takes a type-unsafe SVGGenericAnimatedType - the caller has to guarantee the type matches.
 83 This is strictly enforced for the single caller of constructFromCopy, and guaranteed to be safe.
 84
 85 * svg/SVGAnimatedLength.h: Add new constructFromCopy method, which is used to avoid string-roundtrips when resetting to base values.
 86 * svg/SVGAnimatedType.cpp:
 87 (WebCore::SVGAnimatedType::supportsAnimVal): Only returns true for AnimatedLength, for now.
 88 (WebCore::SVGAnimatedType::setValue): Takes a SVGGenericAnimatedType, assuming the type matches. Callers have to guarantee type-safety!
 89 * svg/SVGAnimatedType.h:
 90 (SVGAnimatedType): Add new static supportsAnimVal(AnimatedPropertyType) function.
 91 (WebCore::SVGAnimatedType::variant): Add a generic accessor for all animated types, called variant(). Only one place uses this.
 92 * svg/SVGAnimatedTypeAnimator.h:
 93 (WebCore::SVGAnimatedTypeAnimator::constructFromCopy):
 94 New method to construct an eg. SVGAnimatedLengthAnimator right from a SVGLength, instead of a String.
 95 In that case the SVGAnimatedType just stores a pointer to the underlying SVGLength, no copying and or other roundtrips involved.
 96
 97 * svg/SVGAnimationElement.cpp:
 98 (WebCore::SVGAnimationElement::svgAttributeChanged):
 99 Implement this instead of attributeChanged. The previous implementation reset the animation state to Inactive, causing a full
 100 rebuild, whenever any attribute changes, even though it might not be related for the animation element, eg.
 101 animate.setAttribute("stdDeviationX", "foobar"). Fix that by checking if we support the attribute (keyTimes/keySplines/etc..)
 102 , if not pass it on to SVGSMILElement (which supports begin/end/etc..) to check if it can handle that.
 103
 104 (WebCore::SVGAnimationElement::animationAttributeChanged):
 105 Called from our svgAttributeChanged, and/or from SVGSMILElement::svgAttributeChanged, whenever a _known_ attribute has changed.
 106 This sledgehammer should be used with care, instead of each time attributeChanged() is called :-)
 107
 108 (WebCore::setTargetAttributeAnimatedCSSValue):
 109 Remove support for removing properties from the override style sheet. I've added this optimization too early, we should reevaluate
 110 this once more types support animVal. It currently complexifies the logic too much, requiring setAttributeAnimatedValue to know
 111 if the animation ends (and that's not easy to figure out, at least not using started/endedActiveInterval, as I anticipated).
 112
 113 (WebCore::findMatchingAnimatedProperty):
 114 Add helper functions which retrieves a SVGAnimatedProperty* for a given SVGElement* targetElement, an attributeName, and an attribute
 115 type. eg. findMatchingAnimatedProperty(myRectElement, SVGNames::xAttr, AnimatedLength) returns the SVGAnimatedProperty which is
 116 exposed to JS, that holds: SVGProperty* baseVal, and SVGProperty* animVal. (Lazily created if they got accessed from JS.). This is
 117 used to update the animVal pointing to a new eg. SVGLength* value, once animation has started, to make rect->x() return that new
 118 SVGLength* value (internally), and to reflect the current animated value in rect.x.animVal.value from JS.
 119
 120 (WebCore::SVGAnimationElement::applyAnimatedValue): Refactored from setTargetAttributeAnimatedValue, to simplify the code.
 121 (WebCore::notifyAnimatedPropertyAboutAnimationBeginEnd):
 122 Helper function to share code betweeen animationStarted/animationEnded.
 123 It takes a SVGAnimatedProperty* and a SVGAnimatedType* which may be zero, indicating that the animation ended.
 124 It calls animationStarted/animationEnded on the given SVGAnimatedProperty, to update the animVal state.
 125 It also figures out all instances of the target element, and their SVGAnimatedProperties that may need updating.
 126
 127 (WebCore::SVGAnimationElement::animationStarted): Uses the helper above, passing on the given animatedType.
 128 (WebCore::SVGAnimationElement::animationEnded): Uses the helper above, passing 0 as animatedType.
 129 (WebCore::InstanceUpdateBlocker::InstanceUpdateBlocker):
 130 Added new helper struct, doing element->setInstancesUpdatedBlock(true) on construction and setInstancesUpdatesBlocked(false) on
 131 destruction, making it impossible to forget one. If we ever rewrite svgAttributeChanged & co to auto-update the cloned instances,
 132 this can go away.
 133
 134 (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
 135 Now takes an SVGAnimatedType* instead of a String parameter. In order to avoid string-roundtrips for animVal support, let us
 136 decide if we need to construct a String out of it, or not. For animations supporting animVal (only SVGLength) we don't need
 137 to update any attribute or animVal pointer here, that happens automatically! We only need to notify the targetElement eg,
 138 that its xAttr changed! Previously we had to call targetElement->setAttribute("x", "...") on every animation step for
 139 SVGLength animations - that's gone now! The SVGAnimatedType pointers remains the same during the whole animation, so there's
 140 no need to call animationStarted() at each animated step!
 141
 142 (WebCore::SVGAnimationElement::animatedPropertyForType):
 143 Helper function returning a SVGAnimatedProperty* for the current target element & current target attribute, if the
 144 current animation is running on a type supporting animVal (SVGLength), or returning 0. This is needed for SVGAnimateElement.
 145 Reuses the existing findMatchingAnimatedProperty code.
 146
 147 * svg/SVGAnimationElement.h:
 148 * svg/animation/SMILTimeContainer.cpp:
 149 (WebCore::SMILTimeContainer::updateAnimations):
 150 Add comment to clarify why caching baseValues is just wrong. For SVGLength animations the problem is now gone.
 151 This is exercised using the new additive-from-to-width-animation.html & additive-values-width-animation.html tests.
 152
 153 * svg/animation/SVGSMILElement.cpp:
 154 (WebCore::SVGSMILElement::removedFromDocument):
 155 Since animVal requires that the SVGAnimatedProperties are correctly reset if an animation element is removed from the document,
 156 we have to call targetElementWillChange(0) from here. That requires to move the "m_attributeName = anyQName()" line down,
 157 otherwise targetElementWillChange() would early exit, as no valid attributeName was specified.
 158
 159 This is verified using the new svg/animations/remove-animation-element-while-animation-is-running.html
 160 and svg/repaint/repainting-after-animation-element-removal.svg tests.
 161
 162 (WebCore::SVGSMILElement::isSupportedAttribute): Add function like all SVG*Elements have identifying their supported attributes.
 163 (WebCore::SVGSMILElement::svgAttributeChanged):
 164 Implement svgAttributeChanged instead of attributeChanged. Only take action if the attribute is actually supported.
 165 If one of the common attributes like begin/end/etc. changed, be sure to call animationAttributeChanged() so that our
 166 ancestor-classes get notified about this and can take action as well.
 167
 168 (WebCore::SVGSMILElement::targetElement): Adapt logic to targetElementDidChange -> targetElementWillChange change.
 169 (WebCore::SVGSMILElement::targetElementWillChange):
 170 Renamed from targetElementDidChange. Added "oldTarget" as parameter as well. Our ancestor-classes like SVGAnimateElement
 171 use this to properly deregister the animVal in the old target, before resetting the SVGAnimatedType, otherwise we'd leave
 172 dangling pointers around (verified manually by guard malloc runs, that none of this happens).
 173
 174 Also add a default implementation here in targetElementWillChange, that ancestor classes have to call.
 175 We now properly call endedActiveInterval() if the m_activeState is currently Active, so that animations are shut-down
 176 just like if the animation properly ends (use the same cleanup routines, etc.). Not doing that now leads to assertions.
 177
 178 (WebCore::SVGSMILElement::resetTargetElement):
 179 Instead of forcing m_activeState to be inactive, use the standard methods to end the animation.
 180 targetElementWillChange(m_targetElement, 0) and animationAttributeChanged().
 181
 182 resetTargetElement() is only called by SVGDocumentExtensions::removeAllAnimationElementsFromTarget() for following conditions:
 183 - targetElement gets destructed
 184 - targetElement gets removed from the document
 185 - targetElement id changes
 186
 187 If the targetElement gets destructed or removed, no actions need to be taken, as the SVGAnimatedPropertys are teared down
 188 as well. But if only the id changes, we still have to properly disconnect the animVals - this is all handled through
 189 targetElementWillChange now - that's why this has to be called from here as well.
 190 That explains why targetElementWillChange() now needs to check if the targetElement is destructing or not.
 191
 192 * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
 193 Pass the AnimatedPropertyType from the SVGPropertyInfo to the SVGAnimatedProperties.
 194 Requires mechanic changes in all SVGAnimated* classes. We need acccess to the AnimatedPropertyType
 195 to verify the SVGAnimatedType objects, passed to animationStarted, match our type. This is to enforce
 196 strict type-checking, whenever SVGGenericAnimatedTypes are passed around.
 197
 198 (WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
 199 (WebCore::SVGAnimatedEnumerationPropertyTearOff::SVGAnimatedEnumerationPropertyTearOff):
 200 * svg/properties/SVGAnimatedListPropertyTearOff.h: Ditto.
 201 (WebCore::SVGAnimatedListPropertyTearOff::create):
 202 (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
 203 * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Ditto.
 204 (WebCore::SVGAnimatedPathSegListPropertyTearOff::create):
 205 (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff):
 206 * svg/properties/SVGAnimatedProperty.h: Store AnimatedPropertyType, add accessors.
 207 (WebCore::SVGAnimatedProperty::animatedPropertyType): Add accessor.
 208 (WebCore::SVGAnimatedProperty::animationValueChanged): New animVal related functions to be implemented in the animated tear offs.
 209 (WebCore::SVGAnimatedProperty::animationStarted): Ditto.
 210 (WebCore::SVGAnimatedProperty::animationEnded): Ditto.
 211 (WebCore::SVGAnimatedProperty::currentBaseValue):
 212 Generic accessor for the baseVal: returns a SVGGenericAnimatedType.
 213 It takes an AnimatedPropertyType as input, that's only needed to verify that the type we're returning matches
 214 the expectation of the caller. If not, return 0 to avoid any potential casting mistakes, which would lead to crashes.
 215
 216 (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Store m_animatedPropertyType.
 217 * svg/properties/SVGAnimatedPropertyTearOff.h:
 218 (WebCore::SVGAnimatedPropertyTearOff::create): Same changes as in the other tear offs: pass around AnimatedPropertyType.
 219 (WebCore::SVGAnimatedPropertyTearOff::currentBaseValue): Returns &m_property, if the type matches (see above).
 220 (SVGAnimatedPropertyTearOff): Pass around AnimatedPropertyType.
 221 (WebCore::SVGAnimatedPropertyTearOff::animationValueChanged): No-op for non list types, don't need to do anything here.
 222 (WebCore::SVGAnimatedPropertyTearOff::animationStarted):
 223 (WebCore::SVGAnimatedPropertyTearOff::animationEnded):
 224 Store the currently animated value in the animVal() property tear off, that's also re-used as-is for the JS bindings.
 225 As this is important, here's an example of how this affects methods like rect->x() used in the renderers.
 226
 227 Setting m_isAnimating to true, redirects any rect->x() calls that previously returned rect->m_x, to
 228 rect->xAnimated()->animVal()->propertyReference() (which returns the same SVGLength& that the SVGAnimatedElement
 229 m_animatedType contains). Calling rect->setXBaseValue() still modifies rect->m_x, and is used by all parseAttribute()
 230 methods in svg/ as setAttribute() calls only ever modify the "baseValue", never the current animated value.
 231 rect.x.baseVal will return a SVGLength object corresponding to rect->m_x.
 232 rect.x.animVal will return a SVGLength object corresponding to rect->xAnimated()->animVal()->propertyReference().
 233
 234 These implementation details are all hidden in the SVGAnimatedPropertyMacros. Here's an example from SVGRectElement:
 235 DECLARE_ANIMATED_LENGTH(X, x) -> Replace PropertyType with 'SVGLength', LowerProperty with 'x', and UpperProperty with 'X'.
 236
 237 PropertyType& LowerProperty() const
 238 {
 239 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType, TearOffType, IsDerivedFromSVGElement<UseOwnerType>::value>(this, LowerProperty##PropertyInfo())) {
 240 if (wrapper->isAnimating())
 241 return wrapper->currentAnimatedValue();
 242 }
 243 return m_##LowerProperty.value;
 244 }
 245
 246 PropertyType& LowerProperty##BaseValue() const
 247 {
 248 return m_##LowerProperty.value;
 249 }
 250
 251 void set##UpperProperty##BaseValue(const PropertyType& type)
 252 {
 253 m_##LowerProperty.value = type;
 254 }
 255
 256 Any code outside of svg/, eg. in rendering/svg, does not need to care about any baseVal/animVal differences.
 257 During layout eg. RenderSVGRect calls rect->x().value(someLengthContext) to get the current 'x' as float. If an animation
 258 is running on that rect element it will automatically retrieve the last set animated value here - all under the hood.
 259 I hope that sheds some light in those myserious functions, they were designed with animVal in mind, but we never had that until now :-)
 260
 261 (WebCore::SVGAnimatedPropertyTearOff::SVGAnimatedPropertyTearOff): Pass around AnimatedPropertyType.
 262 (WebCore::SVGAnimatedPropertyTearOff::~SVGAnimatedPropertyTearOff): Add destructor to debug builds veryifing that m_isAnimating is false.
 263 * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto.
 264 (WebCore::SVGAnimatedStaticPropertyTearOff::create):
 265 (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
 266 * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Ditto.
 267 (WebCore::SVGAnimatedTransformListPropertyTearOff::create):
 268 (WebCore::SVGAnimatedTransformListPropertyTearOff::SVGAnimatedTransformListPropertyTearOff):
 269 * svg/properties/SVGPropertyInfo.h: Add SVGGenericAnimatedType definition.
 270 * svg/properties/SVGPropertyTearOff.h: Remove obsolete updateAnimVal method - switched to using setValue directly.
 271
12722012-03-09 Robert Kroeger <rjkroege@chromium.org>
2273
3274 Handle more Gesture* events by performing scrolls on the correct target ScrollableArea

Source/WebCore/svg/SVGAnimateElement.cpp

3434#include "SVGNames.h"
3535#include "SVGStyledElement.h"
3636
37 using namespace std;
38 
3937namespace WebCore {
4038
4139SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* document)
4240 : SVGAnimationElement(tagName, document)
4341 , m_animatedPropertyType(AnimatedString)
44  , m_aboutToStopAnimation(false)
4542 , m_fromPropertyValueType(RegularPropertyValue)
4643 , m_toPropertyValueType(RegularPropertyValue)
4744{

@@void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeat
176173 ASSERT(m_fromType->type() == m_animatedPropertyType);
177174 ASSERT(m_toType);
178175
 176 ASSERT(resultElement->hasTagName(SVGNames::animateTag)
 177 || resultElement->hasTagName(SVGNames::animateColorTag)
 178 || resultElement->hasTagName(SVGNames::setTag));
 179
179180 SVGAnimateElement* resultAnimationElement = static_cast<SVGAnimateElement*>(resultElement);
180181 ASSERT(resultAnimationElement->m_animatedType);
181182 ASSERT(resultAnimationElement->m_animatedPropertyType == m_animatedPropertyType);
182  ASSERT(resultAnimationElement->hasTagName(SVGNames::animateTag)
183  || resultAnimationElement->hasTagName(SVGNames::animateColorTag)
184  || resultAnimationElement->hasTagName(SVGNames::setTag));
185183
186184 if (hasTagName(SVGNames::setTag))
187185 percentage = 1;

@@bool SVGAnimateElement::calculateFromAndByValues(const String& fromString, const
217215
218216void SVGAnimateElement::resetToBaseValue(const String& baseString)
219217{
 218 // If animatedProperty is not null, we're dealing with a SVG DOM primitive animation.
 219 // In that case we don't need any base value strings, but can directly operate on these
 220 // SVG DOM primitives, like SVGLength.
 221 SVGAnimatedTypeAnimator* animator = ensureAnimator();
 222 if (SVGAnimatedProperty* animatedProperty = animatedPropertyForType(animator->type())) {
 223 if (!m_animatedType) {
 224 m_animatedType = animator->constructFromCopy(animatedProperty->currentBaseValue(animator->type()));
 225 animationStarted(animatedProperty, m_animatedType.get());
 226 } else
 227 m_animatedType->setValue(animatedProperty->currentBaseValue(m_animator->type()));
 228 ASSERT(m_animatedPropertyType == animator->type());
 229 return;
 230 }
 231
220232 if (!m_animatedType)
221  m_animatedType = ensureAnimator()->constructFromString(baseString);
 233 m_animatedType = animator->constructFromString(baseString);
222234 else
223235 m_animatedType->setValueAsString(attributeName(), baseString);
224  ASSERT(m_animatedPropertyType == m_animator->type());
 236 ASSERT(m_animatedPropertyType == animator->type());
225237}
226 
 238
227239void SVGAnimateElement::applyResultsToTarget()
228240{
229241 ASSERT(m_animatedPropertyType != AnimatedEnumeration);
230242 ASSERT(m_animatedPropertyType != AnimatedTransformList);
231243 ASSERT(m_animatedPropertyType != AnimatedUnknown);
232244 ASSERT(m_animatedType);
233 
234  if (m_aboutToStopAnimation) {
235  m_aboutToStopAnimation = false;
236  resetAnimationState(m_animatedType->valueAsString());
237  return;
238  }
239 
240  setTargetAttributeAnimatedValue(m_animatedType->valueAsString());
 245 setTargetAttributeAnimatedValue(m_animatedType.get());
241246}
242247
243248float SVGAnimateElement::calculateDistance(const String& fromString, const String& toString)

@@float SVGAnimateElement::calculateDistance(const String& fromString, const Strin
250255 return ensureAnimator()->calculateDistance(fromString, toString);
251256}
252257
253 void SVGAnimateElement::targetElementDidChange(SVGElement* targetElement)
 258void SVGAnimateElement::targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget)
254259{
 260 SVGSMILElement::targetElementWillChange(currentTarget, newTarget);
 261
 262 // Be sure to never execute any of this, while the target element is being removed from the document or destructed.
 263 if (currentTarget && currentTarget->inDocument() && currentTarget->parentNode()) {
 264 ASSERT(!currentTarget->m_deletionHasBegun);
 265 if (SVGAnimatedProperty* animatedProperty = animatedPropertyForType(m_animatedPropertyType))
 266 animationEnded(animatedProperty);
 267 }
 268
255269 m_animatedType.clear();
256270 m_fromType.clear();
257271 m_toType.clear();
258272 m_animator.clear();
259  m_animatedPropertyType = targetElement ? determineAnimatedPropertyType(targetElement) : AnimatedString;
 273 m_animatedPropertyType = newTarget ? determineAnimatedPropertyType(newTarget) : AnimatedString;
260274}
261275
262276SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()

@@SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
267281 return m_animator.get();
268282}
269283
270 void SVGAnimateElement::endedActiveInterval()
271 {
272  SVGAnimationElement::endedActiveInterval();
273  m_aboutToStopAnimation = true;
274284}
275285
276 }
277286#endif // ENABLE(SVG)

Source/WebCore/svg/SVGAnimateElement.h

@@protected:
6565 virtual void applyResultsToTarget();
6666 virtual float calculateDistance(const String& fromString, const String& toString);
6767
68  virtual void endedActiveInterval();
69  virtual void targetElementDidChange(SVGElement* targetElement) OVERRIDE;
 68 virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* oldTarget) OVERRIDE;
7069
7170private:
7271 SVGAnimatedTypeAnimator* ensureAnimator();
7372
7473 virtual bool hasValidAttributeType();
7574 AnimatedPropertyType m_animatedPropertyType;
76  bool m_aboutToStopAnimation;
7775
7876 AnimatedPropertyValueType m_fromPropertyValueType;
7977 AnimatedPropertyValueType m_toPropertyValueType;

Source/WebCore/svg/SVGAnimatedLength.cpp

@@PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromString(const
4747 return SVGAnimatedType::createLength(new SVGLength(m_lengthMode, string));
4848}
4949
 50PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromCopy(SVGGenericAnimatedType animatedType)
 51{
 52 ASSERT(animatedType);
 53 return SVGAnimatedType::createLength(new SVGLength(*reinterpret_cast<SVGLength*>(animatedType)));
 54}
 55
5056void SVGAnimatedLengthAnimator::calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString)
5157{
5258 ASSERT(m_contextElement);

Source/WebCore/svg/SVGAnimatedLength.h

@@public:
4545 virtual ~SVGAnimatedLengthAnimator() { }
4646
4747 virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
 48 virtual PassOwnPtr<SVGAnimatedType> constructFromCopy(SVGGenericAnimatedType);
4849
4950 virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString);
5051 virtual void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& byString);

Source/WebCore/svg/SVGAnimatedType.cpp

@@void SVGAnimatedType::setPreserveAspectRatioBaseValue(const SVGPreserveAspectRat
427427 *m_data.preserveAspectRatio = preserveAspectRatio;
428428}
429429
430 
 430bool SVGAnimatedType::supportsAnimVal(AnimatedPropertyType type)
 431{
 432 // FIXME: This lists the current state of our animVal support: only SVGLength is supported for now.
 433 switch (type) {
 434 case AnimatedLength:
 435 return true;
 436 case AnimatedAngle:
 437 case AnimatedBoolean:
 438 case AnimatedColor:
 439 case AnimatedEnumeration:
 440 case AnimatedInteger:
 441 case AnimatedLengthList:
 442 case AnimatedNumber:
 443 case AnimatedNumberList:
 444 case AnimatedNumberOptionalNumber:
 445 case AnimatedPath:
 446 case AnimatedPoints:
 447 case AnimatedPreserveAspectRatio:
 448 case AnimatedRect:
 449 case AnimatedString:
 450 case AnimatedTransformList:
 451 case AnimatedUnknown:
 452 return false;
 453 }
 454
 455 ASSERT_NOT_REACHED();
 456 return false;
 457}
 458
 459void SVGAnimatedType::setValue(SVGGenericAnimatedType type)
 460{
 461 // FIXME: This lists the current state of our animVal support: only SVGLength is supported for now.
 462 switch (m_type) {
 463 case AnimatedLength:
 464 *m_data.length = *reinterpret_cast<SVGLength*>(type);
 465 return;
 466 case AnimatedAngle:
 467 case AnimatedBoolean:
 468 case AnimatedColor:
 469 case AnimatedEnumeration:
 470 case AnimatedInteger:
 471 case AnimatedLengthList:
 472 case AnimatedNumber:
 473 case AnimatedNumberList:
 474 case AnimatedNumberOptionalNumber:
 475 case AnimatedPath:
 476 case AnimatedPoints:
 477 case AnimatedPreserveAspectRatio:
 478 case AnimatedRect:
 479 case AnimatedString:
 480 case AnimatedTransformList:
 481 case AnimatedUnknown:
 482 break;
 483 }
 484
 485 ASSERT_NOT_REACHED();
 486}
 487
431488} // namespace WebCore
432489
433490#endif // ENABLE(SVG)

Source/WebCore/svg/SVGAnimatedType.h

2222
2323#if ENABLE(SVG)
2424#include "SVGElement.h"
 25#include "SVGPropertyInfo.h"
2526
2627namespace WebCore {
2728

@@public:
5455 static PassOwnPtr<SVGAnimatedType> createPreserveAspectRatio(SVGPreserveAspectRatio*);
5556 static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*);
5657 static PassOwnPtr<SVGAnimatedType> createString(String*);
 58 static bool supportsAnimVal(AnimatedPropertyType);
5759
5860 AnimatedPropertyType type() const { return m_type; }
 61 SVGGenericAnimatedType variant() const { return m_data.variant; }
5962
6063 SVGAngle& angle();
6164 bool& boolean();

@@public:
7275 FloatRect& rect();
7376 String& string();
7477
 78 // Use with care, the actual type of the generic animated object has to be equal to our type().
 79 void setValue(SVGGenericAnimatedType);
 80
7581 String valueAsString();
7682 bool setValueAsString(const QualifiedName&, const String&);
7783

@@private:
103109 SVGPointList* pointList;
104110 FloatRect* rect;
105111 String* string;
 112 SVGGenericAnimatedType variant;
106113 } m_data;
107114};
108115

Source/WebCore/svg/SVGAnimatedTypeAnimator.h

@@class SVGAnimatedTypeAnimator {
3333public:
3434 virtual ~SVGAnimatedTypeAnimator() { }
3535 virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) = 0;
 36 // FIXME: Make this pure once all types implement this. Its needed for animVal, and currently only SVGLengthAnimator implements this.
 37 virtual PassOwnPtr<SVGAnimatedType> constructFromCopy(SVGGenericAnimatedType) { return PassOwnPtr<SVGAnimatedType>(); }
3638
3739 virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString) = 0;
3840 virtual void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString) = 0;

Source/WebCore/svg/SVGAnimationElement.cpp

@@bool SVGAnimationElement::isSupportedAttribute(const QualifiedName& attrName)
156156 }
157157 return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
158158}
159 
 159
160160void SVGAnimationElement::parseAttribute(Attribute* attr)
161161{
162162 if (!isSupportedAttribute(attr->name())) {

@@void SVGAnimationElement::parseAttribute(Attribute* attr)
201201 ASSERT_NOT_REACHED();
202202}
203203
204 void SVGAnimationElement::attributeChanged(Attribute* attr)
 204void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName)
 205{
 206 if (!isSupportedAttribute(attrName)) {
 207 SVGSMILElement::svgAttributeChanged(attrName);
 208 return;
 209 }
 210
 211 animationAttributeChanged();
 212}
 213
 214void SVGAnimationElement::animationAttributeChanged()
205215{
206216 // Assumptions may not hold after an attribute change.
207217 m_animationValid = false;
208218 setInactive();
209  SVGSMILElement::attributeChanged(attr);
210219}
211220
212221float SVGAnimationElement::getStartTime() const

@@bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement
333342static inline void setTargetAttributeAnimatedCSSValue(SVGElement* targetElement, const QualifiedName& attributeName, const String& value)
334343{
335344 StylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyleProperties();
336  if (value.isNull()) {
337  if (propertySet->removeProperty(cssPropertyID(attributeName.localName())))
338  targetElement->setNeedsStyleRecalc();
339  return;
340  }
341 
342345 if (propertySet->setProperty(cssPropertyID(attributeName.localName()), value, false, 0))
343346 targetElement->setNeedsStyleRecalc();
344347}
345348
346 static inline void setTargetAttributeAnimatedXMLValue(SVGElement* targetElement, const QualifiedName& attributeName, const String& value)
 349static inline SVGAnimatedProperty* findMatchingAnimatedProperty(SVGElement* targetElement, const QualifiedName& attributeName, AnimatedPropertyType type)
347350{
348  // FIXME: Detach animVal, if value.isNull() - once animVal support is enabled.
349  targetElement->setAttribute(attributeName, value);
 351 Vector<RefPtr<SVGAnimatedProperty> > properties;
 352 targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(targetElement, attributeName, properties);
 353
 354 size_t propertiesSize = properties.size();
 355 for (size_t i = 0; i < propertiesSize; ++i) {
 356 SVGAnimatedProperty* property = properties[i].get();
 357 if (property->animatedPropertyType() != type)
 358 continue;
 359
 360 // FIXME: This check can go away once all types support animVal.
 361 if (SVGAnimatedType::supportsAnimVal(property->animatedPropertyType()))
 362 return property;
 363 return 0;
 364 }
 365
 366 return 0;
350367}
351368
352 void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value)
 369void SVGAnimationElement::applyAnimatedValue(SVGAnimationElement::ShouldApplyAnimation shouldApply, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType* animatedType)
353370{
 371 ASSERT(animatedType);
 372
 373 switch (shouldApply) {
 374 case DontApplyAnimation:
 375 ASSERT_NOT_REACHED();
 376 break;
 377 case ApplyCSSAnimation:
 378 setTargetAttributeAnimatedCSSValue(targetElement, attributeName, animatedType->valueAsString());
 379 break;
 380 case ApplyXMLAnimation:
 381 if (SVGAnimatedProperty* property = findMatchingAnimatedProperty(targetElement, attributeName, animatedType->type())) {
 382 property->animationValueChanged();
 383 break;
 384 }
 385
 386 // FIXME: Deprecated legacy code path which mutates the DOM.
 387 targetElement->setAttribute(attributeName, animatedType->valueAsString());
 388 break;
 389 }
 390}
 391
 392struct InstanceUpdateBlocker {
 393 InstanceUpdateBlocker(SVGElement* targetElement)
 394 : m_targetElement(targetElement->isStyled() ? static_cast<SVGStyledElement*>(targetElement) : 0)
 395 {
 396 if (m_targetElement)
 397 m_targetElement->setInstanceUpdatesBlocked(true);
 398 }
 399
 400 ~InstanceUpdateBlocker()
 401 {
 402 if (m_targetElement)
 403 m_targetElement->setInstanceUpdatesBlocked(false);
 404 }
 405
 406 SVGStyledElement* m_targetElement;
 407};
 408
 409void SVGAnimationElement::setTargetAttributeAnimatedValue(SVGAnimatedType* animatedType)
 410{
 411 ASSERT(animatedType);
 412
354413 SVGElement* targetElement = this->targetElement();
355414 const QualifiedName& attributeName = this->attributeName();
356415 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
357416 if (shouldApply == DontApplyAnimation)
358417 return;
359418
360  if (targetElement->isStyled())
361  static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(true);
 419 // Scope this block, so instances updates will be unblocked, before we try to update the instances.
 420 {
 421 InstanceUpdateBlocker blocker(targetElement);
 422 applyAnimatedValue(shouldApply, targetElement, attributeName, animatedType);
 423 }
362424
363  if (shouldApply == ApplyCSSAnimation)
364  setTargetAttributeAnimatedCSSValue(targetElement, attributeName, value);
365  else
366  setTargetAttributeAnimatedXMLValue(targetElement, attributeName, value);
 425 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
 426 const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
 427 const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
 428 for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
 429 if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
 430 applyAnimatedValue(shouldApply, shadowTreeElement, attributeName, animatedType);
 431 }
 432}
367433
368  if (targetElement->isStyled())
369  static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(false);
 434static inline void notifyAnimatedPropertyAboutAnimationBeginEnd(SVGAnimatedProperty* property, SVGAnimatedType* type, SVGElement* targetElement, const QualifiedName& attributeName)
 435{
 436 ASSERT(property);
 437 ASSERT(targetElement);
 438 ASSERT(property->contextElement() == targetElement);
 439 ASSERT(property->attributeName() == attributeName);
 440 if (type)
 441 property->animationStarted(type);
 442 else {
 443 // animationEnded() notifies the targetElement about the attribute change - take care of blocking
 444 // updates to instances of elements, otherwise they use trees got recloned, unncessary.
 445 InstanceUpdateBlocker blocker(targetElement);
 446 property->animationEnded();
 447 }
370448
371449 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
372450 const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();

@@void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value)
376454 if (!shadowTreeElement)
377455 continue;
378456
379  if (shouldApply == ApplyCSSAnimation)
380  setTargetAttributeAnimatedCSSValue(shadowTreeElement, attributeName, value);
 457 SVGAnimatedProperty* propertyInstance = findMatchingAnimatedProperty(shadowTreeElement, attributeName, property->animatedPropertyType());
 458 if (!propertyInstance)
 459 continue;
 460
 461 if (type)
 462 propertyInstance->animationStarted(type);
381463 else
382  setTargetAttributeAnimatedXMLValue(shadowTreeElement, attributeName, value);
 464 propertyInstance->animationEnded();
383465 }
384466}
385467
386 void SVGAnimationElement::resetAnimationState(const String& baseValue)
 468void SVGAnimationElement::animationStarted(SVGAnimatedProperty* property, SVGAnimatedType* type)
 469{
 470 ASSERT(type);
 471 notifyAnimatedPropertyAboutAnimationBeginEnd(property, type, targetElement(), attributeName());
 472}
 473
 474void SVGAnimationElement::animationEnded(SVGAnimatedProperty* property)
 475{
 476 notifyAnimatedPropertyAboutAnimationBeginEnd(property, 0, targetElement(), attributeName());
 477}
 478
 479SVGAnimatedProperty* SVGAnimationElement::animatedPropertyForType(AnimatedPropertyType type)
387480{
388  // FIXME: This extra check will go away, once animVal is enabled.
389481 SVGElement* targetElement = this->targetElement();
390482 const QualifiedName& attributeName = this->attributeName();
391483 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
392  if (shouldApply == DontApplyAnimation)
393  return;
394 
395  if (isFrozen() || shouldApply == ApplyXMLAnimation)
396  setTargetAttributeAnimatedValue(baseValue);
397  else // Only CSS animations support detaching previously animated properties so far, indicating by passing a null-string.
398  setTargetAttributeAnimatedValue(String());
 484 if (shouldApply != ApplyXMLAnimation)
 485 return 0;
 486 return findMatchingAnimatedProperty(targetElement, attributeName, type);
399487}
400488
401489SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName)

@@void SVGAnimationElement::updateAnimation(float percent, unsigned repeat, SVGSMI
662750}
663751
664752}
 753
665754#endif // ENABLE(SVG)

Source/WebCore/svg/SVGAnimationElement.h

@@enum CalcMode {
5757
5858class ConditionEventListener;
5959class TimeContainer;
 60class SVGAnimatedType;
6061
6162class SVGAnimationElement : public SVGSMILElement,
6263 public SVGTests,

@@protected:
8687
8788 bool isSupportedAttribute(const QualifiedName&);
8889 virtual void parseAttribute(Attribute*) OVERRIDE;
 90 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
8991
9092 enum AttributeType {
9193 AttributeTypeCSS,

@@protected:
98100 String byValue() const;
99101 String fromValue() const;
100102
101  String targetAttributeBaseValue() const;
102  void setTargetAttributeAnimatedValue(const String&);
 103 String targetAttributeBaseValue();
 104 void setTargetAttributeAnimatedValue(SVGAnimatedType*);
 105 SVGAnimatedProperty* animatedPropertyForType(AnimatedPropertyType);
 106
 107 void animationStarted(SVGAnimatedProperty*, SVGAnimatedType*);
 108 void animationEnded(SVGAnimatedProperty*);
103109
104110 // from SVGSMILElement
105111 virtual void startedActiveInterval();
106112 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement);
107113
108  void resetAnimationState(const String& baseValue);
109 
110114private:
111  virtual void attributeChanged(Attribute*) OVERRIDE;
 115 virtual void animationAttributeChanged() OVERRIDE;
112116
113117 virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0;
114118 virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0;

@@private:
131135 };
132136
133137 ShouldApplyAnimation shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName);
 138 void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType*);
134139
135140 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement)
136141 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)

Source/WebCore/svg/animation/SMILTimeContainer.cpp

@@void SMILTimeContainer::updateAnimations(SMILTime elapsed)
265265 if (!animation->hasValidAttributeType())
266266 continue;
267267 resultElement = animation;
 268 // FIXME: As soon as we stop mutating the DOM, we can stop passing the cached baseValue here.
 269 // Caching the baseValue results in wrong additive="sum" behaviour. Reason: the m_savedBaseValues
 270 // is NEVER reset, it always contains the state of the baseValue, at the point where we first
 271 // called baseValueFor(), typically at the beginning of the animation.
268272 resultElement->resetToBaseValue(baseValueFor(key));
269273 resultsElements.add(key, resultElement);
270274 }

Source/WebCore/svg/animation/SVGSMILElement.cpp

@@void SVGSMILElement::insertedIntoDocument()
216216
217217void SVGSMILElement::removedFromDocument()
218218{
219  m_attributeName = anyQName();
220219 if (m_timeContainer) {
221220 m_timeContainer->unschedule(this);
222221 m_timeContainer = 0;

@@void SVGSMILElement::removedFromDocument()
229228 // Clear target now, because disconnectConditions calls targetElement() which will recreate the target if we removed it sooner.
230229 if (m_targetElement) {
231230 document()->accessSVGExtensions()->removeAnimationElementFromTarget(this, m_targetElement);
 231 targetElementWillChange(m_targetElement, 0);
232232 m_targetElement = 0;
233233 }
234234
 235 m_attributeName = anyQName();
235236 SVGElement::removedFromDocument();
236237}
237238

@@void SVGSMILElement::parseBeginOrEnd(const String& parseString, BeginOrEnd begin
391392 sortTimeList(timeList);
392393}
393394
 395bool SVGSMILElement::isSupportedAttribute(const QualifiedName& attrName)
 396{
 397 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
 398 if (supportedAttributes.isEmpty()) {
 399 supportedAttributes.add(SVGNames::beginAttr);
 400 supportedAttributes.add(SVGNames::endAttr);
 401 supportedAttributes.add(SVGNames::durAttr);
 402 supportedAttributes.add(SVGNames::repeatDurAttr);
 403 supportedAttributes.add(SVGNames::repeatCountAttr);
 404 supportedAttributes.add(SVGNames::minAttr);
 405 supportedAttributes.add(SVGNames::maxAttr);
 406 supportedAttributes.add(SVGNames::attributeNameAttr);
 407 supportedAttributes.add(XLinkNames::hrefAttr);
 408 }
 409 return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
 410}
 411
394412void SVGSMILElement::parseAttribute(Attribute* attr)
395413{
396414 if (attr->name() == SVGNames::beginAttr) {

@@void SVGSMILElement::parseAttribute(Attribute* attr)
415433 SVGElement::parseAttribute(attr);
416434}
417435
418 void SVGSMILElement::attributeChanged(Attribute* attr)
 436void SVGSMILElement::svgAttributeChanged(const QualifiedName& attrName)
419437{
420  SVGElement::attributeChanged(attr);
 438 if (!isSupportedAttribute(attrName)) {
 439 SVGElement::svgAttributeChanged(attrName);
 440 return;
 441 }
421442
422  const QualifiedName& attrName = attr->name();
423443 if (attrName == SVGNames::durAttr)
424444 m_cachedDur = invalidCachedTime;
425445 else if (attrName == SVGNames::repeatDurAttr)

@@void SVGSMILElement::attributeChanged(Attribute* attr)
430450 m_cachedMin = invalidCachedTime;
431451 else if (attrName == SVGNames::maxAttr)
432452 m_cachedMax = invalidCachedTime;
433  else if (attrName == SVGNames::attributeNameAttr) {
434  if (inDocument())
435  m_attributeName = constructQualifiedName(this, attr->value());
436  }
437 
438  if (inDocument()) {
 453 else if (inDocument()) {
439454 if (attrName == SVGNames::beginAttr)
440455 beginListChanged(elapsed());
441456 else if (attrName == SVGNames::endAttr)
442457 endListChanged(elapsed());
 458 else if (attrName == SVGNames::attributeNameAttr)
 459 m_attributeName = constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr));
 460 else if (attrName.matches(XLinkNames::hrefAttr)) {
 461 if (SVGElement* targetElement = this->targetElement())
 462 document()->accessSVGExtensions()->removeAllAnimationElementsFromTarget(targetElement);
 463 }
443464 }
 465
 466 animationAttributeChanged();
444467}
445468
446469inline Element* SVGSMILElement::eventBaseFor(const Condition& condition)

@@SVGElement* SVGSMILElement::targetElement()
518541 if (m_targetElement)
519542 return m_targetElement;
520543
521  String href = xlinkHref();
 544 String href = getAttribute(XLinkNames::hrefAttr);
522545 ContainerNode* target = href.isEmpty() ? parentNode() : SVGURIReference::targetElementFromIRIString(href, document());
523546 if (!target || !target->isSVGElement())
524547 return 0;
525548
526  m_targetElement = static_cast<SVGElement*>(target);
 549 SVGElement* targetElement = static_cast<SVGElement*>(target);
 550 targetElementWillChange(m_targetElement, targetElement);
 551 m_targetElement = targetElement;
527552 document()->accessSVGExtensions()->addAnimationElementToTarget(this, m_targetElement);
528 
529  targetElementDidChange(m_targetElement);
530 
531553 return m_targetElement;
532554}
533555
 556void SVGSMILElement::targetElementWillChange(SVGElement*, SVGElement*)
 557{
 558 // If the animation state is Active, always reset to a clear state before leaving the old target element.
 559 if (m_activeState == Active)
 560 endedActiveInterval();
 561}
 562
534563void SVGSMILElement::resetTargetElement()
535564{
 565 targetElementWillChange(m_targetElement, 0);
536566 m_targetElement = 0;
537 
538  // Force the animation to recompute values that are only calculated when an animation becomes active.
539  // Failing to do this means that a target reset and change during active animation may result in
540  // invalid state.
541  m_activeState = Inactive;
542 
543  targetElementDidChange(0);
 567 animationAttributeChanged();
544568}
545569
546570SMILTime SVGSMILElement::elapsed() const

@@SVGSMILElement::FillMode SVGSMILElement::fill() const
577601 return value == freeze ? FillFreeze : FillRemove;
578602}
579603
580 String SVGSMILElement::xlinkHref() const
581 {
582  return getAttribute(XLinkNames::hrefAttr);
583 }
584 
585604SMILTime SVGSMILElement::dur() const
586605{
587606 if (m_cachedDur != invalidCachedTime)

Source/WebCore/svg/animation/SVGSMILElement.h

@@public:
4444
4545 static bool isSMILElement(Node*);
4646
 47 bool isSupportedAttribute(const QualifiedName&);
4748 virtual void parseAttribute(Attribute*) OVERRIDE;
48  virtual void attributeChanged(Attribute*) OVERRIDE;
 49 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
4950 virtual void insertedIntoDocument();
5051 virtual void removedFromDocument();
5152
5253 virtual bool hasValidAttributeType() = 0;
 54 virtual void animationAttributeChanged() = 0;
5355
5456 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); }
5557

@@public:
7476
7577 FillMode fill() const;
7678
77  String xlinkHref() const;
78 
7979 SMILTime dur() const;
8080 SMILTime repeatDur() const;
8181 SMILTime repeatCount() const;

@@protected:
115115 void setInactive() { m_activeState = Inactive; }
116116
117117 // Sub-classes may need to take action when the target is changed.
118  virtual void targetElementDidChange(SVGElement*) { }
 118 virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget);
119119 virtual void endedActiveInterval();
120120
121121private:

Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h

@@public:
4040 SVGAnimatedStaticPropertyTearOff<int>::setBaseVal(property, ec);
4141 }
4242
43  static PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<EnumType> > create(SVGElement* contextElement, const QualifiedName& attributeName, EnumType& property)
 43 static PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<EnumType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, EnumType& property)
4444 {
4545 ASSERT(contextElement);
46  return adoptRef(new SVGAnimatedEnumerationPropertyTearOff<EnumType>(contextElement, attributeName, reinterpret_cast<int&>(property)));
 46 return adoptRef(new SVGAnimatedEnumerationPropertyTearOff<EnumType>(contextElement, attributeName, animatedPropertyType, reinterpret_cast<int&>(property)));
4747 }
4848
4949 EnumType& currentAnimatedValue() { return reinterpret_cast<EnumType&>(SVGAnimatedStaticPropertyTearOff<int>::currentAnimatedValue()); }
5050
5151private:
52  SVGAnimatedEnumerationPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, int& property)
53  : SVGAnimatedStaticPropertyTearOff<int>(contextElement, attributeName, property)
 52 SVGAnimatedEnumerationPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, int& property)
 53 : SVGAnimatedStaticPropertyTearOff<int>(contextElement, attributeName, animatedPropertyType, property)
5454 {
5555 }
5656};

Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h

@@public:
8686 bool isAnimating() const { return false; }
8787 PropertyType& currentAnimatedValue() { return m_values; }
8888
89  static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& values)
 89 static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values)
9090 {
9191 ASSERT(contextElement);
92  return adoptRef(new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, values));
 92 return adoptRef(new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, values));
9393 }
9494
9595protected:
96  SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& values)
97  : SVGAnimatedProperty(contextElement, attributeName)
 96 SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values)
 97 : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType)
9898 , m_values(values)
9999 {
100100 if (!values.isEmpty())

Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h

@@public:
5151 return static_pointer_cast<SVGPathSegListPropertyTearOff>(m_baseVal)->removeItemFromList(segment, shouldSynchronizeWrappers);
5252 }
5353
54  static PassRefPtr<SVGAnimatedPathSegListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, SVGPathSegList& values)
 54 static PassRefPtr<SVGAnimatedPathSegListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegList& values)
5555 {
5656 ASSERT(contextElement);
57  return adoptRef(new SVGAnimatedPathSegListPropertyTearOff(contextElement, attributeName, values));
 57 return adoptRef(new SVGAnimatedPathSegListPropertyTearOff(contextElement, attributeName, animatedPropertyType, values));
5858 }
5959
6060private:
61  SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, SVGPathSegList& values)
62  : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attributeName, values)
 61 SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegList& values)
 62 : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attributeName, animatedPropertyType, values)
6363 {
6464 }
6565};

Source/WebCore/svg/properties/SVGAnimatedProperty.h

2828
2929namespace WebCore {
3030
 31class SVGAnimatedType;
3132class SVGElement;
3233
3334class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty> {
3435public:
3536 SVGElement* contextElement() const { return m_contextElement.get(); }
3637 const QualifiedName& attributeName() const { return m_attributeName; }
 38 AnimatedPropertyType animatedPropertyType() const { return m_animatedPropertyType; }
3739
3840 void commitChange()
3941 {

@@public:
4345 }
4446
4547 virtual bool isAnimatedListTearOff() const { return false; }
46  virtual void updateAnimVal(void*) { ASSERT_NOT_REACHED(); }
 48
 49 virtual void animationStarted(SVGAnimatedType*) { ASSERT_NOT_REACHED(); }
 50 virtual void animationEnded() { ASSERT_NOT_REACHED(); }
 51 virtual void animationValueChanged() { ASSERT_NOT_REACHED(); }
 52 virtual SVGGenericAnimatedType currentBaseValue(AnimatedPropertyType) const { ASSERT_NOT_REACHED(); return 0; }
4753
4854 // Caching facilities.
4955 typedef HashMap<SVGAnimatedPropertyDescription, RefPtr<SVGAnimatedProperty>, SVGAnimatedPropertyDescriptionHash, SVGAnimatedPropertyDescriptionHashTraits> Cache;

@@public:
8288 SVGAnimatedPropertyDescription key(element, info->propertyIdentifier);
8389 RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key);
8490 if (!wrapper) {
85  wrapper = TearOffType::create(element, info->attributeName, property);
 91 wrapper = TearOffType::create(element, info->attributeName, info->animatedPropertyType, property);
8692 animatedPropertyCache()->set(key, wrapper);
8793 }
8894 return static_pointer_cast<TearOffType>(wrapper).release();

@@public:
124130 }
125131
126132protected:
127  SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName)
 133 SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType)
128134 : m_contextElement(contextElement)
129135 , m_attributeName(attributeName)
 136 , m_animatedPropertyType(animatedPropertyType)
130137 {
131138 }
132139

@@private:
139146
140147 RefPtr<SVGElement> m_contextElement;
141148 const QualifiedName& m_attributeName;
 149 AnimatedPropertyType m_animatedPropertyType;
142150};
143151
144152}

Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h

2222
2323#if ENABLE(SVG)
2424#include "SVGAnimatedProperty.h"
 25#include "SVGAnimatedType.h"
2526#include "SVGPropertyTearOff.h"
2627
2728namespace WebCore {

@@public:
4344 return m_animVal.get();
4445 }
4546
46  static PassRefPtr<SVGAnimatedPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
 47 static PassRefPtr<SVGAnimatedPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property)
4748 {
4849 ASSERT(contextElement);
49  return adoptRef(new SVGAnimatedPropertyTearOff<PropertyType>(contextElement, attributeName, property));
 50 return adoptRef(new SVGAnimatedPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, property));
5051 }
5152
5253 bool isAnimating() const { return m_isAnimating; }

@@public:
5859 return static_cast<SVGPropertyTearOff<PropertyType>*>(m_animVal.get())->propertyReference();
5960 }
6061
61  virtual void updateAnimVal(void* value)
 62 virtual SVGGenericAnimatedType currentBaseValue(AnimatedPropertyType expectedPropertyType) const
6263 {
63  if (value) {
64  static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->updateAnimVal(reinterpret_cast<PropertyType*>(value));
65  m_isAnimating = true;
66  return;
67  }
 64 ASSERT(animatedPropertyType() == expectedPropertyType);
 65 // If these types don't match, always return 0 here in release builds, to avoid trashing memory.
 66 if (expectedPropertyType != animatedPropertyType())
 67 return 0;
 68 return &m_property;
 69 }
 70
 71 virtual void animationStarted(SVGAnimatedType* animatedType)
 72 {
 73 ASSERT(animatedType);
 74 ASSERT(animatedType->type() == animatedPropertyType());
 75 static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->setValue(*reinterpret_cast<PropertyType*>(animatedType->variant()));
 76 m_isAnimating = true;
 77 }
6878
69  static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->updateAnimVal(&m_property);
 79 virtual void animationEnded()
 80 {
 81 ASSERT(m_isAnimating);
 82 static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->setValue(m_property);
7083 m_isAnimating = false;
 84
 85 ASSERT(contextElement());
 86 contextElement()->svgAttributeChanged(attributeName());
 87 }
 88
 89 virtual void animationValueChanged()
 90 {
 91 ASSERT(contextElement());
 92 contextElement()->svgAttributeChanged(attributeName());
7193 }
7294
7395private:
74  SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
75  : SVGAnimatedProperty(contextElement, attributeName)
 96 SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property)
 97 : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType)
7698 , m_property(property)
7799 , m_isAnimating(false)
78100 {
79101 }
80102
 103#ifndef NDEBUG
 104 virtual ~SVGAnimatedPropertyTearOff()
 105 {
 106 ASSERT(!m_isAnimating);
 107 }
 108#endif
 109
81110 PropertyType& m_property;
82111 bool m_isAnimating;
83112 RefPtr<SVGProperty> m_baseVal;

Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h

@@public:
4949 bool isAnimating() const { return false; }
5050 PropertyType& currentAnimatedValue() { return m_property; }
5151
52  static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
 52 static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property)
5353 {
5454 ASSERT(contextElement);
55  return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, property));
 55 return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, property));
5656 }
5757
5858protected:
59  SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
60  : SVGAnimatedProperty(contextElement, attributeName)
 59 SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property)
 60 : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType)
6161 , m_property(property)
6262 {
6363 }

Source/WebCore/svg/properties/SVGAnimatedTransformListPropertyTearOff.h

@@public:
4343 return m_animVal.get();
4444 }
4545
46  static PassRefPtr<SVGAnimatedTransformListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, SVGTransformList& values)
 46 static PassRefPtr<SVGAnimatedTransformListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGTransformList& values)
4747 {
4848 ASSERT(contextElement);
49  return adoptRef(new SVGAnimatedTransformListPropertyTearOff(contextElement, attributeName, values));
 49 return adoptRef(new SVGAnimatedTransformListPropertyTearOff(contextElement, attributeName, animatedPropertyType, values));
5050 }
5151
5252private:
53  SVGAnimatedTransformListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, SVGTransformList& values)
54  : SVGAnimatedListPropertyTearOff<SVGTransformList>(contextElement, attributeName, values)
 53 SVGAnimatedTransformListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGTransformList& values)
 54 : SVGAnimatedListPropertyTearOff<SVGTransformList>(contextElement, attributeName, animatedPropertyType, values)
5555 {
5656 }
5757};

Source/WebCore/svg/properties/SVGPropertyInfo.h

@@struct SVGPropertyInfo {
7070 LookupOrCreateWrapperForAnimatedProperty lookupOrCreateWrapperForAnimatedProperty;
7171};
7272
 73typedef void* SVGGenericAnimatedType;
 74
7375}
7476
7577#endif // ENABLE(SVG)

Source/WebCore/svg/properties/SVGPropertyTearOff.h

@@public:
4949 PropertyType& propertyReference() { return *m_value; }
5050 SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty.get(); }
5151
52  // Used only by the list tear offs!
5352 void setValue(PropertyType& value)
5453 {
5554 if (m_valueIsCopy)

@@public:
9392
9493 virtual SVGPropertyRole role() const { return m_role; }
9594
96  void updateAnimVal(PropertyType* value)
97  {
98  ASSERT(!m_valueIsCopy);
99  ASSERT(m_role == AnimValRole);
100  m_value = value;
101  }
102 
10395protected:
10496 SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& value)
10597 : m_animatedProperty(animatedProperty)

LayoutTests/ChangeLog

 12012-03-10 Nikolas Zimmermann <nzimmermann@rim.com>
 2
 3 animations update baseVal instead of animVal
 4 https://bugs.webkit.org/show_bug.cgi?id=12437
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Update test expectations after turning on animVal support for SVGLength, the first primitive now support animVal.
 9 Added several new tests, checking additive behaviour with SVGLength objects, removing animation elements
 10 while animations are running (+ test repainting of those cases), etc.
 11
 12 * platform/mac/svg/repaint/repainting-after-animation-element-removal-expected.png: Added.
 13 * platform/mac/svg/repaint/repainting-after-animation-element-removal-expected.txt: Added.
 14 * svg/animations/additive-from-to-width-animation-expected.txt: Added.
 15 * svg/animations/additive-from-to-width-animation.html: Added.
 16 * svg/animations/additive-values-width-animation-expected.txt: Added.
 17 * svg/animations/additive-values-width-animation.html: Added.
 18 * svg/animations/animVal-basics-expected.txt:
 19 * svg/animations/animate-calcMode-spline-by-expected.txt:
 20 * svg/animations/animate-calcMode-spline-from-by-expected.txt:
 21 * svg/animations/animate-calcMode-spline-from-to-expected.txt:
 22 * svg/animations/animate-calcMode-spline-to-expected.txt:
 23 * svg/animations/animate-calcMode-spline-values-expected.txt:
 24 * svg/animations/animate-elem-02-t-drt-expected.txt:
 25 * svg/animations/animate-elem-09-t-drt-expected.txt:
 26 * svg/animations/animate-elem-10-t-drt-expected.txt:
 27 * svg/animations/animate-elem-11-t-drt-expected.txt:
 28 * svg/animations/animate-elem-12-t-drt-expected.txt:
 29 * svg/animations/animate-elem-13-t-drt-expected.txt:
 30 * svg/animations/animate-elem-14-t-drt-expected.txt:
 31 * svg/animations/animate-elem-15-t-drt-expected.txt:
 32 * svg/animations/animate-elem-16-t-drt-expected.txt:
 33 * svg/animations/animate-elem-17-t-drt-expected.txt:
 34 * svg/animations/animate-elem-18-t-drt-expected.txt:
 35 * svg/animations/animate-elem-19-t-drt-expected.txt:
 36 * svg/animations/animate-end-attribute-expected.txt:
 37 * svg/animations/animate-endElement-beginElement-expected.txt:
 38 * svg/animations/animate-from-to-keyTimes-expected.txt:
 39 * svg/animations/animate-insert-begin-expected.txt:
 40 * svg/animations/animate-insert-no-begin-expected.txt:
 41 * svg/animations/animate-keySplines-expected.txt:
 42 * svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt:
 43 * svg/animations/attributeTypes-expected.txt:
 44 * svg/animations/change-baseVal-while-animating-fill-freeze-2-expected.txt: Added.
 45 * svg/animations/change-baseVal-while-animating-fill-freeze-2.html: Added.
 46 * svg/animations/change-baseVal-while-animating-fill-freeze-expected.txt: Added.
 47 * svg/animations/change-baseVal-while-animating-fill-freeze.html: Added.
 48 * svg/animations/change-baseVal-while-animating-fill-remove-2-expected.txt: Added.
 49 * svg/animations/change-baseVal-while-animating-fill-remove-2.html: Added.
 50 * svg/animations/change-baseVal-while-animating-fill-remove-expected.txt: Added.
 51 * svg/animations/change-baseVal-while-animating-fill-remove.html: Added.
 52 * svg/animations/change-target-while-animating-SVG-property-expected.txt: Added.
 53 * svg/animations/change-target-while-animating-SVG-property.html: Added.
 54 * svg/animations/multiple-animations-fill-freeze-expected.txt: Added.
 55 * svg/animations/multiple-animations-fill-freeze.html: Added.
 56 * svg/animations/remove-animation-element-while-animation-is-running-expected.txt: Added.
 57 * svg/animations/remove-animation-element-while-animation-is-running.html: Added.
 58 * svg/animations/resources/additive-from-to-width-animation.svg: Added.
 59 * svg/animations/resources/additive-values-width-animation.svg: Added.
 60 * svg/animations/resources/change-baseVal-while-animating-fill-freeze.svg: Added.
 61 * svg/animations/resources/change-baseVal-while-animating-fill-remove.svg: Added.
 62 * svg/animations/resources/change-target-while-animating-SVG-property.svg: Added.
 63 * svg/animations/resources/multiple-animations-fill-freeze.svg: Added.
 64 * svg/animations/resources/remove-animation-element-while-animation-is-running.svg: Added.
 65 * svg/animations/script-tests/additive-from-to-width-animation.js: Added.
 66 (sample1):
 67 (sample2):
 68 (sample3):
 69 (executeTest):
 70 * svg/animations/script-tests/additive-values-width-animation.js: Added.
 71 (sample1):
 72 (sample2):
 73 (sample3):
 74 (changeBaseVal):
 75 (sample4):
 76 (sample5):
 77 (executeTest):
 78 * svg/animations/script-tests/animVal-basics.js:
 79 (sample2):
 80 (sample3):
 81 * svg/animations/script-tests/animate-calcMode-spline-by.js:
 82 (sample2):
 83 (sample3):
 84 * svg/animations/script-tests/animate-calcMode-spline-from-by.js:
 85 (sample2):
 86 (sample3):
 87 * svg/animations/script-tests/animate-calcMode-spline-from-to.js:
 88 (sample2):
 89 (sample3):
 90 * svg/animations/script-tests/animate-calcMode-spline-to.js:
 91 (sample2):
 92 (sample3):
 93 * svg/animations/script-tests/animate-calcMode-spline-values.js:
 94 (sample2):
 95 (sample3):
 96 * svg/animations/script-tests/animate-elem-02-t-drt.js:
 97 (sampleAfterBegin):
 98 (sampleAfterMid):
 99 (sampleAfterBeginOfFirstRepetition):
 100 (sampleAfterMidOfFirstRepetition):
 101 * svg/animations/script-tests/animate-elem-09-t-drt.js:
 102 (sample1):
 103 (sample2):
 104 (sample3):
 105 (sample4):
 106 * svg/animations/script-tests/animate-elem-10-t-drt.js:
 107 (sample1):
 108 (sample2):
 109 (sample3):
 110 (sample4):
 111 * svg/animations/script-tests/animate-elem-11-t-drt.js:
 112 (sample1):
 113 (sample2):
 114 (sample3):
 115 (sample4):
 116 * svg/animations/script-tests/animate-elem-12-t-drt.js:
 117 (sample1):
 118 (sample2):
 119 (sample3):
 120 (sample4):
 121 * svg/animations/script-tests/animate-elem-13-t-drt.js:
 122 (sample1):
 123 (sample2):
 124 (sample3):
 125 * svg/animations/script-tests/animate-elem-14-t-drt.js:
 126 (sample1):
 127 (sample2):
 128 (sample3):
 129 (sample4):
 130 * svg/animations/script-tests/animate-elem-15-t-drt.js:
 131 (sample1):
 132 (sample2):
 133 (sample3):
 134 (sample4):
 135 * svg/animations/script-tests/animate-elem-16-t-drt.js:
 136 (sample1):
 137 (sample2):
 138 (sample3):
 139 (sample4):
 140 * svg/animations/script-tests/animate-elem-17-t-drt.js:
 141 (sample1):
 142 (sample2):
 143 (sample3):
 144 (sample4):
 145 * svg/animations/script-tests/animate-elem-18-t-drt.js:
 146 (sample1):
 147 (sample2):
 148 (sample3):
 149 (sample4):
 150 * svg/animations/script-tests/animate-elem-19-t-drt.js:
 151 (sample1):
 152 (sample2):
 153 (sample3):
 154 (sample4):
 155 * svg/animations/script-tests/animate-end-attribute.js:
 156 (sample2):
 157 (sample3):
 158 * svg/animations/script-tests/animate-endElement-beginElement.js:
 159 (sample1):
 160 * svg/animations/script-tests/animate-from-to-keyTimes.js:
 161 (sample1):
 162 (sample2):
 163 * svg/animations/script-tests/animate-insert-begin.js:
 164 (sample1):
 165 (sample2):
 166 * svg/animations/script-tests/animate-insert-no-begin.js:
 167 (sample1):
 168 (sample2):
 169 * svg/animations/script-tests/animate-keySplines.js:
 170 (sample1):
 171 (sample2):
 172 (sample3):
 173 * svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js:
 174 (sample1):
 175 (sample2):
 176 (sample3):
 177 * svg/animations/script-tests/attributeTypes.js:
 178 (sample1):
 179 (sample2):
 180 (sample3):
 181 * svg/animations/script-tests/change-baseVal-while-animating-fill-freeze-2.js: Added.
 182 (sample1):
 183 (sample2):
 184 (sample3):
 185 (sample4):
 186 (sample5):
 187 (executeTest):
 188 * svg/animations/script-tests/change-baseVal-while-animating-fill-freeze.js: Added.
 189 (sample1):
 190 (sample2):
 191 (sample3):
 192 (sample4):
 193 (sample5):
 194 (executeTest):
 195 * svg/animations/script-tests/change-baseVal-while-animating-fill-remove-2.js: Added.
 196 (sample1):
 197 (sample2):
 198 (sample3):
 199 (sample4):
 200 (sample5):
 201 (executeTest):
 202 * svg/animations/script-tests/change-baseVal-while-animating-fill-remove.js: Added.
 203 (sample1):
 204 (sample2):
 205 (sample3):
 206 (sample4):
 207 (sample5):
 208 (executeTest):
 209 * svg/animations/script-tests/change-target-while-animating-SVG-property.js: Added.
 210 (sample1):
 211 (sample2):
 212 (sample3):
 213 (sample4):
 214 (sample5):
 215 (executeTest):
 216 * svg/animations/script-tests/multiple-animations-fill-freeze.js: Added.
 217 (sample1):
 218 (sample2):
 219 (sample3):
 220 (sample4):
 221 (sample5):
 222 (sample6):
 223 (sample7):
 224 (sample8):
 225 (executeTest):
 226 * svg/animations/script-tests/remove-animation-element-while-animation-is-running.js: Added.
 227 (sample1):
 228 (sample2):
 229 (sample3):
 230 (sample4):
 231 (executeTest):
 232 * svg/animations/script-tests/svglength-animation-LengthModeHeight.js:
 233 (sample2):
 234 (sample3):
 235 * svg/animations/script-tests/svglength-animation-LengthModeOther.js:
 236 (sample2):
 237 (sample3):
 238 * svg/animations/script-tests/svglength-animation-LengthModeWidth.js:
 239 (sample2):
 240 (sample3):
 241 * svg/animations/script-tests/svglength-animation-invalid-value-1.js:
 242 (sample2):
 243 * svg/animations/script-tests/svglength-animation-invalid-value-2.js:
 244 (sample2):
 245 * svg/animations/script-tests/svglength-animation-invalid-value-3.js:
 246 (sample2):
 247 * svg/animations/script-tests/svglength-animation-number-to-number.js:
 248 (sample2):
 249 (sample3):
 250 * svg/animations/script-tests/svglength-animation-px-to-cm.js:
 251 (sample2):
 252 (sample3):
 253 * svg/animations/script-tests/svglength-animation-px-to-ems.js:
 254 (sample2):
 255 (sample3):
 256 * svg/animations/script-tests/svglength-animation-px-to-exs.js:
 257 (sample2):
 258 (sample3):
 259 * svg/animations/script-tests/svglength-animation-px-to-in.js:
 260 (sample2):
 261 (sample3):
 262 * svg/animations/script-tests/svglength-animation-px-to-number.js:
 263 (sample2):
 264 (sample3):
 265 * svg/animations/script-tests/svglength-animation-px-to-pc.js:
 266 (sample2):
 267 (sample3):
 268 * svg/animations/script-tests/svglength-animation-px-to-percentage.js:
 269 (sample2):
 270 (sample3):
 271 * svg/animations/script-tests/svglength-animation-px-to-pt.js:
 272 (sample2):
 273 (sample3):
 274 * svg/animations/script-tests/svglength-animation-px-to-px.js:
 275 (sample2):
 276 (sample3):
 277 * svg/animations/script-tests/svglength-animation-unitType.js:
 278 (sample1):
 279 (sample2):
 280 (sample3):
 281 * svg/animations/script-tests/svglength-animation-values.js:
 282 (sample2):
 283 (sample3):
 284 (sample4):
 285 (sample5):
 286 * svg/animations/svglength-animation-LengthModeHeight-expected.txt:
 287 * svg/animations/svglength-animation-LengthModeOther-expected.txt:
 288 * svg/animations/svglength-animation-LengthModeWidth-expected.txt:
 289 * svg/animations/svglength-animation-invalid-value-1-expected.txt:
 290 * svg/animations/svglength-animation-invalid-value-2-expected.txt:
 291 * svg/animations/svglength-animation-invalid-value-3-expected.txt:
 292 * svg/animations/svglength-animation-number-to-number-expected.txt:
 293 * svg/animations/svglength-animation-px-to-cm-expected.txt:
 294 * svg/animations/svglength-animation-px-to-ems-expected.txt:
 295 * svg/animations/svglength-animation-px-to-exs-expected.txt:
 296 * svg/animations/svglength-animation-px-to-in-expected.txt:
 297 * svg/animations/svglength-animation-px-to-number-expected.txt:
 298 * svg/animations/svglength-animation-px-to-pc-expected.txt:
 299 * svg/animations/svglength-animation-px-to-percentage-expected.txt:
 300 * svg/animations/svglength-animation-px-to-pt-expected.txt:
 301 * svg/animations/svglength-animation-px-to-px-expected.txt:
 302 * svg/animations/svglength-animation-unitType-expected.txt:
 303 * svg/animations/svglength-animation-values-expected.txt:
 304 * svg/repaint/repainting-after-animation-element-removal.svg: Added.
 305
13062012-03-09 Robert Kroeger <rjkroege@chromium.org>
2307
3308 Handle more Gesture* events by performing scrolls on the correct target ScrollableArea

LayoutTests/platform/mac/svg/repaint/repainting-after-animation-element-removal-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/mac/svg/repaint/repainting-after-animation-element-removal-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderSVGRoot {svg} at (0,0) size 50x50
 5 RenderSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]

LayoutTests/svg/animations/additive-from-to-width-animation-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This tests multiple additive='sum' animations running at the same time
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect.width.animVal.value is 20
 10PASS rect.width.baseVal.value is 10
 11PASS rect.width.animVal.value is 60
 12PASS rect.width.baseVal.value is 10
 13PASS rect.width.animVal.value is 100
 14PASS rect.width.baseVal.value is 10
 15PASS rect.width.animVal.value is 100
 16PASS rect.width.baseVal.value is 10
 17PASS successfullyParsed is true
 18
 19TEST COMPLETE
 20

LayoutTests/svg/animations/additive-from-to-width-animation.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/additive-from-to-width-animation.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/additive-values-width-animation-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This tests values animation and additive='sum'
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect.width.animVal.value is 10
 10PASS rect.width.baseVal.value is 10
 11PASS rect.width.animVal.value is 60
 12PASS rect.width.baseVal.value is 10
 13PASS rect.width.animVal.value is 93.3
 14PASS rect.width.baseVal.value is 10
 15PASS rect.width.animVal.value is 143.33
 16PASS rect.width.baseVal.value is 60
 17PASS rect.width.animVal.value is 160
 18PASS rect.width.baseVal.value is 60
 19PASS rect.width.animVal.value is 160
 20PASS rect.width.baseVal.value is 60
 21PASS rect.width.animVal.value is 160
 22PASS rect.width.baseVal.value is 60
 23PASS successfullyParsed is true
 24
 25TEST COMPLETE
 26

LayoutTests/svg/animations/additive-values-width-animation.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/additive-values-width-animation.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/animVal-basics-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 200
99PASS rect.width.baseVal.value is 200
1010PASS rect.width.animVal.value is 150
11 PASS rect.width.baseVal.value is 150
 11PASS rect.width.baseVal.value is 200
1212PASS rect.width.animVal.value is 100
13 PASS rect.width.baseVal.value is 100
 13PASS rect.width.baseVal.value is 200
1414PASS rect.width.animVal.value is 200
1515PASS rect.width.baseVal.value is 200
1616PASS successfullyParsed is true

LayoutTests/svg/animations/animate-calcMode-spline-by-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.x.animVal.value is 100
99PASS rect.x.baseVal.value is 100
1010PASS rect.x.animVal.value is 18.8
11 PASS rect.x.baseVal.value is 18.8
 11PASS rect.x.baseVal.value is 100
1212PASS rect.x.animVal.value is 0
13 PASS rect.x.baseVal.value is 0
 13PASS rect.x.baseVal.value is 100
1414PASS rect.x.animVal.value is 100
1515PASS rect.x.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/animate-calcMode-spline-from-by-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.x.animVal.value is 100
99PASS rect.x.baseVal.value is 100
1010PASS rect.x.animVal.value is 18.8
11 PASS rect.x.baseVal.value is 18.8
 11PASS rect.x.baseVal.value is 100
1212PASS rect.x.animVal.value is 0
13 PASS rect.x.baseVal.value is 0
 13PASS rect.x.baseVal.value is 100
1414PASS rect.x.animVal.value is 100
1515PASS rect.x.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/animate-calcMode-spline-from-to-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.x.animVal.value is 100
99PASS rect.x.baseVal.value is 100
1010PASS rect.x.animVal.value is 18.8
11 PASS rect.x.baseVal.value is 18.8
 11PASS rect.x.baseVal.value is 100
1212PASS rect.x.animVal.value is 0
13 PASS rect.x.baseVal.value is 0
 13PASS rect.x.baseVal.value is 100
1414PASS rect.x.animVal.value is 100
1515PASS rect.x.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/animate-calcMode-spline-to-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.x.animVal.value is 100
99PASS rect.x.baseVal.value is 100
1010PASS rect.x.animVal.value is 18.8
11 PASS rect.x.baseVal.value is 18.8
 11PASS rect.x.baseVal.value is 100
1212PASS rect.x.animVal.value is 0
13 PASS rect.x.baseVal.value is 0
 13PASS rect.x.baseVal.value is 100
1414PASS rect.x.animVal.value is 100
1515PASS rect.x.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/animate-calcMode-spline-values-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.x.animVal.value is 100
99PASS rect.x.baseVal.value is 100
1010PASS rect.x.animVal.value is 18.8
11 PASS rect.x.baseVal.value is 18.8
 11PASS rect.x.baseVal.value is 100
1212PASS rect.x.animVal.value is 0
13 PASS rect.x.baseVal.value is 0
 13PASS rect.x.baseVal.value is 100
1414PASS rect.x.animVal.value is 100
1515PASS rect.x.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/animate-elem-02-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.height.animVal.value is 200
 10PASS rect1.height.baseVal.value is 20
1011PASS rect2.height.animVal.value is 220
 12PASS rect2.height.baseVal.value is 20
1113PASS rect3.height.animVal.value is 200
 14PASS rect3.height.baseVal.value is 20
1215PASS rect1.height.animVal.value is 200
 16PASS rect1.height.baseVal.value is 20
1317PASS rect2.height.animVal.value is 220
 18PASS rect2.height.baseVal.value is 20
1419PASS rect3.height.animVal.value is 200
 20PASS rect3.height.baseVal.value is 20
1521PASS rect1.height.animVal.value is 20
 22PASS rect1.height.baseVal.value is 20
1623PASS rect2.height.animVal.value is 40
 24PASS rect2.height.baseVal.value is 20
1725PASS rect3.height.animVal.value is 20
 26PASS rect3.height.baseVal.value is 20
1827PASS rect1.height.animVal.value is 20
 28PASS rect1.height.baseVal.value is 20
1929PASS rect2.height.animVal.value is 40
 30PASS rect2.height.baseVal.value is 20
2031PASS rect3.height.animVal.value is 20
 32PASS rect3.height.baseVal.value is 20
2133PASS rect1.height.animVal.value is 200
 34PASS rect1.height.baseVal.value is 20
2235PASS rect2.height.animVal.value is 220
 36PASS rect2.height.baseVal.value is 20
2337PASS rect3.height.animVal.value is 220
 38PASS rect3.height.baseVal.value is 20
2439PASS rect1.height.animVal.value is 200
 40PASS rect1.height.baseVal.value is 20
2541PASS rect2.height.animVal.value is 220
 42PASS rect2.height.baseVal.value is 20
2643PASS rect3.height.animVal.value is 220
 44PASS rect3.height.baseVal.value is 20
2745PASS rect1.height.animVal.value is 20
 46PASS rect1.height.baseVal.value is 20
2847PASS rect2.height.animVal.value is 40
 48PASS rect2.height.baseVal.value is 20
2949PASS rect3.height.animVal.value is 40
 50PASS rect3.height.baseVal.value is 20
3051PASS rect1.height.animVal.value is 20
 52PASS rect1.height.baseVal.value is 20
3153PASS rect2.height.animVal.value is 40
 54PASS rect2.height.baseVal.value is 20
3255PASS rect3.height.animVal.value is 40
 56PASS rect3.height.baseVal.value is 20
3357PASS rect1.height.animVal.value is 20
 58PASS rect1.height.baseVal.value is 20
3459PASS rect2.height.animVal.value is 40
 60PASS rect2.height.baseVal.value is 20
3561PASS rect3.height.animVal.value is 40
 62PASS rect3.height.baseVal.value is 20
3663PASS rect1.height.animVal.value is 20
 64PASS rect1.height.baseVal.value is 20
3765PASS rect2.height.animVal.value is 40
 66PASS rect2.height.baseVal.value is 20
3867PASS rect3.height.animVal.value is 40
 68PASS rect3.height.baseVal.value is 20
3969PASS successfullyParsed is true
4070
4171TEST COMPLETE

LayoutTests/svg/animations/animate-elem-09-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.height.animVal.value is 210
 10PASS rect1.height.baseVal.value is 210
1011PASS rootSVGElement.getTransformToElement(rect2).e is -250
1112PASS rootSVGElement.getTransformToElement(rect2).f is -250
1213PASS rect1.height.animVal.value is 177
 14PASS rect1.height.baseVal.value is 210
1315PASS rootSVGElement.getTransformToElement(rect2).e is -250
1416PASS rootSVGElement.getTransformToElement(rect2).f is -217
1517PASS rect1.height.animVal.value is 177
 18PASS rect1.height.baseVal.value is 210
1619PASS rootSVGElement.getTransformToElement(rect2).e is -250
1720PASS rootSVGElement.getTransformToElement(rect2).f is -217
1821PASS rect1.height.animVal.value is 121
 22PASS rect1.height.baseVal.value is 210
1923PASS rootSVGElement.getTransformToElement(rect2).e is -250
2024PASS rootSVGElement.getTransformToElement(rect2).f is -161
2125PASS rect1.height.animVal.value is 121
 26PASS rect1.height.baseVal.value is 210
2227PASS rootSVGElement.getTransformToElement(rect2).e is -250
2328PASS rootSVGElement.getTransformToElement(rect2).f is -161
2429PASS rect1.height.animVal.value is 10
 30PASS rect1.height.baseVal.value is 210
2531PASS rootSVGElement.getTransformToElement(rect2).e is -250
2632PASS rootSVGElement.getTransformToElement(rect2).f is -50
2733PASS rect1.height.animVal.value is 10
 34PASS rect1.height.baseVal.value is 210
2835PASS rootSVGElement.getTransformToElement(rect2).e is -250
2936PASS rootSVGElement.getTransformToElement(rect2).f is -50
3037PASS rect1.height.animVal.value is 10
 38PASS rect1.height.baseVal.value is 210
3139PASS rootSVGElement.getTransformToElement(rect2).e is -250
3240PASS rootSVGElement.getTransformToElement(rect2).f is -50
3341PASS successfullyParsed is true

LayoutTests/svg/animations/animate-elem-10-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.height.animVal.value is 210
 10PASS rect1.height.baseVal.value is 210
1011PASS rootSVGElement.getTransformToElement(rect2).e is -250
1112PASS rootSVGElement.getTransformToElement(rect2).f is -250
1213PASS rect1.height.animVal.value is 177
 14PASS rect1.height.baseVal.value is 210
1315PASS rootSVGElement.getTransformToElement(rect2).e is -250
1416PASS rootSVGElement.getTransformToElement(rect2).f is -217
1517PASS rect1.height.animVal.value is 177
 18PASS rect1.height.baseVal.value is 210
1619PASS rootSVGElement.getTransformToElement(rect2).e is -250
1720PASS rootSVGElement.getTransformToElement(rect2).f is -217
1821PASS rect1.height.animVal.value is 121
 22PASS rect1.height.baseVal.value is 210
1923PASS rootSVGElement.getTransformToElement(rect2).e is -250
2024PASS rootSVGElement.getTransformToElement(rect2).f is -161
2125PASS rect1.height.animVal.value is 121
 26PASS rect1.height.baseVal.value is 210
2227PASS rootSVGElement.getTransformToElement(rect2).e is -250
2328PASS rootSVGElement.getTransformToElement(rect2).f is -161
2429PASS rect1.height.animVal.value is 10
 30PASS rect1.height.baseVal.value is 210
2531PASS rootSVGElement.getTransformToElement(rect2).e is -250
2632PASS rootSVGElement.getTransformToElement(rect2).f is -50
2733PASS rect1.height.animVal.value is 10
 34PASS rect1.height.baseVal.value is 210
2835PASS rootSVGElement.getTransformToElement(rect2).e is -250
2936PASS rootSVGElement.getTransformToElement(rect2).f is -50
3037PASS rect1.height.animVal.value is 10
 38PASS rect1.height.baseVal.value is 210
3139PASS rootSVGElement.getTransformToElement(rect2).e is -250
3240PASS rootSVGElement.getTransformToElement(rect2).f is -50
3341PASS successfullyParsed is true

LayoutTests/svg/animations/animate-elem-11-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.height.animVal.value is 210
 10PASS rect1.height.baseVal.value is 210
1011PASS rootSVGElement.getTransformToElement(rect2).e is -250
1112PASS rootSVGElement.getTransformToElement(rect2).f is -250
1213PASS rect1.height.animVal.value is 143.4
 14PASS rect1.height.baseVal.value is 210
1315PASS rootSVGElement.getTransformToElement(rect2).e is -250
1416PASS rootSVGElement.getTransformToElement(rect2).f is -183.4
1517PASS rect1.height.animVal.value is 143.4
 18PASS rect1.height.baseVal.value is 210
1619PASS rootSVGElement.getTransformToElement(rect2).e is -250
1720PASS rootSVGElement.getTransformToElement(rect2).f is -183.4
1821PASS rect1.height.animVal.value is 76.7
 22PASS rect1.height.baseVal.value is 210
1923PASS rootSVGElement.getTransformToElement(rect2).e is -250
2024PASS rootSVGElement.getTransformToElement(rect2).f is -116.7
2125PASS rect1.height.animVal.value is 76.7
 26PASS rect1.height.baseVal.value is 210
2227PASS rootSVGElement.getTransformToElement(rect2).e is -250
2328PASS rootSVGElement.getTransformToElement(rect2).f is -116.7
2429PASS rect1.height.animVal.value is 10
 30PASS rect1.height.baseVal.value is 210
2531PASS rootSVGElement.getTransformToElement(rect2).e is -250
2632PASS rootSVGElement.getTransformToElement(rect2).f is -50
2733PASS rect1.height.animVal.value is 10
 34PASS rect1.height.baseVal.value is 210
2835PASS rootSVGElement.getTransformToElement(rect2).e is -250
2936PASS rootSVGElement.getTransformToElement(rect2).f is -50
3037PASS rect1.height.animVal.value is 10
 38PASS rect1.height.baseVal.value is 210
3139PASS rootSVGElement.getTransformToElement(rect2).e is -250
3240PASS rootSVGElement.getTransformToElement(rect2).f is -50
3341PASS successfullyParsed is true

LayoutTests/svg/animations/animate-elem-12-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.height.animVal.value is 210
 10PASS rect1.height.baseVal.value is 210
1011PASS rootSVGElement.getTransformToElement(rect2).e is -250
1112PASS rootSVGElement.getTransformToElement(rect2).f is -250
1213PASS rect1.height.animVal.value is 177
 14PASS rect1.height.baseVal.value is 210
1315PASS rootSVGElement.getTransformToElement(rect2).e is -250
1416PASS rootSVGElement.getTransformToElement(rect2).f is -217
1517PASS rect1.height.animVal.value is 177
 18PASS rect1.height.baseVal.value is 210
1619PASS rootSVGElement.getTransformToElement(rect2).e is -250
1720PASS rootSVGElement.getTransformToElement(rect2).f is -217
1821PASS rect1.height.animVal.value is 121
 22PASS rect1.height.baseVal.value is 210
1923PASS rootSVGElement.getTransformToElement(rect2).e is -250
2024PASS rootSVGElement.getTransformToElement(rect2).f is -161
2125PASS rect1.height.animVal.value is 121
 26PASS rect1.height.baseVal.value is 210
2227PASS rootSVGElement.getTransformToElement(rect2).e is -250
2328PASS rootSVGElement.getTransformToElement(rect2).f is -161
2429PASS rect1.height.animVal.value is 10
 30PASS rect1.height.baseVal.value is 210
2531PASS rootSVGElement.getTransformToElement(rect2).e is -250
2632PASS rootSVGElement.getTransformToElement(rect2).f is -50
2733PASS rect1.height.animVal.value is 10
 34PASS rect1.height.baseVal.value is 210
2835PASS rootSVGElement.getTransformToElement(rect2).e is -250
2936PASS rootSVGElement.getTransformToElement(rect2).f is -50
3037PASS rect1.height.animVal.value is 10
 38PASS rect1.height.baseVal.value is 210
3139PASS rootSVGElement.getTransformToElement(rect2).e is -250
3240PASS rootSVGElement.getTransformToElement(rect2).f is -50
3341PASS successfullyParsed is true

LayoutTests/svg/animations/animate-elem-13-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.width.animVal.value is 30
 10PASS rect1.width.baseVal.value is 30
1011PASS rect1.width.animVal.value is 165
 12PASS rect1.width.baseVal.value is 30
1113PASS rect1.width.animVal.value is 300
 14PASS rect1.width.baseVal.value is 30
1215PASS rect1.width.animVal.value is 300
 16PASS rect1.width.baseVal.value is 30
1317PASS successfullyParsed is true
1418
1519TEST COMPLETE

LayoutTests/svg/animations/animate-elem-14-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect.width.animVal.value is 300
 10PASS rect.width.baseVal.value is 300
1011PASS rect.width.animVal.value is 300
 12PASS rect.width.baseVal.value is 300
1113PASS rect.width.animVal.value is 255
 14PASS rect.width.baseVal.value is 300
1215PASS rect.width.animVal.value is 255
 16PASS rect.width.baseVal.value is 300
1317PASS rect.width.animVal.value is 180
 18PASS rect.width.baseVal.value is 300
1419PASS rect.width.animVal.value is 180
 20PASS rect.width.baseVal.value is 300
1521FAIL rect.width.animVal.value should be close to 30. Was 180.
 22PASS rect.width.baseVal.value is 300
1623FAIL rect.width.animVal.value should be close to 30. Was 180.
 24PASS rect.width.baseVal.value is 300
1725FAIL rect.width.animVal.value should be close to 30. Was 180.
 26PASS rect.width.baseVal.value is 300
1827FAIL rect.width.animVal.value should be close to 30. Was 180.
 28PASS rect.width.baseVal.value is 300
1929FAIL rect.width.animVal.value should be close to 30. Was 180.
 30PASS rect.width.baseVal.value is 300
2031PASS rect.width.animVal.value is 30
 32PASS rect.width.baseVal.value is 300
2133PASS rect.width.animVal.value is 30
 34PASS rect.width.baseVal.value is 300
2235PASS successfullyParsed is true
2336
2437TEST COMPLETE

LayoutTests/svg/animations/animate-elem-15-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect.width.animVal.value is 300
 10PASS rect.width.baseVal.value is 300
1011PASS rect.width.animVal.value is 232.5
 12PASS rect.width.baseVal.value is 300
1113PASS rect.width.animVal.value is 232.5
 14PASS rect.width.baseVal.value is 300
1215PASS rect.width.animVal.value is 165
 16PASS rect.width.baseVal.value is 300
1317PASS rect.width.animVal.value is 165
 18PASS rect.width.baseVal.value is 300
1419PASS rect.width.animVal.value is 30
 20PASS rect.width.baseVal.value is 300
1521PASS rect.width.animVal.value is 30
 22PASS rect.width.baseVal.value is 300
1623PASS rect.width.animVal.value is 30
 24PASS rect.width.baseVal.value is 300
1725PASS successfullyParsed is true
1826
1927TEST COMPLETE

LayoutTests/svg/animations/animate-elem-16-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect.width.animVal.value is 300
 10PASS rect.width.baseVal.value is 300
1011PASS rect.width.animVal.value is 255
 12PASS rect.width.baseVal.value is 300
1113PASS rect.width.animVal.value is 255
 14PASS rect.width.baseVal.value is 300
1215PASS rect.width.animVal.value is 180
 16PASS rect.width.baseVal.value is 300
1317PASS rect.width.animVal.value is 180
 18PASS rect.width.baseVal.value is 300
1419PASS rect.width.animVal.value is 30
 20PASS rect.width.baseVal.value is 300
1521PASS rect.width.animVal.value is 30
 22PASS rect.width.baseVal.value is 300
1623PASS rect.width.animVal.value is 30
 24PASS rect.width.baseVal.value is 300
1725PASS successfullyParsed is true
1826
1927TEST COMPLETE

LayoutTests/svg/animations/animate-elem-17-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect.width.animVal.value is 300
 10PASS rect.width.baseVal.value is 300
1011PASS rect.width.animVal.value is 255
 12PASS rect.width.baseVal.value is 300
1113PASS rect.width.animVal.value is 255
 14PASS rect.width.baseVal.value is 300
1215PASS rect.width.animVal.value is 180
 16PASS rect.width.baseVal.value is 300
1317PASS rect.width.animVal.value is 180
 18PASS rect.width.baseVal.value is 300
1419PASS rect.width.animVal.value is 30
 20PASS rect.width.baseVal.value is 300
1521PASS rect.width.animVal.value is 30
 22PASS rect.width.baseVal.value is 300
1623PASS rect.width.animVal.value is 30
 24PASS rect.width.baseVal.value is 300
1725PASS successfullyParsed is true
1826
1927TEST COMPLETE

LayoutTests/svg/animations/animate-elem-18-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect.width.animVal.value is 300
 10PASS rect.width.baseVal.value is 300
1011PASS rect.width.animVal.value is 300
 12PASS rect.width.baseVal.value is 300
1113PASS rect.width.animVal.value is 255
 14PASS rect.width.baseVal.value is 300
1215PASS rect.width.animVal.value is 255
 16PASS rect.width.baseVal.value is 300
1317PASS rect.width.animVal.value is 180
 18PASS rect.width.baseVal.value is 300
1419PASS rect.width.animVal.value is 180
 20PASS rect.width.baseVal.value is 300
1521FAIL rect.width.animVal.value should be close to 30. Was 180.
 22PASS rect.width.baseVal.value is 300
1623FAIL rect.width.animVal.value should be close to 30. Was 180.
 24PASS rect.width.baseVal.value is 300
1725PASS rect.width.animVal.value is 30
 26PASS rect.width.baseVal.value is 300
1827PASS rect.width.animVal.value is 30
 28PASS rect.width.baseVal.value is 300
1929PASS successfullyParsed is true
2030
2131TEST COMPLETE

LayoutTests/svg/animations/animate-elem-19-t-drt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect.width.animVal.value is 300
 10PASS rect.width.baseVal.value is 300
1011PASS rect.width.animVal.value is 255
 12PASS rect.width.baseVal.value is 300
1113PASS rect.width.animVal.value is 255
 14PASS rect.width.baseVal.value is 300
1215PASS rect.width.animVal.value is 180
 16PASS rect.width.baseVal.value is 300
1317PASS rect.width.animVal.value is 180
 18PASS rect.width.baseVal.value is 300
1419PASS rect.width.animVal.value is 30
 20PASS rect.width.baseVal.value is 300
1521PASS rect.width.animVal.value is 30
 22PASS rect.width.baseVal.value is 300
1623PASS rect.width.animVal.value is 30
 24PASS rect.width.baseVal.value is 300
1725PASS successfullyParsed is true
1826
1927TEST COMPLETE

LayoutTests/svg/animations/animate-end-attribute-expected.txt

@@SVG 1.1 dynamic animation tests
33PASS rect.x.animVal.value is 100
44PASS rect.x.baseVal.value is 100
55PASS rect.x.animVal.value is 50
6 PASS rect.x.baseVal.value is 50
 6PASS rect.x.baseVal.value is 100
77PASS rect.x.animVal.value is 200
8 PASS rect.x.baseVal.value is 200
 8PASS rect.x.baseVal.value is 100
99PASS rect.x.animVal.value is 200
10 PASS rect.x.baseVal.value is 200
 10PASS rect.x.baseVal.value is 100
1111PASS successfullyParsed is true
1212
1313TEST COMPLETE

LayoutTests/svg/animations/animate-endElement-beginElement-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
66
77
88PASS rect.x.animVal.value is 50
 9PASS rect.x.baseVal.value is 0
910PASS successfullyParsed is true
1011
1112TEST COMPLETE

LayoutTests/svg/animations/animate-from-to-keyTimes-expected.txt

11SVG 1.1 dynamic animation tests
22
 3PASS rect.x.animVal.value is 100
 4PASS rect.x.baseVal.value is 100
 5PASS rect.x.animVal.value is 200
 6PASS rect.x.baseVal.value is 100
 7PASS rect.x.animVal.value is 200
38PASS rect.x.baseVal.value is 100
4 PASS rect.x.baseVal.value is 200
5 PASS rect.x.baseVal.value is 200
69PASS successfullyParsed is true
710
811TEST COMPLETE

LayoutTests/svg/animations/animate-insert-begin-expected.txt

@@Test behavior of dynamically inserting animate with begin attribute
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
 8PASS rect.x.animVal.value is 0
 9PASS rect.x.baseVal.value is 0
 10PASS rect.x.animVal.value is 90
811PASS rect.x.baseVal.value is 0
9 PASS rect.x.baseVal.value is 90
1012PASS successfullyParsed is true
1113
1214TEST COMPLETE

LayoutTests/svg/animations/animate-insert-no-begin-expected.txt

@@Test behavior of dynamically inserting animate without begin attribute
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
 8PASS rect.x.animVal.value is 0
 9PASS rect.x.baseVal.value is 0
 10PASS rect.x.animVal.value is 90
811PASS rect.x.baseVal.value is 0
9 PASS rect.x.baseVal.value is 90
1012PASS successfullyParsed is true
1113
1214TEST COMPLETE

LayoutTests/svg/animations/animate-keySplines-expected.txt

@@Testing correct parsing of keySplines.
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
8 PASS rect.height.baseVal.value is 167
98PASS rect.height.animVal.value is 167
10 PASS rect.height.baseVal.value is 111
 9PASS rect.height.baseVal.value is 100
1110PASS rect.height.animVal.value is 111
1211PASS rect.height.baseVal.value is 100
1312PASS rect.height.animVal.value is 100
 13PASS rect.height.baseVal.value is 100
1414PASS successfullyParsed is true
1515
1616TEST COMPLETE

LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt

11SVG 1.1 dynamic animation tests
22
 3PASS rect.x.animVal.value is 100
 4PASS rect.x.baseVal.value is 100
 5PASS rect.x.animVal.value is 200
 6PASS rect.x.baseVal.value is 100
 7PASS rect.x.animVal.value is 300
38PASS rect.x.baseVal.value is 100
4 PASS rect.x.baseVal.value is 200
5 PASS rect.x.baseVal.value is 300
69PASS successfullyParsed is true
710
811TEST COMPLETE

LayoutTests/svg/animations/attributeTypes-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
77
88
99PASS rect1.width.animVal.value is 10
 10PASS rect1.width.baseVal.value is 10
1011PASS getComputedStyle(rect1).fill is "#008000"
1112PASS rect2.width.animVal.value is 100
 13PASS rect2.width.baseVal.value is 100
1214PASS getComputedStyle(rect2).fill is "#008000"
1315PASS rect3.width.animVal.value is 100
 16PASS rect3.width.baseVal.value is 100
1417PASS getComputedStyle(rect3).fill is "#ff0000"
1518PASS rect3.getAttribute('fill') is "red"
1619PASS rect4.width.animVal.value is 100
 20PASS rect4.width.baseVal.value is 100
1721PASS getComputedStyle(rect4).fill is "#ff0000"
1822PASS rect4.getAttribute('fill') is "red"
1923PASS rect1.width.animVal.value is 55
 24PASS rect1.width.baseVal.value is 10
2025PASS getComputedStyle(rect1).fill is "#008000"
2126PASS rect2.width.animVal.value is 100
 27PASS rect2.width.baseVal.value is 100
2228PASS getComputedStyle(rect2).fill is "#008000"
2329PASS rect3.width.animVal.value is 100
 30PASS rect3.width.baseVal.value is 100
2431PASS getComputedStyle(rect3).fill is "#804000"
2532PASS rect3.getAttribute('fill') is "red"
2633PASS rect4.width.animVal.value is 100
 34PASS rect4.width.baseVal.value is 100
2735PASS getComputedStyle(rect4).fill is "#804000"
2836PASS rect4.getAttribute('fill') is "red"
2937PASS rect1.width.animVal.value is 100
 38PASS rect1.width.baseVal.value is 10
3039PASS getComputedStyle(rect1).fill is "#008000"
3140PASS rect2.width.animVal.value is 100
 41PASS rect2.width.baseVal.value is 100
3242PASS getComputedStyle(rect2).fill is "#008000"
3343PASS rect3.width.animVal.value is 100
 44PASS rect3.width.baseVal.value is 100
3445PASS getComputedStyle(rect3).fill is "#008000"
3546PASS rect3.getAttribute('fill') is "red"
3647PASS rect4.width.animVal.value is 100
 48PASS rect4.width.baseVal.value is 100
3749PASS getComputedStyle(rect4).fill is "#008000"
3850PASS rect4.getAttribute('fill') is "red"
3951PASS rect1.width.animVal.value is 100
 52PASS rect1.width.baseVal.value is 10
4053PASS getComputedStyle(rect1).fill is "#008000"
4154PASS rect2.width.animVal.value is 100
 55PASS rect2.width.baseVal.value is 100
4256PASS getComputedStyle(rect2).fill is "#008000"
4357PASS rect3.width.animVal.value is 100
 58PASS rect3.width.baseVal.value is 100
4459PASS getComputedStyle(rect3).fill is "#008000"
4560PASS rect3.getAttribute('fill') is "red"
4661PASS rect4.width.animVal.value is 100
 62PASS rect4.width.baseVal.value is 100
4763PASS getComputedStyle(rect4).fill is "#008000"
4864PASS rect4.getAttribute('fill') is "red"
4965PASS successfullyParsed is true

LayoutTests/svg/animations/change-baseVal-while-animating-fill-freeze-2-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This tests scripting baseVal while animation is running
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect.width.animVal.value is 10
 10PASS rect.width.baseVal.value is 10
 11PASS rect.width.animVal.value is 30
 12PASS rect.width.baseVal.value is 10
 13PASS rect.width.animVal.value is 30
 14PASS rect.width.baseVal.value is 100
 15PASS rect.width.animVal.value is 50
 16PASS rect.width.baseVal.value is 100
 17PASS rect.width.animVal.value is 50
 18PASS rect.width.baseVal.value is 100
 19PASS rect.width.animVal.value is 50
 20PASS rect.width.baseVal.value is 100
 21PASS successfullyParsed is true
 22
 23TEST COMPLETE
 24

LayoutTests/svg/animations/change-baseVal-while-animating-fill-freeze-2.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/change-baseVal-while-animating-fill-freeze-2.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/change-baseVal-while-animating-fill-freeze-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This tests scripting baseVal while animation is running
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect.width.animVal.value is 10
 10PASS rect.width.baseVal.value is 10
 11PASS rect.width.animVal.value is 30
 12PASS rect.width.baseVal.value is 10
 13PASS rect.width.animVal.value is 30
 14PASS rect.width.baseVal.value is 100
 15PASS rect.width.animVal.value is 50
 16PASS rect.width.baseVal.value is 100
 17PASS rect.width.animVal.value is 50
 18PASS rect.width.baseVal.value is 100
 19PASS rect.width.animVal.value is 50
 20PASS rect.width.baseVal.value is 100
 21PASS successfullyParsed is true
 22
 23TEST COMPLETE
 24

LayoutTests/svg/animations/change-baseVal-while-animating-fill-freeze.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/change-baseVal-while-animating-fill-freeze.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/change-baseVal-while-animating-fill-remove-2-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This tests scripting baseVal while animation is running
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect.width.animVal.value is 10
 10PASS rect.width.baseVal.value is 10
 11PASS rect.width.animVal.value is 30
 12PASS rect.width.baseVal.value is 10
 13PASS rect.width.animVal.value is 30
 14PASS rect.width.baseVal.value is 100
 15PASS rect.width.animVal.value is 50
 16PASS rect.width.baseVal.value is 100
 17PASS rect.width.animVal.value is 100
 18PASS rect.width.baseVal.value is 100
 19PASS rect.width.animVal.value is 100
 20PASS rect.width.baseVal.value is 100
 21PASS successfullyParsed is true
 22
 23TEST COMPLETE
 24

LayoutTests/svg/animations/change-baseVal-while-animating-fill-remove-2.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/change-baseVal-while-animating-fill-remove-2.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/change-baseVal-while-animating-fill-remove-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This tests scripting baseVal while animation is running
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect.width.animVal.value is 10
 10PASS rect.width.baseVal.value is 10
 11PASS rect.width.animVal.value is 30
 12PASS rect.width.baseVal.value is 10
 13PASS rect.width.animVal.value is 30
 14PASS rect.width.baseVal.value is 100
 15PASS rect.width.animVal.value is 50
 16PASS rect.width.baseVal.value is 100
 17PASS rect.width.animVal.value is 100
 18PASS rect.width.baseVal.value is 100
 19PASS rect.width.animVal.value is 100
 20PASS rect.width.baseVal.value is 100
 21PASS successfullyParsed is true
 22
 23TEST COMPLETE
 24

LayoutTests/svg/animations/change-baseVal-while-animating-fill-remove.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/change-baseVal-while-animating-fill-remove.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/change-target-while-animating-SVG-property-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This changes the target of an animation while its running
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect1.width.animVal.value is 150
 10PASS rect1.width.baseVal.value is 150
 11PASS rect2.width.animVal.value is 150
 12PASS rect2.width.baseVal.value is 150
 13PASS rect1.width.animVal.value is 100
 14PASS rect1.width.baseVal.value is 150
 15PASS rect2.width.animVal.value is 150
 16PASS rect2.width.baseVal.value is 150
 17PASS rect1.width.animVal.value is 150
 18PASS rect1.width.baseVal.value is 150
 19PASS rect2.width.animVal.value is 100
 20PASS rect2.width.baseVal.value is 150
 21PASS rect1.width.animVal.value is 150
 22PASS rect1.width.baseVal.value is 150
 23PASS rect2.width.animVal.value is 50
 24PASS rect2.width.baseVal.value is 150
 25PASS rect1.width.animVal.value is 150
 26PASS rect1.width.baseVal.value is 150
 27PASS rect2.width.animVal.value is 50
 28PASS rect2.width.baseVal.value is 150
 29PASS rect1.width.animVal.value is 150
 30PASS rect1.width.baseVal.value is 150
 31PASS rect2.width.animVal.value is 50
 32PASS rect2.width.baseVal.value is 150
 33PASS successfullyParsed is true
 34
 35TEST COMPLETE
 36

LayoutTests/svg/animations/change-target-while-animating-SVG-property.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/change-target-while-animating-SVG-property.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/multiple-animations-fill-freeze-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This checks the effect on multiple animations on one target
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect1.x.animVal.value is 0
 10PASS rect1.x.baseVal.value is 0
 11PASS rect2.x.animVal.value is 0
 12PASS rect2.x.baseVal.value is 0
 13PASS rect3.x.animVal.value is 0
 14PASS rect3.x.baseVal.value is 0
 15PASS rect1.x.animVal.value is 50
 16PASS rect1.x.baseVal.value is 0
 17PASS rect2.x.animVal.value is 50
 18PASS rect2.x.baseVal.value is 0
 19PASS rect3.x.animVal.value is 50
 20PASS rect3.x.baseVal.value is 0
 21PASS rect1.x.animVal.value is 100
 22PASS rect1.x.baseVal.value is 0
 23PASS rect2.x.animVal.value is 100
 24PASS rect2.x.baseVal.value is 0
 25PASS rect3.x.animVal.value is 100
 26PASS rect3.x.baseVal.value is 0
 27PASS rect1.x.animVal.value is 100
 28PASS rect1.x.baseVal.value is 0
 29PASS rect2.x.animVal.value is 0
 30PASS rect2.x.baseVal.value is 0
 31PASS rect3.x.animVal.value is 100
 32PASS rect3.x.baseVal.value is 0
 33PASS rect1.x.animVal.value is 100
 34PASS rect1.x.baseVal.value is 0
 35PASS rect2.x.animVal.value is 0
 36PASS rect2.x.baseVal.value is 0
 37PASS rect3.x.animVal.value is 100
 38PASS rect3.x.baseVal.value is 0
 39PASS rect1.x.animVal.value is 100
 40PASS rect1.x.baseVal.value is 0
 41PASS rect2.x.animVal.value is 0
 42PASS rect2.x.baseVal.value is 0
 43PASS rect3.x.animVal.value is 100
 44PASS rect3.x.baseVal.value is 0
 45PASS rect1.x.animVal.value is 150
 46PASS rect1.x.baseVal.value is 0
 47PASS rect2.x.animVal.value is 150
 48PASS rect2.x.baseVal.value is 0
 49PASS rect3.x.animVal.value is 150
 50PASS rect3.x.baseVal.value is 0
 51PASS rect1.x.animVal.value is 200
 52PASS rect1.x.baseVal.value is 0
 53PASS rect2.x.animVal.value is 200
 54PASS rect2.x.baseVal.value is 0
 55PASS rect3.x.animVal.value is 200
 56PASS rect3.x.baseVal.value is 0
 57PASS rect1.x.animVal.value is 250
 58PASS rect1.x.baseVal.value is 0
 59PASS rect2.x.animVal.value is 250
 60PASS rect2.x.baseVal.value is 0
 61PASS rect3.x.animVal.value is 250
 62PASS rect3.x.baseVal.value is 0
 63PASS rect1.x.animVal.value is 250
 64PASS rect1.x.baseVal.value is 0
 65PASS rect2.x.animVal.value is 250
 66PASS rect2.x.baseVal.value is 0
 67PASS rect3.x.animVal.value is 100
 68PASS rect3.x.baseVal.value is 0
 69PASS rect1.x.animVal.value is 250
 70PASS rect1.x.baseVal.value is 0
 71PASS rect2.x.animVal.value is 250
 72PASS rect2.x.baseVal.value is 0
 73PASS rect3.x.animVal.value is 100
 74PASS rect3.x.baseVal.value is 0
 75PASS successfullyParsed is true
 76
 77TEST COMPLETE
 78

LayoutTests/svg/animations/multiple-animations-fill-freeze.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/multiple-animations-fill-freeze.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/remove-animation-element-while-animation-is-running-expected.txt

 1SVG 1.1 dynamic animation tests
 2
 3
 4This removes an animation element while the animation is running
 5
 6On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 7
 8
 9PASS rect1.x.animVal.value is 50
 10PASS rect1.x.baseVal.value is 0
 11PASS rect2.x.animVal.value is 50
 12PASS rect2.x.baseVal.value is 0
 13PASS rect1.x.animVal.value is 100
 14PASS rect1.x.baseVal.value is 0
 15PASS rect2.x.animVal.value is 100
 16PASS rect2.x.baseVal.value is 0
 17PASS rect1.x.animVal.value is 0
 18PASS rect1.x.baseVal.value is 0
 19PASS rect2.x.animVal.value is 100
 20PASS rect2.x.baseVal.value is 0
 21PASS rect1.x.animVal.value is 0
 22PASS rect1.x.baseVal.value is 0
 23PASS rect2.x.animVal.value is 0
 24PASS rect2.x.baseVal.value is 0
 25PASS rect1.x.animVal.value is 0
 26PASS rect1.x.baseVal.value is 0
 27PASS rect2.x.animVal.value is 0
 28PASS rect2.x.baseVal.value is 0
 29PASS successfullyParsed is true
 30
 31TEST COMPLETE
 32

LayoutTests/svg/animations/remove-animation-element-while-animation-is-running.html

 1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 2<html>
 3<head>
 4<script src="../../fast/js/resources/js-test-pre.js"></script>
 5<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
 6<script src="resources/SVGAnimationTestCase.js"></script>
 7</head>
 8<body onload="runSMILTest()">
 9<h1>SVG 1.1 dynamic animation tests</h1>
 10<p id="description"></p>
 11<div id="console"></div>
 12<script src="script-tests/remove-animation-element-while-animation-is-running.js"></script>
 13</body>
 14</html>

LayoutTests/svg/animations/resources/additive-from-to-width-animation.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<!-- an1: Change width from 10 to 50 in 4s -->
 6<!-- an2: Change width from 10 to 25 + additive=sum. This results in a change from 20 to 75 -->
 7<!-- an3: Change width from 0 to 25 + additve=sum. This results in a final change from 20 to 100 -->
 8<rect width="10" height="100" fill="green">
 9 <animate id="an1" attributeType="XML" attributeName="width" fill="freeze" from="10" to="50" begin="0s" dur="4s"/>
 10 <animate id="an2" attributeType="XML" attributeName="width" additive="sum" fill="freeze" from="10" to="25" begin="0s" dur="4s"/>
 11 <animate id="an3" attributeType="XML" attributeName="width" additive="sum" fill="freeze" from="0" to="25" begin="0s" dur="4s"/>
 12</rect>
 13
 14</svg>

LayoutTests/svg/animations/resources/additive-values-width-animation.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<!-- an1: Change width from 0 to 50 to 100, all linear interpolated. As additive is set to sum it should add the current baseValue
 6 to the new animated value each time a value from the values list is consumed. Expected:
 7 At 0s, width=10, at 2s, width=50+10=60, at 4s, width=100+10=110.
 8
 9 Our testing harness will change the baseValue from 10 to 60 at 5s. The current animated value (before the script change)
 10 is: <baseValue>+<animValue>: 10 + (100/6*5) = 93.333 at this point. As we change the baseValue to 60, the equation now looks like:
 11 60 + (100/6*5) = 143.333. Before the script change the last second of the animation would have animated width from 85 to 110.
 12 Due the script change its now animating from 93.999 to 143.333 during the last second.
 13-->
 14<rect width="10" height="100" fill="green">
 15 <animate id="an1" attributeType="XML" attributeName="width" fill="freeze" additive="sum" values="0; 50; 100" begin="0s" dur="6s"/>
 16</rect>
 17
 18</svg>

LayoutTests/svg/animations/resources/change-baseVal-while-animating-fill-freeze.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<!-- an1: Change width from 10 to 50 in 4s, a script at 2s will set the width attribute to 50, fill is freeze so this won't have any visible effect, except that SVG DOM baseValue is different -->
 6<rect width="10" height="100" fill="green">
 7 <animate id="an1" attributeType="XML" attributeName="width" fill="freeze" from="10" to="50" begin="0s" dur="4s"/>
 8</rect>
 9
 10</svg>

LayoutTests/svg/animations/resources/change-baseVal-while-animating-fill-remove.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<!-- an1: Change width from 10 to 50 in 4s, a script at 2s will set the width attribute to 100, fill is not freeze, so after the animation ends it should set width to 100 -->
 6<rect width="10" height="100" fill="green">
 7 <animate id="an1" attributeType="XML" attributeName="width" fill="remove" from="10" to="50" begin="0s" dur="4s"/>
 8</rect>
 9
 10</svg>

LayoutTests/svg/animations/resources/change-target-while-animating-SVG-property.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<rect id="target1" width="150" height="100" fill="green"/>
 6<rect id="target2" y="150" width="150" height="100" fill="green"/>
 7
 8<!-- an1: Change width by -100 in 4s on target1. The embedder script will change the target to 'target2' at 2s. -->
 9<!-- target1 should be 100px at 2s and remain this way. target2 should be 50px and remain this way. -->
 10<animate id="an1" xlink:href="#target1" attributeType="XML" attributeName="width" fill="freeze" by="-100" begin="0s" dur="4s"/>
 11
 12</svg>

LayoutTests/svg/animations/resources/multiple-animations-fill-freeze.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<rect x='0' y='0' width='50' height='50' fill='green'>
 6 <animate id="an1" attributeName='x' from='0' to='100' begin='0s' dur='2s' fill='freeze'/>
 7 <animate id="an2" attributeName='x' from='150' to='250' begin='4s' dur='2s' fill='freeze'/>
 8</rect>
 9
 10<rect x='0' y='100' width='50' height='50' fill='green'>
 11 <animate id="an3" attributeName='x' from='0' to='100' begin='0s' dur='2s' fill='remove'/>
 12 <animate id="an4" attributeName='x' from='150' to='250' begin='4s' dur='2s' fill='freeze'/>
 13</rect>
 14
 15<rect x='0' y='200' width='50' height='50' fill='green'>
 16 <animate id="an5" attributeName='x' from='0' to='100' begin='0s' dur='2s' fill='freeze'/>
 17 <animate id="an6" attributeName='x' from='150' to='250' begin='4s' dur='2s' fill='remove'/>
 18</rect>
 19
 20</svg>

LayoutTests/svg/animations/resources/remove-animation-element-while-animation-is-running.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 4
 5<rect x='0' y='0' width='50' height='50' fill='green'>
 6 <animate id="an1" attributeName='x' from='50' to='150' begin='0s' dur='2s' fill='freeze'/>
 7</rect>
 8
 9<rect x='0' y='100' width='50' height='50' fill='green'>
 10 <animate id="an2" attributeName='x' from='50' to='150' begin='0s' dur='2s' fill='remove'/>
 11</rect>
 12
 13</svg>

LayoutTests/svg/animations/script-tests/additive-from-to-width-animation.js

 1description("This tests multiple additive='sum' animations running at the same time");
 2embedSVGTestCase("resources/additive-from-to-width-animation.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect.width.animVal.value", "20");
 7 shouldBe("rect.width.baseVal.value", "10");
 8}
 9
 10function sample2() {
 11 shouldBeCloseEnough("rect.width.animVal.value", "60");
 12 shouldBe("rect.width.baseVal.value", "10");
 13}
 14
 15function sample3() {
 16 shouldBeCloseEnough("rect.width.animVal.value", "100");
 17 shouldBe("rect.width.baseVal.value", "10");
 18}
 19
 20function executeTest() {
 21 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
 22
 23 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
 24 const expectedValues = [
 25 // [animationId, time, sampleCallback]
 26 ["an1", 0.0, sample1],
 27 ["an1", 2.0, sample2],
 28 ["an1", 4.0, sample3],
 29 ["an1", 60.0, sample3]
 30 ];
 31
 32 runAnimationTest(expectedValues);
 33}
 34
 35window.animationStartsImmediately = true;
 36var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/additive-values-width-animation.js

 1description("This tests values animation and additive='sum'");
 2embedSVGTestCase("resources/additive-values-width-animation.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect.width.animVal.value", "10");
 7 shouldBe("rect.width.baseVal.value", "10");
 8}
 9
 10function sample2() {
 11 shouldBeCloseEnough("rect.width.animVal.value", "60");
 12 shouldBe("rect.width.baseVal.value", "10");
 13}
 14
 15function sample3() {
 16 shouldBeCloseEnough("rect.width.animVal.value", "93.3");
 17 shouldBe("rect.width.baseVal.value", "10");
 18}
 19
 20function changeBaseVal() {
 21 // At 5s, only change the baseVal.
 22 rect.width.baseVal.value = 60;
 23}
 24
 25function sample4() {
 26 shouldBeCloseEnough("rect.width.animVal.value", "143.33");
 27 shouldBe("rect.width.baseVal.value", "60");
 28}
 29
 30function sample5() {
 31 shouldBeCloseEnough("rect.width.animVal.value", "160");
 32 shouldBe("rect.width.baseVal.value", "60");
 33}
 34
 35function executeTest() {
 36 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
 37
 38 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
 39 const expectedValues = [
 40 // [animationId, time, sampleCallback]
 41 ["an1", 0.0, sample1],
 42 ["an1", 3.0, sample2],
 43 ["an1", 4.999, sample3],
 44 ["an1", 5.0, changeBaseVal],
 45 ["an1", 5.001, sample4],
 46 ["an1", 6.0, sample5],
 47 ["an1", 6.001, sample5],
 48 ["an1", 60.0, sample5]
 49 ];
 50
 51 runAnimationTest(expectedValues);
 52}
 53
 54window.animationStartsImmediately = true;
 55var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/animVal-basics.js

@@function sample1() {
3030function sample2() {
3131 // Check half-time conditions
3232 shouldBe("rect.width.animVal.value", "150");
33  shouldBe("rect.width.baseVal.value", "150");
 33 shouldBe("rect.width.baseVal.value", "200");
3434}
3535
3636function sample3() {
3737 // Check just before-end conditions
3838 shouldBeCloseEnough("rect.width.animVal.value", "100");
39  shouldBeCloseEnough("rect.width.baseVal.value", "100");
 39 shouldBe("rect.width.baseVal.value", "200");
4040}
4141
4242function executeTest() {

LayoutTests/svg/animations/script-tests/animate-calcMode-spline-by.js

@@function sample1() {
3232function sample2() {
3333 // Check half-time conditions
3434 shouldBeCloseEnough("rect.x.animVal.value", "18.8");
35  shouldBeCloseEnough("rect.x.baseVal.value", "18.8");
 35 shouldBe("rect.x.baseVal.value", "100");
3636}
3737
3838function sample3() {
3939 // Check just before-end conditions
4040 shouldBeCloseEnough("rect.x.animVal.value", "0");
41  shouldBeCloseEnough("rect.x.baseVal.value", "0");
 41 shouldBe("rect.x.baseVal.value", "100");
4242}
4343
4444function executeTest() {

LayoutTests/svg/animations/script-tests/animate-calcMode-spline-from-by.js

@@function sample1() {
3333function sample2() {
3434 // Check half-time conditions
3535 shouldBeCloseEnough("rect.x.animVal.value", "18.8");
36  shouldBeCloseEnough("rect.x.baseVal.value", "18.8");
 36 shouldBe("rect.x.baseVal.value", "100");
3737}
3838
3939function sample3() {
4040 // Check just before-end conditions
4141 shouldBeCloseEnough("rect.x.animVal.value", "0");
42  shouldBeCloseEnough("rect.x.baseVal.value", "0");
 42 shouldBe("rect.x.baseVal.value", "100");
4343}
4444
4545function executeTest() {

LayoutTests/svg/animations/script-tests/animate-calcMode-spline-from-to.js

@@function sample1() {
3333function sample2() {
3434 // Check half-time conditions
3535 shouldBeCloseEnough("rect.x.animVal.value", "18.8");
36  shouldBeCloseEnough("rect.x.baseVal.value", "18.8");
 36 shouldBe("rect.x.baseVal.value", "100");
3737}
3838
3939function sample3() {
4040 // Check just before-end conditions
4141 shouldBeCloseEnough("rect.x.animVal.value", "0");
42  shouldBeCloseEnough("rect.x.baseVal.value", "0");
 42 shouldBe("rect.x.baseVal.value", "100");
4343}
4444
4545function executeTest() {

LayoutTests/svg/animations/script-tests/animate-calcMode-spline-to.js

@@function sample1() {
3232function sample2() {
3333 // Check half-time conditions
3434 shouldBeCloseEnough("rect.x.animVal.value", "18.8");
35  shouldBeCloseEnough("rect.x.baseVal.value", "18.8");
 35 shouldBe("rect.x.baseVal.value", "100");
3636}
3737
3838function sample3() {
3939 // Check just before-end conditions
4040 shouldBeCloseEnough("rect.x.animVal.value", "0");
41  shouldBeCloseEnough("rect.x.baseVal.value", "0");
 41 shouldBe("rect.x.baseVal.value", "100");
4242}
4343
4444function executeTest() {

LayoutTests/svg/animations/script-tests/animate-calcMode-spline-values.js

@@function sample1() {
3232function sample2() {
3333 // Check half-time conditions
3434 shouldBeCloseEnough("rect.x.animVal.value", "18.8");
35  shouldBeCloseEnough("rect.x.baseVal.value", "18.8");
 35 shouldBe("rect.x.baseVal.value", "100");
3636}
3737
3838function sample3() {
3939 // Check just before-end conditions
4040 shouldBeCloseEnough("rect.x.animVal.value", "0");
41  shouldBeCloseEnough("rect.x.baseVal.value", "0");
 41 shouldBe("rect.x.baseVal.value", "100");
4242}
4343
4444function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-02-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-02-t.svg");
44// Setup animation test
55function sampleAfterBegin() {
66 shouldBe("rect1.height.animVal.value", "200");
7  //shouldBe("rect1.height.baseVal.value", "20");
 7 shouldBe("rect1.height.baseVal.value", "20");
88
99 shouldBe("rect2.height.animVal.value", "220");
10  //shouldBe("rect2.height.baseVal.value", "20");
 10 shouldBe("rect2.height.baseVal.value", "20");
1111
1212 shouldBe("rect3.height.animVal.value", "200");
13  //shouldBe("rect3.height.baseVal.value", "20");
 13 shouldBe("rect3.height.baseVal.value", "20");
1414}
1515
1616function sampleAfterMid() {
1717 shouldBe("rect1.height.animVal.value", "20");
18  //shouldBe("rect1.height.baseVal.value", "20");
 18 shouldBe("rect1.height.baseVal.value", "20");
1919
2020 shouldBe("rect2.height.animVal.value", "40");
21  //shouldBe("rect2.height.baseVal.value", "20");
 21 shouldBe("rect2.height.baseVal.value", "20");
2222
2323 shouldBe("rect3.height.animVal.value", "20");
24  //shouldBe("rect3.height.baseVal.value", "20");
 24 shouldBe("rect3.height.baseVal.value", "20");
2525}
2626
2727function sampleAfterBeginOfFirstRepetition() {
2828 shouldBe("rect1.height.animVal.value", "200");
29  //shouldBe("rect1.height.baseVal.value", "20");
 29 shouldBe("rect1.height.baseVal.value", "20");
3030
3131 shouldBe("rect2.height.animVal.value", "220");
32  //shouldBe("rect2.height.baseVal.value", "20");
 32 shouldBe("rect2.height.baseVal.value", "20");
3333
3434 shouldBe("rect3.height.animVal.value", "220");
35  //shouldBe("rect3.height.baseVal.value", "20");
 35 shouldBe("rect3.height.baseVal.value", "20");
3636}
3737
3838function sampleAfterMidOfFirstRepetition() {
3939 shouldBe("rect1.height.animVal.value", "20");
40  //shouldBe("rect1.height.baseVal.value", "20");
 40 shouldBe("rect1.height.baseVal.value", "20");
4141
4242 shouldBe("rect2.height.animVal.value", "40");
43  //shouldBe("rect2.height.baseVal.value", "20");
 43 shouldBe("rect2.height.baseVal.value", "20");
4444
4545 shouldBe("rect3.height.animVal.value", "40");
46  //shouldBe("rect3.height.baseVal.value", "20");
 46 shouldBe("rect3.height.baseVal.value", "20");
4747}
4848
4949function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-09-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-09-t.svg");
44// Setup animation test
55function sample1() {
66 shouldBe("rect1.height.animVal.value", "210");
7  //shouldBe("rect1.height.baseVal.value", "210");
 7 shouldBe("rect1.height.baseVal.value", "210");
88 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250");
99}
1010
1111function sample2() {
1212 shouldBe("rect1.height.animVal.value", "177");
13  //shouldBe("rect1.height.baseVal.value", "210");
 13 shouldBe("rect1.height.baseVal.value", "210");
1414 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-217");
1515}
1616
1717function sample3() {
1818 shouldBe("rect1.height.animVal.value", "121");
19  //shouldBe("rect1.height.baseVal.value", "210");
 19 shouldBe("rect1.height.baseVal.value", "210");
2020 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-161");
2121}
2222
2323function sample4() {
2424 shouldBe("rect1.height.animVal.value", "10");
25  //shouldBe("rect1.height.baseVal.value", "210");
 25 shouldBe("rect1.height.baseVal.value", "210");
2626 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50");
2727}
2828

LayoutTests/svg/animations/script-tests/animate-elem-10-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-10-t.svg");
44// Setup animation test
55function sample1() {
66 shouldBeCloseEnough("rect1.height.animVal.value", "210");
7  //shouldBe("rect1.height.baseVal.value", "210");
 7 shouldBe("rect1.height.baseVal.value", "210");
88 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250");
99}
1010
1111function sample2() {
1212 shouldBeCloseEnough("rect1.height.animVal.value", "177");
13  //shouldBe("rect1.height.baseVal.value", "210");
 13 shouldBe("rect1.height.baseVal.value", "210");
1414 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-217");
1515}
1616
1717function sample3() {
1818 shouldBeCloseEnough("rect1.height.animVal.value", "121");
19  //shouldBe("rect1.height.baseVal.value", "210");
 19 shouldBe("rect1.height.baseVal.value", "210");
2020 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-161");
2121}
2222
2323function sample4() {
2424 shouldBeCloseEnough("rect1.height.animVal.value", "10");
25  //shouldBe("rect1.height.baseVal.value", "210");
 25 shouldBe("rect1.height.baseVal.value", "210");
2626 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50");
2727}
2828

LayoutTests/svg/animations/script-tests/animate-elem-11-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-11-t.svg");
44// Setup animation test
55function sample1() {
66 shouldBeCloseEnough("rect1.height.animVal.value", "210");
7  //shouldBe("rect1.height.baseVal.value", "210");
 7 shouldBe("rect1.height.baseVal.value", "210");
88 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250");
99}
1010
1111function sample2() {
1212 shouldBeCloseEnough("rect1.height.animVal.value", "143.4");
13  //shouldBe("rect1.height.baseVal.value", "210");
 13 shouldBe("rect1.height.baseVal.value", "210");
1414 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-183.4");
1515}
1616
1717function sample3() {
1818 shouldBeCloseEnough("rect1.height.animVal.value", "76.7");
19  //shouldBe("rect1.height.baseVal.value", "210");
 19 shouldBe("rect1.height.baseVal.value", "210");
2020 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-116.7");
2121}
2222
2323function sample4() {
2424 shouldBeCloseEnough("rect1.height.animVal.value", "10");
25  //shouldBe("rect1.height.baseVal.value", "210");
 25 shouldBe("rect1.height.baseVal.value", "210");
2626 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50");
2727}
2828

LayoutTests/svg/animations/script-tests/animate-elem-12-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-12-t.svg");
44// Setup animation test
55function sample1() {
66 shouldBeCloseEnough("rect1.height.animVal.value", "210");
7  //shouldBe("rect1.height.baseVal.value", "210");
 7 shouldBe("rect1.height.baseVal.value", "210");
88 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250");
99}
1010
1111function sample2() {
1212 shouldBeCloseEnough("rect1.height.animVal.value", "177");
13  //shouldBe("rect1.height.baseVal.value", "210");
 13 shouldBe("rect1.height.baseVal.value", "210");
1414 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-217");
1515}
1616
1717function sample3() {
1818 shouldBeCloseEnough("rect1.height.animVal.value", "121");
19  //shouldBe("rect1.height.baseVal.value", "210");
 19 shouldBe("rect1.height.baseVal.value", "210");
2020 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-161");
2121}
2222
2323function sample4() {
2424 shouldBeCloseEnough("rect1.height.animVal.value", "10");
25  //shouldBe("rect1.height.baseVal.value", "210");
 25 shouldBe("rect1.height.baseVal.value", "210");
2626 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50");
2727}
2828

LayoutTests/svg/animations/script-tests/animate-elem-13-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-13-t.svg");
44// Setup animation test
55function sample1() {
66 shouldBeCloseEnough("rect1.width.animVal.value", "30");
7  //shouldBe("rect1.width.baseVal.value", "30");
 7 shouldBe("rect1.width.baseVal.value", "30");
88}
99
1010function sample2() {
1111 shouldBeCloseEnough("rect1.width.animVal.value", "165");
12  //shouldBe("rect1.width.baseVal.value", "30");
 12 shouldBe("rect1.width.baseVal.value", "30");
1313}
1414
1515function sample3() {
1616 shouldBeCloseEnough("rect1.width.animVal.value", "300");
17  //shouldBe("rect1.width.baseVal.value", "30");
 17 shouldBe("rect1.width.baseVal.value", "30");
1818}
1919
2020function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-14-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-14-t.svg");
44// Setup animation test
55function sample1() { // From 0s to 2s
66 shouldBeCloseEnough("rect.width.animVal.value", "300");
7  //shouldBe("rect.width.baseVal.value", "300");
 7 shouldBe("rect.width.baseVal.value", "300");
88}
99
1010function sample2() { // From 2s to 4s
1111 shouldBeCloseEnough("rect.width.animVal.value", "255");
12  //shouldBe("rect.width.baseVal.value", "300");
 12 shouldBe("rect.width.baseVal.value", "300");
1313}
1414
1515function sample3() { // From 4s to 6s
1616 shouldBeCloseEnough("rect.width.animVal.value", "180");
17  //shouldBe("rect.width.baseVal.value", "300");
 17 shouldBe("rect.width.baseVal.value", "300");
1818}
1919
2020function sample4() { // From 6s to 10s
2121 shouldBeCloseEnough("rect.width.animVal.value", "30");
22  //shouldBe("rect.width.baseVal.value", "300");
 22 shouldBe("rect.width.baseVal.value", "300");
2323}
2424
2525function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-15-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-15-t.svg");
44// Setup animation test
55function sample1() { // From 0s to 2.25s
66 shouldBeCloseEnough("rect.width.animVal.value", "300");
7  //shouldBe("rect.width.baseVal.value", "300");
 7 shouldBe("rect.width.baseVal.value", "300");
88}
99
1010function sample2() { // From 2.25s to 4.5s
1111 shouldBeCloseEnough("rect.width.animVal.value", "232.5");
12  //shouldBe("rect.width.baseVal.value", "300");
 12 shouldBe("rect.width.baseVal.value", "300");
1313}
1414
1515function sample3() { // From 4.5s to 9s
1616 shouldBeCloseEnough("rect.width.animVal.value", "165");
17  //shouldBe("rect.width.baseVal.value", "300");
 17 shouldBe("rect.width.baseVal.value", "300");
1818}
1919
2020function sample4() { // From 9s to 9s
2121 shouldBeCloseEnough("rect.width.animVal.value", "30");
22  //shouldBe("rect.width.baseVal.value", "300");
 22 shouldBe("rect.width.baseVal.value", "300");
2323}
2424
2525function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-16-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-16-t.svg");
44// Setup animation test
55function sample1() { // From 0s to 2s
66 shouldBeCloseEnough("rect.width.animVal.value", "300");
7  //shouldBe("rect.width.baseVal.value", "300");
 7 shouldBe("rect.width.baseVal.value", "300");
88}
99
1010function sample2() { // From 2s to 4s
1111 shouldBeCloseEnough("rect.width.animVal.value", "255");
12  //shouldBe("rect.width.baseVal.value", "300");
 12 shouldBe("rect.width.baseVal.value", "300");
1313}
1414
1515function sample3() { // From 4s to 8s
1616 shouldBeCloseEnough("rect.width.animVal.value", "180");
17  //shouldBe("rect.width.baseVal.value", "300");
 17 shouldBe("rect.width.baseVal.value", "300");
1818}
1919
2020function sample4() { // From 8s to 8s
2121 shouldBeCloseEnough("rect.width.animVal.value", "30");
22  //shouldBe("rect.width.baseVal.value", "300");
 22 shouldBe("rect.width.baseVal.value", "300");
2323}
2424
2525function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-17-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-17-t.svg");
44// Setup animation test
55function sample1() { // From 0s to 2s
66 shouldBeCloseEnough("rect.width.animVal.value", "300");
7  //shouldBe("rect.width.baseVal.value", "300");
 7 shouldBe("rect.width.baseVal.value", "300");
88}
99
1010function sample2() { // From 2s to 4s
1111 shouldBeCloseEnough("rect.width.animVal.value", "255");
12  //shouldBe("rect.width.baseVal.value", "300");
 12 shouldBe("rect.width.baseVal.value", "300");
1313}
1414
1515function sample3() { // From 4s to 8s
1616 shouldBeCloseEnough("rect.width.animVal.value", "180");
17  //shouldBe("rect.width.baseVal.value", "300");
 17 shouldBe("rect.width.baseVal.value", "300");
1818}
1919
2020function sample4() { // From 8s to 8s
2121 shouldBeCloseEnough("rect.width.animVal.value", "30");
22  //shouldBe("rect.width.baseVal.value", "300");
 22 shouldBe("rect.width.baseVal.value", "300");
2323}
2424
2525function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-18-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-18-t.svg");
44// Setup animation test
55function sample1() { // From 0s to 2s
66 shouldBeCloseEnough("rect.width.animVal.value", "300");
7  //shouldBe("rect.width.baseVal.value", "300");
 7 shouldBe("rect.width.baseVal.value", "300");
88}
99
1010function sample2() { // From 2s to 6s
1111 shouldBeCloseEnough("rect.width.animVal.value", "255");
12  //shouldBe("rect.width.baseVal.value", "300");
 12 shouldBe("rect.width.baseVal.value", "300");
1313}
1414
1515function sample3() { // From 6s to 8s
1616 shouldBeCloseEnough("rect.width.animVal.value", "180");
17  //shouldBe("rect.width.baseVal.value", "300");
 17 shouldBe("rect.width.baseVal.value", "300");
1818}
1919
2020function sample4() { // From 8s to 10s
2121 shouldBeCloseEnough("rect.width.animVal.value", "30");
22  //shouldBe("rect.width.baseVal.value", "300");
 22 shouldBe("rect.width.baseVal.value", "300");
2323}
2424
2525function executeTest() {

LayoutTests/svg/animations/script-tests/animate-elem-19-t-drt.js

@@embedSVGTestCase("../W3C-SVG-1.1/animate-elem-19-t.svg");
44// Setup animation test
55function sample1() { // From 0s to 4s
66 shouldBeCloseEnough("rect.width.animVal.value", "300");
7  //shouldBe("rect.width.baseVal.value", "300");
 7 shouldBe("rect.width.baseVal.value", "300");
88}
99
1010function sample2() { // From 4s to 6s
1111 shouldBeCloseEnough("rect.width.animVal.value", "255");
12  //shouldBe("rect.width.baseVal.value", "300");
 12 shouldBe("rect.width.baseVal.value", "300");
1313}
1414
1515function sample3() { // From 6s to 8s
1616 shouldBeCloseEnough("rect.width.animVal.value", "180");
17  //shouldBe("rect.width.baseVal.value", "300");
 17 shouldBe("rect.width.baseVal.value", "300");
1818}
1919
2020function sample4() { // From 8s to 8s
2121 shouldBeCloseEnough("rect.width.animVal.value", "30");
22  //shouldBe("rect.width.baseVal.value", "300");
 22 shouldBe("rect.width.baseVal.value", "300");
2323}
2424
2525function executeTest() {

LayoutTests/svg/animations/script-tests/animate-end-attribute.js

@@function sample1() {
2828
2929function sample2() {
3030 shouldBe("rect.x.animVal.value", "50");
31  shouldBe("rect.x.baseVal.value", "50");
 31 shouldBe("rect.x.baseVal.value", "100");
3232}
3333
3434function sample3() {
3535 shouldBeCloseEnough("rect.x.animVal.value", "200");
36  shouldBeCloseEnough("rect.x.baseVal.value", "200");
 36 shouldBe("rect.x.baseVal.value", "100");
3737}
3838
3939function executeTest() {

LayoutTests/svg/animations/script-tests/animate-endElement-beginElement.js

@@rootSVGElement.appendChild(rect);
2626function sample1() {
2727 // Check half-time conditions
2828 shouldBe("rect.x.animVal.value", "50");
 29 shouldBe("rect.x.baseVal.value", "0");
2930}
3031
3132function executeTest() {

LayoutTests/svg/animations/script-tests/animate-from-to-keyTimes.js

@@rootSVGElement.appendChild(rect);
2222
2323// Setup animation test
2424function sample1() {
 25 shouldBe("rect.x.animVal.value", "100");
2526 shouldBe("rect.x.baseVal.value", "100");
2627}
2728
2829function sample2() {
29  shouldBe("rect.x.baseVal.value", "200");
 30 shouldBe("rect.x.animVal.value", "200");
 31 shouldBe("rect.x.baseVal.value", "100");
3032}
3133
3234function executeTest() {

LayoutTests/svg/animations/script-tests/animate-insert-begin.js

@@rootSVGElement.appendChild(rect);
2323
2424// Setup animation test
2525function sample1() {
 26 shouldBe("rect.x.animVal.value", "0");
2627 shouldBe("rect.x.baseVal.value", "0");
2728}
2829
2930function sample2() {
30  shouldBe("rect.x.baseVal.value", "90");
 31 shouldBe("rect.x.animVal.value", "90");
 32 shouldBe("rect.x.baseVal.value", "0");
3133}
3234
3335function executeTest() {

LayoutTests/svg/animations/script-tests/animate-insert-no-begin.js

@@rootSVGElement.appendChild(rect);
2323
2424// Setup animation test
2525function sample1() {
 26 shouldBe("rect.x.animVal.value", "0");
2627 shouldBe("rect.x.baseVal.value", "0");
2728}
2829
2930function sample2() {
30  shouldBe("rect.x.baseVal.value", "90");
 31 shouldBe("rect.x.animVal.value", "90");
 32 shouldBe("rect.x.baseVal.value", "0");
3133}
3234
3335function executeTest() {

LayoutTests/svg/animations/script-tests/animate-keySplines.js

@@rootSVGElement.appendChild(rect);
2525// Setup animation test
2626function sample1() {
2727 // Check initial/end conditions
28  shouldBe("rect.height.baseVal.value", "167");
29  shouldBe("rect.height.animVal.value", "167");
 28 shouldBeCloseEnough("rect.height.animVal.value", "167");
 29 shouldBe("rect.height.baseVal.value", "100");
3030}
3131
3232function sample2() {
3333 // Check half-time conditions
34  shouldBe("rect.height.baseVal.value", "111");
35  shouldBe("rect.height.animVal.value", "111");
 34 shouldBeCloseEnough("rect.height.animVal.value", "111");
 35 shouldBe("rect.height.baseVal.value", "100");
3636}
3737
3838function sample3() {
3939 // Check just before-end conditions
 40 shouldBeCloseEnough("rect.height.animVal.value", "100");
4041 shouldBe("rect.height.baseVal.value", "100");
41  shouldBe("rect.height.animVal.value", "100");
4242}
4343
4444function executeTest() {

LayoutTests/svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js

@@rootSVGElement.appendChild(rect);
2323
2424// Setup animation test
2525function sample1() {
 26 shouldBe("rect.x.animVal.value", "100");
2627 shouldBe("rect.x.baseVal.value", "100");
2728}
2829
2930function sample2() {
30  shouldBe("rect.x.baseVal.value", "200");
 31 shouldBe("rect.x.animVal.value", "200");
 32 shouldBe("rect.x.baseVal.value", "100");
3133}
3234
3335function sample3() {
34  shouldBe("rect.x.baseVal.value", "300");
 36 shouldBe("rect.x.animVal.value", "300");
 37 shouldBe("rect.x.baseVal.value", "100");
3538}
3639
3740function executeTest() {

LayoutTests/svg/animations/script-tests/attributeTypes.js

@@embedSVGTestCase("resources/attributeTypes.svg");
44// Setup animation test
55function sample1() {
66 shouldBeCloseEnough("rect1.width.animVal.value", "10");
7  //shouldBe("rect1.width.baseVal.value", "10");
 7 shouldBe("rect1.width.baseVal.value", "10");
88 shouldBeEqualToString("getComputedStyle(rect1).fill", "#008000");
99
1010 shouldBe("rect2.width.animVal.value", "100");
11  //shouldBe("rect2.width.baseVal.value", "100");
 11 shouldBe("rect2.width.baseVal.value", "100");
1212 shouldBeEqualToString("getComputedStyle(rect2).fill", "#008000");
1313
1414 shouldBe("rect3.width.animVal.value", "100");
15  //shouldBe("rect3.width.baseVal.value", "100");
 15 shouldBe("rect3.width.baseVal.value", "100");
1616 shouldBeEqualToString("getComputedStyle(rect3).fill", "#ff0000");
1717 shouldBeEqualToString("rect3.getAttribute('fill')", "red");
1818
1919 shouldBe("rect4.width.animVal.value", "100");
20  //shouldBe("rect4.width.baseVal.value", "100");
 20 shouldBe("rect4.width.baseVal.value", "100");
2121 shouldBeEqualToString("getComputedStyle(rect4).fill", "#ff0000");
2222 shouldBeEqualToString("rect4.getAttribute('fill')", "red");
2323}
2424
2525function sample2() {
2626 shouldBeCloseEnough("rect1.width.animVal.value", "55");
27  //shouldBe("rect1.width.baseVal.value", "10");
 27 shouldBe("rect1.width.baseVal.value", "10");
2828 shouldBeEqualToString("getComputedStyle(rect1).fill", "#008000");
2929
3030 shouldBe("rect2.width.animVal.value", "100");
31  //shouldBe("rect2.width.baseVal.value", "100");
 31 shouldBe("rect2.width.baseVal.value", "100");
3232 shouldBeEqualToString("getComputedStyle(rect2).fill", "#008000");
3333
3434 shouldBe("rect3.width.animVal.value", "100");
35  //shouldBe("rect3.width.baseVal.value", "100");
 35 shouldBe("rect3.width.baseVal.value", "100");
3636 shouldBeEqualToString("getComputedStyle(rect3).fill", "#804000");
3737 shouldBeEqualToString("rect3.getAttribute('fill')", "red");
3838
3939 shouldBe("rect4.width.animVal.value", "100");
40  //shouldBe("rect4.width.baseVal.value", "100");
 40 shouldBe("rect4.width.baseVal.value", "100");
4141 shouldBeEqualToString("getComputedStyle(rect4).fill", "#804000");
4242 shouldBeEqualToString("rect4.getAttribute('fill')", "red");
4343}
4444
4545function sample3() {
4646 shouldBeCloseEnough("rect1.width.animVal.value", "100");
47  //shouldBe("rect1.width.baseVal.value", "10");
 47 shouldBe("rect1.width.baseVal.value", "10");
4848 shouldBeEqualToString("getComputedStyle(rect1).fill", "#008000");
4949
5050 shouldBe("rect2.width.animVal.value", "100");
51  //shouldBe("rect2.width.baseVal.value", "100");
 51 shouldBe("rect2.width.baseVal.value", "100");
5252 shouldBeEqualToString("getComputedStyle(rect2).fill", "#008000");
5353
5454 shouldBe("rect3.width.animVal.value", "100");
55  //shouldBe("rect3.width.baseVal.value", "100");
 55 shouldBe("rect3.width.baseVal.value", "100");
5656 shouldBeEqualToString("getComputedStyle(rect3).fill", "#008000");
5757 shouldBeEqualToString("rect3.getAttribute('fill')", "red");
5858
5959 shouldBe("rect4.width.animVal.value", "100");
60  //shouldBe("rect4.width.baseVal.value", "100");
 60 shouldBe("rect4.width.baseVal.value", "100");
6161 shouldBeEqualToString("getComputedStyle(rect4).fill", "#008000");
6262 shouldBeEqualToString("rect4.getAttribute('fill')", "red");
6363}

LayoutTests/svg/animations/script-tests/change-baseVal-while-animating-fill-freeze-2.js

 1description("This tests scripting baseVal while animation is running");
 2embedSVGTestCase("resources/change-baseVal-while-animating-fill-freeze.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect.width.animVal.value", "10");
 7 shouldBe("rect.width.baseVal.value", "10");
 8}
 9
 10function sample2() {
 11 shouldBeCloseEnough("rect.width.animVal.value", "30");
 12 shouldBe("rect.width.baseVal.value", "10");
 13
 14 rect.setAttribute("width", "100");
 15}
 16
 17function sample3() {
 18 shouldBeCloseEnough("rect.width.animVal.value", "30");
 19 shouldBe("rect.width.baseVal.value", "100");
 20}
 21
 22function sample4() {
 23 shouldBeCloseEnough("rect.width.animVal.value", "50");
 24 shouldBe("rect.width.baseVal.value", "100");
 25}
 26
 27function sample5() {
 28 shouldBe("rect.width.animVal.value", "50");
 29 shouldBe("rect.width.baseVal.value", "100");
 30}
 31
 32function executeTest() {
 33 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
 34
 35 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
 36 const expectedValues = [
 37 // [animationId, time, sampleCallback]
 38 ["an1", 0.0, sample1],
 39 ["an1", 2.0, sample2],
 40 ["an1", 2.001, sample3],
 41 ["an1", 3.999, sample4],
 42 ["an1", 4.001, sample5],
 43 ["an1", 60.0, sample5]
 44 ];
 45
 46 runAnimationTest(expectedValues);
 47}
 48
 49window.animationStartsImmediately = true;
 50var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/change-baseVal-while-animating-fill-freeze.js

 1description("This tests scripting baseVal while animation is running");
 2embedSVGTestCase("resources/change-baseVal-while-animating-fill-freeze.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect.width.animVal.value", "10");
 7 shouldBe("rect.width.baseVal.value", "10");
 8}
 9
 10function sample2() {
 11 shouldBeCloseEnough("rect.width.animVal.value", "30");
 12 shouldBe("rect.width.baseVal.value", "10");
 13
 14 rect.width.baseVal.value = 100;
 15}
 16
 17function sample3() {
 18 shouldBeCloseEnough("rect.width.animVal.value", "30");
 19 shouldBe("rect.width.baseVal.value", "100");
 20}
 21
 22function sample4() {
 23 shouldBeCloseEnough("rect.width.animVal.value", "50");
 24 shouldBe("rect.width.baseVal.value", "100");
 25}
 26
 27function sample5() {
 28 shouldBe("rect.width.animVal.value", "50");
 29 shouldBe("rect.width.baseVal.value", "100");
 30}
 31
 32function executeTest() {
 33 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
 34
 35 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
 36 const expectedValues = [
 37 // [animationId, time, sampleCallback]
 38 ["an1", 0.0, sample1],
 39 ["an1", 2.0, sample2],
 40 ["an1", 2.001, sample3],
 41 ["an1", 3.999, sample4],
 42 ["an1", 4.001, sample5],
 43 ["an1", 60.0, sample5]
 44 ];
 45
 46 runAnimationTest(expectedValues);
 47}
 48
 49window.animationStartsImmediately = true;
 50var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/change-baseVal-while-animating-fill-remove-2.js

 1description("This tests scripting baseVal while animation is running");
 2embedSVGTestCase("resources/change-baseVal-while-animating-fill-remove.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect.width.animVal.value", "10");
 7 shouldBe("rect.width.baseVal.value", "10");
 8}
 9
 10function sample2() {
 11 shouldBeCloseEnough("rect.width.animVal.value", "30");
 12 shouldBe("rect.width.baseVal.value", "10");
 13
 14 rect.setAttribute("width", "100");
 15}
 16
 17function sample3() {
 18 shouldBeCloseEnough("rect.width.animVal.value", "30");
 19 shouldBe("rect.width.baseVal.value", "100");
 20}
 21
 22function sample4() {
 23 shouldBeCloseEnough("rect.width.animVal.value", "50");
 24 shouldBe("rect.width.baseVal.value", "100");
 25}
 26
 27function sample5() {
 28 shouldBe("rect.width.animVal.value", "100");
 29 shouldBe("rect.width.baseVal.value", "100");
 30}
 31
 32function executeTest() {
 33 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
 34
 35 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
 36 const expectedValues = [
 37 // [animationId, time, sampleCallback]
 38 ["an1", 0.0, sample1],
 39 ["an1", 2.0, sample2],
 40 ["an1", 2.001, sample3],
 41 ["an1", 3.999, sample4],
 42 ["an1", 4.001, sample5],
 43 ["an1", 60.0, sample5]
 44 ];
 45
 46 runAnimationTest(expectedValues);
 47}
 48
 49window.animationStartsImmediately = true;
 50var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/change-baseVal-while-animating-fill-remove.js

 1description("This tests scripting baseVal while animation is running");
 2embedSVGTestCase("resources/change-baseVal-while-animating-fill-remove.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect.width.animVal.value", "10");
 7 shouldBe("rect.width.baseVal.value", "10");
 8}
 9
 10function sample2() {
 11 shouldBeCloseEnough("rect.width.animVal.value", "30");
 12 shouldBe("rect.width.baseVal.value", "10");
 13
 14 rect.width.baseVal.value = 100;
 15}
 16
 17function sample3() {
 18 shouldBeCloseEnough("rect.width.animVal.value", "30");
 19 shouldBe("rect.width.baseVal.value", "100");
 20}
 21
 22function sample4() {
 23 shouldBeCloseEnough("rect.width.animVal.value", "50");
 24 shouldBe("rect.width.baseVal.value", "100");
 25}
 26
 27function sample5() {
 28 shouldBe("rect.width.animVal.value", "100");
 29 shouldBe("rect.width.baseVal.value", "100");
 30}
 31
 32function executeTest() {
 33 rect = rootSVGElement.ownerDocument.getElementsByTagName("rect")[0];
 34
 35 // All animations in the test file use the same duration, so it's not needed to list all sample points individually for an5/an6/an7/an8.
 36 const expectedValues = [
 37 // [animationId, time, sampleCallback]
 38 ["an1", 0.0, sample1],
 39 ["an1", 2.0, sample2],
 40 ["an1", 2.001, sample3],
 41 ["an1", 3.999, sample4],
 42 ["an1", 4.001, sample5],
 43 ["an1", 60.0, sample5]
 44 ];
 45
 46 runAnimationTest(expectedValues);
 47}
 48
 49window.animationStartsImmediately = true;
 50var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/change-target-while-animating-SVG-property.js

 1description("This changes the target of an animation while its running");
 2embedSVGTestCase("resources/change-target-while-animating-SVG-property.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect1.width.animVal.value", "150");
 7 shouldBe("rect1.width.baseVal.value", "150");
 8
 9 shouldBeCloseEnough("rect2.width.animVal.value", "150");
 10 shouldBe("rect2.width.baseVal.value", "150");
 11}
 12
 13function sample2() {
 14 shouldBeCloseEnough("rect1.width.animVal.value", "100");
 15 shouldBe("rect1.width.baseVal.value", "150");
 16
 17 shouldBeCloseEnough("rect2.width.animVal.value", "150");
 18 shouldBe("rect2.width.baseVal.value", "150");
 19
 20 // Switch to new target while animation is running.
 21 // The effect is that rect1 is now reset to the initial state, before any animation was applied to it.
 22 // Compatible with FF. In Opera it only works when not driving the timeline using setCurrentTime.
 23 rootSVGElement.ownerDocument.getElementById("an1").setAttributeNS(xlinkNS, "xlink:href", "#target2");
 24}
 25
 26function sample3() {
 27 shouldBeCloseEnough("rect1.width.animVal.value", "150");
 28 shouldBe("rect1.width.baseVal.value", "150");
 29
 30 shouldBeCloseEnough("rect2.width.animVal.value", "100");
 31 shouldBe("rect2.width.baseVal.value", "150");
 32}
 33
 34function sample4() {
 35 shouldBeCloseEnough("rect1.width.animVal.value", "150");
 36 shouldBe("rect1.width.baseVal.value", "150");
 37
 38 shouldBeCloseEnough("rect2.width.animVal.value", "50");
 39 shouldBe("rect2.width.baseVal.value", "150");
 40}
 41
 42function sample5() {
 43 shouldBe("rect1.width.animVal.value", "150");
 44 shouldBe("rect1.width.baseVal.value", "150");
 45
 46 shouldBe("rect2.width.animVal.value", "50");
 47 shouldBe("rect2.width.baseVal.value", "150");
 48}
 49
 50function executeTest() {
 51 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
 52 rect1 = rects[0];
 53 rect2 = rects[1];
 54
 55 const expectedValues = [
 56 // [animationId, time, sampleCallback]
 57 ["an1", 0.0, sample1],
 58 ["an1", 2.0, sample2],
 59 ["an1", 2.001, sample3],
 60 ["an1", 3.999, sample4],
 61 ["an1", 4.001, sample5],
 62 ["an1", 60.0, sample5]
 63 ];
 64
 65 runAnimationTest(expectedValues);
 66}
 67
 68window.animationStartsImmediately = true;
 69var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/multiple-animations-fill-freeze.js

 1description("This checks the effect on multiple animations on one target");
 2embedSVGTestCase("resources/multiple-animations-fill-freeze.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect1.x.animVal.value", "0");
 7 shouldBe("rect1.x.baseVal.value", "0");
 8
 9 shouldBeCloseEnough("rect2.x.animVal.value", "0");
 10 shouldBe("rect2.x.baseVal.value", "0");
 11
 12 shouldBeCloseEnough("rect3.x.animVal.value", "0");
 13 shouldBe("rect3.x.baseVal.value", "0");
 14}
 15
 16function sample2() {
 17 shouldBeCloseEnough("rect1.x.animVal.value", "50");
 18 shouldBe("rect1.x.baseVal.value", "0");
 19
 20 shouldBeCloseEnough("rect2.x.animVal.value", "50");
 21 shouldBe("rect2.x.baseVal.value", "0");
 22
 23 shouldBeCloseEnough("rect3.x.animVal.value", "50");
 24 shouldBe("rect3.x.baseVal.value", "0");
 25}
 26
 27function sample3() {
 28 shouldBeCloseEnough("rect1.x.animVal.value", "100");
 29 shouldBe("rect1.x.baseVal.value", "0");
 30
 31 shouldBeCloseEnough("rect2.x.animVal.value", "100");
 32 shouldBe("rect2.x.baseVal.value", "0");
 33
 34 shouldBeCloseEnough("rect3.x.animVal.value", "100");
 35 shouldBe("rect3.x.baseVal.value", "0");
 36}
 37
 38function sample4() {
 39 shouldBe("rect1.x.animVal.value", "100");
 40 shouldBe("rect1.x.baseVal.value", "0");
 41
 42 shouldBe("rect2.x.animVal.value", "0");
 43 shouldBe("rect2.x.baseVal.value", "0");
 44
 45 shouldBe("rect3.x.animVal.value", "100");
 46 shouldBe("rect3.x.baseVal.value", "0");
 47}
 48
 49function sample5() {
 50 shouldBeCloseEnough("rect1.x.animVal.value", "150");
 51 shouldBe("rect1.x.baseVal.value", "0");
 52
 53 shouldBeCloseEnough("rect2.x.animVal.value", "150");
 54 shouldBe("rect2.x.baseVal.value", "0");
 55
 56 shouldBeCloseEnough("rect3.x.animVal.value", "150");
 57 shouldBe("rect3.x.baseVal.value", "0");
 58}
 59
 60function sample6() {
 61 shouldBeCloseEnough("rect1.x.animVal.value", "200");
 62 shouldBe("rect1.x.baseVal.value", "0");
 63
 64 shouldBeCloseEnough("rect2.x.animVal.value", "200");
 65 shouldBe("rect2.x.baseVal.value", "0");
 66
 67 shouldBeCloseEnough("rect3.x.animVal.value", "200");
 68 shouldBe("rect3.x.baseVal.value", "0");
 69}
 70
 71function sample7() {
 72 shouldBeCloseEnough("rect1.x.animVal.value", "250");
 73 shouldBe("rect1.x.baseVal.value", "0");
 74
 75 shouldBeCloseEnough("rect2.x.animVal.value", "250");
 76 shouldBe("rect2.x.baseVal.value", "0");
 77
 78 shouldBeCloseEnough("rect3.x.animVal.value", "250");
 79 shouldBe("rect3.x.baseVal.value", "0");
 80}
 81
 82function sample8() {
 83 shouldBe("rect1.x.animVal.value", "250");
 84 shouldBe("rect1.x.baseVal.value", "0");
 85
 86 shouldBe("rect2.x.animVal.value", "250");
 87 shouldBe("rect2.x.baseVal.value", "0");
 88
 89 shouldBe("rect3.x.animVal.value", "100");
 90 shouldBe("rect3.x.baseVal.value", "0");
 91}
 92
 93function executeTest() {
 94 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
 95 rect1 = rects[0];
 96 rect2 = rects[1];
 97 rect3 = rects[2];
 98
 99 const expectedValues = [
 100 // [animationId, time, sampleCallback]
 101 ["an1", 0.0, sample1],
 102 ["an1", 1.0, sample2],
 103 ["an1", 1.999, sample3],
 104 ["an1", 2.001, sample4],
 105 ["an1", 3.0, sample4],
 106 ["an1", 3.999, sample4],
 107 ["an1", 4.0, sample5],
 108 ["an1", 5.0, sample6],
 109 ["an1", 5.999, sample7],
 110 ["an1", 6.001, sample8],
 111 ["an1", 60.0, sample8]
 112 ];
 113
 114 runAnimationTest(expectedValues);
 115}
 116
 117window.animationStartsImmediately = true;
 118var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/remove-animation-element-while-animation-is-running.js

 1description("This removes an animation element while the animation is running");
 2embedSVGTestCase("resources/remove-animation-element-while-animation-is-running.svg");
 3
 4// Setup animation test
 5function sample1() {
 6 shouldBeCloseEnough("rect1.x.animVal.value", "50");
 7 shouldBe("rect1.x.baseVal.value", "0");
 8
 9 shouldBeCloseEnough("rect2.x.animVal.value", "50");
 10 shouldBe("rect2.x.baseVal.value", "0");
 11}
 12
 13function sample2() {
 14 shouldBeCloseEnough("rect1.x.animVal.value", "100");
 15 shouldBe("rect1.x.baseVal.value", "0");
 16
 17 shouldBeCloseEnough("rect2.x.animVal.value", "100");
 18 shouldBe("rect2.x.baseVal.value", "0");
 19
 20 // Remove the animation element animating rect1
 21 // The effect is that rect1 is now reset to the initial state, before any animation was applied to it.
 22 // Compatible with FF. In Opera it shows a repainting bug currently (two rects are visible!).
 23 var an1 = rootSVGElement.ownerDocument.getElementById("an1");
 24 an1.parentNode.removeChild(an1);
 25}
 26
 27function sample3() {
 28 shouldBe("rect1.x.animVal.value", "0");
 29 shouldBe("rect1.x.baseVal.value", "0");
 30
 31 shouldBeCloseEnough("rect2.x.animVal.value", "100");
 32 shouldBe("rect2.x.baseVal.value", "0");
 33}
 34
 35function sample4() {
 36 shouldBe("rect1.x.animVal.value", "0");
 37 shouldBe("rect1.x.baseVal.value", "0");
 38
 39 shouldBe("rect2.x.animVal.value", "0");
 40 shouldBe("rect2.x.baseVal.value", "0");
 41}
 42
 43function executeTest() {
 44 var rects = rootSVGElement.ownerDocument.getElementsByTagName("rect");
 45 rect1 = rects[0];
 46 rect2 = rects[1];
 47
 48 const expectedValues = [
 49 // [animationId, time, sampleCallback]
 50 ["an1", 0.0, sample1],
 51 ["an1", 1.0, sample2],
 52 ["an2", 1.001, sample3],
 53 ["an2", 2.001, sample4],
 54 ["an2", 60.0, sample4]
 55 ];
 56
 57 runAnimationTest(expectedValues);
 58}
 59
 60window.animationStartsImmediately = true;
 61var successfullyParsed = true;

LayoutTests/svg/animations/script-tests/svglength-animation-LengthModeHeight.js

@@function sample1() {
3434
3535function sample2() {
3636 shouldBe("rect.height.animVal.value", "150");
37  shouldBe("rect.height.baseVal.value", "150");
 37 shouldBe("rect.height.baseVal.value", "100");
3838}
3939
4040function sample3() {
4141 shouldBeCloseEnough("rect.height.animVal.value", "200");
42  shouldBeCloseEnough("rect.height.baseVal.value", "200");
 42 shouldBe("rect.height.baseVal.value", "100");
4343}
4444
4545function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-LengthModeOther.js

@@function sample1() {
3333
3434function sample2() {
3535 shouldBeCloseEnough("circle.r.animVal.value", "132.5");
36  shouldBeCloseEnough("circle.r.baseVal.value", "132.5");
 36 shouldBe("circle.r.baseVal.value", "10");
3737}
3838
3939function sample3() {
4040 shouldBeCloseEnough("circle.r.animVal.value", "254.9");
41  shouldBeCloseEnough("circle.r.baseVal.value", "254.9");
 41 shouldBe("circle.r.baseVal.value", "10");
4242}
4343
4444function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-LengthModeWidth.js

@@function sample1() {
3434
3535function sample2() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "200");
37  shouldBeCloseEnough("rect.width.baseVal.value", "200");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function sample3() {
4141 shouldBeCloseEnough("rect.width.animVal.value", "300");
42  shouldBeCloseEnough("rect.width.baseVal.value", "300");
 42 shouldBe("rect.width.baseVal.value", "100");
4343}
4444
4545function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-invalid-value-1.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "0");
32  shouldBe("rect.width.baseVal.value", "0");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-invalid-value-2.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "0");
32  shouldBe("rect.width.baseVal.value", "0");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-invalid-value-3.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "0");
32  shouldBe("rect.width.baseVal.value", "0");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-number-to-number.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "150");
32  shouldBe("rect.width.baseVal.value", "150");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "200");
37  shouldBeCloseEnough("rect.width.baseVal.value", "200");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-cm.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBeCloseEnough("rect.width.animVal.value", "144.5");
32  shouldBeCloseEnough("rect.width.baseVal.value", "144.5");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "189");
37  shouldBeCloseEnough("rect.width.baseVal.value", "189");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-ems.js

@@function sample1() {
3030
3131function sample2() {
3232 shouldBe("rect.width.animVal.value", "150");
33  shouldBe("rect.width.baseVal.value", "150");
 33 shouldBe("rect.width.baseVal.value", "100");
3434}
3535
3636function sample3() {
3737 shouldBeCloseEnough("rect.width.animVal.value", "200");
38  shouldBeCloseEnough("rect.width.baseVal.value", "200");
 38 shouldBe("rect.width.baseVal.value", "100");
3939}
4040
4141function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-exs.js

@@function sample1() {
3030
3131function sample2() {
3232 shouldBe("rect.width.animVal.value", "150");
33  shouldBe("rect.width.baseVal.value", "150");
 33 shouldBe("rect.width.baseVal.value", "100");
3434}
3535
3636function sample3() {
3737 shouldBeCloseEnough("rect.width.animVal.value", "200");
38  shouldBeCloseEnough("rect.width.baseVal.value", "200");
 38 shouldBe("rect.width.baseVal.value", "100");
3939}
4040
4141function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-in.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBeCloseEnough("rect.width.animVal.value", "170");
32  shouldBeCloseEnough("rect.width.baseVal.value", "170");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "240");
37  shouldBeCloseEnough("rect.width.baseVal.value", "240");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-number.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "150");
32  shouldBe("rect.width.baseVal.value", "150");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "200");
37  shouldBeCloseEnough("rect.width.baseVal.value", "200");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-pc.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "170");
32  shouldBe("rect.width.baseVal.value", "170");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "240");
37  shouldBeCloseEnough("rect.width.baseVal.value", "240");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-percentage.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBeCloseEnough("rect.width.animVal.value", "350");
32  shouldBeCloseEnough("rect.width.baseVal.value", "350");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "600", 1);
37  shouldBeCloseEnough("rect.width.baseVal.value", "600", 1);
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-pt.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBeCloseEnough("rect.width.animVal.value", "161.2");
32  shouldBeCloseEnough("rect.width.baseVal.value", "161.2");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "189");
37  shouldBeCloseEnough("rect.width.baseVal.value", "189");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-px-to-px.js

@@function sample1() {
2929
3030function sample2() {
3131 shouldBe("rect.width.animVal.value", "150");
32  shouldBe("rect.width.baseVal.value", "150");
 32 shouldBe("rect.width.baseVal.value", "100");
3333}
3434
3535function sample3() {
3636 shouldBeCloseEnough("rect.width.animVal.value", "200");
37  shouldBeCloseEnough("rect.width.baseVal.value", "200");
 37 shouldBe("rect.width.baseVal.value", "100");
3838}
3939
4040function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-unitType.js

@@rootSVGElement.appendChild(rect);
2424function sample1() {
2525 // Check initial/end conditions
2626 shouldBe("rect.width.animVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
 27 shouldBe("rect.width.baseVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
2728}
2829
2930function sample2() {
3031 shouldBe("rect.width.animVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
 32 shouldBe("rect.width.baseVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
3133}
3234
3335function sample3() {
3436 shouldBe("rect.width.animVal.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
 37 shouldBe("rect.width.baseVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
3538}
3639
3740function executeTest() {

LayoutTests/svg/animations/script-tests/svglength-animation-values.js

@@function sample1() {
2828
2929function sample2() {
3030 shouldBe("rect.width.animVal.value", "130");
31  shouldBe("rect.width.baseVal.value", "130");
 31 shouldBe("rect.width.baseVal.value", "100");
3232}
3333
3434function sample3() {
3535 shouldBeCloseEnough("rect.width.animVal.value", "151.2");
36  shouldBeCloseEnough("rect.width.baseVal.value", "151.2");
 36 shouldBe("rect.width.baseVal.value", "100");
3737}
3838
3939function sample4() {
4040 shouldBe("rect.width.animVal.value", "576");
41  shouldBe("rect.width.baseVal.value", "576");
 41 shouldBe("rect.width.baseVal.value", "100");
4242}
4343
4444function sample5() {
4545 shouldBeCloseEnough("rect.width.animVal.value", "267");
46  shouldBeCloseEnough("rect.width.baseVal.value", "267");
 46 shouldBe("rect.width.baseVal.value", "100");
4747}
4848
4949function executeTest() {

LayoutTests/svg/animations/svglength-animation-LengthModeHeight-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.height.animVal.value is 100
99PASS rect.height.baseVal.value is 100
1010PASS rect.height.animVal.value is 150
11 PASS rect.height.baseVal.value is 150
 11PASS rect.height.baseVal.value is 100
1212PASS rect.height.animVal.value is 200
13 PASS rect.height.baseVal.value is 200
 13PASS rect.height.baseVal.value is 100
1414PASS rect.height.animVal.value is 100
1515PASS rect.height.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-LengthModeOther-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS circle.r.animVal.value is 10
99PASS circle.r.baseVal.value is 10
1010PASS circle.r.animVal.value is 132.5
11 PASS circle.r.baseVal.value is 132.5
 11PASS circle.r.baseVal.value is 10
1212PASS circle.r.animVal.value is 254.9
13 PASS circle.r.baseVal.value is 254.9
 13PASS circle.r.baseVal.value is 10
1414PASS circle.r.animVal.value is 10
1515PASS circle.r.baseVal.value is 10
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-LengthModeWidth-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 200
11 PASS rect.width.baseVal.value is 200
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 300
13 PASS rect.width.baseVal.value is 300
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-invalid-value-1-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 0
11 PASS rect.width.baseVal.value is 0
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 100
1313PASS rect.width.baseVal.value is 100
1414PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-invalid-value-2-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 0
11 PASS rect.width.baseVal.value is 0
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 100
1313PASS rect.width.baseVal.value is 100
1414PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-invalid-value-3-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 0
11 PASS rect.width.baseVal.value is 0
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 100
1313PASS rect.width.baseVal.value is 100
1414PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-number-to-number-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 150
11 PASS rect.width.baseVal.value is 150
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 200
13 PASS rect.width.baseVal.value is 200
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-cm-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 144.5
11 PASS rect.width.baseVal.value is 144.5
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 189
13 PASS rect.width.baseVal.value is 189
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-ems-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 150
11 PASS rect.width.baseVal.value is 150
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 200
13 PASS rect.width.baseVal.value is 200
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-exs-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 150
11 PASS rect.width.baseVal.value is 150
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 200
13 PASS rect.width.baseVal.value is 200
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-in-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 170
11 PASS rect.width.baseVal.value is 170
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 240
13 PASS rect.width.baseVal.value is 240
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-number-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 150
11 PASS rect.width.baseVal.value is 150
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 200
13 PASS rect.width.baseVal.value is 200
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-pc-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 170
11 PASS rect.width.baseVal.value is 170
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 240
13 PASS rect.width.baseVal.value is 240
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-percentage-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 350
11 PASS rect.width.baseVal.value is 350
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 600
13 PASS rect.width.baseVal.value is 600
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-pt-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 161.2
11 PASS rect.width.baseVal.value is 161.2
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 189
13 PASS rect.width.baseVal.value is 189
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-px-to-px-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 150
11 PASS rect.width.baseVal.value is 150
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 200
13 PASS rect.width.baseVal.value is 200
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 100
1515PASS rect.width.baseVal.value is 100
1616PASS successfullyParsed is true

LayoutTests/svg/animations/svglength-animation-unitType-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
66
77
88PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
 9PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
910PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
 11PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
1012PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_PX
 13PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
1114PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
 15PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
1216PASS successfullyParsed is true
1317
1418TEST COMPLETE

LayoutTests/svg/animations/svglength-animation-values-expected.txt

@@On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
88PASS rect.width.animVal.value is 100
99PASS rect.width.baseVal.value is 100
1010PASS rect.width.animVal.value is 130
11 PASS rect.width.baseVal.value is 130
 11PASS rect.width.baseVal.value is 100
1212PASS rect.width.animVal.value is 151.2
13 PASS rect.width.baseVal.value is 151.2
 13PASS rect.width.baseVal.value is 100
1414PASS rect.width.animVal.value is 576
15 PASS rect.width.baseVal.value is 576
 15PASS rect.width.baseVal.value is 100
1616PASS rect.width.animVal.value is 267
17 PASS rect.width.baseVal.value is 267
 17PASS rect.width.baseVal.value is 100
1818PASS rect.width.animVal.value is 100
1919PASS rect.width.baseVal.value is 100
2020PASS successfullyParsed is true

LayoutTests/svg/repaint/repainting-after-animation-element-removal.svg

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
 3<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintTest()">
 4<script xlink:href="../../fast/repaint/resources/repaint.js" type="text/javascript"></script>
 5<script type="text/javascript">
 6function repaintTest() {
 7 if (window.layoutTestController)
 8 layoutTestController.waitUntilDone();
 9
 10 // Run a part of the animation timeline, so we're sure that we're removing the animation element while it's active!
 11 setTimeout(function() {
 12 var an1 = document.getElementById('an1');
 13 an1.parentNode.removeChild(an1);
 14 if (window.layoutTestController)
 15 layoutTestController.notifyDone();
 16 }, 100);
 17}
 18</script>
 19
 20<rect x='0' y='0' width='50' height='50' fill='green'>
 21 <animate id="an1" attributeName='x' from='50' to='150' begin='0s' dur='2s' fill='freeze'/>
 22</rect>
 23
 24</svg>