Re: External references: how to handle 404?
Cameron McCormack <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.svg |
|---|---|
| Message-ID | <[email protected]> |
Hi Boris.
Boris Zbarsky wrote:
> The real question here is this: if an SVG element references
> http://example.com/example.svg#foo and the returned HTTP response is a
> 404 with Content-Type image/svg+xml that contains an element with
> id="foo", should that element be used, or should we pretend that we got
> no document back at all?
Pretend that you got no document back at all in most cases, I think. In
Tiny 1.2, there is this text below the reference restriction table:
Additionally, any IRI reference which cannot be resolved is an invalid
IRI reference. Examples of reasons for an IRI reference to be unable
to be resolved include:
...
* The IRI reference is to a resource that does not exist (for
example, an 'image' element that references an HTTP resource that
results in a 404 response code, even if the response body contains
an otherwise supported raster image resource).
http://dev.w3.org/SVG/profiles/1.2T/publish/linking.html#unresolved-resources
Then, for example, the description of <use xlink:href=""> says what to
do in the case of an invalid IRI reference:
An IRI reference to an element/fragment within an SVG document. An
invalid IRI reference is an unsupported value. An empty attribute
value (xlink:href="") disables rendering of the element. The lacuna
value is the empty string.
http://dev.w3.org/SVG/profiles/1.2T/publish/struct.html#UseElementHrefAttribute
And elements with attributes that have unsupported values are processed
as if that attribute were not present. Thus for <use xlink:href="bad"/>
you'd get no rendering.
> Robert suggests the latter, and I'm leaning that way too, but that's not
> obvious per the spec. For example, a local reference to #foo inside the
> 404 document should clearly work, right?
If that 404 document is being displayed? I suppose it should. I don't
think 1.2T says anything about what to do when an SVG resource is
displayed (at the top level, or in an <html:object>, or whatever) when
it's the body of a 404. The descriptions of "invalid IRI references"
are really for the case when the top level SVG document is a 2xx, and an
IRI reference within that is to a 4xx document or similar.
--
Cameron McCormack ≝ http://mcc.id.au/
_______________________________________________
dev-tech-svg mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-svg