WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
119938
Animate CSS Image filter() function
https://bugs.webkit.org/show_bug.cgi?id=119938
Summary
Animate CSS Image filter() function
Dirk Schulze
Reported
2013-08-16 23:38:46 PDT
WebKit should support animating filter().
Attachments
Patch
(23.64 KB, patch)
2013-08-16 23:57 PDT
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Patch
(23.59 KB, patch)
2013-08-17 00:10 PDT
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Patch
(26.42 KB, patch)
2013-08-17 13:54 PDT
,
Dirk Schulze
eflews.bot
: commit-queue-
Details
Formatted Diff
Diff
Patch
(26.42 KB, patch)
2013-08-17 15:37 PDT
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Patch
(26.84 KB, patch)
2013-08-19 05:05 PDT
,
Dirk Schulze
simon.fraser
: review-
Details
Formatted Diff
Diff
Patch
(28.34 KB, patch)
2013-08-19 13:37 PDT
,
Dirk Schulze
simon.fraser
: review-
Details
Formatted Diff
Diff
Patch
(59.64 KB, patch)
2013-08-28 23:42 PDT
,
Dirk Schulze
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion
(874.37 KB, application/zip)
2013-08-29 02:52 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2
(1.15 MB, application/zip)
2013-08-29 05:35 PDT
,
Build Bot
no flags
Details
Patch
(75.81 KB, patch)
2013-08-29 06:57 PDT
,
Dirk Schulze
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2
(531.24 KB, application/zip)
2013-08-29 07:47 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion
(1.56 MB, application/zip)
2013-08-29 09:54 PDT
,
Build Bot
no flags
Details
Patch
(76.61 KB, patch)
2013-08-29 12:34 PDT
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Patch
(76.58 KB, patch)
2013-08-29 14:45 PDT
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Patch
(76.20 KB, patch)
2013-08-29 14:55 PDT
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Show Obsolete
(14)
View All
Add attachment
proposed patch, testcase, etc.
Dirk Schulze
Comment 1
2013-08-16 23:57:27 PDT
Created
attachment 208984
[details]
Patch
WebKit Commit Bot
Comment 2
2013-08-16 23:59:37 PDT
Attachment 208984
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/animations/resources/animation-test-helpers.js', u'LayoutTests/fast/filter-image/filter-image-animation-expected.txt', u'LayoutTests/fast/filter-image/filter-image-animation.html', u'Source/WebCore/ChangeLog', u'Source/WebCore/css/CSSComputedStyleDeclaration.cpp', u'Source/WebCore/css/CSSComputedStyleDeclaration.h', u'Source/WebCore/css/CSSFilterImageValue.h', u'Source/WebCore/page/animation/CSSPropertyAnimation.cpp']" exit_code: 1 Source/WebCore/page/animation/CSSPropertyAnimation.cpp:221: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dirk Schulze
Comment 3
2013-08-17 00:10:06 PDT
Created
attachment 208985
[details]
Patch
Dirk Schulze
Comment 4
2013-08-17 13:54:03 PDT
Created
attachment 209007
[details]
Patch Prepare CSSPropertyAnimation for future generated image blend operations.
EFL EWS Bot
Comment 5
2013-08-17 14:00:59 PDT
Comment on
attachment 209007
[details]
Patch
Attachment 209007
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/1497206
Early Warning System Bot
Comment 6
2013-08-17 14:01:26 PDT
Comment on
attachment 209007
[details]
Patch
Attachment 209007
[details]
did not pass qt-ews (qt): Output:
http://webkit-queues.appspot.com/results/1387361
Early Warning System Bot
Comment 7
2013-08-17 14:02:51 PDT
Comment on
attachment 209007
[details]
Patch
Attachment 209007
[details]
did not pass qt-wk2-ews (qt-wk2): Output:
http://webkit-queues.appspot.com/results/1433645
kov's GTK+ EWS bot
Comment 8
2013-08-17 14:07:00 PDT
Comment on
attachment 209007
[details]
Patch
Attachment 209007
[details]
did not pass gtk-ews (gtk): Output:
http://webkit-queues.appspot.com/results/1433646
EFL EWS Bot
Comment 9
2013-08-17 14:25:04 PDT
Comment on
attachment 209007
[details]
Patch
Attachment 209007
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/1387364
Dirk Schulze
Comment 10
2013-08-17 15:37:12 PDT
Created
attachment 209013
[details]
Patch patch with build fix
Dirk Schulze
Comment 11
2013-08-19 05:05:54 PDT
Created
attachment 209079
[details]
Patch Add toCSSFilterImageValue functions as suggested by anttik.
Antti Koivisto
Comment 12
2013-08-19 11:10:29 PDT
Comment on
attachment 209079
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209079&action=review
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:217 > + CSSFilterImageValue* fromValue = static_cast<CSSFilterImageValue*>(from->data()); > + CSSFilterImageValue* toValue = static_cast<CSSFilterImageValue*>(to->data());
You should use you casting functions here too.
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:321 > + CSSImageGeneratorValue* fromGenerated = static_cast<CSSImageGeneratorValue*>(from->data()); > + CSSImageGeneratorValue* toGenerated = static_cast<CSSImageGeneratorValue*>(to->data());
The could have casting functions.
Antti Koivisto
Comment 13
2013-08-19 11:11:44 PDT
Not my best typing day.
Simon Fraser (smfr)
Comment 14
2013-08-19 11:17:32 PDT
Comment on
attachment 209079
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209079&action=review
Looks OK but I'd like to see a patch with the enum and other comments addressed.
> Source/WebCore/css/CSSComputedStyleDeclaration.h:65 > + static PassRefPtr<CSSValue> valueForFilter(const RenderObject*, const RenderStyle*, const FilterOperations&, bool adjust = true);
It's not clear what "adjust" means in this context. You should use an enum.
> Source/WebCore/css/CSSComputedStyleDeclaration.h:80 > - PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*) const; > + static PassRefPtr<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle*, bool adjust = true);
It's not clear what "adjust" means in this context. You should use an enum.
> Source/WebCore/css/CSSFilterImageValue.h:73 > + bool equalSubimages(const CSSFilterImageValue&) const;
subimage is confusing; we should rename this ("input image"?)
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:225 > + blendFilterOperations( > + anim, > + filterOperationsResult, > + fromValue->filterOperations(), > + toValue->filterOperations(), > + progress);
This doesn't need to be so aggressively wrapped.
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:236 > + RefPtr<CSSValue> filterValue = ComputedStyleExtractor::valueForFilter( > + anim->renderer(), > + anim->renderer()->style(), > + filterOperationsResult, > + false);
Ditto. Congratulations, you just fell into the boolean trap.
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:323 > + ASSERT(fromGenerated); > + ASSERT(toGenerated);
Not sure these assertions are useful, since (if filters are enabled) you'll crash on the next line anyway.
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:327 > + // Animation of generated images just possible if subimages are equal.
s/just/is only I don't really know what a subimage is in this context. It seems different from our use of the term in other places.
Dirk Schulze
Comment 15
2013-08-19 13:37:36 PDT
Created
attachment 209116
[details]
Patch Addresses anttik's and smfr's feedback.
Simon Fraser (smfr)
Comment 16
2013-08-20 11:59:05 PDT
Comment on
attachment 209116
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209116&action=review
> LayoutTests/fast/filter-image/filter-image-animation.html:58 > + @-webkit-keyframes no-anim { > + from { background-image: -webkit-filter(url(resources/image.svg), sepia(1)); } > + to { background-image: -webkit-filter(url(resources/blue.svg), sepia(0)); } > + }
You should test a blend between a filter and simple image, and a filter and gradient, and filter and crossfade (to check for code that behaves badly). You should also test for blends between filter lists of the same and different lengths, and maybe with missing filter lists.
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:903 > +static inline PassRefPtr<CSSPrimitiveValue> valueForPixel(double length, const RenderStyle* style, ZoomAdjustedPixel adjust)
This has a very confusing name; it sounds like you're lookup up the RGBA for a single pixel.
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:908 > +static inline PassRefPtr<CSSPrimitiveValue> valueForPixel(const Length& length, const RenderStyle* style, ZoomAdjustedPixel adjust)
Ditto.
> Source/WebCore/css/CSSComputedStyleDeclaration.h:51 > +enum ZoomAdjustedPixel { AdjustPixel, DoNotAdjustPixel };
Enum types should be descriptive, like AdjustPixelVaulesForZoom { AdjustPixelValuesForZoom, DoNotAdjustPixelValues }
> Source/WebCore/css/CSSFilterImageValue.cpp:168 > +bool CSSFilterImageValue::equalInputImages(const CSSFilterImageValue& other) const
Much better than subimage!
> Source/WebCore/css/CSSFilterImageValue.h:49 > +
Blank line.
Dirk Schulze
Comment 17
2013-08-28 23:42:54 PDT
Created
attachment 209953
[details]
Patch
Build Bot
Comment 18
2013-08-29 02:52:53 PDT
Comment on
attachment 209953
[details]
Patch
Attachment 209953
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/1640119
New failing tests: animations/cross-fade-webkit-mask-box-image.html animations/cross-fade-webkit-mask-image.html animations/cross-fade-background-image.html animations/cross-fade-border-image-source.html animations/cross-fade-list-style-image.html
Build Bot
Comment 19
2013-08-29 02:52:56 PDT
Created
attachment 209962
[details]
Archive of layout-test-results from webkit-ews-08 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-08 Port: mac-mountainlion Platform: Mac OS X 10.8.4
Build Bot
Comment 20
2013-08-29 05:35:43 PDT
Comment on
attachment 209953
[details]
Patch
Attachment 209953
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/1627569
New failing tests: animations/cross-fade-webkit-mask-box-image.html animations/cross-fade-webkit-mask-image.html animations/cross-fade-background-image.html animations/cross-fade-border-image-source.html animations/cross-fade-list-style-image.html
Build Bot
Comment 21
2013-08-29 05:35:47 PDT
Created
attachment 209967
[details]
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-13 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.4
Dirk Schulze
Comment 22
2013-08-29 06:57:32 PDT
Created
attachment 209973
[details]
Patch
Build Bot
Comment 23
2013-08-29 07:47:23 PDT
Comment on
attachment 209973
[details]
Patch
Attachment 209973
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/1640183
New failing tests: animations/cross-fade-border-image-source.html
Build Bot
Comment 24
2013-08-29 07:47:26 PDT
Created
attachment 209978
[details]
Archive of layout-test-results from webkit-ews-11 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-11 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.4
Build Bot
Comment 25
2013-08-29 09:53:55 PDT
Comment on
attachment 209973
[details]
Patch
Attachment 209973
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/1605646
New failing tests: animations/cross-fade-border-image-source.html
Build Bot
Comment 26
2013-08-29 09:54:00 PDT
Created
attachment 209994
[details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-07 Port: mac-mountainlion Platform: Mac OS X 10.8.4
Simon Fraser (smfr)
Comment 27
2013-08-29 11:17:05 PDT
Comment on
attachment 209973
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=209973&action=review
You should add a test for animations between -webkit-filter(url(foo), ...) and url(foo), which should animate the filter values to the no-op filter (just like the filter property).
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:903 > +static inline PassRefPtr<CSSPrimitiveValue> adjustLengthForZoom(double length, const RenderStyle* style, AdjustPixelVaulesForZoom adjust)
AdjustPixelVaulesForZoom is mis-spelled. It's also weird to have the same name for the enum as one of its values.
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:919 > + for (const ShadowData* s = shadow; s; s = s->next()) {
We don't use short variable names like 's'. Maybe currShadowData?
> Source/WebCore/css/CSSComputedStyleDeclaration.h:51 > +enum AdjustPixelVaulesForZoom { AdjustPixelValuesForZoom, DoNotAdjustPixelValues };
Spelling.
> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:221 > + blendFilterOperations(anim, filterOperationsResult, > + fromValue->filterOperations(), toValue->filterOperations(), progress);
I don't think you need to wrap these lines.
Dirk Schulze
Comment 28
2013-08-29 12:34:42 PDT
Created
attachment 210016
[details]
Patch
Dirk Schulze
Comment 29
2013-08-29 14:45:52 PDT
Created
attachment 210034
[details]
Patch
Dirk Schulze
Comment 30
2013-08-29 14:55:33 PDT
Created
attachment 210035
[details]
Patch
WebKit Commit Bot
Comment 31
2013-08-30 12:28:01 PDT
Comment on
attachment 210035
[details]
Patch Clearing flags on attachment: 210035 Committed
r154906
: <
http://trac.webkit.org/changeset/154906
>
WebKit Commit Bot
Comment 32
2013-08-30 12:28:07 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug