Bug 71731 - feImage referencing a primitive draws incorrectly
Summary: feImage referencing a primitive draws incorrectly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on: 71780 71979
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-07 14:03 PST by Tim Horton
Modified: 2011-11-30 11:54 PST (History)
5 users (show)

See Also:


Attachments
screenshot of webkit vs opera (37.98 KB, image/png)
2011-11-07 14:04 PST, Tim Horton
no flags Details
repro (522 bytes, image/svg+xml)
2011-11-07 14:04 PST, Tim Horton
no flags Details
simple patch (12.27 KB, patch)
2011-11-09 16:25 PST, Tim Horton
simon.fraser: review+
simon.fraser: commit-queue-
Details | Formatted Diff | Diff
patch which works in DRT (19.33 KB, patch)
2011-11-29 18:04 PST, Tim Horton
simon.fraser: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
patch fixing notes (19.13 KB, patch)
2011-11-30 11:08 PST, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2011-11-07 14:03:03 PST
Not quite sure what's up here; see the attached image for the rendering difference between Opera and WebKit. The area that the <feImage> should be consuming seems to include a snapshot of the whole document instead of just the <circle> that it points at.
Comment 1 Radar WebKit Bug Importer 2011-11-07 14:03:35 PST
<rdar://problem/10408178>
Comment 2 Tim Horton 2011-11-07 14:04:13 PST
Created attachment 113926 [details]
screenshot of webkit vs opera
Comment 3 Tim Horton 2011-11-07 14:04:28 PST
Created attachment 113927 [details]
repro
Comment 4 Tim Horton 2011-11-07 14:04:47 PST
This is affecting the SVG Wow! Ripple demo.
Comment 5 Tim Horton 2011-11-07 14:25:43 PST
This might be the root cause of https://bugs.webkit.org/show_bug.cgi?id=68664 (or, rather, they might be the same bug).
Comment 6 Tim Horton 2011-11-07 18:36:04 PST
I'll take this one, it looks straightforward. Something to do with the mechanics surrounding SVGFEImageElement's m_cachedImage.
Comment 7 Nikolas Zimmermann 2011-11-07 23:15:10 PST
(In reply to comment #6)
> I'll take this one, it looks straightforward. Something to do with the mechanics surrounding SVGFEImageElement's m_cachedImage.

Hey Tim, I'm also working on feImage as we speak, but found a much larger problem when using feImage with primitiveUnits="objectBoundingBox" and referencing other elements by #elementName.
I can explain it later, once I come to work..

Cheers,
Niko
Comment 8 Tim Horton 2011-11-09 12:00:02 PST
We're trying to resolve the href too early; we should do it on the first build() instead of when the attribute's set, I think. There are other issues here, with invalidation and the like, but those will be addressed in another bug.

This also exposes a crash when the referenced element is 0x0 pixels, so I've fixed that as well.
Comment 9 Tim Horton 2011-11-09 16:25:21 PST
Created attachment 114390 [details]
simple patch
Comment 10 Simon Fraser (smfr) 2011-11-09 16:28:40 PST
Comment on attachment 114390 [details]
simple patch

View in context: https://bugs.webkit.org/attachment.cgi?id=114390&action=review

> LayoutTests/svg/filters/feImage-reference-svg-primitive.svg:11
> +        <circle id="circle" r="100" fill="red" />

Red should not be visible in passing pixel results.
Comment 11 Tim Horton 2011-11-09 16:39:47 PST
(In reply to comment #10)
> (From update of attachment 114390 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=114390&action=review
> 
> > LayoutTests/svg/filters/feImage-reference-svg-primitive.svg:11
> > +        <circle id="circle" r="100" fill="red" />
> 
> Red should not be visible in passing pixel results.

Thanks, Simon!

Landed as r99782.
Comment 12 Tim Horton 2011-11-09 17:53:51 PST
Reopened because of rollout.
Comment 13 Tim Horton 2011-11-09 18:06:06 PST
The test failures only occur in DRT; in Safari, everything looks fine.
Comment 14 Tim Horton 2011-11-29 18:04:04 PST
Created attachment 117088 [details]
patch which works in DRT
Comment 15 Zoltan Herczeg 2011-11-29 23:53:56 PST
Comment on attachment 117088 [details]
patch which works in DRT

I think this is a good patch overall. Some notes:

View in context: https://bugs.webkit.org/attachment.cgi?id=117088&action=review

> LayoutTests/ChangeLog:22
> +        * platform/mac/svg/filters/feImage-reference-invalidation-expected.png: Added.
> +        * platform/mac/svg/filters/feImage-reference-invalidation-expected.txt: Added.
> +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.png: Added.
> +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.txt: Added.

These test cases seems rather simple, can't we use the same results on all platforms?

> LayoutTests/svg/filters/feImage-reference-invalidation.svg:6
> +        <rect id="circle" width="100" height="100" fill="red" />
> +        <rect id="circle2" width="100" height="100" fill="green" />

Why this is a rect if its name is circle?
Comment 16 WebKit Review Bot 2011-11-30 05:02:29 PST
Comment on attachment 117088 [details]
patch which works in DRT

Attachment 117088 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10693183

New failing tests:
svg/filters/feImage-reference-invalidation.svg
svg/filters/feImage-reference-svg-primitive.svg
svg/filters/feImage-zero-size-crash.svg
Comment 17 Simon Fraser (smfr) 2011-11-30 09:22:57 PST
Comment on attachment 117088 [details]
patch which works in DRT

View in context: https://bugs.webkit.org/attachment.cgi?id=117088&action=review

> LayoutTests/ChangeLog:21
> +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.png: Added.

It's a shame that this passing result contains red.
Comment 18 Tim Horton 2011-11-30 11:08:20 PST
Created attachment 117230 [details]
patch fixing notes
Comment 19 Tim Horton 2011-11-30 11:10:23 PST
(In reply to comment #15)
> (From update of attachment 117088 [details])
> I think this is a good patch overall. Some notes:
> 
> View in context: https://bugs.webkit.org/attachment.cgi?id=117088&action=review
> 
> > LayoutTests/ChangeLog:22
> > +        * platform/mac/svg/filters/feImage-reference-invalidation-expected.png: Added.
> > +        * platform/mac/svg/filters/feImage-reference-invalidation-expected.txt: Added.
> > +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.png: Added.
> > +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.txt: Added.
> 
> These test cases seems rather simple, can't we use the same results on all platforms?

In theory? Yes. In practice, I've (almost) never made pixel results that work on the Chromium bot also. I've just uploaded a new patch with non-platform-specific results (I just remembered I forgot to update the ChangeLog, I'll do that locally) just to see if the cr-linux bot accepts my results, otherwise I'll land it with the platform-specific results.
Comment 20 Tim Horton 2011-11-30 11:48:37 PST
(In reply to comment #19)
> (In reply to comment #15)
> > (From update of attachment 117088 [details] [details])
> > I think this is a good patch overall. Some notes:
> > 
> > View in context: https://bugs.webkit.org/attachment.cgi?id=117088&action=review
> > 
> > > LayoutTests/ChangeLog:22
> > > +        * platform/mac/svg/filters/feImage-reference-invalidation-expected.png: Added.
> > > +        * platform/mac/svg/filters/feImage-reference-invalidation-expected.txt: Added.
> > > +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.png: Added.
> > > +        * platform/mac/svg/filters/feImage-reference-svg-primitive-expected.txt: Added.
> > 
> > These test cases seems rather simple, can't we use the same results on all platforms?
> 
> In theory? Yes. In practice, I've (almost) never made pixel results that work on the Chromium bot also. I've just uploaded a new patch with non-platform-specific results (I just remembered I forgot to update the ChangeLog, I'll do that locally) just to see if the cr-linux bot accepts my results, otherwise I'll land it with the platform-specific results.

Actually, that doesn't look like a winning approach today (the cr-linux EWS machine seems stuck), so I'll commit given Simon's r+ above and keep an eye on the bots.
Comment 21 Tim Horton 2011-11-30 11:54:06 PST
Landed (again) in r101542.