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)
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.
| Reporter | ||
Updated•14 years ago
|
Comment 1•14 years ago
|
||
no longer? So it did work in the past, if so when did it stop working?
| Reporter | ||
Comment 2•14 years ago
|
||
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]
Comment 3•14 years ago
|
||
| Reporter | ||
Comment 4•14 years ago
|
||
(In reply to comment #3)
> Created attachment 549745 [details]
> its the xml:base that's the issue
Is that a bug, or correct behaviour?
Comment 5•14 years ago
|
||
I'm not sure yet.
| Reporter | ||
Updated•14 years ago
|
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
Comment 6•14 years ago
|
||
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.
| Reporter | ||
Comment 7•14 years ago
|
||
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
| Reporter | ||
Comment 8•14 years ago
|
||
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.
Comment 9•14 years ago
|
||
(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
| Reporter | ||
Comment 10•14 years ago
|
||
(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.
Comment 11•14 years ago
|
||
(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.
| Reporter | ||
Comment 12•14 years ago
|
||
(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?
Comment 13•14 years ago
|
||
(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.
Comment 14•14 years ago
|
||
use must be same domain. https://bugzilla.mozilla.org/show_bug.cgi?id=269482#c26
Comment 15•14 years ago
|
||
> 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.
Description
•