8000 [css-values] Per WG resolution, attr(foo string) and attr(foo url) do… · w3c/csswg-drafts@c1b5634 · GitHub
Skip to content

Commit c1b5634

Browse files
committed
[css-values] Per WG resolution, attr(foo string) and attr(foo url) don't reparse the attribute; they just take the attribute value literally as a string.
1 parent 78f62a3 commit c1b5634

2 files changed

Lines changed: 47 additions & 35 deletions

File tree

css-values/Overview.html

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
77
<title>CSS Values and Units Module Level 3</title>
88

9-
<link href="http://purl.org/dc/terms/" rel=schema.dc>
9+
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
1010
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
11-
rel=dc.rights>
12-
<meta content="CSS Values and Units Module Level 3" name=dc.title>
13-
<meta content=text name=dc.type>
14-
<meta content=2013-04-04 name=dc.date>
15-
<meta content="Håkon Wium Lie" name=dc.creator>
16-
<meta content="Tab Atkins" name=dc.creator>
17-
<meta content="Elika J. Etemad" name=dc.creator>
18-
<meta content=W3C name=dc.publisher>
19-
<meta content="http://www.w3.org/TR/2013/CR-css3-values-20130404/"
20-
name=dc.identifier>
11+
rel=dcterms.rights>
12+
<meta content="CSS Values and Units Module Level 3" name=dcterms.title>
13+
<meta content=text name=dcterms.type>
14+
<meta content=2013-06-21 name=dcterms.date>
15+
<meta content="Håkon Wium Lie" name=dcterms.creator>
16+
<meta content="Tab Atkins" name=dcterms.creator>
17+
<meta content="Elika J. Etemad" name=dcterms.creator>
18+
<meta content=W3C name=dcterms.publisher>
19+
<meta content="http://www.w3.org/TR/2013/CR-css3-values-20130621/"
20+
name=dcterms.identifier>
2121
<style type="text/css">
2222
code, small { white-space: nowrap }
2323
.say { color: gray; }
@@ -42,14 +42,14 @@
4242
<h1 class=p-name>CSS Values and Units Module Level 3</h1>
4343

4444
<h2 class="no-num no-toc" id=longstatus-date>W3C Candidate Recommendation
45-
<span class=dt-updated><span class=value title=20130404>4 April
45+
<span class=dt-updated><span class=value title=20130621>21 June
4646
2013</span></span></h2>
4747

4848
<dl>
4949
<dt>This version:
5050

5151
<dd><a class=u-url
52-
href="http://www.w3.org/TR/2013/CR-css3-values-20130404/">http://www.w3.org/TR/2013/CR-css3-values-20130404/</a>
52+
href="http://www.w3.org/TR/2013/CR-css3-values-20130621/">http://www.w3.org/TR/2013/CR-css3-values-20130621/</a>
5353

5454
<dt>Latest version:
5555

@@ -418,7 +418,7 @@ <h3 id=component-types><span class=secno>2.1. </span> Component value types</h3>
418418
case, the type name is the property name (complete with quotes) between
419419
the brackets. Such a type does <em>not</em> include <a
420420
href="#common-keywords">CSS-wide keywords</a> such as ‘<a
421-
href="#lsquoinheritrsquo"><code class=css>inherit</code></a>’.
421+
href="#inherit"><code class=css>inherit</code></a>’.
422422

423423
<li>non-terminals that do not share the same name as a property. In this
424424
case, the non-terminal name appears between ‘<code
@@ -435,8 +435,8 @@ <h3 id=component-types><span class=secno>2.1. </span> Component value types</h3>
435435
comma (,) as literals. These represent their corresponding tokens.
436436

437437
<p>All CSS properties also accept the <a href="#common-keywords">CSS-wide
438-
keyword values</a><a href="#lsquoinheritrsquo"><code
439-
class=css>inherit</code></a>’ and ‘<a href="#lsquoinitialrsquo"><code
438+
keyword values</a><a href="#inherit"><code
439+
class=css>inherit</code></a>’ and ‘<a href="#initial"><code
440440
class=css>initial</code></a>’ as the sole component of their property
441441
value. For readability these are not listed explicitly in the property
442442
value syntax definitions. For example, the full value definition of <a
@@ -652,22 +652,22 @@ <h3 id=keywords><span class=secno>3.1. </span> Pre-defined Keywords</h3>
652652
</div>
653653

654654
<h4 id=common-keywords><span class=secno>3.1.1. </span> CSS-wide keywords:
655-
<a href="#lsquoinitialrsquo"><code class=css>initial</code></a>’ and
656-
<a href="#lsquoinheritrsquo"><code class=css>inherit</code></a></h4>
655+
<a href="#initial"><code class=css>initial</code></a>’ and<a
656+
href="#inherit"><code class=css>inherit</code></a></h4>
657657

658658
<p>As defined <a href="#component-types">above</a>, all properties accept
659-
the ‘<a href="#lsquoinitialrsquo"><code class=css>initial</code></a>
660-
and ‘<a href="#lsquoinheritrsquo"><code class=css>inherit</code></a>
661-
keywords, which represent value computations common to all CSS properties.
659+
the ‘<a href="#initial"><code class=css>initial</code></a> and ‘<a
660+
href="#inherit"><code class=css>inherit</code></a> keywords, which
661+
represent value computations common to all CSS properties.
662662

663-
<p>The <dfn id=lsquoinheritrsquo><code class=css>inherit</code></dfn>
664-
keyword is <a
663+
<p>The <dfn id=inherit><code class=css>inherit</code></dfn> keyword
664+
is <a
665665
href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit">defined</a>
666666
in <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
667667

668-
<p>The <dfn id=lsquoinitialrsquo><code class=css>initial</code></dfn>
669-
keyword represents the specified value that is designated as the
670-
property's initial value. <a href="#CSS3CASCADE"
668+
<p>The <dfn id=initial><code class=css>initial</code></dfn> keyword
669+
represents the specified value that is designated as the property's
670+
initial value. <a href="#CSS3CASCADE"
671671
rel=biblioentry>[CSS3CASCADE]<!--{{CSS3CASCADE}}--></a>
672672

673673
<h4 id=custom-idents><span class=secno>3.1.2. </span> Author-defined
@@ -1700,9 +1700,8 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
17001700
<p class=note> Note that ‘<a href="#toggle"><code
17011701
class=css>toggle()</code></a>’ explicitly looks at the computed value of
17021702
the parent, so it works even on non-inherited properties. This is similar
1703-
to the ‘<a href="#lsquoinheritrsquo"><code
1704-
class=css>inherit</code></a>’ keyword, which is works even on
1705-
non-inherited properties.
1703+
to the ‘<a href="#inherit"><code class=css>inherit</code></a>
1704+
keyword, which is works even on non-inherited properties.
17061705

17071706
<p class=note> Note that the <a
17081707
href="http://www.w3.org/TR/CSS21/cascade.html#computed-value">computed
@@ -1831,9 +1830,13 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References:
18311830
<dl>
18321831
<dt><code class=css>string</code>
18331832

1834-
<dd> The attribute value will be parsed as the contents of a CSS <a
1833+
<dd> The attribute value is taken as the contents of a CSS <a
18351834
href="#string-value"><var>&lt;string></var></a>. The default is the empty
18361835
string.
1836+
<p class=note> Note, this does not reparse the attribute value with the
1837+
CSS parser. So, for example, an attribute whose value is "\33" will
1838+
produce a string containing those three characters, not a string
1839+
containing "3" (the character that the escape would evaluate to).
18371840

18381841
<dt><code class=css>color</code>
18391842

@@ -1844,7 +1847,7 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References:
18441847

18451848
<dt><a href="#url"><code class=css>url</code></a>
18461849

1847-
<dd> The attribute value will be parsed as the contents of a CSS <a
1850+
<dd> The attribute value is taken as the contents of a CSS <a
18481851
href="#string-value"><var>&lt;string></var></a>. It is interpreted as a
18491852
quoted string within the ‘<code class=css>url()</code>’ notation. The
18501853
default is ‘<code class=css>about:invalid</code>’, which is a URI
@@ -2319,6 +2322,10 @@ <h2 class=no-num id=changes>Changes</h2>
23192322
<li>Added back the <a
23202323
href="#identifier-value"><var>&lt;custom-ident></var></a> term as a
23212324
convenience notation, so that other specs can refer to it.
2325+
2326+
<li>Specified that attr() with "string" or "url" types doesn't reparse the
2327+
attribute contents, just takes the value literally as the value of a <a
2328+
href="#string-value"><code>&lt;string></code></a>.
23222329
</ul>
23232330

23242331
<h2 class=no-num id=references>References</h2>
@@ -2499,10 +2506,10 @@ <h2 class=no-num id=index>Index</h2>
24992506
<li><var>&lt;image></var>, <a href="#image-value"
25002507
title="section 7.2."><strong>7.2.</strong></a>
25012508

2502-
<li><code class=css>inherit</code>’, <a href="#lsquoinheritrsquo"
2509+
<li><code class=css>inherit</code>’, <a href="#inherit"
25032510
title="section 3.1.1."><strong>3.1.1.</strong></a>
25042511

2505-
<li><code class=css>initial</code>’, <a href="#lsquoinitialrsquo"
2512+
<li><code class=css>initial</code>’, <a href="#initial"
25062513
title="section 3.1.1."><strong>3.1.1.</strong></a>
25072514

25082515
<li>integer, <a href="#integer"

css-values/Overview.src.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,8 +1348,12 @@ <h3 id="attr-notation">
13481348
<dl>
13491349
<dt>''string''
13501350
<dd>
1351-
The attribute value will be parsed as the contents of a CSS <var>&lt;string></var>.
1351+
The attribute value is taken as the contents of a CSS <var>&lt;string></var>.
13521352
The default is the empty string.
1353+
<p class='note'>
1354+
Note, this does not reparse the attribute value with the CSS parser.
1355+
So, for example, an attribute whose value is "\33" will produce a string containing those three characters,
1356+
not a string containing "3" (the character that the escape would evaluate to).
13531357

13541358
<dt>''color''
13551359
<dd>
@@ -1359,7 +1363,7 @@ <h3 id="attr-notation">
13591363

13601364
<dt>''url''
13611365
<dd>
1362-
The attribute value will be parsed as the contents of a CSS <var>&lt;string></var>.
1366+
The attribute value is taken as the contents of a CSS <var>&lt;string></var>.
13631367
It is interpreted as a quoted string within the ''url()'' notation.
13641368
The default is ''about:invalid'', which is a URI defined (<a href="#about-invalid">in Appendix A</a>) to point
13651369
to a non-existent document with a generic error condition.
@@ -1785,6 +1789,7 @@ <h2 class="no-num" id="changes">Changes</h2>
17851789
<li>Deferred exact definition of <a href="#viewport-relative-lengths">viewport-percentage units</a>
17861790
in paged media to <a href="http://www.w3.org/TR/css3-page/">CSS Paged Media</a>.
17871791
<li>Added back the <var>&lt;custom-ident></var> term as a convenience notation, so that other specs can refer to it.
1792+
<li>Specified that attr() with "string" or "url" types doesn't reparse the attribute contents, just takes the value literally as the value of a <code>&lt;string></code>.
17881793
</ul>
17891794

17901795
<h2 class="no-num" id="references">References</h2>

0 commit comments

Comments
 (0)