https://bugs.webkit.org/show_bug.cgi?id=77491
Reviewed by Simon Fraser.
Source/WebCore:
The new blend function added with r105403 takes unsigned as parameters therefore
we have to be careful to not overflow in case the to is less than from (animating
from 400 to 0 for example).
Test: animations/animation-border-overflow.html
* platform/animation/AnimationUtilities.h:
(WebCore::blend):
LayoutTests:
* animations/animation-border-overflow-expected.txt: Added.
* animations/animation-border-overflow.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106672
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-03 Alexis Menard <alexis.menard@openbossa.org>
+
+ REGRESSION (r105401-105403): Blue flash on css border transition
+ https://bugs.webkit.org/show_bug.cgi?id=77491
+
+ Reviewed by Simon Fraser.
+
+ * animations/animation-border-overflow-expected.txt: Added.
+ * animations/animation-border-overflow.html: Added.
+
2012-02-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
[Qt][WK2] Incorrect line number dumping
--- /dev/null
+This test performs an animation of the border-top-width property from a given value to 0. It tests if an intermediate value is correct.
+PASS - "border-top-width" property for "box" element at 0.1s saw something close to: 200
+
--- /dev/null
+<html>
+<head>
+<title>Unfilled Animation Test</title>
+<style type="text/css" media="screen">
+#box {
+ height: 100px;
+ width: 100px;
+ border-top-width: 300px;
+ border-style: solid;
+ -webkit-animation-duration: 1s;
+ -webkit-animation-timing-function: ease-in-out;
+ -webkit-animation-name: "anim";
+}
+@-webkit-keyframes "anim" {
+ from { border-top-width: 200px; }
+ to { border-top-width: 0px; }
+}
+
+</style>
+ <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
+ <script type="text/javascript" charset="utf-8">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ const expectedValues = [
+ // [animation-name, time, element-id, property, expected-value, tolerance]
+ ["anim", 0.1, "box", "border-top-width", 200, 20],
+ ];
+
+ runAnimationTest(expectedValues);
+ </script>
+</head>
+<body>
+This test performs an animation of the border-top-width property from a given value to 0. It tests if an intermediate value is correct.
+<div id="box">
+</div>
+<div id="result">
+</div>
+</body>
+</html>
+2012-02-03 Alexis Menard <alexis.menard@openbossa.org>
+
+ REGRESSION (r105401-105403): Blue flash on css border transition
+ https://bugs.webkit.org/show_bug.cgi?id=77491
+
+ Reviewed by Simon Fraser.
+
+ The new blend function added with r105403 takes unsigned as parameters therefore
+ we have to be careful to not overflow in case the to is less than from (animating
+ from 400 to 0 for example).
+
+ Test: animations/animation-border-overflow.html
+
+ * platform/animation/AnimationUtilities.h:
+ (WebCore::blend):
+
2012-02-03 Justin Novosad <junov@chromium.org>
[Chromium] ImageBufferSkia: remove unnecessary overload of flush in
inline unsigned blend(unsigned from, unsigned to, double progress)
{
- return static_cast<unsigned>(lround(static_cast<double>(from) + static_cast<double>(to - from) * progress));
+ return static_cast<unsigned>(lround(to > from ? static_cast<double>(from) + static_cast<double>(to - from) * progress : static_cast<double>(from) - static_cast<double>(from - to) * progress));
}
inline double blend(double from, double to, double progress)