Title: [106718] branches/chromium/1025
- Revision
- 106718
- Author
- [email protected]
- Date
- 2012-02-03 17:30:43 -0800 (Fri, 03 Feb 2012)
Log Message
Merge 106672 - 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.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/9328025
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1025/LayoutTests/animations/animation-border-overflow-expected.txt (from rev 106672, trunk/LayoutTests/animations/animation-border-overflow-expected.txt) (0 => 106718)
--- branches/chromium/1025/LayoutTests/animations/animation-border-overflow-expected.txt (rev 0)
+++ branches/chromium/1025/LayoutTests/animations/animation-border-overflow-expected.txt 2012-02-04 01:30:43 UTC (rev 106718)
@@ -0,0 +1,3 @@
+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
+
Copied: branches/chromium/1025/LayoutTests/animations/animation-border-overflow.html (from rev 106672, trunk/LayoutTests/animations/animation-border-overflow.html) (0 => 106718)
--- branches/chromium/1025/LayoutTests/animations/animation-border-overflow.html (rev 0)
+++ branches/chromium/1025/LayoutTests/animations/animation-border-overflow.html 2012-02-04 01:30:43 UTC (rev 106718)
@@ -0,0 +1,40 @@
+<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="" 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>
Modified: branches/chromium/1025/Source/WebCore/platform/animation/AnimationUtilities.h (106717 => 106718)
--- branches/chromium/1025/Source/WebCore/platform/animation/AnimationUtilities.h 2012-02-04 01:29:14 UTC (rev 106717)
+++ branches/chromium/1025/Source/WebCore/platform/animation/AnimationUtilities.h 2012-02-04 01:30:43 UTC (rev 106718)
@@ -37,7 +37,7 @@
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)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes