Skip to content

Commit a144f56

Browse files
committed
Dang it, let's submit the actual generated copy.
1 parent b7f212e commit a144f56

1 file changed

Lines changed: 52 additions & 35 deletions

File tree

css3-images/Overview.html

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -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 &lsquo;<code class=css>image()</code>&rsquo;
137+
Annotations: the &lsquo;<code class=css>image()</code>&rsquo;
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
&lsquo;<code class=css>image()</code>&rsquo; notation</h3>
395395

396396
<p>The &lsquo;<code class=css>image()</code>&rsquo; 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 &lsquo;<code class=css>image()</code>&rsquo; 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>&lt;image-list></dfn> =
402-
image( [ &lt;image-decl&gt; , ]* [ &lt;image-decl&gt; | &lt;color> | &lt;element-reference> | &lt;image-combination> | &lt;gradient> ] )</pre>
406+
image( [ &lt;image-decl> , ]* [ &lt;image-decl> | &lt;color> | &lt;image> ] )</pre>
403407

404-
<p>where &lt;image-decl&gt; is given by
408+
<p>where &lt;image-decl> is given by:
405409

406410
<pre class=prod><dfn id=ltimage-decl>&lt;image-decl></dfn> =
407-
[ &lt;string&gt; | &lt;url-token&gt; ] [ snap? &amp;&amp; &lt;resolution&gt; ]?</pre>
408-
409-
<p>&lt;url-token&gt; is given as
410-
<code>[!#$%&amp;*-~]|{nonascii}|{escape}</code> (i.e. the contents of
411-
&lsquo;<code class=css>url()</code>&rsquo;) using the productions in the
412-
<a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">CSS2.1
413-
tokenization</a>. <strong>The &lt;url-token&gt; must not contain unescaped
414-
brackets, commas, white space characters, single quotes (') or double
415-
quotes (&quot;); if it does the &lsquo;<code
416-
class=css>image()</code>&rsquo; 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 &lsquo;<code class=css>snap</code>&rsquo; 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>&lt;image-decl></i></a>s can be used. If it is a
429-
color, the <a href="#ltimage-list"><i>&lt;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+
[ &lt;string> | &lt;url> ] [ snap? && &lt;resolution> ]? [ ltr | rtl ]?
412+
413+
</pre>
414+
415+
<p>Each <a href="#ltimage-decl"><i>&lt;image-decl></i></a> represents an
416+
external image. If a &lt;string> is provided, it represents the same image
417+
that it would if the the string were given to the &lsquo;<code
418+
class=css>url()</code>&rsquo; function.
419+
420+
<p>If a &lt;resolution> is given, the image must be rendered at that
421+
resolution. <span class=note>Recall that the default resolution of images
422+
is &lsquo;<code class=css>1dppx</code>&rsquo;, so that one image pixel
423+
corresponds to one CSS &lsquo;<code class=css>px</code>&rsquo;
424+
unit.</span> If the &lsquo;<code class=css>snap</code>&rsquo; 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 (&lsquo;<code class=css>ltr</code>&rsquo; or
434+
&lsquo;<code class=css>rtl</code>&rsquo;) 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 &lt;image-decl> representing an image that the browser can
441+
successfully load and display. The final argument can be a &lt;color> or
442+
other type of &lt;image to serve as ultimate fallback if none of the
443+
preceding &lt;image-decl>s can be used. If the final argument is a
444+
&lt;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 &lsquo;<code
448+
<p>The rule below would tell the UA to load &lsquo;<code
435449
class=css>wavy.svg</code>&rsquo; if it can; failing that to load
436450
&lsquo;<code class=css>wavy.png</code>&rsquo; and display it at 150dpi;
437451
failing that to display &lsquo;<code class=css>wavy.gif</code>&rsquo;;
438452
and finally, if none of the images can be loaded and displayed, to use
439453
the color &lsquo;<code class=css>blue</code>&rsquo; 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 &lsquo;<code class=property>background-image</code>&rsquo; property
445462
specifies that dimensionless images must stretch to cover the entire

0 commit comments

Comments
 (0)