| Summary: | Using the filter functional notation for background images results in wrong background-size rendering | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | thatemil <bjorklund.emil> | ||||||
| Component: | CSS | Assignee: | zalan <zalan> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | commit-queue, dbates, dino, sabouhallawa, simon.fraser, thorton, webkit-bug-importer, zalan | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Mac | ||||||||
| OS: | OS X 10.10 | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 148371 | ||||||||
| Attachments: |
|
||||||||
|
Description
thatemil
2015-08-20 08:07:36 PDT
I'm confused. I didn't think we supported filter(<image>, <filter-list>). Well, confusion or no, the filter seems to work fine on the background image (I even tried animating it), it's just the sizing bit that doesn't seem to work. :-) Ah I see, it was -webkit-filter() until https://trac.webkit.org/changeset/188647. Yes, this looks like a bug. We're not rendering the filtered output with the correct background-size. genererate filter image ignores the size argument when it copies the source to the destination.
diff --git a/Source/WebCore/css/CSSFilterImageValue.cpp b/Source/WebCore/css/CSSFilterImageValue.cpp
index 5d80331..41de312 100644
--- a/Source/WebCore/css/CSSFilterImageValue.cpp
+++ b/Source/WebCore/css/CSSFilterImageValue.cpp
@@ -123,7 +123,7 @@ RefPtr<Image> CSSFilterImageValue::image(RenderElement* renderer, const FloatSiz
std::unique_ptr<ImageBuffer> texture = ImageBuffer::create(size);
if (!texture)
return Image::nullImage();
- texture->context()->drawImage(image, ColorSpaceDeviceRGB, IntPoint());
+ texture->context()->drawImage(image, ColorSpaceDeviceRGB, FloatRect(FloatPoint(0, 0), size));
RefPtr<FilterEffectRenderer> filterRenderer = FilterEffectRenderer::create();
filterRenderer->setSourceImage(WTF::move(texture));
Created attachment 259744 [details]
Patch
Comment on attachment 259744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259744&action=review This looks sane to me. > Source/WebCore/ChangeLog:10 > + When the size is ignored, we end up paining the image with its native size while the filter paining => painting > LayoutTests/ChangeLog:10 > + When the size is ignored, we end up paining the image with its native size while the filter Ditto. Comment on attachment 259744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259744&action=review > LayoutTests/fast/filter-image/background-filter-image-expected.html:17 > + Is this empty line necessary? Created attachment 259882 [details]
Patch
Comment on attachment 259882 [details] Patch Clearing flags on attachment: 259882 Committed r188935: <http://trac.webkit.org/changeset/188935> All reviewed patches have been landed. Closing bug. |