REGRESSION (r105401-105403): Blue flash on css border transition

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
parent aa9600c6
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
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
<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
......@@ -37,7 +37,7 @@ inline int blend(int from, int to, double progress)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment