From 4c76b63590b5203d24548634b77049df97e491ee Mon Sep 17 00:00:00 2001 From: "alexis.menard@openbossa.org" Date: Fri, 3 Feb 2012 18:21:22 +0000 Subject: [PATCH] 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 --- LayoutTests/ChangeLog | 10 ++++++ .../animation-border-overflow-expected.txt | 3 ++ .../animations/animation-border-overflow.html | 40 ++++++++++++++++++++++ Source/WebCore/ChangeLog | 16 +++++++++ .../platform/animation/AnimationUtilities.h | 2 +- 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 LayoutTests/animations/animation-border-overflow-expected.txt create mode 100644 LayoutTests/animations/animation-border-overflow.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 49998c3..c9262a7 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2012-02-03 Alexis Menard + + 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 [Qt][WK2] Incorrect line number dumping diff --git a/LayoutTests/animations/animation-border-overflow-expected.txt b/LayoutTests/animations/animation-border-overflow-expected.txt new file mode 100644 index 0000000..73d9304 --- /dev/null +++ b/LayoutTests/animations/animation-border-overflow-expected.txt @@ -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 + diff --git a/LayoutTests/animations/animation-border-overflow.html b/LayoutTests/animations/animation-border-overflow.html new file mode 100644 index 0000000..d8cd3ed --- /dev/null +++ b/LayoutTests/animations/animation-border-overflow.html @@ -0,0 +1,40 @@ + + +Unfilled Animation Test + + + + + +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. +
+
+
+
+ + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 6be9b20..ff07492 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2012-02-03 Alexis Menard + + 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 [Chromium] ImageBufferSkia: remove unnecessary overload of flush in diff --git a/Source/WebCore/platform/animation/AnimationUtilities.h b/Source/WebCore/platform/animation/AnimationUtilities.h index aebca46..87dabe6 100644 --- a/Source/WebCore/platform/animation/AnimationUtilities.h +++ b/Source/WebCore/platform/animation/AnimationUtilities.h @@ -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(lround(static_cast(from) + static_cast(to - from) * progress)); + return static_cast(lround(to > from ? static_cast(from) + static_cast(to - from) * progress : static_cast(from) - static_cast(from - to) * progress)); } inline double blend(double from, double to, double progress) -- 1.8.3.1