On Wednesday, 19 June 2013 at 10:58, Mounir Lamouri wrote:
> On 18/06/13 17:40, Marcos Caceres wrote:
> > I'm not sure I follow? If you have:
> >
> > {src: "foo", width: "64", height: "64", type: "image/svg"}
> >
> > The UA assumes that the generated content is going to be "image/svg"?… more
> > below.
>
> Yes. But what if the icon might be a bitmap format or a vectorial format
> depending on some parameters?
If the parameters are expressed explicit through the URL, then one declares two
or more icons:
{src: "foo?format=svg", width: "64", height: "64", type: "image/svg"}
{src: "foo?format=jpeg", width: "64", height: "64", type: "image/jpeg"}
{src: "foo?format=webp", width: "64", height: "64", type: "image/webp"}
In the case where the type is server determined (e.g., content negotiation or
UA string), the developer is basically agreeing to deal with it, So the
following is still ok:
{src: "foo?format=random", width: "64", height: "64"}
The content negotiation case can be problematic (for devs) as UAs basically say
"I'll accept anything you got!" (image/* and */*) in the Accept header for
image requests. See:
https://developer.mozilla.org/en-US/docs/HTTP/Content_negotiation#Values_for_an_image
_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps