Abstract

This document defines the concept of an "image resource" and a
corresponding WebIDL ImageResource dictionary. Web APIs can use the
ImageResource dictionary to represent an image resource in contexts
where an HTMLImageElement is not suitable or available (e.g., in a
Worker).

Status of This Document

This section describes the status of this
document at the time of its publication. Other documents may supersede
this document. A list of current W3C publications and the latest revision
of this technical report can be found in the
W3C technical reports index at
https://www.w3.org/TR/.

This specification is not stable. Implementors who are
not taking part in the discussions will find the specification changing
out from under them in incompatible ways.

Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress.

1.
Introduction

Web applications often accept developer-provided image resources to be
displayed outside of a HTML document (e.g., in the OS, in the browser
UI, etc.). This specification defines a WebIDL dictionary that
describes an image, and where that image resource can be fetched from.
The user agent can then use this extra information to choose an image
that is best suited to display on the end-user's device or most closely
matches the end-user's preferences or environment.

2.
Privacy and security considerations

Fetching an image resource can reveal the user's IP address. It is
RECOMMENDED that user agents fetch the chosen image resources when
provided by the developer, and store them for re-use if needed. This
limits tracking the user's location over time.

4. ImageResource dictionary

4.1 src member

4.2 sizes member

The sizes member is equivalent to a link
element's sizes attribute, and is processed in the same
manner.

When multiple ImageResource dictionaries are available, a user
agent MAY use the sizes value to decide which image
is most suitable for a display context (and ignore any that are
inappropriate).

Note

When multiple ImageResource dictionaries are being used by an API
(e.g., in a WebIDL sequence), the specifications should indicate
if the order in which the dictionaries are passed is significant. As
a general rule, order is significant and "first match wins".

The sizes member allows for multiple
space-separated size values in order to accommodate image formats
(such as ICO) that can act as a container for multiple images of
varying dimensions.