haikuwebkit/LayoutTests/svg/animations/svgnumber-animation-2-expec...

16 lines
656 B
Plaintext
Raw Permalink Normal View History

2011-06-19 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVGAnimatorFactory does not support SVGNumber https://bugs.webkit.org/show_bug.cgi?id=62938 Follow up of "SVGAnimation should use direct unit animation for SVGLength": https://bugs.webkit.org/show_bug.cgi?id=61368 This patch continues the conversion to the new concept of SVGAnimatorFactory with SVGNumber. With the new animator for the With the new animator for SVGNumber we also support the scientific notation, and everything else that's supported by the SVGNumber parsing, removing the SVGAnimate* specific number parsing functionality. Moving the content of SVGAnimatedType header into its own cpp. Changed behavior of parseNumberFromString(). It checks if the String simply consits of a number now. parseNumberFromString() is using genericParseNumber() for parsing numbers. But this method just stops at the first char that does not belong to a number and returns true. I added a check if the current char pointer is at the last char of the String and return false if not. Tests: svg/animations/svgnumber-animation-1.html svg/animations/svgnumber-animation-2.html svg/animations/svgnumber-animation-3.html * CMakeLists.txt: Added new files to build system. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * svg/SVGAllInOne.cpp: Ditto. * svg/SVGAnimateElement.cpp: Use SVGAnimatedNumberAnimator for animations of SVGNumbers. (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimateElement.h: Remove floats for value storage. This is done by SVGAnimatedTypes now. * svg/SVGAnimatedNumber.cpp: Added. Animator for SVGNumbers. (WebCore::SVGAnimatedNumberAnimator::SVGAnimatedNumberAnimator): (WebCore::SVGAnimatedNumberAnimator::constructFromString): (WebCore::SVGAnimatedNumberAnimator::calculateFromAndToValues): (WebCore::SVGAnimatedNumberAnimator::calculateFromAndByValues): (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue): (WebCore::SVGAnimatedNumberAnimator::calculateDistance): * svg/SVGAnimatedNumber.h: (WebCore::SVGAnimatedNumberAnimator::~SVGAnimatedNumberAnimator): * svg/SVGAnimatedType.cpp: Added. Moved content from header to cpp. (WebCore::SVGAnimatedType::SVGAnimatedType): (WebCore::SVGAnimatedType::~SVGAnimatedType): (WebCore::SVGAnimatedType::createAngle): (WebCore::SVGAnimatedType::createLength): (WebCore::SVGAnimatedType::createNumber): (WebCore::SVGAnimatedType::angle): (WebCore::SVGAnimatedType::length): (WebCore::SVGAnimatedType::number): (WebCore::SVGAnimatedType::valueAsString): (WebCore::SVGAnimatedType::setValueAsString): * svg/SVGAnimatedType.h: Removed method create(). Allways call type specific create funtcions. * svg/SVGAnimatorFactory.h: (WebCore::SVGAnimatorFactory::create): * svg/SVGParserUtilities.cpp: (WebCore::parseNumberFromString): Check if String simply consits of a number. Return false otherwise. 2011-06-19 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVGAnimatorFactory does not support SVGNumber https://bugs.webkit.org/show_bug.cgi?id=62938 Added new tests to check behavior on SVGNumber animation. * svg/animations/script-tests/svgnumber-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumber-animation-2.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumber-animation-3.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgnumber-animation-1-expected.txt: Added. * svg/animations/svgnumber-animation-1.html: Added. * svg/animations/svgnumber-animation-2-expected.txt: Added. * svg/animations/svgnumber-animation-2.html: Added. * svg/animations/svgnumber-animation-3-expected.txt: Added. * svg/animations/svgnumber-animation-3.html: Added. Canonical link: https://commits.webkit.org/78549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-06-19 20:11:24 +00:00
SVG 1.1 dynamic animation tests
Test for SVGNumber animation with different exponents.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
[Qt] svg/animations tests are very flaky https://bugs.webkit.org/show_bug.cgi?id=80703 Reviewed by Rob Buis. Overhaul the svg/animation frameworks, to be more stable. Especially discrete animations were flaky on Qt, because some tests still sampled at integral times like 2.0s, instead of 1.999s (before change), and 2.001s (after change). Always use shouldBeCloseEnough() when comparing font-sizes/color values/, as there's always an uncertainity about the actual sampling time (low but may lead to 40.01px values, instead of 40px). This makes these tests also stable in Firefox/Opera, which was the ultimate goal! * platform/qt/Skipped: Unskip svg/animation tests. * svg/animations/additive-values-width-animation-expected.txt: * svg/animations/animate-color-calcMode-discrete-expected.txt: * svg/animations/animate-color-fill-currentColor-expected.txt: * svg/animations/animate-color-fill-from-by-expected.txt: * svg/animations/animate-color-rgba-calcMode-discrete-expected.txt: * svg/animations/animate-color-transparent-expected.txt: * svg/animations/animate-currentColor-expected.txt: * svg/animations/animate-dynamic-update-attributeName-expected.txt: * svg/animations/animate-elem-03-t-drt-expected.txt: * svg/animations/animate-end-attribute-expected.txt: * svg/animations/animate-from-to-keyTimes-expected.txt: * svg/animations/animate-inherit-css-property-expected.txt: * svg/animations/animate-keySplines-expected.txt: * svg/animations/animate-number-calcMode-discrete-expected.txt: * svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt: * svg/animations/attributeTypes-expected.txt: * svg/animations/resources/SVGAnimationTestCase.js: (expectColor): (expectFillColor): (moveAnimationTimelineAndSample): * svg/animations/script-tests/additive-values-width-animation.js: (executeTest): * svg/animations/script-tests/animVal-basics.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/animate-calcMode-spline-by.js: (sample1): (executeTest): * svg/animations/script-tests/animate-calcMode-spline-from-by.js: (sample1): (executeTest): * svg/animations/script-tests/animate-calcMode-spline-from-to.js: (sample1): (executeTest): * svg/animations/script-tests/animate-calcMode-spline-to.js: (sample1): (executeTest): * svg/animations/script-tests/animate-calcMode-spline-values.js: (sample1): (executeTest): * svg/animations/script-tests/animate-color-calcMode-discrete.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-color-fill-currentColor.js: (sample1): (sample2): (sample3): * svg/animations/script-tests/animate-color-fill-from-by.js: (sample1): (sample2): (sample3): * svg/animations/script-tests/animate-color-rgba-calcMode-discrete.js: (parseAlphaFromColor): (red): * svg/animations/script-tests/animate-color-transparent.js: (expectTransparent): (expectOtherColor): * svg/animations/script-tests/animate-currentColor.js: (sample1): (sample2): (sample3): * svg/animations/script-tests/animate-dynamic-update-attributeName.js: (sample1): (sample2): (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-elem-03-t-drt.js: (parseFontSizeFromString): (sample1): (sample2): (sample3): * svg/animations/script-tests/animate-end-attribute.js: (sample1): (sample2): * svg/animations/script-tests/animate-endElement-beginElement.js: (sample1): * svg/animations/script-tests/animate-from-to-keyTimes.js: * svg/animations/script-tests/animate-gradient-transform.js: (sample1): (sample2): (sample3): * svg/animations/script-tests/animate-inherit-css-property.js: (sample1): (sample2): (sample3): * svg/animations/script-tests/animate-insert-begin.js: (sample1): (sample2): * svg/animations/script-tests/animate-insert-no-begin.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/animate-keySplines.js: (sample3): (sample4): (executeTest): * svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js: (executeTest): * svg/animations/script-tests/animate-number-calcMode-discrete.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/animate-path-animation-Cc-Ss.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-path-animation-Qq-Tt.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-path-animation-cC-sS-inverse.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-path-animation-lL-vV-hH-inverse.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-path-animation-qQ-tT-inverse.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/animate-path-to-animation.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/animateTransform-pattern-transform.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/attributeTypes.js: (sample1): (sample2): (sample3): * svg/animations/script-tests/multiple-animations-fill-freeze.js: (sample1): (sample2): (sample3): (sample4): (sample5): (sample6): (sample7): (sample8): * svg/animations/script-tests/svgPreserveAspectRatio-animation-1.js: (executeTest): * svg/animations/script-tests/svgangle-animation-deg-to-grad.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgangle-animation-deg-to-rad.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgangle-animation-grad-to-deg.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgangle-animation-grad-to-rad.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgangle-animation-rad-to-deg.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgangle-animation-rad-to-grad.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgboolean-animation-1.js: (executeTest): * svg/animations/script-tests/svginteger-animation-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-LengthModeHeight.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-LengthModeOther.js: (sample1): (executeTest): * svg/animations/script-tests/svglength-animation-LengthModeWidth.js: (sample1): (executeTest): * svg/animations/script-tests/svglength-animation-invalid-value-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-invalid-value-2.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-invalid-value-3.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-number-to-number.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-cm.js: (sample1): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-ems.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-exs.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-in.js: (sample1): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-number.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-pc.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-percentage.js: (sample1): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-pt.js: (sample1): (executeTest): * svg/animations/script-tests/svglength-animation-px-to-px.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglength-animation-unitType.js: (executeTest): * svg/animations/script-tests/svglength-animation-values.js: (sample1): (sample2): (sample4): (executeTest): * svg/animations/script-tests/svglengthlist-animation-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglengthlist-animation-2.js: (sample1): (executeTest): * svg/animations/script-tests/svglengthlist-animation-3.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglengthlist-animation-4.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svglengthlist-animation-5.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgnumber-animation-1.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumber-animation-2.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumber-animation-3.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumberlist-animation-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgnumberlist-animation-2.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgnumberoptionalnumber-animation-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgnumberoptionalnumber-animation-2.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgnumberoptionalnumber-animation-3.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgnumberoptionalnumber-animation-4.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgpath-animation-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgpointlist-animation-1.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgpointlist-animation-2.js: (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgrect-animation-1.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgrect-animation-2.js: (sample1): (sample2): (executeTest): * svg/animations/script-tests/svgstring-animation-fallback-to-discrete.js: (executeTest): * svg/animations/script-tests/svgtransform-animation-1.js: (sample1): (sample2): * svg/animations/script-tests/svgtransform-animation-discrete.js: (sample1): (executeTest): * svg/animations/svglength-animation-invalid-value-1-expected.txt: * svg/animations/svglength-animation-invalid-value-2-expected.txt: * svg/animations/svglength-animation-invalid-value-3-expected.txt: * svg/animations/svglength-animation-unitType-expected.txt: * svg/animations/svgnumber-animation-1-expected.txt: * svg/animations/svgnumber-animation-2-expected.txt: * svg/animations/svgnumber-animation-3-expected.txt: * svg/animations/svgtransform-animation-discrete-expected.txt: Canonical link: https://commits.webkit.org/98151@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-13 16:11:17 +00:00
PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0.5
PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 1
PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
2011-06-19 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVGAnimatorFactory does not support SVGNumber https://bugs.webkit.org/show_bug.cgi?id=62938 Follow up of "SVGAnimation should use direct unit animation for SVGLength": https://bugs.webkit.org/show_bug.cgi?id=61368 This patch continues the conversion to the new concept of SVGAnimatorFactory with SVGNumber. With the new animator for the With the new animator for SVGNumber we also support the scientific notation, and everything else that's supported by the SVGNumber parsing, removing the SVGAnimate* specific number parsing functionality. Moving the content of SVGAnimatedType header into its own cpp. Changed behavior of parseNumberFromString(). It checks if the String simply consits of a number now. parseNumberFromString() is using genericParseNumber() for parsing numbers. But this method just stops at the first char that does not belong to a number and returns true. I added a check if the current char pointer is at the last char of the String and return false if not. Tests: svg/animations/svgnumber-animation-1.html svg/animations/svgnumber-animation-2.html svg/animations/svgnumber-animation-3.html * CMakeLists.txt: Added new files to build system. * GNUmakefile.list.am: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * svg/SVGAllInOne.cpp: Ditto. * svg/SVGAnimateElement.cpp: Use SVGAnimatedNumberAnimator for animations of SVGNumbers. (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::calculateAnimatedValue): (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): (WebCore::SVGAnimateElement::resetToBaseValue): (WebCore::SVGAnimateElement::applyResultsToTarget): (WebCore::SVGAnimateElement::calculateDistance): * svg/SVGAnimateElement.h: Remove floats for value storage. This is done by SVGAnimatedTypes now. * svg/SVGAnimatedNumber.cpp: Added. Animator for SVGNumbers. (WebCore::SVGAnimatedNumberAnimator::SVGAnimatedNumberAnimator): (WebCore::SVGAnimatedNumberAnimator::constructFromString): (WebCore::SVGAnimatedNumberAnimator::calculateFromAndToValues): (WebCore::SVGAnimatedNumberAnimator::calculateFromAndByValues): (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue): (WebCore::SVGAnimatedNumberAnimator::calculateDistance): * svg/SVGAnimatedNumber.h: (WebCore::SVGAnimatedNumberAnimator::~SVGAnimatedNumberAnimator): * svg/SVGAnimatedType.cpp: Added. Moved content from header to cpp. (WebCore::SVGAnimatedType::SVGAnimatedType): (WebCore::SVGAnimatedType::~SVGAnimatedType): (WebCore::SVGAnimatedType::createAngle): (WebCore::SVGAnimatedType::createLength): (WebCore::SVGAnimatedType::createNumber): (WebCore::SVGAnimatedType::angle): (WebCore::SVGAnimatedType::length): (WebCore::SVGAnimatedType::number): (WebCore::SVGAnimatedType::valueAsString): (WebCore::SVGAnimatedType::setValueAsString): * svg/SVGAnimatedType.h: Removed method create(). Allways call type specific create funtcions. * svg/SVGAnimatorFactory.h: (WebCore::SVGAnimatorFactory::create): * svg/SVGParserUtilities.cpp: (WebCore::parseNumberFromString): Check if String simply consits of a number. Return false otherwise. 2011-06-19 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. SVGAnimatorFactory does not support SVGNumber https://bugs.webkit.org/show_bug.cgi?id=62938 Added new tests to check behavior on SVGNumber animation. * svg/animations/script-tests/svgnumber-animation-1.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumber-animation-2.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/script-tests/svgnumber-animation-3.js: Added. (sample1): (sample2): (sample3): (executeTest): * svg/animations/svgnumber-animation-1-expected.txt: Added. * svg/animations/svgnumber-animation-1.html: Added. * svg/animations/svgnumber-animation-2-expected.txt: Added. * svg/animations/svgnumber-animation-2.html: Added. * svg/animations/svgnumber-animation-3-expected.txt: Added. * svg/animations/svgnumber-animation-3.html: Added. Canonical link: https://commits.webkit.org/78549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-06-19 20:11:24 +00:00
PASS successfullyParsed is true
TEST COMPLETE