Re: [svgwg] xlink:href in <animate> doesn't work in sourceless iframes (#700)

If anything in that section (Processing of URL references) is defined in a way that breaks something that worked in SVG 1, it's my mistake.  But, SVG 1 left a lot of stuff undefined, and this is definitely something that wasn't considered: using same-document URL references within documents that don't have a resolvable URL for the document as a whole.

The CSS special rules for `#target` URLs were designed to help with CSS specified in different document. But, they have the side effect of automatically handling this situation, too.

For SVG (`xlink:`)`href` references, we don't want to go quite as general as the CSS rules, as that would mess things up when you reference elements in a different file and then want the internal references in that second file to still be resolved locally. But we can definitely still tweak the rules for URL processing that I added to SVG 2.

The current rules require you to make a URL absolute _first_, then decide if it is same-document second.  This approach was intended to ensure that any URL references to the current document are recognized as same-document URLs, whether or not they start with a # mark.  But, we need a way to make that work even if you're in a document with an unresolvable URL.

Interestingly, the HTML [rules for resolving URLs in iframe `srcdoc`](https://html.spec.whatwg.org/multipage/urls-and-fetching.html#about:srcdoc) are very similar to the rules for resolving URLs in shadow trees: they use the base URL of the containing document.  We should therefore try to handle both issues at the same time & in the same way.  See https://github.com/w3c/webcomponents/issues/179 and cc @TabAtkins

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/700#issuecomment-508942391 using your GitHub account

Received on Saturday, 6 July 2019 17:34:53 UTC