- From: Elika Etemad via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 10 Aug 2011 23:45:31 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-values In directory hutz:/tmp/cvs-serv7642 Modified Files: Overview.html Overview.src.html Log Message: Generic Datatype Reorganization Part V: Strings and URLs Also, create a cleaner split between this module and syntax. Index: Overview.html =================================================================== RCS file: /sources/public/csswg/css3-values/Overview.html,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- Overview.html 10 Aug 2011 23:44:59 -0000 1.76 +++ Overview.html 10 Aug 2011 23:45:29 -0000 1.77 @@ -165,14 +165,12 @@ <li><a href="#syntax-and-terminology"><span class=secno>3. </span>Syntax and terminology</a> <ul class=toc> - <li><a href="#strings"><span class=secno>3.1. </span>Strings</a> - - <li><a href="#functional-notation"><span class=secno>3.2. + <li><a href="#functional-notation"><span class=secno>3.1. </span>Functional notation</a> </ul> - <li><a href="#idents"><span class=secno>4. </span> Keywords and - Identifiers</a> + <li><a href="#textual-values"><span class=secno>4. </span> Textual Data + Types</a> <ul class=toc> <li><a href="#keywords"><span class=secno>4.1. </span> Pre-defined Keywords</a> @@ -185,6 +183,12 @@ <li><a href="#identifiers"><span class=secno>4.2. </span> User-defined Identifiers: the ‘<code class=css><identifier></code>’ type</a> + + <li><a href="#strings"><span class=secno>4.3. </span> Quoted Strings: + the ‘<code class=css><string></code>’ type</a> + + <li><a href="#urls"><span class=secno>4.4. </span> Resource Locators: + the ‘<code class=css><url></code>’ type</a> </ul> <li><a href="#numeric-types"><span class=secno>5. </span> Numeric Data @@ -251,29 +255,24 @@ class=property>max</code>’ functions</a> </ul> - <li><a href="#ltstringgt"><span class=secno>7.4. - </span><string></a> - - <li><a href="#ltcolorgt"><span class=secno>7.5. </span><color></a> + <li><a href="#ltcolorgt"><span class=secno>7.4. </span><color></a> - <li><a href="#ltattrgt"><span class=secno>7.6. </span><attr></a> - - <li><a href="#uris"><span class=secno>7.7. </span><url></a> + <li><a href="#ltattrgt"><span class=secno>7.5. </span><attr></a> - <li><a href="#ltimagegt"><span class=secno>7.8. </span><image></a> + <li><a href="#ltimagegt"><span class=secno>7.6. </span><image></a> - <li><a href="#ltfractiongt"><span class=secno>7.9. + <li><a href="#ltfractiongt"><span class=secno>7.7. </span><fraction></a> <ul class=toc> - <li><a href="#the-fr-unit"><span class=secno>7.9.1. </span>The + <li><a href="#the-fr-unit"><span class=secno>7.7.1. </span>The ‘<code class=property>fr</code>’ unit</a> </ul> - <li><a href="#ltgridgt"><span class=secno>7.10. </span><grid></a> + <li><a href="#ltgridgt"><span class=secno>7.8. </span><grid></a> <ul class=toc> - <li><a href="#the-gr-unit"><span class=secno>7.10.1. </span>The + <li><a href="#the-gr-unit"><span class=secno>7.8.1. </span>The ‘<code class=property>gr</code>’ unit</a> </ul> </ul> @@ -544,46 +543,7 @@ <p>The generic data types described in the next sections use some common syntactic building blocks and terms that are described in this section. - <h3 id=strings><span class=secno>3.1. </span>Strings</h3> - - <p>A <dfn id=string>string</dfn> is a sequence of characters enclosed by - double quotes or single quotes. Double quotes cannot occur inside double - quotes, unless escaped (as ‘<code class=css>\"</code>’ or as - ‘<code class=css>\22</code>’). Analogously for single quotes - ("\‘<code class=css>" or "\27").<!--"--> </code> - - <div class=example> - <pre> -content: "this is a ’string'."; -content: "this is a \"string\"."; -content: ‘<code class=css>this is a "string".</code>’; -content: ‘<code class=css>this is a \</code>’string\‘<code class=css>.</code>’; -</pre> - </div> - - <p>A string cannot directly contain a <span class=index - id=newline>newline</span>. To include a newline in a string, use the - escape "\A" (hexadecimal A is the line feed character in Unicode (U+000A), - but represents the generic notion of "newline" in CSS). See the <span - class=property>‘<code class=property>content</code>’</span> - property for an example. - - <p>It is possible to break strings over several lines, for aesthetic or - other reasons, but in such a case the newline itself has to be escaped - with a backslash (\). The newline is subsequently removed from the string. - For instance, the following two selectors are exactly the same: - - <div class=example> - <p style="display:none">Example(s):</p> - - <pre> -a[title="a not s\ -o very long title"] {/*...*/} -a[title="a not so very long title"] {/*...*/} -</pre> - </div> - - <h3 id=functional-notation><span class=secno>3.2. </span>Functional + <h3 id=functional-notation><span class=secno>3.1. </span>Functional notation</h3> <p>Some values use a <dfn id=functional-notation0>functional notation</dfn> @@ -604,7 +564,7 @@ that is not a compound value is a <dfn id=simple-value>simple value</dfn>. - <h2 id=idents><span class=secno>4. </span> Keywords and Identifiers</h2> + <h2 id=textual-values><span class=secno>4. </span> Textual Data Types</h2> <p>An <dfn id=identifier>identifier</dfn> is a sequence of characters conforming to the <code>IDENT</code> token in the <a @@ -684,6 +644,115 @@ class=css>EXAMPLE</code>’ are two different, unrelated user-defined identifiers). + <h3 id=strings><span class=secno>4.3. </span> Quoted Strings: the ‘<a + href="#string-value"><code class=css><string></code></a>’ type</h3> + + <p>Strings are denoted by <dfn + id=string-value><code><string></code></dfn> and consist of a + sequence of characters delimited by double quotes or single quotes. They + correspond to the <code>STRING</code> token in the <a + href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>. + <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> + + <div class=example> + <p>Double quotes cannot occur inside double quotes, unless escaped (as + ‘<code class=css>\"</code>’ or as ‘<code + class=css>\22</code>’). Analogously for single quotes + ("\‘<code class=css>" or "\27"). </code> + + <pre> +<!-- -->content: "this is a ’string'."; +<!-- -->content: "this is a \"string\"."; +<!-- -->content: ‘<code class=css>this is a "string".</code>’; +<!-- -->content: ‘<code class=css>this is a \</code>’string\‘<code class=css>.</code>’;</pre> + </div> + + <p>It is possible to break strings over several lines, for aesthetic or + other reasons, but in such a case the newline itself has to be escaped + with a backslash (\). The newline is subsequently removed from the string. + For instance, the following two selectors are exactly the same: + + <div class=example> + <p style="display:none">Example(s):</p> + + <pre> +<!-- -->a[title="a not s\ +<!-- -->o very long title"] {/*...*/} +<!-- -->a[title="a not so very long title"] {/*...*/}</pre> + </div> + + <p>Since a string cannot directly represent a newline, to include a newline + in a string, use the escape "\A". (Hexadecimal A is the line feed + character in Unicode (U+000A), but represents the generic notion of + "newline" in CSS.) + + <h3 id=urls><span class=secno>4.4. </span> Resource Locators: the ‘<a + href="#url-value"><code class=css><url></code></a>’ type</h3> + + <p>A <dfn id=url>URL</dfn> is a pointer to a resource and is a <a + href="http://www.w3.org/TR/CSS21/syndata.html#uri">specially-parsed</a> <a + href="#functional-notation">functional notation</a> denoted by <dfn + id=url-value><code><url></code></dfn>. It corresponds to the + <code>URI</code> token in the <a + href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>. + <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> + + <div class=example> + <p>Below is an example of a URL being used as a background image: + + <pre>body { background: url("http://www.example.com/pinkish.gif") }</pre> + + <p>The same example can be written without quotes: + + <pre>body { background: url(http://www.example.com/pinkish.gif) }</pre> + </div> + + <p class=note>Note that in some CSS syntactic contexts (as defined by that + context), a URL can be represented as a <a + href="#string-value"><code><string></code></a> rather than by <a + href="#url-value"><code><URL></code></a>. An example of this is the + <a href="http://www.w3.org/TR/CSS21/cascade.html#at-import">‘<code + class=css>@import</code>’ rule</a>. + + <p>Parentheses, whitespace characters, single quotes (') and double + quotes (") appearing in a URL must be escaped with a backslash so that the + resulting value is a valid <a href="#url"><code>URL</code></a> token, e.g. + ‘<code class=css>url(open\(parens)</code>’, ‘<code + class=css>url(close\)parens)</code>’. Depending on the type of URL, + it might also be possible to write these characters as URI-escapes (where + <code>(</code> = <code>%28</code>, <code>)</code> = <code>%29</code>, + etc.) as described in <a href="#URI" + rel=biblioentry>[URI]<!--{{URI}}--></a>. Alternatively a URL containing + such characters may be represented as a quoted <a + href="#string">string</a> within the ‘<a href="#url"><code + class=css>url()</code></a>’ notation. + + <p>In order to create modular style sheets that are not dependent on the + absolute location of a resource, authors should use relative URIs. + Relative URIs (as defined in [[RFC3986]]) are resolved to full URIs using + a base URI. RFC 3986, section 3, defines the normative algorithm + for this process. For CSS style sheets, the base URI is that of the style + sheet, not that of the source document. + + <div class=example> + <p>For example, suppose the following rule: + + <pre>body { background: url("tile.png") }</pre> + + <p>is located in a style sheet designated by the URL:</p> + + <pre>http://www.example.org/style/basic.css</pre> + + <p>The background of the source document's <code><body></code> will + be tiled with whatever image is described by the resource designated by + the URL: + + <pre>http://www.example.org/style/tile.png</pre> + + <p>The same image will be used regardless of the URL of the source + document containing the <code><body<</code>. + </div> + <h2 id=numeric-types><span class=secno>5. </span> Numeric Data Types</h2> <h3 id=integers><span class=secno>5.1. </span> Integers: the ‘<a @@ -1263,12 +1332,7 @@ both auto and fixed layout tables are treated as if ‘<code class=property>auto</code>’ had been specified. - <h3 id=ltstringgt><span class=secno>7.4. </span><string></h3> - - <p>Strings are denoted by <dfn id=ltstringgt0><string></dfn> in the - value definitions. - - <h3 id=ltcolorgt><span class=secno>7.5. </span><color></h3> + <h3 id=ltcolorgt><span class=secno>7.4. </span><color></h3> <p><em>This section is not normative. The CSS3 Color module <a href="#CSS3COLOR" rel=biblioentry>[CSS3COLOR]<!--{{!CSS3COLOR}}--></a> @@ -1290,7 +1354,7 @@ </pre> </div> - <h3 id=ltattrgt><span class=secno>7.6. </span><attr></h3> + <h3 id=ltattrgt><span class=secno>7.5. </span><attr></h3> <p class=issue>Describe the feature fully here, not just a delta from CSS 21. @@ -1351,11 +1415,11 @@ <dt>url <dd>The attribute value will be interpreted as the URI part of a - ‘<code class=css>url()</code>’ expression. The default is a - UA-dependent URI defined to point to a non-existent document with a - generic error condition. (i.e. it shouldn't be an FTP URI that causes a - DNS error, or an HTTP URI that results in a 404, it should be a - nondescript error condition.) + ‘<a href="#url"><code class=css>url()</code></a>’ + expression. The default is a UA-dependent URI defined to point to a + non-existent document with a generic error condition. (i.e. it + shouldn't be an FTP URI that causes a DNS error, or an HTTP URI that + results in a 404, it should be a nondescript error condition.) <dt>integer @@ -1390,8 +1454,8 @@ <p class=issue>Should there also be a "keyword" type to, e.g., support ‘<code class=css>float: attr(align)</code>’</p> - <p>If the <type> is missing, ‘<a href="#string"><code - class=property>string</code></a>’ is implied. + <p>If the <type> is missing, ‘<code + class=property>string</code>’ is implied. <p class=issue>Ideally, it shouldn't be necessary to specify the type if it is obvious. For example, this should be valid: "<tt>background-image: @@ -1489,81 +1553,7 @@ expect UAs to honor this rule for HTML documents?: <tt>P[COLOR] { color: attr(COLOR, color) }</tt>. - <h3 id=uris><span class=secno>7.7. </span><url></h3> - - <p><dfn id=urls title="Uniform Resource Locator (URL)|URL (Uniform - Resource Locator)">URLs</dfn> (Uniform Resource Locators, see <a - href="#RFC1738" rel=biblioentry>[RFC1738]<!--{{RFC1738}}--></a> and <a - href="#RFC1808" rel=biblioentry>[RFC1808]<!--{{RFC1808}}--></a>) provide - the address of a resource on the Web. An alternative and more general - term is <dfn id=uris0 title="Resource Identifier (URI)|URI (Uniform - Resource Identifier)">URIs</dfn> (Uniform Resource Identifiers, see - [!URI]). This specification uses the term URI.</p> - - <p>For historical reasons, the name of the URI function is "url". The URI - function takes one URI as the argument. The URI may be quoted with - single quote (') or double quote (") characters. If quoted, - the two quote characters must be the same. - - <div class=example> - <p style="display:none">Example(s):</p> - - <pre> -body { background: url("http://www.example.com/pinkish.gif") } -</pre> - </div> - - <div class=example> - <p>An example without quotes:</p> - - <pre> -li { list-style: url(http://www.example.com/redball.png) disc } -</pre> - </div> - - <p>Parentheses, commas, whitespace characters, single quotes - (‘<code class=css>) and double quotes ("<!--"-->) appearing in a - URI must be escaped with a backslash: </code>’\(‘<code - class=css>, </code>’\)‘<code class=css>, - </code>’\,‘<code class=css>.</code></p> - - <p>Depending on the type of URI, it might also be possible to write the - above characters as URI-escapes (where "(" = %28, ")" = %29, etc.) as - described in [!URI].</p> - - <p>In order to create modular style sheets that are not dependent on the - absolute location of a resource, authors should use relative URIs. - Relative URIs (as defined in <a href="#RFC1808" - rel=biblioentry>[RFC1808]<!--{{RFC1808}}--></a>) are resolved to full - URIs using a base URI. RFC 1808, section 3, defines the - normative algorithm for this process. For CSS style sheets, the base URI - is that of the style sheet, not that of the source document.</p> - - <div class=example> - <p>For example, suppose the following rule:</p> - - <pre> -body { background: url("yellow") } -</pre> - - <p>is located in a style sheet designated by the URI:</p> - - <pre> -http://www.example.org/style/basic.css -</pre> - - <p>The background of the source document’s BODY will be tiled with - whatever image is described by the resource designated by the URI</p> - - <pre> -http://www.example.org/style/yellow -</pre> - </div> - - <p>User agents may vary in how they handle URIs that designate - unavailable or inapplicable resources.</p> - - <h3 id=ltimagegt><span class=secno>7.8. </span><image></h3> + <h3 id=ltimagegt><span class=secno>7.6. </span><image></h3> <p>TBD. <!-- <h4>The 'counter' function</h4> @@ -1601,13 +1591,13 @@ --> - <h3 id=ltfractiongt><span class=secno>7.9. </span><fraction></h3> + <h3 id=ltfractiongt><span class=secno>7.7. </span><fraction></h3> <p>Some properties accept a series of length values that, in sum, should add up to a certain length. To take up any remaining space, fractions can be used. - <h4 id=the-fr-unit><span class=secno>7.9.1. </span>The ‘<code + <h4 id=the-fr-unit><span class=secno>7.7.1. </span>The ‘<code class=property>fr</code>’ unit</h4> <p>The <dfn id=fr title="fr (unit)">fr</dfn> unit is used to distribute @@ -1626,7 +1616,7 @@ <p>The ‘<code class=css>fr</code>’ unit can only be used in combination with regular length units. - <h3 id=ltgridgt><span class=secno>7.10. </span><grid></h3> + <h3 id=ltgridgt><span class=secno>7.8. </span><grid></h3> <p>A grid is a set of invisible vertical and horizontal lines that can be used to align content. In CSS3, a grid lines can be established @@ -1636,7 +1626,7 @@ distance between grid lines can be referred to by the ‘<code class=css>gr</code>’ unit. - <h4 id=the-gr-unit><span class=secno>7.10.1. </span>The ‘<code + <h4 id=the-gr-unit><span class=secno>7.8.1. </span>The ‘<code class=property>gr</code>’ unit</h4> <p>The <dfn id=gr title="gr (unit)">gr</dfn> unit is used to position @@ -2069,22 +2059,13 @@ </dd> <!----> - <dt id=RFC1738>[RFC1738] - - <dd>T. Berners-Lee; L. Masinter; M. McCahill. <a - href="http://www.ietf.org/rfc/rfc1738.txt"><cite>Uniform Resource - Locators (URL).</cite></a> December 1994. Internet RFC 1738. URL: <a - href="http://www.ietf.org/rfc/rfc1738.txt">http://www.ietf.org/rfc/rfc1738.txt</a> - </dd> - <!----> - - <dt id=RFC1808>[RFC1808] + <dt id=URI>[URI] - <dd>R. Fielding. <a - href="http://www.ietf.org/rfc/rfc1808.txt"><cite>Relative Uniform - Resource Locators.</cite></a> June 1995. Internet RFC 1808. (Obsoleted - by RFC 3986) URL: <a - href="http://www.ietf.org/rfc/rfc1808.txt">http://www.ietf.org/rfc/rfc1808.txt</a> + <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a + href="http://www.ietf.org/rfc/rfc3986.txt"><cite>Uniform Resource + Identifiers (URI): generic syntax.</cite></a> January 2005. Internet + RFC 3986. URL: <a + href="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a> </dd> <!----> </dl> @@ -2105,13 +2086,13 @@ <li>ch, <a href="#ch-unit" title=ch><strong>6.1.1.</strong></a> - <li>color, <a href="#color" title=color><strong>7.5.</strong></a> + <li>color, <a href="#color" title=color><strong>7.4.</strong></a> <li><color>, <a href="#ltcolorgt0" - title="<color>"><strong>7.5.</strong></a> + title="<color>"><strong>7.4.</strong></a> <li>compound value, <a href="#compound-value" title="compound - value"><strong>3.2.</strong></a> + value"><strong>3.1.</strong></a> <li>computed value, <a href="#computed-value" title="computed value"><strong>8.2.</strong></a> @@ -2129,15 +2110,15 @@ title="<frequency>"><strong>7.3.</strong></a> <li>fr (unit), <a href="#fr" title="fr - (unit)"><strong>7.9.1.</strong></a> + (unit)"><strong>7.7.1.</strong></a> <li>functional notation, <a href="#functional-notation0" - title="functional notation"><strong>3.2.</strong></a> + title="functional notation"><strong>3.1.</strong></a> <li>grad, <a href="#grad" title=grad><strong>7.1.</strong></a> <li>gr (unit), <a href="#gr" title="gr - (unit)"><strong>7.10.1.</strong></a> + (unit)"><strong>7.8.1.</strong></a> <li>Hz, <a href="#hz" title=Hz><strong>7.3.</strong></a> @@ -2171,8 +2152,6 @@ <li>ms, <a href="#ms" title=ms><strong>7.2.</strong></a> - <li>newline, <a href="#newline" title=newline>3.1.</a> - <li>number, <a href="#number" title=number><strong>5.2.</strong></a> <li><a href="#number-value"><code><number></code></a>, <a @@ -2192,35 +2171,26 @@ <li>rem, <a href="#rem-unit" title=rem><strong>6.1.1.</strong></a> - <li>Resource Identifier (URI), <a href="#uris0" title="Resource - Identifier (URI)"><strong>7.7.</strong></a> - <li>s, <a href="#s" title=s><strong>7.2.</strong></a> <li>simple value, <a href="#simple-value" title="simple - value"><strong>3.2.</strong></a> + value"><strong>3.1.</strong></a> <li>specified value, <a href="#specified-value" title="specified value"><strong>8.1.</strong></a> - <li>string, <a href="#string" title=string><strong>3.1.</strong></a> - - <li><string>, <a href="#ltstringgt0" - title="<string>"><strong>7.4.</strong></a> + <li><a href="#string-value"><code><string></code></a>, <a + href="#string-value" title="<string>"><strong>4.3.</strong></a> <li><time>, <a href="#time-value" title="<time>"><strong>7.2.</strong></a> <li>turn, <a href="#turn" title=turn><strong>7.1.</strong></a> - <li>Uniform Resource Locator (URL), <a href="#urls" title="Uniform - Resource Locator (URL)"><strong>7.7.</strong></a> - - <li>URI (Uniform Resource Identifier), <a href="#uris0" title="URI - (Uniform Resource Identifier)"><strong>7.7.</strong></a> + <li>URL, <a href="#url" title=URL><strong>4.4.</strong></a> - <li>URL (Uniform Resource Locator), <a href="#urls" title="URL (Uniform - Resource Locator)"><strong>7.7.</strong></a> + <li><a href="#url-value"><code><url></code></a>, <a + href="#url-value" title="<url>"><strong>4.4.</strong></a> <li>used value, <a href="#used-value" title="used value"><strong>8.3.</strong></a> Index: Overview.src.html =================================================================== RCS file: /sources/public/csswg/css3-values/Overview.src.html,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- Overview.src.html 10 Aug 2011 23:44:59 -0000 1.79 +++ Overview.src.html 10 Aug 2011 23:45:29 -0000 1.80 @@ -269,41 +269,6 @@ common syntactic building blocks and terms that are described in this section. -<h3>Strings</h3> - -<p>A <dfn>string</dfn> is a sequence of characters enclosed by double quotes or single quotes. Double quotes cannot occur inside double quotes, unless escaped (as '\"' or as '\22'). Analogously for single quotes ("\'" or "\27").<!--"--> - -<div class=example> -<pre> -content: "this is a 'string'."; -content: "this is a \"string\"."; -content: 'this is a "string".'; -content: 'this is a \'string\'.'; -</pre> -</div> - -<p>A string cannot directly contain a <span class="index">newline</span>. To -include a newline in a string, use the escape "\A" (hexadecimal A is the line -feed character in Unicode (U+000A), but represents the generic notion of "newline" in -CSS). See the <span class="property">'content'</span> property for an -example.</p> - -<p>It is possible to break strings over several lines, for aesthetic or -other reasons, but in such a case the newline itself has to be escaped -with a backslash (\). The newline is subsequently removed from the -string. For instance, the following two selectors are exactly the -same:</p> - -<div class="example"> -<p style="display:none">Example(s):</p> -<pre> -a[title="a not s\ -o very long title"] {/*...*/} -a[title="a not so very long title"] {/*...*/} -</pre> -</div> - - <h3>Functional notation</h3> <p>Some values use a <dfn>functional notation</dfn> to type values and @@ -324,8 +289,8 @@ is called a <dfn>compound value</dfn>. A value that is not a compound value is a <dfn>simple value</dfn>. -<h2 id="idents"> -Keywords and Identifiers</h2> +<h2 id="textual-values"> +Textual Data Types</h2> <p>An <dfn>identifier</dfn> is a sequence of characters conforming to the <code>IDENT</code> token in the @@ -391,6 +356,97 @@ (e.g. ''example'' and ''EXAMPLE'' are two different, unrelated user-defined identifiers). +<h3 id="strings"> +Quoted Strings: the ''<string>'' type</h3> + + <p>Strings are denoted by <dfn id="string-value"><code><string></code></dfn> + and consist of a sequence of characters delimited by double quotes or + single quotes. They correspond to the <code>STRING</code> token in the + <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>. + [[!CSS21]] + + <div class=example> + <p>Double quotes cannot occur inside double quotes, unless escaped + (as '\"' or as '\22'). Analogously for single quotes ("\'" or "\27"). + <pre> +<!-- -->content: "this is a 'string'."; +<!-- -->content: "this is a \"string\"."; +<!-- -->content: 'this is a "string".'; +<!-- -->content: 'this is a \'string\'.';</pre> + </div> + + <p>It is possible to break strings over several lines, for aesthetic or + other reasons, but in such a case the newline itself has to be escaped + with a backslash (\). The newline is subsequently removed from the + string. For instance, the following two selectors are exactly the + same:</p> + + <div class="example"> + <p style="display:none">Example(s):</p> + <pre> +<!-- -->a[title="a not s\ +<!-- -->o very long title"] {/*...*/} +<!-- -->a[title="a not so very long title"] {/*...*/}</pre> + </div> + + <p>Since a string cannot directly represent a newline, to include a + newline in a string, use the escape "\A". (Hexadecimal A is the line + feed character in Unicode (U+000A), but represents the generic notion + of "newline" in CSS.)</p> + +<h3 id="urls"> +Resource Locators: the ''<url>'' type</h3> + + <p>A <dfn>URL</dfn> is a pointer to a resource and is a + <a href="http://www.w3.org/TR/CSS21/syndata.html#uri">specially-parsed</a> + <a href="#functional-notation">functional notation</a> denoted by + <dfn id="url-value"><code><url></code></dfn>. It corresponds to the + <code>URI</code> token in the + <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>. + [[!CSS21]] + + <div class="example"> + <p>Below is an example of a URL being used as a background image: + <pre>body { background: url("http://www.example.com/pinkish.gif") }</pre> + <p>The same example can be written without quotes: + <pre>body { background: url(http://www.example.com/pinkish.gif) }</pre> + </div> + + <p class="note">Note that in some CSS syntactic contexts (as defined + by that context), a URL can be represented as a <code><string></code> + rather than by <code><URL></code>. An example of this is the + <a href="http://www.w3.org/TR/CSS21/cascade.html#at-import">''@import'' rule</a>. + + <p>Parentheses, whitespace characters, single quotes (') and + double quotes (") appearing in a URL must be escaped with a backslash + so that the resulting value is a valid <code>URL</code> token, + e.g. 'url(open\(parens)', 'url(close\)parens)'. + Depending on the type of URL, it might also be possible to write these + characters as URI-escapes (where <code>(</code> = <code>%28</code>, + <code>)</code> = <code>%29</code>, etc.) as described in [[URI]]. + Alternatively a URL containing such characters may be represented as + a quoted <a href="#string">string</a> within the ''url()'' notation. + + <p>In order to create modular style sheets that are not dependent on + the absolute location of a resource, authors should use relative URIs. + Relative URIs (as defined in [[RFC3986]]) are resolved to full URIs + using a base URI. RFC 3986, section 3, defines the normative + algorithm for this process. For CSS style sheets, the base URI is that + of the style sheet, not that of the source document. + + <div class="example"> + <p>For example, suppose the following rule: + <pre>body { background: url("tile.png") }</pre> + <p>is located in a style sheet designated by the URL:</p> + <pre>http://www.example.org/style/basic.css</pre> + <p>The background of the source document's <code><body></code> + will be tiled with whatever image is described by the resource + designated by the URL: + <pre>http://www.example.org/style/tile.png</pre> + <p>The same image will be used regardless of the URL of the source + document containing the <code><body<</code>. + </div> + <h2 id="numeric-types"> Numeric Data Types</h2> @@ -863,13 +919,6 @@ -<h3><string></h3> - -<p>Strings are denoted by <dfn><string></dfn> in the value -definitions. - - - <h3><color></h3> <p><em>This section is not normative. The CSS3 Color module [[!CSS3COLOR]] defines the CSS3 color values.</em> @@ -1088,75 +1137,6 @@ -<h3 id="uris"><url></h3> - -<p><dfn title="Uniform Resource Locator (URL)|URL (Uniform Resource -Locator)">URLs</dfn> (Uniform Resource Locators, see [[RFC1738]] and -[[RFC1808]]) provide the address of a resource on the Web. An -alternative and more general term is <dfn title="Resource Identifier -(URI)|URI (Uniform Resource Identifier)">URIs</dfn> (Uniform Resource -Identifiers, see [!URI]). This specification uses the term URI.</p> - -<p>For historical reasons, the name of the URI function is "url". The -URI function takes one URI as the argument. The URI may be quoted with -single quote (') or double quote (") characters. If quoted, the two -quote characters must be the same. - -<div class="example"> -<p style="display:none">Example(s):</p> - -<pre> -body { background: url("http://www.example.com/pinkish.gif") } -</pre> -</div> - -<div class="example"> -<p>An example without quotes:</p> - -<pre> -li { list-style: url(http://www.example.com/redball.png) disc } -</pre> - -</div> - -<p>Parentheses, commas, whitespace characters, single quotes (') and double -quotes ("<!--"-->) appearing in a URI must be escaped with a backslash: '\(', '\)', -'\,'.</p> - -<p>Depending on the type of URI, it might also be possible to write the above -characters as URI-escapes (where "(" = %28, ")" = %29, etc.) as described in -[!URI].</p> - -<p>In order to create modular style sheets that are not dependent on the -absolute location of a resource, authors should use relative URIs. Relative URIs -(as defined in [[RFC1808]]) are resolved to full URIs using a base URI. -RFC 1808, section 3, defines the normative algorithm for this process. For -CSS style sheets, the base URI is that of the style sheet, not that of the -source document.</p> - -<div class="example"> -<p>For example, suppose the following rule:</p> - -<pre> -body { background: url("yellow") } -</pre> - -<p>is located in a style sheet designated by the URI:</p> - -<pre> -http://www.example.org/style/basic.css -</pre> - -<p>The background of the source document's BODY will be tiled with whatever -image is described by the resource designated by the URI</p> -<pre> -http://www.example.org/style/yellow -</pre> -</div> - -<p>User agents may vary in how they handle URIs that designate unavailable or -inapplicable resources.</p> - <h3><image></h3> <p>TBD.
Received on Wednesday, 10 August 2011 23:45:33 UTC