Skip to content

Commit 8cdc183

Browse files
committed
Added serialization section for element-reference.
Fixed some references/definition links.
1 parent 46b2803 commit 8cdc183

2 files changed

Lines changed: 90 additions & 32 deletions

File tree

css3-images/Overview.html

Lines changed: 72 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ <h2 class="no-num no-toc" id=abstract>Abstract</h2>
6666
<p>This CSS Image Values and Replaced Content module has two parts: First,
6767
it defines the syntax for &lt;image&gt; values in CSS. &lt;image&gt;
6868
values can be a single URI to an image, a list of URIs denoting a series
69-
of fallbacks, or gradients. Second, it defines properties used to control
70-
the interaction of replaced content and the CSS layout algorithms. These
71-
properties can affect the used image resolution for bitmaps, the replaced
72-
object's orientation, and whether and how to preserve the object's aspect
73-
ratio.
69+
of fallbacks, a reference to an element in the document, or gradients.
70+
Second, it defines properties used to control the interaction of replaced
71+
content and the CSS layout algorithms. These properties can affect the
72+
used image resolution for bitmaps, the replaced object's orientation, and
73+
whether and how to preserve the object's aspect ratio.
7474

7575
<h2 class="no-num no-toc" id=status>Status of this document</h2>
7676
<!--begin-status-->
@@ -179,13 +179,18 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
179179
notation</a>
180180

181181
<li><a href="#serializing-image-notation"><span class=secno>7.3.
182-
</span>Serializing the &lsquo;<code class=css>image()</code>&rsquo;
182+
</span>Serializing the &lsquo;<code class=css>image()</code>&rsquo; /
183+
&lsquo;<code class=css>&lt;image-list></code>&rsquo; notation</a>
184+
185+
<li><a href="#serializing-element-notation"><span class=secno>7.4.
186+
</span>Serializing the &lsquo;<code class=css>element()</code>&rsquo; /
187+
&lsquo;<code class=css>&lt;element-reference></code>&rsquo;
183188
notation</a>
184189

185-
<li><a href="#serializing-gradients"><span class=secno>7.4.
190+
<li><a href="#serializing-gradients"><span class=secno>7.5.
186191
</span>Serializing Gradients</a>
187192

188-
<li><a href="#serializing-properties"><span class=secno>7.5.
193+
<li><a href="#serializing-properties"><span class=secno>7.6.
189194
</span>Serializing new properties</a>
190195
</ul>
191196

@@ -211,8 +216,8 @@ <h2 id=intro><span class=secno>1. </span>Introduction</h2>
211216
&lsquo;<code class=property>background-image</code>&rsquo; property,
212217
could only be given by a single URI value. This module introduces
213218
additional notations that allow a 2D image to be given as a list of URIs
214-
denoting fallbacks, as a slice of a larger image (sprite), and as a
215-
gradient.</p>
219+
denoting fallbacks, as a reference to an element in the document, and as
220+
a gradient.</p>
216221
</div>
217222

218223
<div>
@@ -351,12 +356,12 @@ <h3 id=image-notation><span class=secno>4.2. </span>Image Fallbacks: the
351356
The UA must use only the first image that it can load and display. The
352357
syntax for &lsquo;<code class=css>image()</code>&rsquo; is defined as
353358

354-
<pre class=prod><dfn id=ltimage-listgt>&lt;image-list&gt;</dfn> = <!--
359+
<pre class=prod><dfn id=ltimage-list>&lt;image-list></dfn> = <!--
355360
-->image( [ &lt;image-decl&gt; , ]* [ &lt;image-decl&gt; | &lt;color> | &lt;gradient> | &lt;element-reference> ] )</pre>
356361

357362
<p>where &lt;image-decl&gt; is given by
358363

359-
<pre class=prod><dfn id=ltimage-declgt>&lt;image-decl&gt;</dfn> = <!--
364+
<pre class=prod><dfn id=ltimage-decl>&lt;image-decl></dfn> = <!--
360365
-->[ &lt;string&gt; | &lt;url-token&gt; ] [ snap? &amp;&amp; &lt;resolution&gt; ]?</pre>
361366

362367
<p>&lt;url-token&gt; is given as
@@ -433,8 +438,10 @@ <h3 id=element-reference><span class=secno>4.3. </span>Using Elements as
433438
<pre
434439
class=prod><dfn id=ltelement-reference>&lt;element-reference></dfn> = element( [&lt;id-selector> | &lt;identifier> ] )</pre>
435440

436-
<p>where &lt;id-selector> is an ID selector [[SELECTORS3]], and
437-
&lt;identifier> is an identifer [[CSS3VALUES]].</p>
441+
<p>where &lt;id-selector> is an ID selector <a href="#SELECT"
442+
rel=biblioentry>[SELECT]<!--{{!SELECT}}--></a>, and &lt;identifier> is
443+
an identifer <a href="#CSS3VAL"
444+
rel=biblioentry>[CSS3VAL]<!--{{!CSS3VAL}}--></a>.</p>
438445

439446
<p>If the argument to the &lsquo;<code class=css>element()</code>&rsquo;
440447
function is an ID selector, the function references the element matched
@@ -1585,24 +1592,26 @@ <h3 id=serializing-url-notation><span class=secno>7.2.
15851592

15861593
<div>
15871594
<h3 id=serializing-image-notation><span class=secno>7.3.
1588-
</span>Serializing the &lsquo;<code class=css>image()</code>&rsquo;
1589-
notation</h3>
1595+
</span>Serializing the &lsquo;<code class=css>image()</code>&rsquo; /
1596+
&lsquo;<a href="#ltimage-list"><code
1597+
class=css>&lt;image-list></code></a>&rsquo; notation</h3>
15901598

1591-
<p>To serialize an image() function:</p>
1599+
<p>To serialize an &lsquo;<a href="#ltimage-list"><code
1600+
class=css>&lt;image-list></code></a>&rsquo;:</p>
15921601

15931602
<ol>
15941603
<li>Append "image(" to s.
15951604

15961605
<li>For each argument, serialize the argument as an &lt;image-decl>,
1597-
&lt;color>, or &lt;gradient> as appropriate, and append it to s.
1598-
Then, if it is not the final argument, append a comma and a space ",
1599-
" to s.
1606+
&lt;color>, &lt;element-reference>, or &lt;gradient> as appropriate,
1607+
and append it to s. Then, if it is not the final argument, append a
1608+
comma and a space ", " to s.
16001609

16011610
<li>Append a close parenthesis ")" to s.
16021611
</ol>
16031612

1604-
<p>To serialize an &lsquo;<code
1605-
class=css>&lt;image-decl></code>&rsquo;:</p>
1613+
<p>To serialize an &lsquo;<a href="#ltimage-decl"><code
1614+
class=css>&lt;image-decl></code></a>&rsquo;:</p>
16061615

16071616
<ol>
16081617
<li>Serialize the first part of the value (the &lt;string> or
@@ -1617,7 +1626,26 @@ <h3 id=serializing-image-notation><span class=secno>7.3.
16171626
</div>
16181627

16191628
<div>
1620-
<h3 id=serializing-gradients><span class=secno>7.4. </span>Serializing
1629+
<h3 id=serializing-element-notation><span class=secno>7.4.
1630+
</span>Serializing the &lsquo;<code class=css>element()</code>&rsquo;
1631+
/ &lsquo;<a href="#ltelement-reference"><code
1632+
class=css>&lt;element-reference></code></a>&rsquo; notation</h3>
1633+
1634+
<p>To serialize an &lsquo;<a href="#ltelement-reference"><code
1635+
class=css>&lt;element-reference></code></a>&rsquo;:</p>
1636+
1637+
<ol>
1638+
<li>Append "element(" to s.
1639+
1640+
<li>Serialize the argument as a selector or identifier, as
1641+
appropriate, and append it to s.
1642+
1643+
<li>Append a close parenthesis ")" to s.
1644+
</ol>
1645+
</div>
1646+
1647+
<div>
1648+
<h3 id=serializing-gradients><span class=secno>7.5. </span>Serializing
16211649
Gradients</h3>
16221650

16231651
<p>To serialize a &lsquo;<a href="#ltlinear-gradient"><code
@@ -1714,7 +1742,7 @@ <h3 id=serializing-gradients><span class=secno>7.4. </span>Serializing
17141742
</div>
17151743

17161744
<div>
1717-
<h3 id=serializing-properties><span class=secno>7.5.
1745+
<h3 id=serializing-properties><span class=secno>7.6.
17181746
</span>Serializing new properties</h3>
17191747

17201748
<p>To serialize the &lsquo;<a href="#image-resolution1"><code
@@ -1777,6 +1805,16 @@ <h3 class=no-num id=normative-references>Normative references</h3>
17771805
</dd>
17781806
<!---->
17791807

1808+
<dt id=CSS3VAL>[CSS3VAL]
1809+
1810+
<dd>Chris Lilley; H&#229;kon Wium Lie. <a
1811+
href="http://www.w3.org/TR/2006/WD-css3-values-20060919"><cite>CSS3
1812+
Values and Units.</cite></a> 19 September 2006. W3C Working Draft.
1813+
(Work in progress.) URL: <a
1814+
href="http://www.w3.org/TR/2006/WD-css3-values-20060919">http://www.w3.org/TR/2006/WD-css3-values-20060919</a>
1815+
</dd>
1816+
<!---->
1817+
17801818
<dt id=RFC2119>[RFC2119]
17811819

17821820
<dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
@@ -1785,6 +1823,16 @@ <h3 class=no-num id=normative-references>Normative references</h3>
17851823
href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
17861824
</dd>
17871825
<!---->
1826+
1827+
<dt id=SELECT>[SELECT]
1828+
1829+
<dd>Tantek &#199;elik; et al. <a
1830+
href="http://www.w3.org/TR/2009/PR-css3-selectors-20091215"><cite>Selectors
1831+
Level 3.</cite></a> 15 December 2009. W3C Proposed Recommendation.
1832+
(Work in progress.) URL: <a
1833+
href="http://www.w3.org/TR/2009/PR-css3-selectors-20091215">http://www.w3.org/TR/2009/PR-css3-selectors-20091215</a>
1834+
</dd>
1835+
<!---->
17881836
</dl>
17891837
<!--end-normative-->
17901838
<h3 class=no-num id=informative-references>Informative references</h3>

css3-images/Overview.src.html

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h2 class="no-num no-toc" id="abstract">Abstract</h2>
4242
<p>This CSS Image Values and Replaced Content module has two parts:
4343
First, it defines the syntax for &lt;image&gt; values in CSS.
4444
&lt;image&gt; values can be a single URI to an image, a list of
45-
URIs denoting a series of fallbacks, or
45+
URIs denoting a series of fallbacks, a reference to an element in the document, or
4646
gradients. Second, it defines properties used to control the
4747
interaction of replaced content and the CSS layout algorithms.
4848
These properties can affect the used image resolution for bitmaps,
@@ -64,7 +64,7 @@ <h2 id="intro">Introduction</h2>
6464
'background-image' property, could only be given by a single URI
6565
value. This module introduces additional notations that allow a
6666
2D image to be given as a list of URIs denoting fallbacks, as a
67-
slice of a larger image (sprite), and as a gradient.</p>
67+
reference to an element in the document, and as a gradient.</p>
6868
</div>
6969

7070
<div>
@@ -175,12 +175,12 @@ <h3 id="image-notation">Image Fallbacks: the ''image()'' notation</h3>
175175
each one a fallback for the previous. The UA must use only the first image
176176
that it can load and display. The syntax for ''image()'' is defined as
177177

178-
<pre class="prod"><dfn>&lt;image-list&gt;</dfn> = <!--
178+
<pre class="prod"><dfn>&lt;image-list></dfn> = <!--
179179
-->image( [ &lt;image-decl&gt; , ]* [ &lt;image-decl&gt; | &lt;color> | &lt;gradient> | &lt;element-reference> ] )</pre>
180180

181181
<p>where &lt;image-decl&gt; is given by
182182

183-
<pre class="prod"><dfn>&lt;image-decl&gt;</dfn> = <!--
183+
<pre class="prod"><dfn>&lt;image-decl></dfn> = <!--
184184
-->[ &lt;string&gt; | &lt;url-token&gt; ] [ snap? &amp;&amp; &lt;resolution&gt; ]?</pre>
185185

186186
<p>&lt;url-token&gt; is given as <code>[!#$%&amp;*-~]|{nonascii}|{escape}</code>
@@ -232,7 +232,7 @@ <h3 id="image-notation">Image Fallbacks: the ''image()'' notation</h3>
232232
<h3 id=element-reference>Using Elements as Images: The ''element()'' notation</h3>
233233
<p>The ''element()'' function allows an author to reference an element in the document that should be used as an image. As the referenced element changes, for example, by the user typing into a &lt;textarea> element or a script drawing into a &lt;canvas> element in HTML, the image produced by the ''element()'' function stays in sync, allowing dynamic effects such as script-animated background images or previews of the next slide in a slideshow. The syntax for ''element()'' is defined as:</p>
234234
<pre class=prod><dfn>&lt;element-reference></dfn> = element( [&lt;id-selector> | &lt;identifier> ] )</pre>
235-
<p>where &lt;id-selector> is an ID selector [[SELECTORS3]], and &lt;identifier> is an identifer [[CSS3VALUES]].</p>
235+
<p>where &lt;id-selector> is an ID selector [[!SELECT]], and &lt;identifier> is an identifer [[!CSS3VAL]].</p>
236236
<p>If the argument to the ''element()'' function is an ID selector, the function references the element matched by the selector. If it's an identifier, the function references the element who's <dfn>CSS element reference identifier</dfn> is the identifier. (CSS does not define how an element acquires a ''CSS element reference identifier''; that is determined by the host language.) If no element in the document matches the selector, or no element has the identifier as its ''CSS element reference identifier'', the function represents a fully transparent image with no intrinsic dimensions, equivalent to <code>image(transparent)</code>. Otherwise, the function represents an image with width and height equal to the width and height of the referenced element, with an appearance exactly equivalent to that of the referenced element. Whether or not the referenced element is currently being rendered on-screen, for media types where this is relevant, must not affect the appearance of the image represented by the function; the image must always be equivalent to how the element would appear when rendered on-screen. If the document changes so that which element is matched, or whether an element is matched at all, changes, the image represented by the function must change accordingly.</p>
237237
<p>If the argument passed to ''element()'' isn't an ID selector or an ident, it is a syntax error.</p>
238238
<div class=example>
@@ -803,11 +803,11 @@ <h3 id=serializing-url-notation>Serializing the ''url()'' notation</h3>
803803
</div>
804804

805805
<div>
806-
<h3 id=serializing-image-notation>Serializing the ''image()'' notation</h3>
807-
<p>To serialize an image() function:</p>
806+
<h3 id=serializing-image-notation>Serializing the ''image()'' / ''&lt;image-list>'' notation</h3>
807+
<p>To serialize an ''&lt;image-list>'':</p>
808808
<ol>
809809
<li>Append "image(" to s.</li>
810-
<li>For each argument, serialize the argument as an &lt;image-decl>, &lt;color>, or &lt;gradient> as appropriate, and append it to s. Then, if it is not the final argument, append a comma and a space ", " to s.</li>
810+
<li>For each argument, serialize the argument as an &lt;image-decl>, &lt;color>, &lt;element-reference>, or &lt;gradient> as appropriate, and append it to s. Then, if it is not the final argument, append a comma and a space ", " to s.</li>
811811
<li>Append a close parenthesis ")" to s.</li>
812812
</ol>
813813
<p>To serialize an ''&lt;image-decl>'':</p>
@@ -818,6 +818,16 @@ <h3 id=serializing-image-notation>Serializing the ''image()'' notation</h3>
818818
</ol>
819819
</div>
820820

821+
<div>
822+
<h3 id=serializing-element-notation>Serializing the ''element()'' / ''&lt;element-reference>'' notation</h3>
823+
<p>To serialize an ''&lt;element-reference>'':</p>
824+
<ol>
825+
<li>Append "element(" to s.</li>
826+
<li>Serialize the argument as a selector or identifier, as appropriate, and append it to s.</li>
827+
<li>Append a close parenthesis ")" to s.</li>
828+
</ol>
829+
</div>
830+
821831
<div>
822832
<h3 id="serializing-gradients">Serializing Gradients</h3>
823833
<p>To serialize a ''&lt;linear-gradient>'':</p>

0 commit comments

Comments
 (0)