Skip to content

Commit a426128

Browse files
committed
[css-images-3][css-images-4] Per CSSWG resolution, layout-affecting metadata occuring after the image data should be ignored.
1 parent bee538e commit a426128

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

css-images-3/Overview.bs

+32
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,36 @@ Image References: the ''url()'' notation {#url-notation}
210210
it's interpreted as an image.
211211
</div>
212212

213+
### Image Metadata ### {#url-metadata}
214+
215+
Images can contain metadata
216+
such as resolution and orientation
217+
which specifies how to render the image.
218+
Some image formats are flexible in where this metadata can be placed in the file;
219+
however, if the metadata occurs <em>after</em> the bulk of the actual image data,
220+
it harms the UA's ability to “progressively decode” the image
221+
and display it as the image's data streams in.
222+
223+
To reduce the impact of this issue:
224+
225+
* Authors <em>must</em> produce their image files
226+
so that such metadata occurs first in the image file.
227+
(Note: This is the default for most images already.)
228+
* User agents <em>should</em> ignore any layout-impacting metadata (such as orientation or resolution)
229+
that occurs after the actual image data begins in the file.
230+
(Note: This rule does not impact metadata that does not affect layout,
231+
such as color space information.)
232+
233+
If a user agent cannot ignore the metadata based its location in the file
234+
(for example, if the decoder being used
235+
does not report where in the file the metadata was located),
236+
it <em>must</em> use the metadata in all cases.
237+
(In particular, it is not valid
238+
to use the metadata only when the image is "small"
239+
and the entire file is downloaded quickly,
240+
but to ignore it if the image is large
241+
and the metadata isn't downloaded until well after the image starts being displayed.)
242+
213243

214244
<!--
215245
██████ ████████ ███ ████████ ████ ████████ ██ ██ ████████ ██████
@@ -1565,6 +1595,8 @@ Image Processing {#image-processing}
15651595
If there is no orientation specified in its metadata,
15661596
this value computes to ''image-orientation/none''.
15671597

1598+
Note: [[#url-metadata]] imposes some restrictions on what metadata can be used.
1599+
15681600
<dt><dfn lt="<angle>|flip|<angle> || flip"><<angle>> || flip</dfn>
15691601
<dd>
15701602
Positive <<angle>> values cause the image to be rotated to the right

css-images-4/Overview.bs

+2
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,8 @@ Overriding Image Resolutions: the 'image-resolution' property {#the-image-resolu
19551955
the explicitly specified resolution is used (if given),
19561956
else it defaults to ''1dppx''.
19571957

1958+
Note: [[css-images-3#url-metadata]] imposes some restrictions on what metadata can be used.
1959+
19581960
<dt><dfn>snap</dfn>
19591961
<dd>
19601962
If the "snap" keyword is provided,

0 commit comments

Comments
 (0)