Bug 65344

Summary: Make external URL references work
Product: WebKit Reporter: Rob Buis <rwlbuis>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: cigitia, gwynne, ivan.enderlin, japhet, lea, pdr, rhodovan.u-szeged, sergio.gomes, webkit-bugzilla, zbynek.jun, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 90955    
Bug Blocks: 44144, 12499    

Description Rob Buis 2011-07-28 15:14:10 PDT
Follow-up for https://bugs.webkit.org/show_bug.cgi?id=63283
Comment 1 Rob Buis 2011-07-30 09:12:33 PDT
Keeping this as a reminder for this bug:

> > Source/WebCore/css/SVGCSSStyleSelector.cpp:396
> > -            svgstyle->setMarkerEndResource(SVGURIReference::getTarget(s));
> > +            svgstyle->setMarkerEndResource(SVGURIReference::fragmentIdentifierFromIRIString(s, m_element->document()));
> 
> Oops, we silently assume same-document references here! If we just extract the fragment identifier here, we're going to ignore any external URL.
> We should store the whole IRI string here, and lookup the targetelmenetForIRIString later in rendering/ when we actually use the marker end resource.
> 
> That affects all usages of fragmentIdentifierFromIRIString - thery're all assuming same-doc refs, which is wrong.
> (Parts from our IRC discussion)

Cheers,

Rob.
Comment 2 zbynek.jun 2011-08-24 16:03:39 PDT
Hi Rob,

  any progress on this issue ? Blocked #12499 is realy annoying for larger SVG applications.

Zbynek
Comment 3 Renata Hodovan 2011-09-01 13:18:12 PDT
Is anybody working on this bug? I'm interested in this topic and I'd like to work on it if there are no objections.
Comment 4 Alan Hogan 2012-06-10 23:52:24 PDT
Just want to follow this bug.
Comment 5 Lea Verou 2012-08-19 00:47:29 PDT
Is there any progress on this? It’s practically crippling any non-trivial use case for SVG.
Comment 6 Philip Rogers 2012-08-19 21:34:48 PDT
*** Bug 90955 has been marked as a duplicate of this bug. ***
Comment 7 Philip Rogers 2012-08-19 21:43:04 PDT
I believe this bug refers to external SVG references with fragment URIs? External url references should work fine, with the caveat that fragment URIs do not work due to this longstanding issue: https://bugs.webkit.org/show_bug.cgi?id=6007

If this is indeed about the fragment URI bug, we should mark it as a duplicate of https://bugs.webkit.org/show_bug.cgi?id=91791.

@Lea, to my knowledge nobody is working on this at the moment :(
Comment 8 Sérgio Gomes 2023-08-30 05:26:24 PDT
Hey folks!

Any news on this bug? Note that this is still present in current WebKit, in that if a document loads an external SVG file via SVG `<use>`, then any `url(#foo)` usage in that external SVG file fails, because it is apparently looking for `foo` in the importing document instead of the external SVG file.

To illustrate this, here is a small test page: https://sgomes.github.io/external-svg-with-filter/

It includes both a "correct usage" test, where both the filter and the element that makes use of it are defined inside the external SVG; as well as an "incorrect usage" test that matches WebKit's apparent expectation, where the filter is instead defined in the importing document.

Blink and Gecko pass the "correct usage" test by rendering the shadow, and pass the "incorrect usage" test by rendering an entirely white image.

Webkit fails the "correct usage" test by rendering an entirely white image, and fails the "incorrect usage example" by rendering the shadow.