Bug 63789

Summary: SVGAnimatedType should support SVGAnimatedInteger animation
Product: WebKit Reporter: Dirk Schulze <krit>
Component: SVGAssignee: Dirk Schulze <krit>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 41761    
Attachments:
Description Flags
Patch
none
Patch zimmermann: review+

Dirk Schulze
Reported 2011-07-01 00:37:08 PDT
SVGAnimatedType should support SVGAnimatedInteger animation
Attachments
Patch (27.05 KB, patch)
2011-07-01 00:51 PDT, Dirk Schulze
no flags
Patch (27.03 KB, patch)
2011-07-01 01:17 PDT, Dirk Schulze
zimmermann: review+
Dirk Schulze
Comment 1 2011-07-01 00:51:33 PDT
Dirk Schulze
Comment 2 2011-07-01 01:17:47 PDT
WebKit Review Bot
Comment 3 2011-07-01 01:20:14 PDT
Attachment 99444 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1 Source/WebCore/svg/SVGAnimatedInteger.h:55: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.h:55: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.h:56: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.h:56: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.h:58: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.h:58: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.h:58: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:44: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:44: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:55: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:55: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:69: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:69: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Source/WebCore/svg/SVGAnimatedInteger.cpp:69: The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5] Total errors found: 14 in 18 files If any of these errors are false positives, please file a bug against check-webkit-style.
Nikolas Zimmermann
Comment 4 2011-07-01 01:25:30 PDT
Comment on attachment 99441 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=99441&action=review Looks good to me. > Source/WebCore/svg/SVGAnimatedInteger.cpp:40 > + bool ok; > + animtedType->integer() = string.toIntStrict(&ok); Hm, we have to revisit error handling from methods like constructFromSTring at some point. > Source/WebCore/svg/SVGAnimatedInteger.cpp:84 > + animatedInt = roundf(result); Don't you have to cast to int, as the return value is a float here? Do any of the specs (svg/smil) say sth. about rounding? whether round/ceil or floor is desired? > Source/WebCore/svg/SVGAnimatedInteger.cpp:90 > + int from = fromString.toIntStrict(); Oh, toIntStrict does not _need_ a bool& ok param... so why don't you leave it out in constructFromString?
Dirk Schulze
Comment 5 2011-07-01 01:32:43 PDT
(In reply to comment #4) > (From update of attachment 99441 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=99441&action=review > > Looks good to me. > > > Source/WebCore/svg/SVGAnimatedInteger.cpp:40 > > + bool ok; > > + animtedType->integer() = string.toIntStrict(&ok); > > Hm, we have to revisit error handling from methods like constructFromSTring at some point. I definitely plan it for the future. > > > Source/WebCore/svg/SVGAnimatedInteger.cpp:84 > > + animatedInt = roundf(result); Can add it. It compiles right now > > Don't you have to cast to int, as the return value is a float here? > Do any of the specs (svg/smil) say sth. about rounding? whether round/ceil or floor is desired? That's the problem. There is no description about that, we could use discrete animation here, but rounding to the nearest value makes more sense (is more useful for the webdeveloper) IMHO. > > > Source/WebCore/svg/SVGAnimatedInteger.cpp:90 > > + int from = fromString.toIntStrict(); > > Oh, toIntStrict does not _need_ a bool& ok param... so why don't you leave it out in constructFromString? No it doesn't need it, it was a preparation for the error handling in the future. I'll remove it for now.
Nikolas Zimmermann
Comment 6 2011-07-01 01:35:08 PDT
Comment on attachment 99444 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=99444&action=review r=me. > Source/WebCore/svg/SVGAnimatedInteger.cpp:40 > + bool ok; > + animtedType->integer() = string.toIntStrict(&ok); Remove the ok. > Source/WebCore/svg/SVGAnimatedInteger.cpp:84 > + animatedInt = roundf(result); static_cast<int>(..) > LayoutTests/svg/animations/script-tests/svginteger-animation-1.js:39 > + shouldBe("feConvolveMatrix.targetX.animVal", "0"); would be great if you could add the commented out baseVal statement, so I have an easier job later: // shouldBe("feConvolveMatrix.targetX.baseVal", "0") ... > LayoutTests/svg/animations/script-tests/svginteger-animation-1.js:43 > + shouldBe("feConvolveMatrix.targetX.animVal", "1"); Ditto. > LayoutTests/svg/animations/script-tests/svginteger-animation-1.js:47 > + shouldBe("feConvolveMatrix.targetX.animVal", "2"); Ditto.
Dirk Schulze
Comment 7 2011-07-01 01:38:11 PDT
Note You need to log in before you can comment on or make changes to this bug.