Generic Datatype Reorganization Part V: Strings and URLs

Wed, 10 Aug 2011 23:45:29 +0000

author
Elika Etemad <fantasai.cvs@inkedblade.net>
date
Wed, 10 Aug 2011 23:45:29 +0000
changeset 3292
324c6ef7c447
parent 3291
8e1babb965e4
child 3293
c38cec6b116e

Generic Datatype Reorganization Part V: Strings and URLs
Also, create a cleaner split between this module and syntax.

css3-values/Overview.html file | annotate | diff | comparison | revisions
css3-values/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/css3-values/Overview.html	Wed Aug 10 23:44:59 2011 +0000
     1.2 +++ b/css3-values/Overview.html	Wed Aug 10 23:45:29 2011 +0000
     1.3 @@ -165,14 +165,12 @@
     1.4     <li><a href="#syntax-and-terminology"><span class=secno>3. </span>Syntax
     1.5      and terminology</a>
     1.6      <ul class=toc>
     1.7 -     <li><a href="#strings"><span class=secno>3.1. </span>Strings</a>
     1.8 -
     1.9 -     <li><a href="#functional-notation"><span class=secno>3.2.
    1.10 +     <li><a href="#functional-notation"><span class=secno>3.1.
    1.11        </span>Functional notation</a>
    1.12      </ul>
    1.13  
    1.14 -   <li><a href="#idents"><span class=secno>4. </span> Keywords and
    1.15 -    Identifiers</a>
    1.16 +   <li><a href="#textual-values"><span class=secno>4. </span> Textual Data
    1.17 +    Types</a>
    1.18      <ul class=toc>
    1.19       <li><a href="#keywords"><span class=secno>4.1. </span> Pre-defined
    1.20        Keywords</a>
    1.21 @@ -185,6 +183,12 @@
    1.22       <li><a href="#identifiers"><span class=secno>4.2. </span> User-defined
    1.23        Identifiers: the &lsquo;<code
    1.24        class=css>&lt;identifier&gt;</code>&rsquo; type</a>
    1.25 +
    1.26 +     <li><a href="#strings"><span class=secno>4.3. </span> Quoted Strings:
    1.27 +      the &lsquo;<code class=css>&lt;string&gt;</code>&rsquo; type</a>
    1.28 +
    1.29 +     <li><a href="#urls"><span class=secno>4.4. </span> Resource Locators:
    1.30 +      the &lsquo;<code class=css>&lt;url&gt;</code>&rsquo; type</a>
    1.31      </ul>
    1.32  
    1.33     <li><a href="#numeric-types"><span class=secno>5. </span> Numeric Data
    1.34 @@ -251,29 +255,24 @@
    1.35          class=property>max</code>&rsquo; functions</a>
    1.36        </ul>
    1.37  
    1.38 -     <li><a href="#ltstringgt"><span class=secno>7.4.
    1.39 -      </span>&lt;string&gt;</a>
    1.40 -
    1.41 -     <li><a href="#ltcolorgt"><span class=secno>7.5. </span>&lt;color&gt;</a>
    1.42 +     <li><a href="#ltcolorgt"><span class=secno>7.4. </span>&lt;color&gt;</a>
    1.43        
    1.44  
    1.45 -     <li><a href="#ltattrgt"><span class=secno>7.6. </span>&lt;attr&gt;</a>
    1.46 -
    1.47 -     <li><a href="#uris"><span class=secno>7.7. </span>&lt;url&gt;</a>
    1.48 -
    1.49 -     <li><a href="#ltimagegt"><span class=secno>7.8. </span>&lt;image&gt;</a>
    1.50 +     <li><a href="#ltattrgt"><span class=secno>7.5. </span>&lt;attr&gt;</a>
    1.51 +
    1.52 +     <li><a href="#ltimagegt"><span class=secno>7.6. </span>&lt;image&gt;</a>
    1.53        
    1.54  
    1.55 -     <li><a href="#ltfractiongt"><span class=secno>7.9.
    1.56 +     <li><a href="#ltfractiongt"><span class=secno>7.7.
    1.57        </span>&lt;fraction&gt;</a>
    1.58        <ul class=toc>
    1.59 -       <li><a href="#the-fr-unit"><span class=secno>7.9.1. </span>The
    1.60 +       <li><a href="#the-fr-unit"><span class=secno>7.7.1. </span>The
    1.61          &lsquo;<code class=property>fr</code>&rsquo; unit</a>
    1.62        </ul>
    1.63  
    1.64 -     <li><a href="#ltgridgt"><span class=secno>7.10. </span>&lt;grid&gt;</a>
    1.65 +     <li><a href="#ltgridgt"><span class=secno>7.8. </span>&lt;grid&gt;</a>
    1.66        <ul class=toc>
    1.67 -       <li><a href="#the-gr-unit"><span class=secno>7.10.1. </span>The
    1.68 +       <li><a href="#the-gr-unit"><span class=secno>7.8.1. </span>The
    1.69          &lsquo;<code class=property>gr</code>&rsquo; unit</a>
    1.70        </ul>
    1.71      </ul>
    1.72 @@ -544,46 +543,7 @@
    1.73    <p>The generic data types described in the next sections use some common
    1.74     syntactic building blocks and terms that are described in this section.
    1.75  
    1.76 -  <h3 id=strings><span class=secno>3.1. </span>Strings</h3>
    1.77 -
    1.78 -  <p>A <dfn id=string>string</dfn> is a sequence of characters enclosed by
    1.79 -   double quotes or single quotes. Double quotes cannot occur inside double
    1.80 -   quotes, unless escaped (as &lsquo;<code class=css>\"</code>&rsquo; or as
    1.81 -   &lsquo;<code class=css>\22</code>&rsquo;). Analogously for single quotes
    1.82 -   ("\&lsquo;<code class=css>" or "\27").<!--"--> </code>
    1.83 -
    1.84 -  <div class=example>
    1.85 -   <pre>
    1.86 -content: "this is a &rsquo;string'.";
    1.87 -content: "this is a \"string\".";
    1.88 -content: &lsquo;<code class=css>this is a "string".</code>&rsquo;;
    1.89 -content: &lsquo;<code class=css>this is a \</code>&rsquo;string\&lsquo;<code class=css>.</code>&rsquo;;
    1.90 -</pre>
    1.91 -  </div>
    1.92 -
    1.93 -  <p>A string cannot directly contain a <span class=index
    1.94 -   id=newline>newline</span>. To include a newline in a string, use the
    1.95 -   escape "\A" (hexadecimal A is the line feed character in Unicode (U+000A),
    1.96 -   but represents the generic notion of "newline" in CSS). See the <span
    1.97 -   class=property>&lsquo;<code class=property>content</code>&rsquo;</span>
    1.98 -   property for an example.
    1.99 -
   1.100 -  <p>It is possible to break strings over several lines, for aesthetic or
   1.101 -   other reasons, but in such a case the newline itself has to be escaped
   1.102 -   with a backslash (\). The newline is subsequently removed from the string.
   1.103 -   For instance, the following two selectors are exactly the same:
   1.104 -
   1.105 -  <div class=example>
   1.106 -   <p style="display:none">Example(s):</p>
   1.107 -
   1.108 -   <pre>
   1.109 -a[title="a not s\
   1.110 -o very long title"] {/*...*/}
   1.111 -a[title="a not so very long title"] {/*...*/}
   1.112 -</pre>
   1.113 -  </div>
   1.114 -
   1.115 -  <h3 id=functional-notation><span class=secno>3.2. </span>Functional
   1.116 +  <h3 id=functional-notation><span class=secno>3.1. </span>Functional
   1.117     notation</h3>
   1.118  
   1.119    <p>Some values use a <dfn id=functional-notation0>functional notation</dfn>
   1.120 @@ -604,7 +564,7 @@
   1.121     that is not a compound value is a <dfn id=simple-value>simple value</dfn>.
   1.122     
   1.123  
   1.124 -  <h2 id=idents><span class=secno>4. </span> Keywords and Identifiers</h2>
   1.125 +  <h2 id=textual-values><span class=secno>4. </span> Textual Data Types</h2>
   1.126  
   1.127    <p>An <dfn id=identifier>identifier</dfn> is a sequence of characters
   1.128     conforming to the <code>IDENT</code> token in the <a
   1.129 @@ -684,6 +644,115 @@
   1.130     class=css>EXAMPLE</code>&rsquo; are two different, unrelated user-defined
   1.131     identifiers).
   1.132  
   1.133 +  <h3 id=strings><span class=secno>4.3. </span> Quoted Strings: the &lsquo;<a
   1.134 +   href="#string-value"><code class=css>&lt;string&gt;</code></a>&rsquo; type</h3>
   1.135 +
   1.136 +  <p>Strings are denoted by <dfn
   1.137 +   id=string-value><code>&lt;string&gt;</code></dfn> and consist of a
   1.138 +   sequence of characters delimited by double quotes or single quotes. They
   1.139 +   correspond to the <code>STRING</code> token in the <a
   1.140 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>.
   1.141 +   <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
   1.142 +
   1.143 +  <div class=example>
   1.144 +   <p>Double quotes cannot occur inside double quotes, unless escaped (as
   1.145 +    &lsquo;<code class=css>\"</code>&rsquo; or as &lsquo;<code
   1.146 +    class=css>\22</code>&rsquo;). Analogously for single quotes
   1.147 +    ("\&lsquo;<code class=css>" or "\27"). </code>
   1.148 +
   1.149 +   <pre>
   1.150 +<!-- -->content: "this is a &rsquo;string'.";
   1.151 +<!-- -->content: "this is a \"string\".";
   1.152 +<!-- -->content: &lsquo;<code class=css>this is a "string".</code>&rsquo;;
   1.153 +<!-- -->content: &lsquo;<code class=css>this is a \</code>&rsquo;string\&lsquo;<code class=css>.</code>&rsquo;;</pre>
   1.154 +  </div>
   1.155 +
   1.156 +  <p>It is possible to break strings over several lines, for aesthetic or
   1.157 +   other reasons, but in such a case the newline itself has to be escaped
   1.158 +   with a backslash (\). The newline is subsequently removed from the string.
   1.159 +   For instance, the following two selectors are exactly the same:
   1.160 +
   1.161 +  <div class=example>
   1.162 +   <p style="display:none">Example(s):</p>
   1.163 +
   1.164 +   <pre>
   1.165 +<!-- -->a[title="a not s\
   1.166 +<!-- -->o very long title"] {/*...*/}
   1.167 +<!-- -->a[title="a not so very long title"] {/*...*/}</pre>
   1.168 +  </div>
   1.169 +
   1.170 +  <p>Since a string cannot directly represent a newline, to include a newline
   1.171 +   in a string, use the escape "\A". (Hexadecimal A is the line feed
   1.172 +   character in Unicode (U+000A), but represents the generic notion of
   1.173 +   "newline" in CSS.)
   1.174 +
   1.175 +  <h3 id=urls><span class=secno>4.4. </span> Resource Locators: the &lsquo;<a
   1.176 +   href="#url-value"><code class=css>&lt;url&gt;</code></a>&rsquo; type</h3>
   1.177 +
   1.178 +  <p>A <dfn id=url>URL</dfn> is a pointer to a resource and is a <a
   1.179 +   href="http://www.w3.org/TR/CSS21/syndata.html#uri">specially-parsed</a> <a
   1.180 +   href="#functional-notation">functional notation</a> denoted by <dfn
   1.181 +   id=url-value><code>&lt;url&gt;</code></dfn>. It corresponds to the
   1.182 +   <code>URI</code> token in the <a
   1.183 +   href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>.
   1.184 +   <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
   1.185 +
   1.186 +  <div class=example>
   1.187 +   <p>Below is an example of a URL being used as a background image:
   1.188 +
   1.189 +   <pre>body { background: url("http://www.example.com/pinkish.gif") }</pre>
   1.190 +
   1.191 +   <p>The same example can be written without quotes:
   1.192 +
   1.193 +   <pre>body { background: url(http://www.example.com/pinkish.gif) }</pre>
   1.194 +  </div>
   1.195 +
   1.196 +  <p class=note>Note that in some CSS syntactic contexts (as defined by that
   1.197 +   context), a URL can be represented as a <a
   1.198 +   href="#string-value"><code>&lt;string&gt;</code></a> rather than by <a
   1.199 +   href="#url-value"><code>&lt;URL&gt;</code></a>. An example of this is the
   1.200 +   <a href="http://www.w3.org/TR/CSS21/cascade.html#at-import">&lsquo;<code
   1.201 +   class=css>@import</code>&rsquo; rule</a>.
   1.202 +
   1.203 +  <p>Parentheses, whitespace characters, single quotes (&apos;) and double
   1.204 +   quotes (") appearing in a URL must be escaped with a backslash so that the
   1.205 +   resulting value is a valid <a href="#url"><code>URL</code></a> token, e.g.
   1.206 +   &lsquo;<code class=css>url(open\(parens)</code>&rsquo;, &lsquo;<code
   1.207 +   class=css>url(close\)parens)</code>&rsquo;. Depending on the type of URL,
   1.208 +   it might also be possible to write these characters as URI-escapes (where
   1.209 +   <code>(</code> = <code>%28</code>, <code>)</code> = <code>%29</code>,
   1.210 +   etc.) as described in <a href="#URI"
   1.211 +   rel=biblioentry>[URI]<!--{{URI}}--></a>. Alternatively a URL containing
   1.212 +   such characters may be represented as a quoted <a
   1.213 +   href="#string">string</a> within the &lsquo;<a href="#url"><code
   1.214 +   class=css>url()</code></a>&rsquo; notation.
   1.215 +
   1.216 +  <p>In order to create modular style sheets that are not dependent on the
   1.217 +   absolute location of a resource, authors should use relative URIs.
   1.218 +   Relative URIs (as defined in [[RFC3986]]) are resolved to full URIs using
   1.219 +   a base URI. RFC&nbsp;3986, section&nbsp;3, defines the normative algorithm
   1.220 +   for this process. For CSS style sheets, the base URI is that of the style
   1.221 +   sheet, not that of the source document.
   1.222 +
   1.223 +  <div class=example>
   1.224 +   <p>For example, suppose the following rule:
   1.225 +
   1.226 +   <pre>body { background: url("tile.png") }</pre>
   1.227 +
   1.228 +   <p>is located in a style sheet designated by the URL:</p>
   1.229 +
   1.230 +   <pre>http://www.example.org/style/basic.css</pre>
   1.231 +
   1.232 +   <p>The background of the source document's <code>&lt;body&gt;</code> will
   1.233 +    be tiled with whatever image is described by the resource designated by
   1.234 +    the URL:
   1.235 +
   1.236 +   <pre>http://www.example.org/style/tile.png</pre>
   1.237 +
   1.238 +   <p>The same image will be used regardless of the URL of the source
   1.239 +    document containing the <code>&lt;body&lt;</code>.
   1.240 +  </div>
   1.241 +
   1.242    <h2 id=numeric-types><span class=secno>5. </span> Numeric Data Types</h2>
   1.243  
   1.244    <h3 id=integers><span class=secno>5.1. </span> Integers: the &lsquo;<a
   1.245 @@ -1263,12 +1332,7 @@
   1.246       both auto and fixed layout tables are treated as if &lsquo;<code
   1.247       class=property>auto</code>&rsquo; had been specified.
   1.248  
   1.249 -    <h3 id=ltstringgt><span class=secno>7.4. </span>&lt;string&gt;</h3>
   1.250 -
   1.251 -    <p>Strings are denoted by <dfn id=ltstringgt0>&lt;string&gt;</dfn> in the
   1.252 -     value definitions.
   1.253 -
   1.254 -    <h3 id=ltcolorgt><span class=secno>7.5. </span>&lt;color&gt;</h3>
   1.255 +    <h3 id=ltcolorgt><span class=secno>7.4. </span>&lt;color&gt;</h3>
   1.256  
   1.257      <p><em>This section is not normative. The CSS3 Color module <a
   1.258       href="#CSS3COLOR" rel=biblioentry>[CSS3COLOR]<!--{{!CSS3COLOR}}--></a>
   1.259 @@ -1290,7 +1354,7 @@
   1.260  </pre>
   1.261      </div>
   1.262  
   1.263 -    <h3 id=ltattrgt><span class=secno>7.6. </span>&lt;attr&gt;</h3>
   1.264 +    <h3 id=ltattrgt><span class=secno>7.5. </span>&lt;attr&gt;</h3>
   1.265  
   1.266      <p class=issue>Describe the feature fully here, not just a delta from CSS
   1.267       21.
   1.268 @@ -1351,11 +1415,11 @@
   1.269       <dt>url
   1.270  
   1.271       <dd>The attribute value will be interpreted as the URI part of a
   1.272 -      &lsquo;<code class=css>url()</code>&rsquo; expression. The default is a
   1.273 -      UA-dependent URI defined to point to a non-existent document with a
   1.274 -      generic error condition. (i.e. it shouldn't be an FTP URI that causes a
   1.275 -      DNS error, or an HTTP URI that results in a 404, it should be a
   1.276 -      nondescript error condition.)
   1.277 +      &lsquo;<a href="#url"><code class=css>url()</code></a>&rsquo;
   1.278 +      expression. The default is a UA-dependent URI defined to point to a
   1.279 +      non-existent document with a generic error condition. (i.e. it
   1.280 +      shouldn't be an FTP URI that causes a DNS error, or an HTTP URI that
   1.281 +      results in a 404, it should be a nondescript error condition.)
   1.282  
   1.283       <dt>integer
   1.284  
   1.285 @@ -1390,8 +1454,8 @@
   1.286      <p class=issue>Should there also be a "keyword" type to, e.g., support
   1.287       &lsquo;<code class=css>float: attr(align)</code>&rsquo;</p>
   1.288  
   1.289 -    <p>If the &lt;type> is missing, &lsquo;<a href="#string"><code
   1.290 -     class=property>string</code></a>&rsquo; is implied.
   1.291 +    <p>If the &lt;type> is missing, &lsquo;<code
   1.292 +     class=property>string</code>&rsquo; is implied.
   1.293  
   1.294      <p class=issue>Ideally, it shouldn't be necessary to specify the type if
   1.295       it is obvious. For example, this should be valid: "<tt>background-image:
   1.296 @@ -1489,81 +1553,7 @@
   1.297       expect UAs to honor this rule for HTML documents?: <tt>P[COLOR] { color:
   1.298       attr(COLOR, color) }</tt>.
   1.299  
   1.300 -    <h3 id=uris><span class=secno>7.7. </span>&lt;url&gt;</h3>
   1.301 -
   1.302 -    <p><dfn id=urls title="Uniform Resource Locator (URL)|URL (Uniform
   1.303 -     Resource Locator)">URLs</dfn> (Uniform Resource Locators, see <a
   1.304 -     href="#RFC1738" rel=biblioentry>[RFC1738]<!--{{RFC1738}}--></a> and <a
   1.305 -     href="#RFC1808" rel=biblioentry>[RFC1808]<!--{{RFC1808}}--></a>) provide
   1.306 -     the address of a resource on the Web. An alternative and more general
   1.307 -     term is <dfn id=uris0 title="Resource Identifier (URI)|URI (Uniform
   1.308 -     Resource Identifier)">URIs</dfn> (Uniform Resource Identifiers, see
   1.309 -     [!URI]). This specification uses the term URI.</p>
   1.310 -
   1.311 -    <p>For historical reasons, the name of the URI function is "url". The URI
   1.312 -     function takes one URI as the argument. The URI may be quoted with
   1.313 -     single quote (&apos;) or double quote (&quot;) characters. If quoted,
   1.314 -     the two quote characters must be the same.
   1.315 -
   1.316 -    <div class=example>
   1.317 -     <p style="display:none">Example(s):</p>
   1.318 -
   1.319 -     <pre>
   1.320 -body { background: url("http://www.example.com/pinkish.gif") }
   1.321 -</pre>
   1.322 -    </div>
   1.323 -
   1.324 -    <div class=example>
   1.325 -     <p>An example without quotes:</p>
   1.326 -
   1.327 -     <pre>
   1.328 -li { list-style: url(http://www.example.com/redball.png) disc }
   1.329 -</pre>
   1.330 -    </div>
   1.331 -
   1.332 -    <p>Parentheses, commas, whitespace characters, single quotes
   1.333 -     (&lsquo;<code class=css>) and double quotes ("<!--"-->) appearing in a
   1.334 -     URI must be escaped with a backslash: </code>&rsquo;\(&lsquo;<code
   1.335 -     class=css>, </code>&rsquo;\)&lsquo;<code class=css>,
   1.336 -     </code>&rsquo;\,&lsquo;<code class=css>.</code></p>
   1.337 -
   1.338 -    <p>Depending on the type of URI, it might also be possible to write the
   1.339 -     above characters as URI-escapes (where "(" = %28, ")" = %29, etc.) as
   1.340 -     described in [!URI].</p>
   1.341 -
   1.342 -    <p>In order to create modular style sheets that are not dependent on the
   1.343 -     absolute location of a resource, authors should use relative URIs.
   1.344 -     Relative URIs (as defined in <a href="#RFC1808"
   1.345 -     rel=biblioentry>[RFC1808]<!--{{RFC1808}}--></a>) are resolved to full
   1.346 -     URIs using a base URI. RFC&nbsp;1808, section&nbsp;3, defines the
   1.347 -     normative algorithm for this process. For CSS style sheets, the base URI
   1.348 -     is that of the style sheet, not that of the source document.</p>
   1.349 -
   1.350 -    <div class=example>
   1.351 -     <p>For example, suppose the following rule:</p>
   1.352 -
   1.353 -     <pre>
   1.354 -body { background: url("yellow") }
   1.355 -</pre>
   1.356 -
   1.357 -     <p>is located in a style sheet designated by the URI:</p>
   1.358 -
   1.359 -     <pre>
   1.360 -http://www.example.org/style/basic.css
   1.361 -</pre>
   1.362 -
   1.363 -     <p>The background of the source document&rsquo;s BODY will be tiled with
   1.364 -      whatever image is described by the resource designated by the URI</p>
   1.365 -
   1.366 -     <pre>
   1.367 -http://www.example.org/style/yellow
   1.368 -</pre>
   1.369 -    </div>
   1.370 -
   1.371 -    <p>User agents may vary in how they handle URIs that designate
   1.372 -     unavailable or inapplicable resources.</p>
   1.373 -
   1.374 -    <h3 id=ltimagegt><span class=secno>7.8. </span>&lt;image&gt;</h3>
   1.375 +    <h3 id=ltimagegt><span class=secno>7.6. </span>&lt;image&gt;</h3>
   1.376  
   1.377      <p>TBD. <!--
   1.378  <h4>The 'counter' function</h4>
   1.379 @@ -1601,13 +1591,13 @@
   1.380  -->
   1.381       
   1.382  
   1.383 -    <h3 id=ltfractiongt><span class=secno>7.9. </span>&lt;fraction&gt;</h3>
   1.384 +    <h3 id=ltfractiongt><span class=secno>7.7. </span>&lt;fraction&gt;</h3>
   1.385  
   1.386      <p>Some properties accept a series of length values that, in sum, should
   1.387       add up to a certain length. To take up any remaining space, fractions
   1.388       can be used.
   1.389  
   1.390 -    <h4 id=the-fr-unit><span class=secno>7.9.1. </span>The &lsquo;<code
   1.391 +    <h4 id=the-fr-unit><span class=secno>7.7.1. </span>The &lsquo;<code
   1.392       class=property>fr</code>&rsquo; unit</h4>
   1.393  
   1.394      <p>The <dfn id=fr title="fr (unit)">fr</dfn> unit is used to distribute
   1.395 @@ -1626,7 +1616,7 @@
   1.396      <p>The &lsquo;<code class=css>fr</code>&rsquo; unit can only be used in
   1.397       combination with regular length units.
   1.398  
   1.399 -    <h3 id=ltgridgt><span class=secno>7.10. </span>&lt;grid&gt;</h3>
   1.400 +    <h3 id=ltgridgt><span class=secno>7.8. </span>&lt;grid&gt;</h3>
   1.401  
   1.402      <p>A grid is a set of invisible vertical and horizontal lines that can be
   1.403       used to align content. In CSS3, a grid lines can be established
   1.404 @@ -1636,7 +1626,7 @@
   1.405       distance between grid lines can be referred to by the &lsquo;<code
   1.406       class=css>gr</code>&rsquo; unit.
   1.407  
   1.408 -    <h4 id=the-gr-unit><span class=secno>7.10.1. </span>The &lsquo;<code
   1.409 +    <h4 id=the-gr-unit><span class=secno>7.8.1. </span>The &lsquo;<code
   1.410       class=property>gr</code>&rsquo; unit</h4>
   1.411  
   1.412      <p>The <dfn id=gr title="gr (unit)">gr</dfn> unit is used to position
   1.413 @@ -2069,22 +2059,13 @@
   1.414        </dd>
   1.415       <!---->
   1.416  
   1.417 -     <dt id=RFC1738>[RFC1738]
   1.418 -
   1.419 -     <dd>T. Berners-Lee; L. Masinter; M. McCahill. <a
   1.420 -      href="http://www.ietf.org/rfc/rfc1738.txt"><cite>Uniform Resource
   1.421 -      Locators (URL).</cite></a> December 1994. Internet RFC 1738. URL: <a
   1.422 -      href="http://www.ietf.org/rfc/rfc1738.txt">http://www.ietf.org/rfc/rfc1738.txt</a>
   1.423 -      </dd>
   1.424 -     <!---->
   1.425 -
   1.426 -     <dt id=RFC1808>[RFC1808]
   1.427 -
   1.428 -     <dd>R. Fielding. <a
   1.429 -      href="http://www.ietf.org/rfc/rfc1808.txt"><cite>Relative Uniform
   1.430 -      Resource Locators.</cite></a> June 1995. Internet RFC 1808. (Obsoleted
   1.431 -      by RFC 3986) URL: <a
   1.432 -      href="http://www.ietf.org/rfc/rfc1808.txt">http://www.ietf.org/rfc/rfc1808.txt</a>
   1.433 +     <dt id=URI>[URI]
   1.434 +
   1.435 +     <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a
   1.436 +      href="http://www.ietf.org/rfc/rfc3986.txt"><cite>Uniform Resource
   1.437 +      Identifiers (URI): generic syntax.</cite></a> January 2005. Internet
   1.438 +      RFC 3986. URL: <a
   1.439 +      href="http://www.ietf.org/rfc/rfc3986.txt">http://www.ietf.org/rfc/rfc3986.txt</a>
   1.440        </dd>
   1.441       <!---->
   1.442      </dl>
   1.443 @@ -2105,13 +2086,13 @@
   1.444  
   1.445       <li>ch, <a href="#ch-unit" title=ch><strong>6.1.1.</strong></a>
   1.446  
   1.447 -     <li>color, <a href="#color" title=color><strong>7.5.</strong></a>
   1.448 +     <li>color, <a href="#color" title=color><strong>7.4.</strong></a>
   1.449  
   1.450       <li>&lt;color&gt;, <a href="#ltcolorgt0"
   1.451 -      title="&lt;color&gt;"><strong>7.5.</strong></a>
   1.452 +      title="&lt;color&gt;"><strong>7.4.</strong></a>
   1.453  
   1.454       <li>compound value, <a href="#compound-value" title="compound
   1.455 -      value"><strong>3.2.</strong></a>
   1.456 +      value"><strong>3.1.</strong></a>
   1.457  
   1.458       <li>computed value, <a href="#computed-value" title="computed
   1.459        value"><strong>8.2.</strong></a>
   1.460 @@ -2129,15 +2110,15 @@
   1.461        title="&lt;frequency&gt;"><strong>7.3.</strong></a>
   1.462  
   1.463       <li>fr (unit), <a href="#fr" title="fr
   1.464 -      (unit)"><strong>7.9.1.</strong></a>
   1.465 +      (unit)"><strong>7.7.1.</strong></a>
   1.466  
   1.467       <li>functional notation, <a href="#functional-notation0"
   1.468 -      title="functional notation"><strong>3.2.</strong></a>
   1.469 +      title="functional notation"><strong>3.1.</strong></a>
   1.470  
   1.471       <li>grad, <a href="#grad" title=grad><strong>7.1.</strong></a>
   1.472  
   1.473       <li>gr (unit), <a href="#gr" title="gr
   1.474 -      (unit)"><strong>7.10.1.</strong></a>
   1.475 +      (unit)"><strong>7.8.1.</strong></a>
   1.476  
   1.477       <li>Hz, <a href="#hz" title=Hz><strong>7.3.</strong></a>
   1.478  
   1.479 @@ -2171,8 +2152,6 @@
   1.480  
   1.481       <li>ms, <a href="#ms" title=ms><strong>7.2.</strong></a>
   1.482  
   1.483 -     <li>newline, <a href="#newline" title=newline>3.1.</a>
   1.484 -
   1.485       <li>number, <a href="#number" title=number><strong>5.2.</strong></a>
   1.486  
   1.487       <li><a href="#number-value"><code>&lt;number&gt;</code></a>, <a
   1.488 @@ -2192,35 +2171,26 @@
   1.489  
   1.490       <li>rem, <a href="#rem-unit" title=rem><strong>6.1.1.</strong></a>
   1.491  
   1.492 -     <li>Resource Identifier (URI), <a href="#uris0" title="Resource
   1.493 -      Identifier (URI)"><strong>7.7.</strong></a>
   1.494 -
   1.495       <li>s, <a href="#s" title=s><strong>7.2.</strong></a>
   1.496  
   1.497       <li>simple value, <a href="#simple-value" title="simple
   1.498 -      value"><strong>3.2.</strong></a>
   1.499 +      value"><strong>3.1.</strong></a>
   1.500  
   1.501       <li>specified value, <a href="#specified-value" title="specified
   1.502        value"><strong>8.1.</strong></a>
   1.503  
   1.504 -     <li>string, <a href="#string" title=string><strong>3.1.</strong></a>
   1.505 -
   1.506 -     <li>&lt;string&gt;, <a href="#ltstringgt0"
   1.507 -      title="&lt;string&gt;"><strong>7.4.</strong></a>
   1.508 +     <li><a href="#string-value"><code>&lt;string&gt;</code></a>, <a
   1.509 +      href="#string-value" title="&lt;string&gt;"><strong>4.3.</strong></a>
   1.510  
   1.511       <li>&lt;time&gt;, <a href="#time-value"
   1.512        title="&lt;time&gt;"><strong>7.2.</strong></a>
   1.513  
   1.514       <li>turn, <a href="#turn" title=turn><strong>7.1.</strong></a>
   1.515  
   1.516 -     <li>Uniform Resource Locator (URL), <a href="#urls" title="Uniform
   1.517 -      Resource Locator (URL)"><strong>7.7.</strong></a>
   1.518 -
   1.519 -     <li>URI (Uniform Resource Identifier), <a href="#uris0" title="URI
   1.520 -      (Uniform Resource Identifier)"><strong>7.7.</strong></a>
   1.521 -
   1.522 -     <li>URL (Uniform Resource Locator), <a href="#urls" title="URL (Uniform
   1.523 -      Resource Locator)"><strong>7.7.</strong></a>
   1.524 +     <li>URL, <a href="#url" title=URL><strong>4.4.</strong></a>
   1.525 +
   1.526 +     <li><a href="#url-value"><code>&lt;url&gt;</code></a>, <a
   1.527 +      href="#url-value" title="&lt;url&gt;"><strong>4.4.</strong></a>
   1.528  
   1.529       <li>used value, <a href="#used-value" title="used
   1.530        value"><strong>8.3.</strong></a>
     2.1 --- a/css3-values/Overview.src.html	Wed Aug 10 23:44:59 2011 +0000
     2.2 +++ b/css3-values/Overview.src.html	Wed Aug 10 23:45:29 2011 +0000
     2.3 @@ -269,41 +269,6 @@
     2.4  common syntactic building blocks and terms that are described in this
     2.5  section.
     2.6  
     2.7 -<h3>Strings</h3>
     2.8 -
     2.9 -<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").<!--"-->
    2.10 -
    2.11 -<div class=example>
    2.12 -<pre>
    2.13 -content: "this is a 'string'.";
    2.14 -content: "this is a \"string\".";
    2.15 -content: 'this is a "string".';
    2.16 -content: 'this is a \'string\'.';
    2.17 -</pre>
    2.18 -</div>
    2.19 -
    2.20 -<p>A string cannot directly contain a <span class="index">newline</span>. To
    2.21 -include a newline in a string, use the escape "\A" (hexadecimal A is the line
    2.22 -feed character in Unicode (U+000A), but represents the generic notion of "newline" in
    2.23 -CSS). See the <span class="property">'content'</span> property for an
    2.24 -example.</p>
    2.25 -
    2.26 -<p>It is possible to break strings over several lines, for aesthetic or
    2.27 -other reasons, but in such a case the newline itself has to be escaped
    2.28 -with a backslash (\). The newline is subsequently removed from the
    2.29 -string. For instance, the following two selectors are exactly the
    2.30 -same:</p>
    2.31 -
    2.32 -<div class="example">
    2.33 -<p style="display:none">Example(s):</p>
    2.34 -<pre>
    2.35 -a[title="a not s\
    2.36 -o very long title"] {/*...*/}
    2.37 -a[title="a not so very long title"] {/*...*/}
    2.38 -</pre>
    2.39 -</div>
    2.40 -
    2.41 -
    2.42  <h3>Functional notation</h3>
    2.43  
    2.44  <p>Some values use a <dfn>functional notation</dfn> to type values and
    2.45 @@ -324,8 +289,8 @@
    2.46  is called a <dfn>compound value</dfn>. A value that is not a compound
    2.47  value is a <dfn>simple value</dfn>.
    2.48  
    2.49 -<h2 id="idents">
    2.50 -Keywords and Identifiers</h2>
    2.51 +<h2 id="textual-values">
    2.52 +Textual Data Types</h2>
    2.53  
    2.54  	<p>An <dfn>identifier</dfn> is a sequence of characters conforming to
    2.55  	the <code>IDENT</code> token in the
    2.56 @@ -391,6 +356,97 @@
    2.57    (e.g. ''example'' and ''EXAMPLE'' are two different, unrelated
    2.58    user-defined identifiers).
    2.59  
    2.60 +<h3 id="strings">
    2.61 +Quoted Strings: the ''&lt;string&gt;'' type</h3>
    2.62 +
    2.63 +	<p>Strings are denoted by <dfn id="string-value"><code>&lt;string&gt;</code></dfn>
    2.64 +	and consist of a sequence of characters delimited by double quotes or
    2.65 +	single quotes. They correspond to the <code>STRING</code> token in the
    2.66 +	<a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>.
    2.67 +	[[!CSS21]]
    2.68 +
    2.69 +	<div class=example>
    2.70 +		<p>Double quotes cannot occur inside double quotes, unless escaped
    2.71 +		(as '\"' or as '\22'). Analogously for single quotes ("\'" or "\27").
    2.72 +		<pre>
    2.73 +<!-- -->content: "this is a 'string'.";
    2.74 +<!-- -->content: "this is a \"string\".";
    2.75 +<!-- -->content: 'this is a "string".';
    2.76 +<!-- -->content: 'this is a \'string\'.';</pre>
    2.77 +	</div>
    2.78 +
    2.79 +	<p>It is possible to break strings over several lines, for aesthetic or
    2.80 +	other reasons, but in such a case the newline itself has to be escaped
    2.81 +	with a backslash (\). The newline is subsequently removed from the
    2.82 +	string. For instance, the following two selectors are exactly the
    2.83 +	same:</p>
    2.84 +
    2.85 +	<div class="example">
    2.86 +		<p style="display:none">Example(s):</p>
    2.87 +		<pre>
    2.88 +<!-- -->a[title="a not s\
    2.89 +<!-- -->o very long title"] {/*...*/}
    2.90 +<!-- -->a[title="a not so very long title"] {/*...*/}</pre>
    2.91 +	</div>
    2.92 +
    2.93 +	<p>Since a string cannot directly represent a newline, to include a
    2.94 +	newline in a string, use the escape "\A". (Hexadecimal A is the line
    2.95 +	feed character in Unicode (U+000A), but represents the generic notion
    2.96 +	of "newline" in CSS.)</p>
    2.97 +
    2.98 +<h3 id="urls">
    2.99 +Resource Locators: the ''&lt;url&gt;'' type</h3>
   2.100 +
   2.101 +	<p>A <dfn>URL</dfn> is a pointer to a resource and is a
   2.102 +	<a href="http://www.w3.org/TR/CSS21/syndata.html#uri">specially-parsed</a>
   2.103 +	<a href="#functional-notation">functional notation</a> denoted by
   2.104 +	<dfn id="url-value"><code>&lt;url&gt;</code></dfn>. It corresponds to the
   2.105 +	<code>URI</code> token in the
   2.106 +	<a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>.
   2.107 +	[[!CSS21]]
   2.108 +
   2.109 +	<div class="example">
   2.110 +		<p>Below is an example of a URL being used as a background image:
   2.111 +		<pre>body { background: url("http://www.example.com/pinkish.gif") }</pre>
   2.112 +		<p>The same example can be written without quotes:
   2.113 +		<pre>body { background: url(http://www.example.com/pinkish.gif) }</pre>
   2.114 +	</div>
   2.115 +
   2.116 +	<p class="note">Note that in some CSS syntactic contexts (as defined
   2.117 +	by that context), a URL can be represented as a <code>&lt;string&gt;</code>
   2.118 +	rather than by <code>&lt;URL&gt;</code>. An example of this is the
   2.119 +	<a href="http://www.w3.org/TR/CSS21/cascade.html#at-import">''@import'' rule</a>.
   2.120 +
   2.121 +	<p>Parentheses, whitespace characters, single quotes (&apos;) and
   2.122 +	double quotes (") appearing in a URL must be escaped with a backslash
   2.123 +	so that the resulting value is a valid <code>URL</code> token,
   2.124 +	e.g. 'url(open\(parens)', 'url(close\)parens)'.
   2.125 +	Depending on the type of URL, it might also be possible to write these
   2.126 +	characters as URI-escapes (where <code>(</code> = <code>%28</code>,
   2.127 +	<code>)</code> = <code>%29</code>, etc.) as described in [[URI]].
   2.128 +	Alternatively a URL containing such characters may be represented as
   2.129 +	a quoted <a href="#string">string</a> within the ''url()'' notation.
   2.130 +
   2.131 +	<p>In order to create modular style sheets that are not dependent on
   2.132 +	the absolute location of a resource, authors should use relative URIs.
   2.133 +	Relative URIs (as defined in [[RFC3986]]) are resolved to full URIs
   2.134 +	using a base URI. RFC&nbsp;3986, section&nbsp;3, defines the normative
   2.135 +	algorithm for this process. For CSS style sheets, the base URI is that
   2.136 +	of the style sheet, not that of the source document.
   2.137 +
   2.138 +	<div class="example">
   2.139 +		<p>For example, suppose the following rule:
   2.140 +		<pre>body { background: url("tile.png") }</pre>
   2.141 +		<p>is located in a style sheet designated by the URL:</p>
   2.142 +		<pre>http://www.example.org/style/basic.css</pre>
   2.143 +		<p>The background of the source document's <code>&lt;body&gt;</code>
   2.144 +		will be tiled with whatever image is described by the resource
   2.145 +		designated by the URL:
   2.146 +		<pre>http://www.example.org/style/tile.png</pre>
   2.147 +		<p>The same image will be used regardless of the URL of the source
   2.148 +		document containing the <code>&lt;body&lt;</code>.
   2.149 +	</div>
   2.150 +
   2.151  <h2 id="numeric-types">
   2.152  Numeric Data Types</h2>
   2.153  
   2.154 @@ -863,13 +919,6 @@
   2.155  
   2.156  
   2.157  
   2.158 -<h3>&lt;string&gt;</h3>
   2.159 -
   2.160 -<p>Strings are denoted by <dfn>&lt;string&gt;</dfn> in the value
   2.161 -definitions.
   2.162 -
   2.163 -
   2.164 -
   2.165  <h3>&lt;color&gt;</h3>
   2.166  
   2.167  <p><em>This section is not normative. The CSS3 Color module [[!CSS3COLOR]] defines the CSS3 color values.</em>
   2.168 @@ -1088,75 +1137,6 @@
   2.169  
   2.170  
   2.171  
   2.172 -<h3 id="uris">&lt;url&gt;</h3>
   2.173 -
   2.174 -<p><dfn title="Uniform Resource Locator (URL)|URL (Uniform Resource
   2.175 -Locator)">URLs</dfn> (Uniform Resource Locators, see [[RFC1738]] and
   2.176 -[[RFC1808]]) provide the address of a resource on the Web. An
   2.177 -alternative and more general term is <dfn title="Resource Identifier
   2.178 -(URI)|URI (Uniform Resource Identifier)">URIs</dfn> (Uniform Resource
   2.179 -Identifiers, see [!URI]). This specification uses the term URI.</p>
   2.180 -
   2.181 -<p>For historical reasons, the name of the URI function is "url". The
   2.182 -URI function takes one URI as the argument. The URI may be quoted with
   2.183 -single quote (&apos;) or double quote (&quot;) characters. If quoted, the two
   2.184 -quote characters must be the same.
   2.185 -
   2.186 -<div class="example">
   2.187 -<p style="display:none">Example(s):</p>
   2.188 -
   2.189 -<pre>
   2.190 -body { background: url("http://www.example.com/pinkish.gif") }
   2.191 -</pre>
   2.192 -</div>
   2.193 -
   2.194 -<div class="example">
   2.195 -<p>An example without quotes:</p>
   2.196 -
   2.197 -<pre>
   2.198 -li { list-style: url(http://www.example.com/redball.png) disc }
   2.199 -</pre>
   2.200 -
   2.201 -</div>
   2.202 -
   2.203 -<p>Parentheses, commas, whitespace characters, single quotes (') and double
   2.204 -quotes ("<!--"-->) appearing in a URI must be escaped with a backslash: '\(', '\)',
   2.205 -'\,'.</p>
   2.206 -
   2.207 -<p>Depending on the type of URI, it might also be possible to write the above
   2.208 -characters as URI-escapes (where "(" = %28, ")" = %29, etc.) as described in
   2.209 -[!URI].</p>
   2.210 -
   2.211 -<p>In order to create modular style sheets that are not dependent on the
   2.212 -absolute location of a resource, authors should use relative URIs. Relative URIs
   2.213 -(as defined in [[RFC1808]]) are resolved to full URIs using a base URI.
   2.214 -RFC&nbsp;1808, section&nbsp;3, defines the normative algorithm for this process. For
   2.215 -CSS style sheets, the base URI is that of the style sheet, not that of the
   2.216 -source document.</p>
   2.217 -
   2.218 -<div class="example">
   2.219 -<p>For example, suppose the following rule:</p>
   2.220 -
   2.221 -<pre>
   2.222 -body { background: url("yellow") }
   2.223 -</pre>
   2.224 -
   2.225 -<p>is located in a style sheet designated by the URI:</p>
   2.226 -
   2.227 -<pre>
   2.228 -http://www.example.org/style/basic.css
   2.229 -</pre>
   2.230 -
   2.231 -<p>The background of the source document's BODY will be tiled with whatever
   2.232 -image is described by the resource designated by the URI</p>
   2.233 -<pre>
   2.234 -http://www.example.org/style/yellow
   2.235 -</pre>
   2.236 -</div>
   2.237 -
   2.238 -<p>User agents may vary in how they handle URIs that designate unavailable or
   2.239 -inapplicable resources.</p>
   2.240 -
   2.241  <h3>&lt;image&gt;</h3>
   2.242  
   2.243  <p>TBD.

mercurial