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