@@ -134,7 +134,7 @@ <h2 class="no-num no-toc" id=contents> Table of contents</h2>
134134 notation</ a >
135135
136136 < li > < a href ="#image-notation "> < span class =secno > 4.2. </ span > Image
137- Fallbacks : the ‘< code class =css > image()</ code > ’
137+ Annotations : the ‘< code class =css > image()</ code > ’
138138 notation</ a >
139139
140140 < li > < a href ="#element-reference "> < span class =secno > 4.3. </ span > Using
@@ -390,56 +390,73 @@ <h3 id=url><span class=secno>4.1. </span> Image References and Image
390390 </ div >
391391 <!-- ====================================================================== -->
392392
393- < h3 id =image-notation > < span class =secno > 4.2. </ span > Image Fallbacks : the
393+ < h3 id =image-notation > < span class =secno > 4.2. </ span > Image Annotations : the
394394 ‘< code class =css > image()</ code > ’ notation</ h3 >
395395
396396 < p > The ‘< code class =css > image()</ code > ’ notation allows an
397- author to specify multiple images, each one a fallback for the previous.
398- The UA must use only the first image that it can load and display. The
399- syntax for ‘< code class =css > image()</ code > ’ is defined as
397+ author to tag an image with a few types of useful processing instructions
398+ which can affect the rendering of the image. The author can specify the
399+ desired resolution the image should be rendered at, declare the
400+ directionality of an image so that it can be automatically be reversed if
401+ used in text with a different directionality, or declare fallback images
402+ to be used if the original image can't be decoded or is a type that the
403+ browser doesn't recognize.
400404
401405 < pre class =prod > < dfn id =ltimage-list > <image-list> </ dfn > =
402- image( [ <image-decl> , ]* [ <image-decl> | <color> | <element-reference > | < image-combination > | <gradient > ] )</ pre >
406+ image( [ <image-decl> , ]* [ <image-decl> | <color> | <image> ] )</ pre >
403407
404- < p > where <image-decl> is given by
408+ < p > where <image-decl> is given by:
405409
406410 < pre class =prod > < dfn id =ltimage-decl > <image-decl> </ dfn > =
407- [ <string> | <url-token> ] [ snap? && <resolution> ]?</ pre >
408-
409- < p > <url-token> is given as
410- < code > [!#$%&*-~]|{nonascii}|{escape}</ code > (i.e. the contents of
411- ‘< code class =css > url()</ code > ’) using the productions in the
412- < a href ="http://www.w3.org/TR/CSS21/syndata.html#tokenization "> CSS2.1
413- tokenization</ a > . < strong > The <url-token> must not contain unescaped
414- brackets, commas, white space characters, single quotes (') or double
415- quotes ("); if it does the ‘< code
416- class =css > image()</ code > ’ containing it is invalid.</ strong >
417-
418- < p > Each string or url-token represents the URI of an image. If a resolution
419- is given, then the image must be rendered at the specified resolution. If
420- the ‘< code class =css > snap</ code > ’ keyword is also specified,
421- and the image is a raster image, then the image must be rendered at the
422- resolution closest to the specified resolution that would result in no
423- pixel rounding. < span class =issue > I don't think "no pixel rounding" is the
424- right terminology here... basically we want to avoid blurry images.</ span >
425-
426- < p > The final argument may be a color or generated image, to serve as an
427- ultimate fallback if none of the preceeding < a
428- href ="#ltimage-decl "> < i > <image-decl> </ i > </ a > s can be used. If it is a
429- color, the < a href ="#ltimage-list "> < i > <image-list> </ i > </ a > must
430- represent a single-color image of that color with no < a
431- href ="#intrinsic-dimensions "> < i > intrinsic dimensions</ i > </ a > .
411+ [ <string> | <url> ] [ snap? && <resolution> ]? [ ltr | rtl ]?
412+
413+ </ pre >
414+
415+ < p > Each < a href ="#ltimage-decl "> < i > <image-decl> </ i > </ a > represents an
416+ external image. If a <string> is provided, it represents the same image
417+ that it would if the the string were given to the ‘< code
418+ class =css > url()</ code > ’ function.
419+
420+ < p > If a <resolution> is given, the image must be rendered at that
421+ resolution. < span class =note > Recall that the default resolution of images
422+ is ‘< code class =css > 1dppx</ code > ’, so that one image pixel
423+ corresponds to one CSS ‘< code class =css > px</ code > ’
424+ unit.</ span > If the ‘< code class =css > snap</ code > ’ keyword is
425+ also specified, and the specified resolution would make one image pixel
426+ larger than one device pixel, the image must be rendered at the specified
427+ resolution, rounded to the nearest value that would map one image pixel to
428+ an integer number of device pixels; if the specified resolution would make
429+ one image pixel smaller than one device pixel, the image must be rendered
430+ at the specified resolution, rounded to the nearest value that would map
431+ an integer number of image pixels to one device pixel.
432+
433+ < p > If a directional keyword (‘< code class =css > ltr</ code > ’ or
434+ ‘< code class =css > rtl</ code > ’) is given, the image itself gains
435+ that directionality. If the image is used in a property on an element with
436+ opposite directionality, is must be rendered horizontally flipped (in the
437+ image's own coordinate space).
438+
439+ < p > Multiple arguments can be given, in which case the function represents
440+ the first <image-decl> representing an image that the browser can
441+ successfully load and display. The final argument can be a <color> or
442+ other type of <image to serve as ultimate fallback if none of the
443+ preceding <image-decl> s can be used. If the final argument is a
444+ <color> , it represents a solid-color image of the given color with no
445+ < a href ="#intrinsic-dimensions "> < i > intrinsic dimensions</ i > </ a > .
432446
433447 < div class =example >
434- < p > For example, the rule below would tell the UA to load ‘< code
448+ < p > The rule below would tell the UA to load ‘< code
435449 class =css > wavy.svg</ code > ’ if it can; failing that to load
436450 ‘< code class =css > wavy.png</ code > ’ and display it at 150dpi;
437451 failing that to display ‘< code class =css > wavy.gif</ code > ’;
438452 and finally, if none of the images can be loaded and displayed, to use
439453 the color ‘< code class =css > blue</ code > ’ to create a
440- dimensionless background image.</ p >
454+ dimensionless background image. For example, the browser may not
455+ understand how to render SVG images, the PNG may be malformed, and the
456+ GIF may not exist on the server, so requesting it returns an HTML 404
457+ page instead of an image.</ p >
441458
442- < pre > background-image: image(wavy.svg, 'wavy.png' 150dpi, "wavy.gif", blue);</ pre >
459+ < pre > background-image: image(url( wavy.svg) , 'wavy.png' 150dpi, "wavy.gif", blue);</ pre >
443460
444461 < p > The ‘< code class =property > background-image</ code > ’ property
445462 specifies that dimensionless images must stretch to cover the entire
0 commit comments