Bug 36704

Summary: SVGAnimateColorElement doesn't support by/to animations properly
Product: WebKit Reporter: Dirk Schulze <krit>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Normal CC: zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 41761, 36729    
Attachments:
Description Flags
Patch
none
Patch v2 koivisto: review+

Dirk Schulze
Reported 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.
Attachments
Patch (69.86 KB, patch)
2012-04-28 03:45 PDT, Nikolas Zimmermann
no flags
Patch v2 (69.89 KB, patch)
2012-04-28 03:59 PDT, Nikolas Zimmermann
koivisto: review+
Nikolas Zimmermann
Comment 1 2011-02-25 00:49:50 PST
Maybe after bug 54800 is fixed, this is easy to fix as well.
Nikolas Zimmermann
Comment 2 2012-04-28 03:45:21 PDT
Antti Koivisto
Comment 3 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?
Nikolas Zimmermann
Comment 4 2012-04-28 03:59:50 PDT
Created attachment 139352 [details] Patch v2
Nikolas Zimmermann
Comment 5 2012-04-28 04:02:34 PDT
Note You need to log in before you can comment on or make changes to this bug.