Source/WebCore/ChangeLog

 12012-02-29 Nikolas Zimmermann <nzimmermann@rim.com>
 2
 3 Introduce SMIL overrideStyle, to make SVG stop mutating CSS styles directly
 4 https://bugs.webkit.org/show_bug.cgi?id=79790
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Next step towards enabling animVal support for XML attribute animations.
 9 When SVG CSS properties are animated using SMIL, we currently mutate
 10 the target elements style, and have to keep a baseValue around as String
 11 to be able to recover from the DOM mutations at the end, if fill!="freeze".
 12
 13 The approach required by SMIL is to keep around an override style declaration
 14 set and apply it right after the inline style declarations. Implement that
 15 finally, to avoid mutating styles directly.
 16
 17 Covered by existing tests.
 18
 19 * css/CSSStyleSelector.cpp:
 20 (WebCore::CSSStyleSelector::addElementStyleProperties):
 21 (WebCore):
 22 (WebCore::CSSStyleSelector::collectMatchingRulesForList):
 23 * css/CSSStyleSelector.h:
 24 (CSSStyleSelector):
 25 * svg/SVGAnimateElement.cpp:
 26 (WebCore::SVGAnimateElement::SVGAnimateElement):
 27 (WebCore::SVGAnimateElement::applyResultsToTarget):
 28 (WebCore::SVGAnimateElement::endedActiveInterval):
 29 (WebCore):
 30 * svg/SVGAnimateElement.h:
 31 (SVGAnimateElement):
 32 * svg/SVGAnimationElement.cpp:
 33 (WebCore::setTargetAttributeAnimatedCSSValue):
 34 (WebCore):
 35 (WebCore::setTargetAttributeAnimatedXMLValue):
 36 (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
 37 (WebCore::SVGAnimationElement::resetAnimationState):
 38 (WebCore::SVGAnimationElement::shouldApplyAnimation):
 39 * svg/SVGAnimationElement.h:
 40 * svg/SVGElement.cpp:
 41 (WebCore::SVGElement::~SVGElement):
 42 (WebCore::SVGElement::overrideStylePropertySet):
 43 (WebCore):
 44 (WebCore::SVGElement::ensureOverrideStylePropertySet):
 45 * svg/SVGElement.h:
 46 (SVGElement):
 47 * svg/SVGElementRareData.h:
 48 (WebCore::SVGElementRareData::overrideStylePropertySet):
 49 (WebCore::SVGElementRareData::ensureOverrideStylePropertySet):
 50 (SVGElementRareData):
 51 (WebCore::SVGElementRareData::destroyOverrideStylePropertySet):
 52 * svg/animation/SVGSMILElement.h:
 53 (SVGSMILElement):
 54
1552012-02-28 Yury Semikhatsky <yurys@chromium.org>
256
357 Web Inspector: move DOM counter graphs out of experimental

Source/WebCore/css/CSSStyleSelector.cpp

122122#endif
123123
124124#if ENABLE(SVG)
 125#include "SVGElement.h"
125126#include "SVGNames.h"
126127#endif
127128

@@void CSSStyleSelector::addMatchedProperties(MatchResult& matchResult, StylePrope
760761 matchResult.matchedRules.append(rule);
761762}
762763
 764inline void CSSStyleSelector::addElementStyleProperties(MatchResult& result, StylePropertySet* propertySet, bool isCacheable)
 765{
 766 if (!propertySet)
 767 return;
 768 result.ranges.lastAuthorRule = result.matchedProperties.size();
 769 if (result.ranges.firstAuthorRule == -1)
 770 result.ranges.firstAuthorRule = result.ranges.lastAuthorRule;
 771 addMatchedProperties(result, propertySet);
 772 if (!isCacheable)
 773 result.isCacheable = false;
 774}
 775
763776void CSSStyleSelector::collectMatchingRules(RuleSet* rules, int& firstRuleIndex, int& lastRuleIndex, const MatchOptions& options)
764777{
765778 ASSERT(rules);

@@void CSSStyleSelector::matchAllRules(MatchResult& result)
10301043
10311044 // Now check author rules, beginning first with presentational attributes mapped from HTML.
10321045 if (m_styledElement) {
1033  if (StylePropertySet* attributeStyle = m_styledElement->attributeStyle()) {
1034  result.ranges.lastAuthorRule = m_matchedRules.size();
1035  if (result.ranges.firstAuthorRule == -1)
1036  result.ranges.firstAuthorRule = result.ranges.lastAuthorRule;
1037  addMatchedProperties(result, attributeStyle);
1038  }
 1046 addElementStyleProperties(result, m_styledElement->attributeStyle());
10391047
10401048 // Now we check additional mapped declarations.
10411049 // Tables and table cells share an additional mapped rule that must be applied
10421050 // after all attributes, since their mapped style depends on the values of multiple attributes.
1043  if (StylePropertySet* additionalStyle = m_styledElement->additionalAttributeStyle()) {
1044  if (result.ranges.firstAuthorRule == -1)
1045  result.ranges.firstAuthorRule = result.matchedProperties.size();
1046  result.ranges.lastAuthorRule = result.ranges.firstAuthorRule;
1047  addMatchedProperties(result, additionalStyle);
1048  }
 1051 addElementStyleProperties(result, m_styledElement->additionalAttributeStyle());
10491052
10501053 if (m_styledElement->isHTMLElement()) {
10511054 bool isAuto;

@@void CSSStyleSelector::matchAllRules(MatchResult& result)
10601063 matchAuthorRules(result, false);
10611064
10621065 // Now check our inline style attribute.
1063  if (m_matchAuthorAndUserStyles && m_styledElement) {
1064  StylePropertySet* inlineDecl = m_styledElement->inlineStyleDecl();
1065  if (inlineDecl) {
1066  result.ranges.lastAuthorRule = result.matchedProperties.size();
1067  if (result.ranges.firstAuthorRule == -1)
1068  result.ranges.firstAuthorRule = result.ranges.lastAuthorRule;
1069  addMatchedProperties(result, inlineDecl);
1070  result.isCacheable = false;
1071  }
1072  }
 1066 if (m_matchAuthorAndUserStyles && m_styledElement)
 1067 addElementStyleProperties(result, m_styledElement->inlineStyleDecl(), false /* isCacheable */);
 1068
 1069#if ENABLE(SVG)
 1070 // Now check SMIL animation override style.
 1071 if (m_matchAuthorAndUserStyles && m_styledElement && m_styledElement->isSVGElement())
 1072 addElementStyleProperties(result, static_cast<SVGElement*>(m_styledElement)->overrideStylePropertySet(), false /* isCacheable */);
 1073#endif
10731074}
10741075
10751076inline void CSSStyleSelector::initElement(Element* e)

@@Node* CSSStyleSelector::locateCousinList(Element* parent, unsigned& visitedNodeC
11251126 StyledElement* p = static_cast<StyledElement*>(parent);
11261127 if (p->inlineStyleDecl())
11271128 return 0;
 1129#if ENABLE(SVG)
 1130 if (p->isSVGElement() && static_cast<SVGElement*>(p)->overrideStylePropertySet())
 1131 return 0;
 1132#endif
11281133 if (p->hasID() && m_features.idsInRules.contains(p->idForStyleResolution().impl()))
11291134 return 0;
11301135

@@bool CSSStyleSelector::canShareStyleWithElement(StyledElement* element) const
12731278 return false;
12741279 if (element->inlineStyleDecl())
12751280 return false;
 1281#if ENABLE(SVG)
 1282 if (element->isSVGElement() && static_cast<SVGElement*>(element)->overrideStylePropertySet())
 1283 return false;
 1284#endif
12761285 if (!!element->attributeStyle() != !!m_styledElement->attributeStyle())
12771286 return false;
12781287 if (element->isLink() != m_element->isLink())

@@RenderStyle* CSSStyleSelector::locateSharedStyle()
13701379 // If the element has inline style it is probably unique.
13711380 if (m_styledElement->inlineStyleDecl())
13721381 return 0;
 1382#if ENABLE(SVG)
 1383 if (m_styledElement->isSVGElement() && static_cast<SVGElement*>(m_styledElement)->overrideStylePropertySet())
 1384 return 0;
 1385#endif
13731386 // Ids stop style sharing if they show up in the stylesheets.
13741387 if (m_styledElement->hasID() && m_features.idsInRules.contains(m_styledElement->idForStyleResolution().impl()))
13751388 return 0;

Source/WebCore/css/CSSStyleSelector.h

@@private:
292292 };
293293
294294 static void addMatchedProperties(MatchResult&, StylePropertySet* properties, StyleRule* = 0, unsigned linkMatchType = SelectorChecker::MatchAll);
 295 void addElementStyleProperties(MatchResult&, StylePropertySet*, bool isCacheable = true);
295296
296297 void matchAllRules(MatchResult&);
297298 void matchUARules(MatchResult&);

Source/WebCore/svg/SVGAnimateElement.cpp

@@namespace WebCore {
4141SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* document)
4242 : SVGAnimationElement(tagName, document)
4343 , m_animatedPropertyType(AnimatedString)
 44 , m_aboutToStopAnimation(false)
4445 , m_fromPropertyValueType(RegularPropertyValue)
4546 , m_toPropertyValueType(RegularPropertyValue)
4647{

@@void SVGAnimateElement::applyResultsToTarget()
230231 ASSERT(m_animatedPropertyType != AnimatedUnknown);
231232 ASSERT(m_animatedType);
232233
 234 if (m_aboutToStopAnimation) {
 235 m_aboutToStopAnimation = false;
 236 resetAnimationState(m_animatedType->valueAsString());
 237 return;
 238 }
 239
233240 setTargetAttributeAnimatedValue(m_animatedType->valueAsString());
234241}
235242

@@SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
260267 return m_animator.get();
261268}
262269
 270void SVGAnimateElement::endedActiveInterval()
 271{
 272 SVGAnimationElement::endedActiveInterval();
 273 m_aboutToStopAnimation = true;
 274}
 275
263276}
264277#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();
6869 virtual void targetElementDidChange(SVGElement* targetElement) OVERRIDE;
6970
7071private:

@@private:
7273
7374 virtual bool hasValidAttributeType();
7475 AnimatedPropertyType m_animatedPropertyType;
 76 bool m_aboutToStopAnimation;
7577
7678 AnimatedPropertyValueType m_fromPropertyValueType;
7779 AnimatedPropertyValueType m_toPropertyValueType;

Source/WebCore/svg/SVGAnimationElement.cpp

@@bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* targetElement
330330 return SVGStyledElement::isAnimatableCSSProperty(attributeName);
331331}
332332
333 void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value)
 333static inline void setTargetAttributeAnimatedCSSValue(SVGElement* targetElement, const QualifiedName& attributeName, const String& value)
334334{
335  if (!hasValidAttributeType())
 335 StylePropertySet* propertySet = targetElement->ensureOverrideStylePropertySet();
 336 if (value.isNull()) {
 337 if (propertySet->removeProperty(cssPropertyID(attributeName.localName())))
 338 targetElement->setNeedsStyleRecalc();
336339 return;
 340 }
 341
 342 if (propertySet->setProperty(cssPropertyID(attributeName.localName()), value, false, 0))
 343 targetElement->setNeedsStyleRecalc();
 344}
 345
 346static inline void setTargetAttributeAnimatedXMLValue(SVGElement* targetElement, const QualifiedName& attributeName, const String& value)
 347{
 348 // FIXME: Detach animVal, if value.isNull() - once animVal support is enabled.
 349 targetElement->setAttribute(attributeName, value);
 350}
 351
 352void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value)
 353{
337354 SVGElement* targetElement = this->targetElement();
338  QualifiedName attributeName = this->attributeName();
339  if (!targetElement || attributeName == anyQName() || value.isNull())
 355 const QualifiedName& attributeName = this->attributeName();
 356 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
 357 if (shouldApply == DontApplyAnimation)
340358 return;
341359
342  // We don't want the instance tree to get rebuild. Instances are updated in the loop below.
 360 if (shouldApply == ApplyCSSAnimation)
 361 setTargetAttributeAnimatedCSSValue(targetElement, attributeName, value);
 362 else
 363 setTargetAttributeAnimatedXMLValue(targetElement, attributeName, value);
 364
343365 if (targetElement->isStyled())
344366 static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(true);
345 
346  bool attributeIsCSSProperty = isTargetAttributeCSSProperty(targetElement, attributeName);
347  // Stop animation, if attributeType is set to CSS by the user, but the attribute itself is not a CSS property.
348  if (!attributeIsCSSProperty && attributeType() == AttributeTypeCSS)
349  return;
350367
351  ExceptionCode ec;
352  if (attributeIsCSSProperty) {
353  // FIXME: This should set the override style, not the inline style.
354  // Sadly override styles are not yet implemented.
355  targetElement->style()->setProperty(attributeName.localName(), value, "", ec);
356  } else {
357  // FIXME: This should set the 'presentation' value, not the actual
358  // attribute value. Whatever that means in practice.
359  targetElement->setAttribute(attributeName, value);
360  }
361 
362  if (targetElement->isStyled())
363  static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(false);
364 
365  // If the target element is used in an <use> instance tree, update that as well.
 368 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
366369 const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
367370 const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
368371 for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
369372 SVGElement* shadowTreeElement = (*it)->shadowTreeElement();
370373 if (!shadowTreeElement)
371374 continue;
372  if (attributeIsCSSProperty)
373  shadowTreeElement->style()->setProperty(attributeName.localName(), value, "", ec);
 375
 376 if (shouldApply == ApplyCSSAnimation)
 377 setTargetAttributeAnimatedCSSValue(shadowTreeElement, attributeName, value);
374378 else
375  shadowTreeElement->setAttribute(attributeName, value);
376  (*it)->correspondingUseElement()->setNeedsStyleRecalc();
 379 setTargetAttributeAnimatedCSSValue(shadowTreeElement, attributeName, value);
377380 }
 381
 382 if (targetElement->isStyled())
 383 static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(false);
378384}
379 
 385
 386void SVGAnimationElement::resetAnimationState(const String& baseValue)
 387{
 388 // FIXME: This extra check will go away, once animVal is enabled.
 389 SVGElement* targetElement = this->targetElement();
 390 const QualifiedName& attributeName = this->attributeName();
 391 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());
 399}
 400
 401SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName)
 402{
 403 if (!hasValidAttributeType() || !targetElement || attributeName == anyQName())
 404 return DontApplyAnimation;
 405
 406 AttributeType attributeType = this->attributeType();
 407 switch (attributeType) {
 408 case AttributeTypeAuto:
 409 // For attributeType="auto", try CSS first. If that fails, try XML.
 410 case AttributeTypeCSS:
 411 // If attributeName is a known animatable SVG CSS property, apply the animation.
 412 if (isTargetAttributeCSSProperty(targetElement, attributeName))
 413 return ApplyCSSAnimation;
 414 // If attributeName is unknown and ttributeType is not 'auto', don't apply the animation.
 415 if (attributeType == AttributeTypeCSS)
 416 return DontApplyAnimation;
 417 // For attributeType="auto", try XML animation now.
 418 case AttributeTypeXML:
 419 return ApplyXMLAnimation;
 420 };
 421
 422 ASSERT_NOT_REACHED();
 423 return DontApplyAnimation;
 424}
 425
380426void SVGAnimationElement::calculateKeyTimesForCalcModePaced()
381427{
382428 ASSERT(calcMode() == CalcModePaced);

@@void SVGAnimationElement::startedActiveInterval()
593639 } else if (animationMode == PathAnimation)
594640 m_animationValid = calcMode == CalcModePaced || !fastHasAttribute(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size());
595641}
596 
 642
597643void SVGAnimationElement::updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement)
598644{
599645 if (!m_animationValid)

Source/WebCore/svg/SVGAnimationElement.h

@@protected:
105105 virtual void startedActiveInterval();
106106 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement);
107107
 108 void resetAnimationState(const String& baseValue);
 109
108110private:
109111 virtual void attributeChanged(Attribute*) OVERRIDE;
110112

@@private:
122124 float calculatePercentForFromTo(float percent) const;
123125 unsigned calculateKeyTimesIndex(float percent) const;
124126
 127 enum ShouldApplyAnimation {
 128 DontApplyAnimation,
 129 ApplyCSSAnimation,
 130 ApplyXMLAnimation
 131 };
 132
 133 ShouldApplyAnimation shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName);
 134
125135 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement)
126136 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
127137 END_DECLARE_ANIMATED_PROPERTIES

Source/WebCore/svg/SVGElement.cpp

@@SVGElement::~SVGElement()
7878 ASSERT(it != rareDataMap.end());
7979
8080 SVGElementRareData* rareData = it->second;
 81 rareData->destroyOverrideStylePropertySet();
8182 if (SVGCursorElement* cursorElement = rareData->cursorElement())
8283 cursorElement->removeClient(this);
8384 if (CSSCursorImageValue* cursorImageValue = rareData->cursorImageValue())

@@PassRefPtr<RenderStyle> SVGElement::customStyleForRenderer()
488489 return document()->styleSelector()->styleForElement(correspondingElement(), style, false /*allowSharing*/);
489490}
490491
 492StylePropertySet* SVGElement::overrideStylePropertySet() const
 493{
 494 if (hasRareSVGData())
 495 return rareSVGData()->overrideStylePropertySet();
 496 return 0;
 497}
 498
 499StylePropertySet* SVGElement::ensureOverrideStylePropertySet()
 500{
 501 return ensureRareSVGData()->ensureOverrideStylePropertySet();
 502}
 503
491504#ifndef NDEBUG
492505bool SVGElement::isAnimatableAttribute(const QualifiedName& name)
493506{

Source/WebCore/svg/SVGElement.h

@@public:
107107 static bool isAnimatableAttribute(const QualifiedName&);
108108#endif
109109
 110 StylePropertySet* overrideStylePropertySet() const;
 111 StylePropertySet* ensureOverrideStylePropertySet();
 112
110113protected:
111114 SVGElement(const QualifiedName&, Document*, ConstructionType = CreateSVGElement);
112115

Source/WebCore/svg/SVGElementRareData.h

@@public:
7474 CSSCursorImageValue* cursorImageValue() const { return m_cursorImageValue; }
7575 void setCursorImageValue(CSSCursorImageValue* cursorImageValue) { m_cursorImageValue = cursorImageValue; }
7676
 77 StylePropertySet* overrideStylePropertySet() const { return m_overrideStylePropertySet.get(); }
 78 StylePropertySet* ensureOverrideStylePropertySet()
 79 {
 80 if (!m_overrideStylePropertySet) {
 81 m_overrideStylePropertySet = StylePropertySet::create();
 82 m_overrideStylePropertySet->setStrictParsing(false);
 83 }
 84 return m_overrideStylePropertySet.get();
 85 }
 86
 87 void destroyOverrideStylePropertySet()
 88 {
 89 m_overrideStylePropertySet = 0;
 90 }
 91
7792private:
7893 HashSet<SVGElementInstance*> m_elementInstances;
7994 SVGCursorElement* m_cursorElement;

@@private:
8196 SVGElement* m_correspondingElement;
8297 bool m_instancesUpdatesBlocked : 1;
8398 bool m_hasPendingResources : 1;
 99 RefPtr<StylePropertySet> m_overrideStylePropertySet;
84100};
85101
86102}

Source/WebCore/svg/animation/SVGSMILElement.h

@@protected:
116116
117117 // Sub-classes may need to take action when the target is changed.
118118 virtual void targetElementDidChange(SVGElement*) { }
 119 virtual void endedActiveInterval();
119120
120121private:
121122 virtual void startedActiveInterval() = 0;
122123 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) = 0;
123  void endedActiveInterval();
124124
125125 enum BeginOrEnd {
126126 Begin,

LayoutTests/ChangeLog

 12012-02-29 Nikolas Zimmermann <nzimmermann@rim.com>
 2
 3 Introduce SMIL overrideStyle, to make SVG stop mutating CSS styles directly
 4 https://bugs.webkit.org/show_bug.cgi?id=79790
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 SVG CSS property animations aren't leaked into the DOM anymore, update the tests.
 9
 10 * svg/animations/animate-color-transparent-expected.txt:
 11 * svg/animations/animate-currentColor-expected.txt:
 12 * svg/animations/animate-dynamic-update-attributeName-expected.txt:
 13 * svg/animations/animate-inherit-css-property-expected.txt:
 14 * svg/animations/script-tests/animate-color-transparent.js:
 15 (expectTransparent):
 16 (expectOtherColor):
 17 * svg/animations/script-tests/animate-currentColor.js:
 18 (sample1):
 19 (sample2):
 20 (sample3):
 21 * svg/animations/script-tests/animate-dynamic-update-attributeName.js:
 22 (sample1):
 23 (sample3):
 24 * svg/animations/script-tests/animate-inherit-css-property.js:
 25 (sample1):
 26 (sample2):
 27 (sample3):
 28 * svg/animations/script-tests/svgstring-animation-fallback-to-discrete.js:
 29 (sample1):
 30 (sample2):
 31 (sample3):
 32 * svg/animations/svgstring-animation-fallback-to-discrete-expected.txt:
 33
1342012-02-29 Yury Semikhatsky <yurys@chromium.org>
235
336 Web Inspector: move DOM counter graphs out of experimental

LayoutTests/svg/animations/animate-color-transparent-expected.txt

@@Tests that 'transparent' is treated as a valid color.
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
8 PASS rect.style.fill is '#00ff00'
9 PASS rect.style.fill is '#7f0000'
 8PASS getComputedStyle(rect).fill is '#00ff00'
 9PASS rect.style.fill is ""
 10PASS getComputedStyle(rect).fill is '#7f0000'
 11PASS rect.style.fill is ""
1012PASS successfullyParsed is true
1113
1214TEST COMPLETE

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

@@Tests animation on 'currentColor'.
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
8 PASS rect.style.fill is '#ff0000'
9 PASS rect.style.fill is '#804000'
10 PASS rect.style.fill is '#008000'
 8PASS getComputedStyle(rect).fill is '#ff0000'
 9PASS rect.style.fill is ""
 10PASS getComputedStyle(rect).fill is '#804000'
 11PASS rect.style.fill is ""
 12PASS getComputedStyle(rect).fill is '#008000'
 13PASS rect.style.fill is ""
1114PASS successfullyParsed is true
1215
1316TEST COMPLETE

LayoutTests/svg/animations/animate-dynamic-update-attributeName-expected.txt

@@Test behavior on dynamic-update of attributeName
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
8 PASS rect.style.color is 'rgb(0, 128, 0)'
9 PASS rect.style.fill is '#008000'
 8PASS getComputedStyle(rect).color is 'rgb(0, 128, 0)'
 9PASS rect.style.color is ""
 10PASS getComputedStyle(rect).fill is '#008000'
 11PASS rect.style.fill is ""
1012PASS successfullyParsed is true
1113
1214TEST COMPLETE

LayoutTests/svg/animations/animate-inherit-css-property-expected.txt

@@Tests animation with 'inherit'.
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
8 PASS rect.style.fill is '#ff0000'
9 PASS rect.style.fill is '#804000'
10 PASS rect.style.fill is '#008000'
 8PASS getComputedStyle(rect).fill is '#ff0000'
 9PASS rect.style.fill is ""
 10PASS getComputedStyle(rect).fill is '#804000'
 11PASS rect.style.fill is ""
 12PASS getComputedStyle(rect).fill is '#008000'
 13PASS rect.style.fill is ""
1114PASS successfullyParsed is true
1215
1316TEST COMPLETE

LayoutTests/svg/animations/script-tests/animate-color-transparent.js

@@rootSVGElement.appendChild(rect);
2121
2222// Setup animation test
2323function expectTransparent() {
24  shouldBe("rect.style.fill", "'#00ff00'");
 24 shouldBe("getComputedStyle(rect).fill", "'#00ff00'");
 25 shouldBeEqualToString("rect.style.fill", "");
2526}
2627
2728function expectOtherColor() {
28  shouldBe("rect.style.fill", "'#7f0000'");
 29 shouldBe("getComputedStyle(rect).fill", "'#7f0000'");
 30 shouldBeEqualToString("rect.style.fill", "");
2931}
3032
3133function executeTest() {

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

@@rootSVGElement.appendChild(rect);
2424// Setup animation test
2525function sample1() {
2626 // Check initial/end conditions
27  shouldBe("rect.style.fill", "'#ff0000'");
 27 shouldBe("getComputedStyle(rect).fill", "'#ff0000'");
 28 shouldBeEqualToString("rect.style.fill", "");
2829}
2930
3031function sample2() {
3132 // Check half-time conditions
32  shouldBe("rect.style.fill", "'#804000'");
 33 shouldBe("getComputedStyle(rect).fill", "'#804000'");
 34 shouldBeEqualToString("rect.style.fill", "");
3335}
3436
3537function sample3() {
3638 // Check half-time conditions
37  shouldBe("rect.style.fill", "'#008000'");
 39 shouldBe("getComputedStyle(rect).fill", "'#008000'");
 40 shouldBeEqualToString("rect.style.fill", "");
3841}
3942
4043function executeTest() {

LayoutTests/svg/animations/script-tests/animate-dynamic-update-attributeName.js

@@rootSVGElement.appendChild(rect);
2424
2525// Setup animation test
2626function sample1() {
27  shouldBe("rect.style.color", "'rgb(0, 128, 0)'");
 27 shouldBe("getComputedStyle(rect).color", "'rgb(0, 128, 0)'");
 28 shouldBeEqualToString("rect.style.color", "");
2829}
2930
3031function sample2() {

@@function sample2() {
3334}
3435
3536function sample3() {
36  shouldBe("rect.style.fill", "'#008000'");
 37 shouldBe("getComputedStyle(rect).fill", "'#008000'");
 38 shouldBeEqualToString("rect.style.fill", "");
3739}
3840
3941function executeTest() {

LayoutTests/svg/animations/script-tests/animate-inherit-css-property.js

@@rootSVGElement.appendChild(g);
2727// Setup animation test
2828function sample1() {
2929 // Check initial/end conditions
30  shouldBe("rect.style.fill", "'#ff0000'");
 30 shouldBe("getComputedStyle(rect).fill", "'#ff0000'");
 31 shouldBeEqualToString("rect.style.fill", "");
3132}
3233
3334function sample2() {
3435 // Check half-time conditions
35  shouldBe("rect.style.fill", "'#804000'");
 36 shouldBe("getComputedStyle(rect).fill", "'#804000'");
 37 shouldBeEqualToString("rect.style.fill", "");
3638}
3739
3840function sample3() {
3941 // Check half-time conditions
40  shouldBe("rect.style.fill", "'#008000'");
 42 shouldBe("getComputedStyle(rect).fill", "'#008000'");
 43 shouldBeEqualToString("rect.style.fill", "");
4144}
4245
4346function executeTest() {

LayoutTests/svg/animations/script-tests/svgstring-animation-fallback-to-discrete.js

@@rootSVGElement.appendChild(rect);
2222// Setup animation test
2323function sample1() {
2424 // Check initial/end conditions
25  shouldBe("rect.style.visibility", "'visible'");
 25 shouldBe("getComputedStyle(rect).visibility", "'visible'");
 26 shouldBeEqualToString("rect.style.visibility", "");
2627}
2728
2829function sample2() {
29  shouldBe("rect.style.visibility", "'hidden'");
 30 shouldBe("getComputedStyle(rect).visibility", "'hidden'");
 31 shouldBeEqualToString("rect.style.visibility", "");
3032}
3133
3234function sample3() {
33  shouldBe("rect.style.visibility", "'visible'");
 35 shouldBe("getComputedStyle(rect).visibility", "'visible'");
 36 shouldBeEqualToString("rect.style.visibility", "");
3437}
3538
3639function executeTest() {

LayoutTests/svg/animations/svgstring-animation-fallback-to-discrete-expected.txt

@@Tests fallback to calcMode='discrete' on animation of SVGString with 'values'.
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
66
77
8 PASS rect.style.visibility is 'visible'
9 PASS rect.style.visibility is 'hidden'
10 PASS rect.style.visibility is 'visible'
11 PASS rect.style.visibility is 'visible'
 8PASS getComputedStyle(rect).visibility is 'visible'
 9PASS rect.style.visibility is ""
 10PASS getComputedStyle(rect).visibility is 'hidden'
 11PASS rect.style.visibility is ""
 12PASS getComputedStyle(rect).visibility is 'visible'
 13PASS rect.style.visibility is ""
 14PASS getComputedStyle(rect).visibility is 'visible'
 15PASS rect.style.visibility is ""
1216PASS successfullyParsed is true
1317
1418TEST COMPLETE