- From: 顧思捷 <cku@mozilla.com>
- Date: Wed, 6 Jul 2016 02:02:32 +0800
- To: www-style@w3.org
- Message-ID: <CAHJEGNHfEbM+5RpGFnCwAP6JriA7WV33wBQWv5ceZtVg6ByePw@mail.gmail.com>
Hi,
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.
It's helpful if we can have clear definition of how resolving local-ref of
an anonymous clones element.
[1] https://drafts.csswg.org/css-values/#local-urls
[2] https://svgwg.org/svg2-draft/struct.html#UseElement
Received on Wednesday, 6 July 2016 06:18:56 UTC