WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
78293
Support cross-fade() of generated images (gradients, canvas, etc.)
https://bugs.webkit.org/show_bug.cgi?id=78293
Summary
Support cross-fade() of generated images (gradients, canvas, etc.)
Tim Horton
Reported
2012-02-09 16:16:13 PST
Created
attachment 126400
[details]
extremely preliminary patch We should support things like this: background: -webkit-cross-fade(-webkit-cross-fade(-webkit-canvas(squares), -webkit-canvas(thirdsquares), 0.5), -webkit-canvas(othersquares), 0.5); or this: background: -webkit-cross-fade(-webkit-linear-gradient(red, blue), url("apple.gif"), 0.5); <
rdar://problem/10459872
>
Attachments
extremely preliminary patch
(30.18 KB, patch)
2012-02-09 16:16 PST
,
Tim Horton
webkit.review.bot
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Tim Horton
Comment 1
2012-02-09 16:18:10 PST
I want to do some additional reorganization of CSSImageValue and co. to make this patch much smaller. Also, it still does some things I don't like. Still, it's a start! Also, it fixes animated-GIF-in-cross-fade, but I'll be splitting that out and attaching the (tiny) patch required to that bug.
WebKit Review Bot
Comment 2
2012-02-09 18:13:09 PST
Comment on
attachment 126400
[details]
extremely preliminary patch
Attachment 126400
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/11486469
New failing tests: css3/images/cross-fade-tiled.html animations/cross-fade-border-image-source.html transitions/cross-fade-border-image.html css3/images/cross-fade-simple.html css3/images/cross-fade-invalidation.html transitions/cross-fade-background-image.html animations/cross-fade-list-style-image.html animations/cross-fade-webkit-mask-image.html css3/images/cross-fade-blending.html css3/images/cross-fade-overflow-position.html animations/cross-fade-webkit-mask-box-image.html animations/cross-fade-background-image.html css3/images/cross-fade-sizing.html
Shane Stephens
Comment 3
2012-02-29 19:28:18 PST
***
Bug 79772
has been marked as a duplicate of this bug. ***
Tim Horton
Comment 4
2013-02-22 19:10:45 PST
***
Bug 90828
has been marked as a duplicate of this bug. ***
Sam Weinig
Comment 5
2022-10-22 10:36:38 PDT
Once
https://bugs.webkit.org/show_bug.cgi?id=246594
lands, this should be relatively straightforward to do. Taking this.
Tim Nguyen (:ntim)
Comment 6
2026-05-30 00:09:53 PDT
I think this worked for me: ``` diff --cc Source/WebCore/css/parser/CSSPropertyParserConsumer+Image.cpp index 0aa04b45df6b,0aa04b45df6b..78e5f33f5722 --- a/Source/WebCore/css/parser/CSSPropertyParserConsumer+Image.cpp +++ b/Source/WebCore/css/parser/CSSPropertyParserConsumer+Image.cpp @@@ -988,17 -988,17 +988,24 @@@ static RefPtr<CSSValue> consumeCrossFad if (!fromImageValueOrNone || !consumeCommaIncludingWhitespace(args)) return nullptr; auto toImageValueOrNone = consumeImageOrNone(args, state); -- if (!toImageValueOrNone || !consumeCommaIncludingWhitespace(args)) ++ if (!toImageValueOrNone) return nullptr; -- auto numberOrPercentage = MetaConsumer<CSS::Number<CSS::ClosedUnitRangeClampBoth>, CSS::Percentage<CSS::ClosedPercentageRangeClampBoth>>::consume(args, state); -- if (!numberOrPercentage) -- return nullptr; ++ // The percentage is optional for unprefixed cross-fade(); default to 50%. ++ CSSCrossfadeValue::Progress progress { CSS::Percentage<CSS::ClosedPercentageRangeClampBoth> { 50.0 } }; ++ if (!args.atEnd()) { ++ if (!consumeCommaIncludingWhitespace(args)) ++ return nullptr; ++ auto numberOrPercentage = MetaConsumer<CSS::Number<CSS::ClosedUnitRangeClampBoth>, CSS::Percentage<CSS::ClosedPercentageRangeClampBoth>>::consume(args, state); ++ if (!numberOrPercentage) ++ return nullptr; ++ progress = WTF::move(*numberOrPercentage); ++ } return CSSCrossfadeValue::create( fromImageValueOrNone.releaseNonNull(), toImageValueOrNone.releaseNonNull(), -- WTF::move(*numberOrPercentage), ++ WTF::move(progress), functionId == CSSValueWebkitCrossFade ); } diff --cc Source/WebCore/style/values/images/kinds/StyleCrossfadeImage.cpp index 9fed71b0e0d1,9fed71b0e0d1..6a0692f2a2ff --- a/Source/WebCore/style/values/images/kinds/StyleCrossfadeImage.cpp +++ b/Source/WebCore/style/values/images/kinds/StyleCrossfadeImage.cpp @@@ -183,7 -183,7 +183,10 @@@ RefPtr<WebCore::Image> CrossfadeImage:: protectedToImage = SVGImageForContainer::create(toSVGImage.get(), size, 1, toURL); } -- return CrossfadeGeneratedImage::create(*protectedFromImage, *protectedToImage, m_progress.value.value, fixedSize(*renderer), size); ++ auto crossfadeSize = fixedSize(*renderer); ++ if (crossfadeSize.isEmpty()) ++ crossfadeSize = size; ++ return CrossfadeGeneratedImage::create(*protectedFromImage, *protectedToImage, m_progress.value.value, crossfadeSize, size); } bool CrossfadeImage::currentFrameIsComplete(const RenderElement* renderer) const ```
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