Bug 36704 - SVGAnimateColorElement doesn't support by/to animations properly
Summary: SVGAnimateColorElement doesn't support by/to animations properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords:
Depends on:
Blocks: 41761 36729
  Show dependency treegraph
 
Reported: 2010-03-27 10:38 PDT by Dirk Schulze
Modified: 2012-04-28 04:02 PDT (History)
1 user (show)

See Also:


Attachments
Patch (69.86 KB, patch)
2012-04-28 03:45 PDT, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Patch v2 (69.89 KB, patch)
2012-04-28 03:59 PDT, Nikolas Zimmermann
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 2010-03-27 10:38:23 PDT
If an argument for from is invalid or the attribute 'from' is missing at all, the resulting drawing is wrong. This is caused by SVGAnimateElement::calculateFromAndToValues. It sets transformation from color to string if one argument is wrong/missing. A short try to fix this broke W3C tests animate-elem-40 -41 -60 -62 and -78.
I tried to take the SVGColor of the valid argument, transformed it to a String (SVGColor::cssText()) and set it as new toValue/fromValue.
Comment 1 Nikolas Zimmermann 2011-02-25 00:49:50 PST
Maybe after bug 54800 is fixed, this is easy to fix as well.
Comment 2 Nikolas Zimmermann 2012-04-28 03:45:21 PDT
Created attachment 139351 [details]
Patch
Comment 3 Antti Koivisto 2012-04-28 03:57:26 PDT
Comment on attachment 139351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=139351&action=review

r=me

> Source/WebCore/ChangeLog:8
> +        Switch AnimatedColorAnimator to use the standard animateAdditveNumber() method, taking progress & repeatCount into account.

animateAdditveNumber <- typo

> Source/WebCore/svg/SVGAnimatedColor.cpp:94
> +    animatedColor = ColorDistance::clampColor(static_cast<int>(animatedRed), static_cast<int>(animatedGreen), static_cast<int>(animatedBlue), static_cast<int>(animatedAlpha));

Is static_cast<int>(floatColor) really the correct rounding?
Comment 4 Nikolas Zimmermann 2012-04-28 03:59:50 PDT
Created attachment 139352 [details]
Patch v2
Comment 5 Nikolas Zimmermann 2012-04-28 04:02:34 PDT
Committed r115564: <http://trac.webkit.org/changeset/115564>