Bug 119956 - Support animation of CSS gradients
: Support animation of CSS gradients
Status: NEW
: WebKit
CSS
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2013-08-17 11:33 PST by
Modified: 2013-09-08 14:06 PST (History)


Attachments
Rotating gradient example (404 bytes, text/html)
2013-08-19 03:41 PST, Dirk Schulze
no flags Details
Patch (9.80 KB, patch)
2013-08-19 03:43 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff
Patch (23.57 KB, patch)
2013-09-08 14:03 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2013-08-17 11:33:25 PST
Support animations of CSS gradients
------- Comment #1 From 2013-08-19 03:41:16 PST -------
Created an attachment (id=209074) [details]
Rotating gradient example
------- Comment #2 From 2013-08-19 03:43:39 PST -------
Created an attachment (id=209075) [details]
Patch

Wit this patch, linear gradient angles can be animated as well as colors from color-stops.

Animating the angle as described by the spec at the moment, leads to weird wonky looking gradients, since the gradient length gets shrinked on the edges and stretched on the corners.
------- Comment #3 From 2013-08-19 03:45:17 PST -------
Attachment 209075 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/css/CSSGradientValue.cpp', u'Source/WebCore/css/CSSGradientValue.h', u'Source/WebCore/page/animation/CSSPropertyAnimation.cpp']" exit_code: 1
Source/WebCore/page/animation/CSSPropertyAnimation.cpp:37:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebCore/css/CSSGradientValue.h:129:  The parameter name "to" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
------- Comment #4 From 2013-08-21 07:45:45 PST -------
I think the tasks can be divided into three parts that don't necessarily need to be done in one patch:

Animation of Colors,
Animation of Color stops (with the help of calc as requested by CSS specs)
Animation of Gradient direction/position

I am not particular keen about the last step, since that requires layout information that we might not have at animation time.

The first part should be very easy (done in the patch already) and the most important use case anyway.
------- Comment #5 From 2013-09-08 14:03:37 PST -------
Created an attachment (id=210992) [details]
Patch

color-stop animation from the latest proposal on www-style. Interpolate unordered color-stop list and use calc() to blend different types. The patch cleans up CSSGradientValue.cpp quite a bit as well.
------- Comment #6 From 2013-09-08 14:06:12 PST -------
Attachment 210992 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/css/CSSGradientValue.cpp', u'Source/WebCore/css/CSSGradientValue.h', u'Source/WebCore/page/animation/CSSPropertyAnimation.cpp']" exit_code: 1
Source/WebCore/css/CSSGradientValue.cpp:145:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Source/WebCore/css/CSSGradientValue.h:129:  The parameter name "to" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.