Closed Bug 598204 Opened 14 years ago Closed 13 years ago

Make <feImage> work with xlink:href=[svg-image.svg]

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Unassigned)

References

Details

Attachments

(2 files, 2 obsolete files)

Filing this bug on getting <feImage> to work with SVG images.  Note that this uses separate code from SVG's <image> tag -- the code in question is in nsSVGFEImageElement::Filter(), here:
http://mxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGFilters.cpp#5510

5510 nsSVGFEImageElement::Filter(nsSVGFilterInstance *instance,
5511                             const nsTArray<const Image*>& aSources,
5512                             const Image* aTarget,
5513                             const nsIntRect& rect)
[...]
5526   nsCOMPtr<imgIContainer> imageContainer;
5527   if (currentRequest)
5528     currentRequest->GetImage(getter_AddRefs(imageContainer));
5529 
5530   nsRefPtr<gfxASurface> currentFrame;
5531   if (imageContainer)
5532     imageContainer->GetFrame(imgIContainer::FRAME_CURRENT,
5533                              imgIContainer::FLAG_SYNC_DECODE,
5534                              getter_AddRefs(currentFrame));
Note that imgIContainer::GetFrame isn't implemented yet for SVG-as-image.
Attached image testcase with PNG image
Here's a simple <feImage> testcase using a PNG image. (This works, since it's using a PNG image rather than an SVG image.)
Attached image (helper SVG image) (obsolete) —
Attached image testcase w/ SVG image (obsolete) —
Attached image testcase with SVG image
Opera (which I'm using for comparison) isn't displaying the SVG image when it's hosted on bugzilla, so I'm re-attaching the SVG-image-version with a data-URL-encoded SVG image.
Attachment #476972 - Attachment is obsolete: true
Attachment #476975 - Attachment is obsolete: true
Attachment #476976 - Attachment description: testcase → testcase with SVG image
Attachment #476971 - Attachment description: testcase w/ PNG image → testcase with PNG image
See also bug 455986 which may be a superset of this.
Hm -- bug 455986 seems to be primarily about something else, actually.  Based on its first comment & its first testcase, it seems to focus on "make <feImage> work with xlink:href="foo.svg#someId" -- to get behavior like <use>.  I think it makes sense to keep that bug separate from this one.

So really, we should be detecting the type of <feImage>'s URI (just whether it contains a "#" character).  If it looks like a reference to some element's ID, we want to behave like <use> (bug 455986), and otherwise, we want to behave like <image> (this bug).
Seems to work now in Firefox 7.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
WFM in Firefox 4, in fact
Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0

As noted in comment 0, at the point I filed this bug, imgIContainer::GetFrame wasn't implemented yet for SVG-as-image. (and feImage relies on GetFrame)

So, this was almost certainly fixed by
http://hg.mozilla.org/mozilla-central/rev/e0e28d38dd59
> Bug 589558, patch 1: Implement VectorImage::GetFrame & CopyFrame, using Draw. r=joe a=blocking-betaN+
Depends on: 589558
Flags: in-testsuite?
Resolution: WORKSFORME → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: