Closed Bug 675577 Opened 14 years ago Closed 14 years ago

SVG <use> element no longer working correctly for <image> when <svg> has an xml:base attribute

Categories

(Core :: SVG, defect)

5 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: wieser.eric, Unassigned)

References

()

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1 Steps to reproduce: Made a page that uses the SVG <use> tag in three ways: - Using an image within a <defs> - Using a <g> containing an <image> within a <defs> - Using a <image> not contained within a defs For a control case, an image put straight into the document was also used. Live test case here: http://phrogz.net/SVG/test_image_references.svg Actual results: Only the control image shows up. The other three are missing. Known to work in IE9 and chrome. Also broken in Opera. Expected results: A grid of four green-textured squares should appear, separated by a 1px strip.
no longer? So it did work in the past, if so when did it stop working?
I vaguely recall it working in a previous version of firefox, as per the end of the answer here: http://stackoverflow.com/questions/4611222 > Further, a slightly modified test case using explicit pixel-based image > height and width, and pixel-based SVG viewBox and dimensions works in all > browsers tested. [linking to the mentioned SVG document]
(In reply to comment #3) > Created attachment 549745 [details] > its the xml:base that's the issue Is that a bug, or correct behaviour?
I'm not sure yet.
Summary: SVG <use> element no longer working correctly for <image>. → SVG <use> element no longer working correctly for <image> when <svg> has an xml:base attribute
Concerning http://phrogz.net/SVG/test_image_references.svg Works: Firefox/2.0.0.20 ID:2008121709 Fails: Firefox/3.0.19 ID:2010031422 upto Trunk.
I think I know what the problem is. The <use> element refers to `#top-tile` which with the `xml-base` attribute is set, is reolved to http://phrogz.net/svg/#top-tile, instead of `http://phrogz.net/SVG/test_image_references.svg#top-tile`. This may or may not be the correct behaviour
Changing the use elements to: <use xlink:href="http://phrogz.net/SVG/test_image_references.svg#top-tile" /> is another way to fix this issue, without having to remove the xml:base declaration.
(In reply to comment #7) > I think I know what the problem is. The <use> element refers to `#top-tile` > which with the `xml-base` attribute is set, is reolved to > http://phrogz.net/svg/#top-tile, instead of > `http://phrogz.net/SVG/test_image_references.svg#top-tile`. > > This may or may not be the correct behaviour That's exactly right, well done and it is the correct behaviour. Opera is right too so you should raise Webkit and IE bugs.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
(In reply to comment #9) > (In reply to comment #7) > > I think I know what the problem is. The <use> element refers to `#top-tile` > > which with the `xml-base` attribute is set, is reolved to > > http://phrogz.net/svg/#top-tile, instead of > > `http://phrogz.net/SVG/test_image_references.svg#top-tile`. > > > > This may or may not be the correct behaviour > > That's exactly right, well done and it is the correct behaviour. Opera is > right too so you should raise Webkit and IE bugs. However, setting the xml:base to `http://phrogz.net/SVG/test_image_references.svg` through firebug does not appear to remedy the problem. I can't test this locally since I think it would be an XSS vulnerability.
(In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #7) > > > I think I know what the problem is. The <use> element refers to `#top-tile` > > > which with the `xml-base` attribute is set, is reolved to > > > http://phrogz.net/svg/#top-tile, instead of > > > `http://phrogz.net/SVG/test_image_references.svg#top-tile`. > > > > > > This may or may not be the correct behaviour > > > > That's exactly right, well done and it is the correct behaviour. Opera is > > right too so you should raise Webkit and IE bugs. > > However, setting the xml:base to > `http://phrogz.net/SVG/test_image_references.svg` through firebug does not > appear to remedy the problem. I can't test this locally since I think it > would be an XSS vulnerability. That would break the image links instead.
(In reply to comment #11) > (In reply to comment #10) > > (In reply to comment #9) > > > (In reply to comment #7) > > > > I think I know what the problem is. The <use> element refers to `#top-tile` > > > > which with the `xml-base` attribute is set, is reolved to > > > > http://phrogz.net/svg/#top-tile, instead of > > > > `http://phrogz.net/SVG/test_image_references.svg#top-tile`. > > > > > > > > This may or may not be the correct behaviour > > > > > > That's exactly right, well done and it is the correct behaviour. Opera is > > > right too so you should raise Webkit and IE bugs. > > > > However, setting the xml:base to > > `http://phrogz.net/SVG/test_image_references.svg` through firebug does not > > appear to remedy the problem. I can't test this locally since I think it > > would be an XSS vulnerability. > > That would break the image links instead. Why? The image links are an absolute URL. Besides, the images already work with one incorrect xml:base once the use statements are qualified, so why would they not work with a different one?
(In reply to comment #12) > > Why? The image links are an absolute URL. Besides, the images already work > with one incorrect xml:base once the use statements are qualified, so why > would they not work with a different one? Ahh yes, you are right.
> you should raise Webkit and IE bugs. For WebKit, https://bugs.webkit.org/show_bug.cgi?id=63283 might cover this; you could stick whatever string you want in that <use> href as long as it ends with "#top-tile" and it would work. Worth testing with a build that includes that fix.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: