widget URI scheme that is used to address resources
inside a widget package [[!WIDGETS]].
Resources inside a widget package are identified and located using a method that is specific to widgets technology. Widget URIs reflect this by providing these specific locators with their own syntax so that resources in widget packages can be readily identified.
In general, authors of widget content use relative URI references. Widget URIs are therefore primarily synthesised by the user agent as it absolutises URI references found in documents contained in widgets packages.
There are three classes of products that can claim conformance to this specification:
Throughout this specification, wherever the term URI [[!URI]] is used, it can be replaced interchangeably with the term IRI [[!RFC3987]]. All widget URIs are IRIs, but the term URI is more common and was therefore preferred for readability.
Widget URIs are URIs as per [[!URI]] and [[!RFC3987]], with specific aspects described in the following sections.
A valid widget URI MUST adhere to the IRI grammar rule
from [[!RFC3987]], and its scheme component MUST be the
case-insensitive string "widget".
A valid widget URI reference MUST adhere to the IRI-reference grammar rule from [[!RFC3987]], and if it is an absolute URI reference then it MUST be a valid widget URI.
A producer MUST generate URIs that are normalised according to chapter 5.3.2. "Syntax-Based Normalization" of [[!RFC3987]].
A consumer MUST be able to parse any valid widget URI.
Example widget URIs could thus be:
widget://beefdead/dahuts/sightings/alpes-françaises.svg
(assuming the generated opaque authority is beefdead) or
widget:///secret-identities/marcoscàceres/batman.foaf if there is no
authority component.
A producer MAY include an authority component in URIs. If present, the authority component is said to be opaque, meaning that the authority component has a syntax as defined by [[!RFC3987]] but that the authority component is devoid of semantics.
A consumer SHOULD ignore the authority component, when present.
When computing the base URI for a resource contained in a widget package
a producer MUST concatenate widget://, optionally
the opaque authority, the U+002F SOLIDUS (/) character, and the
Zip relative path to the
resource.
When resolving a relative URI references against a base URI, a consumer MUST use the mechanism defined in chapter 5.2. of [[URI]].
Note that using widget URIs directly when authoring content is discouraged, and authors should stick to using schemeless relative URI references.
To resolve a widget URI to a resource within a given widget package a consumer MUST apply the following algorithm (or one that guarantees the same result):
In some contexts one needs to map a URI into an origin, for instance in the [[HTML5]] HTML5 origin algorithm.
Mapping from a widget URI to an origin takes place as follows:
widget.null.
The following people were instrumental in producing this specification:
Art Barstow, Marcos Caceres, Thomas Roessler, Larry Masinter, Marcin Hanclik, Mark Baker, and Jere Kapyaho.