[csswg-drafts] [css-value] Fragment URLs

CJKu has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-value] Fragment URLs ==
https://lists.w3.org/Archives/Public/www-style/2016Jul/0025.html

While implementing fragment urls[1] inside gecko, I have come across a
behavior which can not find definition on the  spec.

When a SVG use element[2] references to a graphic element(located in
another document) with a local-ref url. By referring behavior on most
modern browsers, I think the correct behavior is to resolve the 
local-ref
url by base of the referenced document.

Here is an example: ref-external.svg uses a rect in ref-resource.svg
**ref-external.svg**
```
<svg>
  <!-- draw in blue -->
  <linearGradient id="grad1 ">
    <stop offset="0.0" stop-color="blue"/>
  </linearGradient>

  <use xlink:href="ref-resource.svg#myrect">
</svg>
```
**ref-resource.svg**
```
<svg>
  <!-- draw in red -->
  <linearGradient id="grad1 ">
    <stop offset="0.0" stop-color="red"/>
  </linearGradient>

  <rect id="myrect" x="200" y="125" width="200" height="125" 
stroke="none"
fill="url(#grad1)" />
</svg>
```

While rendering **ref-external.svg**, I would expect(can be wrong) 
seeing a
red rectangle on the screen, since url(#radialGrad1) will be resolved 
as
  http://.../ref-source.svg#grad1
not
  http://.../ref-external.svg#grad1.

Have clear definition of how resolving local-ref of
an anonymous clones element is super useful.

[1] https://drafts.csswg.org/css-values/#local-urls
[2] https://svgwg.org/svg2-draft/struct.html#UseElement

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/274 using your GitHub 
account

Received on Wednesday, 6 July 2016 09:18:26 UTC