2012-04-03 Nikolas Zimmermann <nzimmermann@rim.com>
Enable animVal support for SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=82459
Reviewed by Dirk Schulze.
Add new tests for all SVGAnimatedEnumeration in the SVG DOM to proof they animate and update animVal correctly.
* platform/gtk/Skipped: Unskip svgenum tests.
* svg/animations/animate-marker-orient-from-angle-to-angle-expected.txt: Added.
* svg/animations/animate-marker-orient-from-angle-to-angle.html: Added.
* svg/animations/animate-marker-orient-from-angle-to-auto-expected.txt: Added.
* svg/animations/animate-marker-orient-from-angle-to-auto.html: Added.
* svg/animations/animate-marker-orient-to-angle-expected.txt: Added.
* svg/animations/animate-marker-orient-to-angle.html: Added.
* svg/animations/script-tests/animate-marker-orient-from-angle-to-angle.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/animate-marker-orient-from-angle-to-auto.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/animate-marker-orient-to-angle.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgangle-animation-deg-to-grad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-deg-to-rad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-grad-to-deg.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-grad-to-rad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-rad-to-deg.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-rad-to-grad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgenum-animation-1.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-10.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-11.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(executeTest):
* svg/animations/script-tests/svgenum-animation-12.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgenum-animation-13.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/svgenum-animation-2.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgenum-animation-3.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-4.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(sample6):
(executeTest):
* svg/animations/script-tests/svgenum-animation-5.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-6.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/svgenum-animation-7.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-8.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(executeTest):
* svg/animations/script-tests/svgenum-animation-9.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/svgangle-animation-deg-to-grad-expected.txt:
* svg/animations/svgangle-animation-deg-to-rad-expected.txt:
* svg/animations/svgangle-animation-grad-to-deg-expected.txt:
* svg/animations/svgangle-animation-grad-to-rad-expected.txt:
* svg/animations/svgangle-animation-rad-to-deg-expected.txt:
* svg/animations/svgangle-animation-rad-to-grad-expected.txt:
* svg/animations/svgenum-animation-1-expected.txt: Added.
* svg/animations/svgenum-animation-1.html: Added.
* svg/animations/svgenum-animation-10-expected.txt: Added.
* svg/animations/svgenum-animation-10.html: Added.
* svg/animations/svgenum-animation-11-expected.txt: Added.
* svg/animations/svgenum-animation-11.html: Added.
* svg/animations/svgenum-animation-12-expected.txt: Added.
* svg/animations/svgenum-animation-12.html: Added.
* svg/animations/svgenum-animation-13-expected.txt: Added.
* svg/animations/svgenum-animation-13.html: Added.
* svg/animations/svgenum-animation-2-expected.txt: Added.
* svg/animations/svgenum-animation-2.html: Added.
* svg/animations/svgenum-animation-3-expected.txt: Added.
* svg/animations/svgenum-animation-3.html: Added.
* svg/animations/svgenum-animation-4-expected.txt: Added.
* svg/animations/svgenum-animation-4.html: Added.
* svg/animations/svgenum-animation-5-expected.txt: Added.
* svg/animations/svgenum-animation-5.html: Added.
* svg/animations/svgenum-animation-6-expected.txt: Added.
* svg/animations/svgenum-animation-6.html: Added.
* svg/animations/svgenum-animation-7-expected.txt: Added.
* svg/animations/svgenum-animation-7.html: Added.
* svg/animations/svgenum-animation-8-expected.txt: Added.
* svg/animations/svgenum-animation-8.html: Added.
* svg/animations/svgenum-animation-9-expected.txt: Added.
* svg/animations/svgenum-animation-9.html: Added.
2012-04-03 Nikolas Zimmermann <nzimmermann@rim.com>
Enable animVal support for SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=82459
Reviewed by Dirk Schulze.
Enable animVal support for the last missing SVG DOM primitive: SVGAnimatedEnumeration.
It's a bit more involved than the others as we have to differentiate between the various
enumerations to use the correct SVGPropertyTraits<MyEnum>::fromString() code-path.
One SVGAnimatedEnumeration property in the SVG DOM is special: SVGAnimatedEnumeration orientType
from SVGMarkerElement. SVGMarkerElement exposes both the orientType and SVGAnimatedAngle orientAngle
SVG DOM properties and both get mapped to the same SVGNames::orientAttr ("orient" XML attribute).
That means that any animation of the orientAttr has to update both orientType & orientAngle.
This is a not a new requirement, we already support attributes like 'stdDeviation' from
SVGFEGaussianBlurElement, which get mapped to multiple SVG DOM objects: SVGAnimatedInteger stdDeviationX/Y.
The difference is that <integer-optional-integer> or <number-optional-number> animations use the
same type in the pair<xxx, xxx> (eg. both int, or both float). The 'orient' attribute needs to be
mapped to pair<xxx, yyy> types. Generalize the templates in SVGAnimatedTypeAnimator to support that.
Example:
<marker id="someMarkerElement" orient="45deg"/>
<animate fill="remove" begin="1s" dur="2s" from="90deg" to="auto" attributeName="orient" xlink:href="#someMarkerElement"/>
at 0s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 45
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
at 1s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 90
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
at 2s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO
someMarkerElement.orientAngle.animVal.value = 0
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
> 3s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 45
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
We need to map the 'orient' attribute to a pair<SVGAngle, unsigned short> type, in order
to track both orientAngle & orientType at the same type. Fortunately SVGAnimatedAngle
is only used in the SVG DOM for SVGMarkerElements orientAngle property. We can directly
switch SVGAnimatedAngleAnimator to the new pair<SVGAngle, unsigned short> type instead
of having to introduce a special SVGAnimatedAngleAndEnumerationAnimator.
Added tests for all SVGAnimatedEnumeration properties in the SVG DOM, including an extensive set of tests
for the synchronization of the orientType / orientAngle properties, when they get animated.
Tests: svg/animations/animate-marker-orient-from-angle-to-angle.html
svg/animations/animate-marker-orient-from-angle-to-auto.html
svg/animations/animate-marker-orient-to-angle.html
svg/animations/svgenum-animation-1.html
svg/animations/svgenum-animation-10.html
svg/animations/svgenum-animation-11.html
svg/animations/svgenum-animation-12.html
svg/animations/svgenum-animation-13.html
svg/animations/svgenum-animation-2.html
svg/animations/svgenum-animation-3.html
svg/animations/svgenum-animation-4.html
svg/animations/svgenum-animation-5.html
svg/animations/svgenum-animation-6.html
svg/animations/svgenum-animation-7.html
svg/animations/svgenum-animation-8.html
svg/animations/svgenum-animation-9.html
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::determineAnimatedPropertyType):
(WebCore::SVGAnimateElement::calculateAnimatedValue):
(WebCore::propertyTypesAreConsistent):
(WebCore::SVGAnimateElement::applyResultsToTarget):
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::constructFromString):
(WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedAngleAnimator::animValWillChange):
(WebCore::SVGAnimatedAngleAnimator::animValDidChange):
(WebCore::SVGAnimatedAngleAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
* svg/SVGAnimatedAngle.h:
(WebCore):
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedEnumeration.cpp: Added.
(WebCore):
(WebCore::enumerationValueForTargetAttribute):
(WebCore::SVGAnimatedEnumerationAnimator::SVGAnimatedEnumerationAnimator):
(WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
(WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedEnumerationAnimator::animValWillChange):
(WebCore::SVGAnimatedEnumerationAnimator::animValDidChange):
(WebCore::SVGAnimatedEnumerationAnimator::calculateFromAndToValues):
(WebCore::SVGAnimatedEnumerationAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedEnumerationAnimator::calculateDistance):
* svg/SVGAnimatedEnumeration.h:
(SVGAnimatedEnumerationAnimator):
(WebCore::SVGAnimatedEnumerationAnimator::~SVGAnimatedEnumerationAnimator):
(WebCore):
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::animValWillChange):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::animValDidChange):
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::animValWillChange):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::animValDidChange):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedString.cpp:
(WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::~SVGAnimatedType):
(WebCore::SVGAnimatedType::createAngleAndEnumeration):
(WebCore::SVGAnimatedType::createEnumeration):
(WebCore):
(WebCore::SVGAnimatedType::angleAndEnumeration):
(WebCore::SVGAnimatedType::enumeration):
(WebCore::SVGAnimatedType::valueAsString):
(WebCore::SVGAnimatedType::setValueAsString):
(WebCore::SVGAnimatedType::supportsAnimVal):
* svg/SVGAnimatedType.h:
(SVGAnimatedType):
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
(SVGAnimatedTypeAnimator):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
(WebCore::SVGAnimatedTypeAnimator::executeAction):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGMarkerElement.cpp:
(WebCore):
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(SVGAnimatedListPropertyTearOff):
* svg/properties/SVGAnimatedPropertyTearOff.h:
(SVGAnimatedPropertyTearOff):
* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(SVGAnimatedStaticPropertyTearOff):
Canonical link: https://commits.webkit.org/100360@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-03 09:39:17 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-09-08 05:29:22 +00:00
|
|
|
<script src="../../resources/js-test-pre.js"></script>
|
2012-04-03 Nikolas Zimmermann <nzimmermann@rim.com>
Enable animVal support for SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=82459
Reviewed by Dirk Schulze.
Add new tests for all SVGAnimatedEnumeration in the SVG DOM to proof they animate and update animVal correctly.
* platform/gtk/Skipped: Unskip svgenum tests.
* svg/animations/animate-marker-orient-from-angle-to-angle-expected.txt: Added.
* svg/animations/animate-marker-orient-from-angle-to-angle.html: Added.
* svg/animations/animate-marker-orient-from-angle-to-auto-expected.txt: Added.
* svg/animations/animate-marker-orient-from-angle-to-auto.html: Added.
* svg/animations/animate-marker-orient-to-angle-expected.txt: Added.
* svg/animations/animate-marker-orient-to-angle.html: Added.
* svg/animations/script-tests/animate-marker-orient-from-angle-to-angle.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/animate-marker-orient-from-angle-to-auto.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/animate-marker-orient-to-angle.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgangle-animation-deg-to-grad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-deg-to-rad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-grad-to-deg.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-grad-to-rad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-rad-to-deg.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-rad-to-grad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgenum-animation-1.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-10.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-11.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(executeTest):
* svg/animations/script-tests/svgenum-animation-12.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgenum-animation-13.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/svgenum-animation-2.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgenum-animation-3.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-4.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(sample6):
(executeTest):
* svg/animations/script-tests/svgenum-animation-5.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-6.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/svgenum-animation-7.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-8.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(executeTest):
* svg/animations/script-tests/svgenum-animation-9.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/svgangle-animation-deg-to-grad-expected.txt:
* svg/animations/svgangle-animation-deg-to-rad-expected.txt:
* svg/animations/svgangle-animation-grad-to-deg-expected.txt:
* svg/animations/svgangle-animation-grad-to-rad-expected.txt:
* svg/animations/svgangle-animation-rad-to-deg-expected.txt:
* svg/animations/svgangle-animation-rad-to-grad-expected.txt:
* svg/animations/svgenum-animation-1-expected.txt: Added.
* svg/animations/svgenum-animation-1.html: Added.
* svg/animations/svgenum-animation-10-expected.txt: Added.
* svg/animations/svgenum-animation-10.html: Added.
* svg/animations/svgenum-animation-11-expected.txt: Added.
* svg/animations/svgenum-animation-11.html: Added.
* svg/animations/svgenum-animation-12-expected.txt: Added.
* svg/animations/svgenum-animation-12.html: Added.
* svg/animations/svgenum-animation-13-expected.txt: Added.
* svg/animations/svgenum-animation-13.html: Added.
* svg/animations/svgenum-animation-2-expected.txt: Added.
* svg/animations/svgenum-animation-2.html: Added.
* svg/animations/svgenum-animation-3-expected.txt: Added.
* svg/animations/svgenum-animation-3.html: Added.
* svg/animations/svgenum-animation-4-expected.txt: Added.
* svg/animations/svgenum-animation-4.html: Added.
* svg/animations/svgenum-animation-5-expected.txt: Added.
* svg/animations/svgenum-animation-5.html: Added.
* svg/animations/svgenum-animation-6-expected.txt: Added.
* svg/animations/svgenum-animation-6.html: Added.
* svg/animations/svgenum-animation-7-expected.txt: Added.
* svg/animations/svgenum-animation-7.html: Added.
* svg/animations/svgenum-animation-8-expected.txt: Added.
* svg/animations/svgenum-animation-8.html: Added.
* svg/animations/svgenum-animation-9-expected.txt: Added.
* svg/animations/svgenum-animation-9.html: Added.
2012-04-03 Nikolas Zimmermann <nzimmermann@rim.com>
Enable animVal support for SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=82459
Reviewed by Dirk Schulze.
Enable animVal support for the last missing SVG DOM primitive: SVGAnimatedEnumeration.
It's a bit more involved than the others as we have to differentiate between the various
enumerations to use the correct SVGPropertyTraits<MyEnum>::fromString() code-path.
One SVGAnimatedEnumeration property in the SVG DOM is special: SVGAnimatedEnumeration orientType
from SVGMarkerElement. SVGMarkerElement exposes both the orientType and SVGAnimatedAngle orientAngle
SVG DOM properties and both get mapped to the same SVGNames::orientAttr ("orient" XML attribute).
That means that any animation of the orientAttr has to update both orientType & orientAngle.
This is a not a new requirement, we already support attributes like 'stdDeviation' from
SVGFEGaussianBlurElement, which get mapped to multiple SVG DOM objects: SVGAnimatedInteger stdDeviationX/Y.
The difference is that <integer-optional-integer> or <number-optional-number> animations use the
same type in the pair<xxx, xxx> (eg. both int, or both float). The 'orient' attribute needs to be
mapped to pair<xxx, yyy> types. Generalize the templates in SVGAnimatedTypeAnimator to support that.
Example:
<marker id="someMarkerElement" orient="45deg"/>
<animate fill="remove" begin="1s" dur="2s" from="90deg" to="auto" attributeName="orient" xlink:href="#someMarkerElement"/>
at 0s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 45
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
at 1s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 90
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
at 2s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO
someMarkerElement.orientAngle.animVal.value = 0
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
> 3s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 45
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
We need to map the 'orient' attribute to a pair<SVGAngle, unsigned short> type, in order
to track both orientAngle & orientType at the same type. Fortunately SVGAnimatedAngle
is only used in the SVG DOM for SVGMarkerElements orientAngle property. We can directly
switch SVGAnimatedAngleAnimator to the new pair<SVGAngle, unsigned short> type instead
of having to introduce a special SVGAnimatedAngleAndEnumerationAnimator.
Added tests for all SVGAnimatedEnumeration properties in the SVG DOM, including an extensive set of tests
for the synchronization of the orientType / orientAngle properties, when they get animated.
Tests: svg/animations/animate-marker-orient-from-angle-to-angle.html
svg/animations/animate-marker-orient-from-angle-to-auto.html
svg/animations/animate-marker-orient-to-angle.html
svg/animations/svgenum-animation-1.html
svg/animations/svgenum-animation-10.html
svg/animations/svgenum-animation-11.html
svg/animations/svgenum-animation-12.html
svg/animations/svgenum-animation-13.html
svg/animations/svgenum-animation-2.html
svg/animations/svgenum-animation-3.html
svg/animations/svgenum-animation-4.html
svg/animations/svgenum-animation-5.html
svg/animations/svgenum-animation-6.html
svg/animations/svgenum-animation-7.html
svg/animations/svgenum-animation-8.html
svg/animations/svgenum-animation-9.html
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::determineAnimatedPropertyType):
(WebCore::SVGAnimateElement::calculateAnimatedValue):
(WebCore::propertyTypesAreConsistent):
(WebCore::SVGAnimateElement::applyResultsToTarget):
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::constructFromString):
(WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedAngleAnimator::animValWillChange):
(WebCore::SVGAnimatedAngleAnimator::animValDidChange):
(WebCore::SVGAnimatedAngleAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
* svg/SVGAnimatedAngle.h:
(WebCore):
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedEnumeration.cpp: Added.
(WebCore):
(WebCore::enumerationValueForTargetAttribute):
(WebCore::SVGAnimatedEnumerationAnimator::SVGAnimatedEnumerationAnimator):
(WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
(WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedEnumerationAnimator::animValWillChange):
(WebCore::SVGAnimatedEnumerationAnimator::animValDidChange):
(WebCore::SVGAnimatedEnumerationAnimator::calculateFromAndToValues):
(WebCore::SVGAnimatedEnumerationAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedEnumerationAnimator::calculateDistance):
* svg/SVGAnimatedEnumeration.h:
(SVGAnimatedEnumerationAnimator):
(WebCore::SVGAnimatedEnumerationAnimator::~SVGAnimatedEnumerationAnimator):
(WebCore):
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::animValWillChange):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::animValDidChange):
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::animValWillChange):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::animValDidChange):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedString.cpp:
(WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::~SVGAnimatedType):
(WebCore::SVGAnimatedType::createAngleAndEnumeration):
(WebCore::SVGAnimatedType::createEnumeration):
(WebCore):
(WebCore::SVGAnimatedType::angleAndEnumeration):
(WebCore::SVGAnimatedType::enumeration):
(WebCore::SVGAnimatedType::valueAsString):
(WebCore::SVGAnimatedType::setValueAsString):
(WebCore::SVGAnimatedType::supportsAnimVal):
* svg/SVGAnimatedType.h:
(SVGAnimatedType):
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
(SVGAnimatedTypeAnimator):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
(WebCore::SVGAnimatedTypeAnimator::executeAction):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGMarkerElement.cpp:
(WebCore):
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(SVGAnimatedListPropertyTearOff):
* svg/properties/SVGAnimatedPropertyTearOff.h:
(SVGAnimatedPropertyTearOff):
* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(SVGAnimatedStaticPropertyTearOff):
Canonical link: https://commits.webkit.org/100360@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-03 09:39:17 +00:00
|
|
|
<script src="../dynamic-updates/resources/SVGTestCase.js"></script>
|
|
|
|
<script src="resources/SVGAnimationTestCase.js"></script>
|
|
|
|
</head>
|
|
|
|
<body onload="runSMILTest()">
|
|
|
|
<h1>SVG 1.1 dynamic animation tests</h1>
|
|
|
|
<p id="description"></p>
|
|
|
|
<div id="console"></div>
|
2017-05-24 22:53:00 +00:00
|
|
|
<script>
|
|
|
|
description("Test ComponentTransferType enumeration animations");
|
|
|
|
createSVGTestCase();
|
|
|
|
|
|
|
|
// Setup test document
|
|
|
|
var feRFunc = createSVGElement("feFuncR");
|
|
|
|
feRFunc.setAttribute("type", "identity");
|
|
|
|
feRFunc.setAttribute("amplitude", "10");
|
|
|
|
|
|
|
|
var feGFunc = createSVGElement("feFuncG");
|
|
|
|
feGFunc.setAttribute("type", "identity");
|
|
|
|
feGFunc.setAttribute("amplitude", "10");
|
|
|
|
|
|
|
|
var feBFunc = createSVGElement("feFuncB");
|
|
|
|
feBFunc.setAttribute("type", "identity");
|
|
|
|
feBFunc.setAttribute("amplitude", "110");
|
|
|
|
|
|
|
|
var feAFunc = createSVGElement("feFuncA");
|
|
|
|
feAFunc.setAttribute("type", "identity");
|
|
|
|
feAFunc.setAttribute("amplitude", "110");
|
|
|
|
|
|
|
|
var feComponentTransfer = createSVGElement("feComponentTransfer");
|
|
|
|
feComponentTransfer.appendChild(feRFunc);
|
|
|
|
feComponentTransfer.appendChild(feGFunc);
|
|
|
|
feComponentTransfer.appendChild(feBFunc);
|
|
|
|
feComponentTransfer.appendChild(feAFunc);
|
|
|
|
|
|
|
|
var filter = createSVGElement("filter");
|
|
|
|
filter.setAttribute("id", "filter");
|
|
|
|
filter.setAttribute("filterUnits", "objectBoundingBox");
|
|
|
|
filter.setAttribute("x", "0%");
|
|
|
|
filter.setAttribute("y", "0%");
|
|
|
|
filter.setAttribute("width", "100%");
|
|
|
|
filter.setAttribute("height", "100%");
|
|
|
|
filter.appendChild(feComponentTransfer);
|
|
|
|
|
|
|
|
var defs = createSVGElement("defs");
|
|
|
|
defs.appendChild(filter);
|
|
|
|
rootSVGElement.appendChild(defs);
|
|
|
|
|
|
|
|
var rect = createSVGElement("rect");
|
|
|
|
rect.setAttribute("id", "rect");
|
|
|
|
rect.setAttribute("width", "100");
|
|
|
|
rect.setAttribute("height", "100");
|
|
|
|
rect.setAttribute("fill", "#408067");
|
|
|
|
rect.setAttribute("filter", "url(#filter)");
|
|
|
|
rect.setAttribute("onclick", "executeTest()");
|
|
|
|
rootSVGElement.appendChild(rect);
|
|
|
|
|
|
|
|
var animate = createSVGElement("animate");
|
|
|
|
animate.setAttribute("id", "animation");
|
|
|
|
animate.setAttribute("attributeName", "type");
|
|
|
|
animate.setAttribute("begin", "rect.click");
|
|
|
|
animate.setAttribute("dur", "5s");
|
|
|
|
animate.setAttribute("values", "identity;table;discrete;linear;gamma");
|
|
|
|
feRFunc.appendChild(animate);
|
|
|
|
|
|
|
|
// Setup animation test
|
|
|
|
function sample1() {
|
|
|
|
shouldBe("feRFunc.type.animVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY");
|
|
|
|
shouldBe("feRFunc.type.baseVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY");
|
|
|
|
}
|
|
|
|
|
|
|
|
function sample2() {
|
|
|
|
shouldBe("feRFunc.type.animVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_TABLE");
|
|
|
|
shouldBe("feRFunc.type.baseVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY");
|
|
|
|
}
|
|
|
|
|
|
|
|
function sample3() {
|
|
|
|
shouldBe("feRFunc.type.animVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE");
|
|
|
|
shouldBe("feRFunc.type.baseVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY");
|
|
|
|
}
|
|
|
|
|
|
|
|
function sample4() {
|
|
|
|
shouldBe("feRFunc.type.animVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_LINEAR");
|
|
|
|
shouldBe("feRFunc.type.baseVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY");
|
|
|
|
}
|
|
|
|
|
|
|
|
function sample5() {
|
|
|
|
shouldBe("feRFunc.type.animVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_GAMMA");
|
|
|
|
shouldBe("feRFunc.type.baseVal", "SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY");
|
|
|
|
}
|
|
|
|
|
|
|
|
function executeTest() {
|
|
|
|
const expectedValues = [
|
|
|
|
// [animationId, time, sampleCallback]
|
|
|
|
["animation", 0.0, sample1],
|
|
|
|
["animation", 0.999, sample1],
|
|
|
|
["animation", 1.001, sample2],
|
|
|
|
["animation", 1.999, sample2],
|
|
|
|
["animation", 2.001, sample3],
|
|
|
|
["animation", 2.999, sample3],
|
|
|
|
["animation", 3.001, sample4],
|
|
|
|
["animation", 3.999, sample4],
|
|
|
|
["animation", 4.001, sample5],
|
|
|
|
["animation", 4.999, sample5],
|
|
|
|
["animation", 5.001, sample1]
|
|
|
|
];
|
|
|
|
|
|
|
|
runAnimationTest(expectedValues);
|
|
|
|
}
|
|
|
|
|
|
|
|
var successfullyParsed = true;
|
|
|
|
</script>
|
2012-04-03 Nikolas Zimmermann <nzimmermann@rim.com>
Enable animVal support for SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=82459
Reviewed by Dirk Schulze.
Add new tests for all SVGAnimatedEnumeration in the SVG DOM to proof they animate and update animVal correctly.
* platform/gtk/Skipped: Unskip svgenum tests.
* svg/animations/animate-marker-orient-from-angle-to-angle-expected.txt: Added.
* svg/animations/animate-marker-orient-from-angle-to-angle.html: Added.
* svg/animations/animate-marker-orient-from-angle-to-auto-expected.txt: Added.
* svg/animations/animate-marker-orient-from-angle-to-auto.html: Added.
* svg/animations/animate-marker-orient-to-angle-expected.txt: Added.
* svg/animations/animate-marker-orient-to-angle.html: Added.
* svg/animations/script-tests/animate-marker-orient-from-angle-to-angle.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/animate-marker-orient-from-angle-to-auto.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/animate-marker-orient-to-angle.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgangle-animation-deg-to-grad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-deg-to-rad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-grad-to-deg.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-grad-to-rad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-rad-to-deg.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgangle-animation-rad-to-grad.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/svgenum-animation-1.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-10.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-11.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(executeTest):
* svg/animations/script-tests/svgenum-animation-12.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgenum-animation-13.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/svgenum-animation-2.js: Added.
(sample1):
(sample2):
(sample3):
(executeTest):
* svg/animations/script-tests/svgenum-animation-3.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-4.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(sample6):
(executeTest):
* svg/animations/script-tests/svgenum-animation-5.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-6.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(executeTest):
* svg/animations/script-tests/svgenum-animation-7.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/script-tests/svgenum-animation-8.js: Added.
(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(executeTest):
* svg/animations/script-tests/svgenum-animation-9.js: Added.
(sample1):
(sample2):
(executeTest):
* svg/animations/svgangle-animation-deg-to-grad-expected.txt:
* svg/animations/svgangle-animation-deg-to-rad-expected.txt:
* svg/animations/svgangle-animation-grad-to-deg-expected.txt:
* svg/animations/svgangle-animation-grad-to-rad-expected.txt:
* svg/animations/svgangle-animation-rad-to-deg-expected.txt:
* svg/animations/svgangle-animation-rad-to-grad-expected.txt:
* svg/animations/svgenum-animation-1-expected.txt: Added.
* svg/animations/svgenum-animation-1.html: Added.
* svg/animations/svgenum-animation-10-expected.txt: Added.
* svg/animations/svgenum-animation-10.html: Added.
* svg/animations/svgenum-animation-11-expected.txt: Added.
* svg/animations/svgenum-animation-11.html: Added.
* svg/animations/svgenum-animation-12-expected.txt: Added.
* svg/animations/svgenum-animation-12.html: Added.
* svg/animations/svgenum-animation-13-expected.txt: Added.
* svg/animations/svgenum-animation-13.html: Added.
* svg/animations/svgenum-animation-2-expected.txt: Added.
* svg/animations/svgenum-animation-2.html: Added.
* svg/animations/svgenum-animation-3-expected.txt: Added.
* svg/animations/svgenum-animation-3.html: Added.
* svg/animations/svgenum-animation-4-expected.txt: Added.
* svg/animations/svgenum-animation-4.html: Added.
* svg/animations/svgenum-animation-5-expected.txt: Added.
* svg/animations/svgenum-animation-5.html: Added.
* svg/animations/svgenum-animation-6-expected.txt: Added.
* svg/animations/svgenum-animation-6.html: Added.
* svg/animations/svgenum-animation-7-expected.txt: Added.
* svg/animations/svgenum-animation-7.html: Added.
* svg/animations/svgenum-animation-8-expected.txt: Added.
* svg/animations/svgenum-animation-8.html: Added.
* svg/animations/svgenum-animation-9-expected.txt: Added.
* svg/animations/svgenum-animation-9.html: Added.
2012-04-03 Nikolas Zimmermann <nzimmermann@rim.com>
Enable animVal support for SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=82459
Reviewed by Dirk Schulze.
Enable animVal support for the last missing SVG DOM primitive: SVGAnimatedEnumeration.
It's a bit more involved than the others as we have to differentiate between the various
enumerations to use the correct SVGPropertyTraits<MyEnum>::fromString() code-path.
One SVGAnimatedEnumeration property in the SVG DOM is special: SVGAnimatedEnumeration orientType
from SVGMarkerElement. SVGMarkerElement exposes both the orientType and SVGAnimatedAngle orientAngle
SVG DOM properties and both get mapped to the same SVGNames::orientAttr ("orient" XML attribute).
That means that any animation of the orientAttr has to update both orientType & orientAngle.
This is a not a new requirement, we already support attributes like 'stdDeviation' from
SVGFEGaussianBlurElement, which get mapped to multiple SVG DOM objects: SVGAnimatedInteger stdDeviationX/Y.
The difference is that <integer-optional-integer> or <number-optional-number> animations use the
same type in the pair<xxx, xxx> (eg. both int, or both float). The 'orient' attribute needs to be
mapped to pair<xxx, yyy> types. Generalize the templates in SVGAnimatedTypeAnimator to support that.
Example:
<marker id="someMarkerElement" orient="45deg"/>
<animate fill="remove" begin="1s" dur="2s" from="90deg" to="auto" attributeName="orient" xlink:href="#someMarkerElement"/>
at 0s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 45
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
at 1s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 90
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
at 2s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO
someMarkerElement.orientAngle.animVal.value = 0
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
> 3s: someMarkerElement.orientType.animVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.animVal.value = 45
someMarkerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE
someMarkerElement.orientAngle.baseVal.value = 45
We need to map the 'orient' attribute to a pair<SVGAngle, unsigned short> type, in order
to track both orientAngle & orientType at the same type. Fortunately SVGAnimatedAngle
is only used in the SVG DOM for SVGMarkerElements orientAngle property. We can directly
switch SVGAnimatedAngleAnimator to the new pair<SVGAngle, unsigned short> type instead
of having to introduce a special SVGAnimatedAngleAndEnumerationAnimator.
Added tests for all SVGAnimatedEnumeration properties in the SVG DOM, including an extensive set of tests
for the synchronization of the orientType / orientAngle properties, when they get animated.
Tests: svg/animations/animate-marker-orient-from-angle-to-angle.html
svg/animations/animate-marker-orient-from-angle-to-auto.html
svg/animations/animate-marker-orient-to-angle.html
svg/animations/svgenum-animation-1.html
svg/animations/svgenum-animation-10.html
svg/animations/svgenum-animation-11.html
svg/animations/svgenum-animation-12.html
svg/animations/svgenum-animation-13.html
svg/animations/svgenum-animation-2.html
svg/animations/svgenum-animation-3.html
svg/animations/svgenum-animation-4.html
svg/animations/svgenum-animation-5.html
svg/animations/svgenum-animation-6.html
svg/animations/svgenum-animation-7.html
svg/animations/svgenum-animation-8.html
svg/animations/svgenum-animation-9.html
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::determineAnimatedPropertyType):
(WebCore::SVGAnimateElement::calculateAnimatedValue):
(WebCore::propertyTypesAreConsistent):
(WebCore::SVGAnimateElement::applyResultsToTarget):
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::constructFromString):
(WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedAngleAnimator::animValWillChange):
(WebCore::SVGAnimatedAngleAnimator::animValDidChange):
(WebCore::SVGAnimatedAngleAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
* svg/SVGAnimatedAngle.h:
(WebCore):
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedEnumeration.cpp: Added.
(WebCore):
(WebCore::enumerationValueForTargetAttribute):
(WebCore::SVGAnimatedEnumerationAnimator::SVGAnimatedEnumerationAnimator):
(WebCore::SVGAnimatedEnumerationAnimator::constructFromString):
(WebCore::SVGAnimatedEnumerationAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedEnumerationAnimator::animValWillChange):
(WebCore::SVGAnimatedEnumerationAnimator::animValDidChange):
(WebCore::SVGAnimatedEnumerationAnimator::calculateFromAndToValues):
(WebCore::SVGAnimatedEnumerationAnimator::calculateFromAndByValues):
(WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedEnumerationAnimator::calculateDistance):
* svg/SVGAnimatedEnumeration.h:
(SVGAnimatedEnumerationAnimator):
(WebCore::SVGAnimatedEnumerationAnimator::~SVGAnimatedEnumerationAnimator):
(WebCore):
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::animValWillChange):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::animValDidChange):
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::animValWillChange):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::animValDidChange):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedString.cpp:
(WebCore::SVGAnimatedStringAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::~SVGAnimatedType):
(WebCore::SVGAnimatedType::createAngleAndEnumeration):
(WebCore::SVGAnimatedType::createEnumeration):
(WebCore):
(WebCore::SVGAnimatedType::angleAndEnumeration):
(WebCore::SVGAnimatedType::enumeration):
(WebCore::SVGAnimatedType::valueAsString):
(WebCore::SVGAnimatedType::setValueAsString):
(WebCore::SVGAnimatedType::supportsAnimVal):
* svg/SVGAnimatedType.h:
(SVGAnimatedType):
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
(SVGAnimatedTypeAnimator):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForType):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForType):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForType):
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::stopAnimValAnimationForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValDidChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::animValWillChangeForTypes):
(WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
(WebCore::SVGAnimatedTypeAnimator::executeAction):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGMarkerElement.cpp:
(WebCore):
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(SVGAnimatedListPropertyTearOff):
* svg/properties/SVGAnimatedPropertyTearOff.h:
(SVGAnimatedPropertyTearOff):
* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(SVGAnimatedStaticPropertyTearOff):
Canonical link: https://commits.webkit.org/100360@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-03 09:39:17 +00:00
|
|
|
</body>
|
|
|
|
</html>
|