Bug 119956

Summary: Support animation of CSS gradients
Product: WebKit Reporter: Dirk Schulze <krit>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: commit-queue, dino, dstockwell, esprehn+autocc, fmalita, glenn, macpherson, menard, schenney, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Rotating gradient example
none
Patch
none
Patch none

Description Dirk Schulze 2013-08-17 11:33:25 PDT
Support animations of CSS gradients
Comment 1 Dirk Schulze 2013-08-19 03:41:16 PDT
Created attachment 209074 [details]
Rotating gradient example
Comment 2 Dirk Schulze 2013-08-19 03:43:39 PDT
Created attachment 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 WebKit Commit Bot 2013-08-19 03:45:17 PDT
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 Dirk Schulze 2013-08-21 07:45:45 PDT
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 Dirk Schulze 2013-09-08 14:03:37 PDT
Created attachment 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 WebKit Commit Bot 2013-09-08 14:06:12 PDT
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.
Comment 7 Radar WebKit Bug Importer 2016-01-20 09:21:47 PST
<rdar://problem/24259320>