Skip to content

Commit 8f5119a

Browse files
committed
Tweak attr() wording in some places, and speciy computed value better.
1 parent 086913f commit 8f5119a

2 files changed

Lines changed: 30 additions & 27 deletions

File tree

css3-values/Overview.html

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ <h3 id=attr><span class=secno>8.3. </span> Attribute References: &lsquo;<a
16051605
http://lists.w3.org/Archives/Member/w3c-css-wg/2002OctDec/0141.html
16061606
-->
16071607

1608-
<p>The <dfn id=attr-value>attr()</dfn> function returns the value of an
1608+
<p>The <dfn id=attr-value>attr()</dfn> function can return the value of an
16091609
attribute on the element for use as a value in a property. If used on a
16101610
pseudo-element, it returns the value of the attribute on the
16111611
pseudo-element's originating element.
@@ -1616,8 +1616,8 @@ <h3 id=attr><span class=secno>8.3. </span> Attribute References: &lsquo;<a
16161616
href="#attr-value"><code class=css>attr()</code></a>&rsquo; expression can
16171617
return many different types. The &lsquo;<a href="#attr-value"><code
16181618
class=css>attr()</code></a>&rsquo; expression cannot return everything,
1619-
for example it cannot do counters, named strings, quotes, or values such
1620-
as &lsquo;<code class=css>auto</code>&rsquo;, &lsquo;<code
1619+
for example it cannot do counters, named strings, quotes, or keyword
1620+
values such as &lsquo;<code class=css>auto</code>&rsquo;, &lsquo;<code
16211621
class=css>nowrap</code>&rsquo;, or &lsquo;<code
16221622
class=css>baseline</code>&rsquo;. This is intentional, as the intent of
16231623
the &lsquo;<a href="#attr-value"><code class=css>attr()</code></a>&rsquo;
@@ -1640,28 +1640,27 @@ <h3 id=attr><span class=secno>8.3. </span> Attribute References: &lsquo;<a
16401640
the value of the attribute with that name on the element, according to the
16411641
rules given below.
16421642

1643-
<p>The &lsquo;<code class=css>&lt;type></code>&rsquo; argument (which is
1644-
optional) is a keyword drawn from the list below that tells the UA how to
1645-
interpret the attribute value. If omitted, &lsquo;<code
1646-
class=css>string</code>&rsquo; is implied. If the type is not valid for
1647-
where the &lsquo;<a href="#attr-value"><code
1648-
class=css>attr()</code></a>&rsquo; expression is placed, the whole
1649-
&lsquo;<a href="#attr-value"><code class=css>attr()</code></a>&rsquo;
1650-
expression is invalid.
1643+
<p>The optional &lsquo;<code class=css>&lt;type></code>&rsquo; argument is
1644+
a keyword drawn from the list below that tells the UA how to interpret the
1645+
attribute value. If omitted, &lsquo;<code class=css>string</code>&rsquo;
1646+
is implied. If the type is not valid for where the &lsquo;<a
1647+
href="#attr-value"><code class=css>attr()</code></a>&rsquo; expression is
1648+
placed, the whole &lsquo;<a href="#attr-value"><code
1649+
class=css>attr()</code></a>&rsquo; expression is invalid.
16511650

1652-
<p>The &lsquo;<code class=css>&lt;value></code>&rsquo; argument (which is
1653-
optional) is a CSS value which must be valid where the &lsquo;<a
1651+
<p>The optional &lsquo;<code class=css>&lt;value></code>&rsquo; argument is
1652+
a CSS value which must be valid where the &lsquo;<a
16541653
href="#attr-value"><code class=css>attr()</code></a>&rsquo; expression is
1655-
placed. It represents a fallback value to be used if the named attribute
1656-
is missing, or its value cannot be parsed into the given type or is
1657-
invalid/out-of-range for the property. If the &lsquo;<code
1654+
placed. It represents a fallback value, which is used if the named
1655+
attribute is missing, or its value cannot be parsed into the given type or
1656+
is invalid/out-of-range for the property. If the &lsquo;<code
16581657
class=css>&lt;value></code>&rsquo; argument is not valid for the property
16591658
where the &lsquo;<a href="#attr-value"><code
16601659
class=css>attr()</code></a>&rsquo; expression is placed, the whole
16611660
&lsquo;<a href="#attr-value"><code class=css>attr()</code></a>&rsquo;
1662-
expression is invalid. The fallback value must not be another &lsquo;<a
1663-
href="#attr-value"><code class=css>attr()</code></a>&rsquo; expression; if
1664-
it is, the outer &lsquo;<a href="#attr-value"><code
1661+
expression is invalid. The fallback value must not contain another
1662+
&lsquo;<a href="#attr-value"><code class=css>attr()</code></a>&rsquo;
1663+
expression; if it is, the outer &lsquo;<a href="#attr-value"><code
16651664
class=css>attr()</code></a>&rsquo; expression is invalid. If the fallback
16661665
&lsquo;<code class=css>&lt;value></code>&rsquo; is absent, the default
16671666
value for the given type (from the list below) is implied.
@@ -1734,7 +1733,8 @@ <h3 id=attr><span class=secno>8.3. </span> Attribute References: &lsquo;<a
17341733
relevant units is not valid for the property. The default should also be
17351734
used if the property in question only accepts values within a certain
17361735
range (e.g. positive lengths or angles from 0 to 90deg) and the attribute
1737-
is out of range (e.g. a negative length or 180deg).
1736+
is out of range (e.g. a negative length or 180deg). If the unit is a
1737+
relative length, it must be computed to an absolute length.
17381738

17391739
<dt>&lsquo;<a href="#em-unit"><code class=css>em</code></a>&rsquo;
17401740

@@ -1781,7 +1781,8 @@ <h3 id=attr><span class=secno>8.3. </span> Attribute References: &lsquo;<a
17811781
unit. The default is &lsquo;<code class=css>0</code>&rsquo; in the
17821782
relevant units, or else the property's minimum value if &lsquo;<code
17831783
class=css>0</code>&rsquo; in the relevant units is not valid for the
1784-
property.
1784+
property. If the unit is a relative length, it must be computed to an
1785+
absolute length.
17851786
</dl>
17861787

17871788
<div class=example>

css3-values/Overview.src.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,14 +1120,14 @@ <h3 id="attr">
11201120
http://lists.w3.org/Archives/Member/w3c-css-wg/2002OctDec/0141.html
11211121
-->
11221122

1123-
<p>The <dfn id='attr-value'>attr()</dfn> function returns the value of an attribute on the element
1123+
<p>The <dfn id='attr-value'>attr()</dfn> function can return the value of an attribute on the element
11241124
for use as a value in a property. If used on a pseudo-element, it returns
11251125
the value of the attribute on the pseudo-element's originating element.</p>
11261126

11271127
<p>In CSS2.1 [[!CSS21]], the ''attr()'' expression always returns a string.
11281128
In CSS3, the ''attr()'' expression can return many different types. The
11291129
''attr()'' expression cannot return everything, for example it cannot
1130-
do counters, named strings, quotes, or values such as ''auto'',
1130+
do counters, named strings, quotes, or keyword values such as ''auto'',
11311131
''nowrap'', or ''baseline''. This is intentional, as the intent of the
11321132
''attr()'' expression is not to make it possible to describe a
11331133
presentational language's formatting using CSS, but to enable CSS
@@ -1143,18 +1143,18 @@ <h3 id="attr">
11431143
value of the ''attr()'' expression is the value of the attribute with that
11441144
name on the element, according to the rules given below.</p>
11451145

1146-
<p>The ''&lt;type>'' argument (which is optional) is a keyword drawn from
1146+
<p>The optional ''&lt;type>'' argument is a keyword drawn from
11471147
the list below that tells the UA how to interpret the attribute value.
11481148
If omitted, ''string'' is implied. If the type is not valid for where the
11491149
''attr()'' expression is placed, the whole ''attr()'' expression is invalid.</p>
11501150

1151-
<p>The ''&lt;value>'' argument (which is optional) is a CSS value which must
1151+
<p>The optional ''&lt;value>'' argument is a CSS value which must
11521152
be valid where the ''attr()'' expression is placed. It represents a fallback
1153-
value to be used if the named attribute is missing, or its value cannot be
1153+
value, which is used if the named attribute is missing, or its value cannot be
11541154
parsed into the given type or is invalid/out-of-range for the property. If
11551155
the ''&lt;value>'' argument is not valid for the property where the ''attr()''
11561156
expression is placed, the whole ''attr()'' expression is invalid. The
1157-
fallback value must not be another ''attr()'' expression; if it is, the
1157+
fallback value must not contain another ''attr()'' expression; if it is, the
11581158
outer ''attr()'' expression is invalid. If the fallback ''&lt;value>'' is
11591159
absent, the default value for the given type (from the list below) is implied.</p>
11601160

@@ -1206,6 +1206,7 @@ <h3 id="attr">
12061206
used if the property in question only accepts values within a certain
12071207
range (e.g. positive lengths or angles from 0 to 90deg) and the
12081208
attribute is out of range (e.g. a negative length or 180deg).
1209+
If the unit is a relative length, it must be computed to an absolute length.
12091210

12101211
<dt>''em''
12111212
<dt>''ex''
@@ -1230,6 +1231,7 @@ <h3 id="attr">
12301231
<dd>The attribute value will be interpreted as a CSS ''&lt;number>'', with the given
12311232
type suffixed as a unit. The default is ''0'' in the relevant
12321233
units, or else the property's minimum value if ''0'' in the relevant units is not valid for the property.
1234+
If the unit is a relative length, it must be computed to an absolute length.
12331235
</dl>
12341236

12351237
<div class="example">

0 commit comments

Comments
 (0)