- From: Tab Atkins Jr.. via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 10 Oct 2011 22:10:53 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-values In directory hutz:/tmp/cvs-serv21018 Modified Files: Overview.html Overview.src.html Log Message: More editorial tweaking of attr() Index: Overview.html =================================================================== RCS file: /sources/public/csswg/css3-values/Overview.html,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- Overview.html 10 Oct 2011 21:56:00 -0000 1.102 +++ Overview.html 10 Oct 2011 22:10:51 -0000 1.103 @@ -1520,7 +1520,9 @@ optional but must be present if the third argument is present) is a keyword drawn from the list below that tells the UA how to interpret the attribute value. If omitted, ‘<code class=css>string</code>’ - is implied. + is implied. If the type is not valid for where the ‘<code + class=css>attr()</code>’ expression is placed, the whole + ‘<code class=css>attr()</code>’ expression is invalid. <p>The ‘<code class=css><value></code>’ argument (which is optional) is a CSS value which must be valid where the ‘<code @@ -1534,6 +1536,11 @@ fallback ‘<code class=css><value></code>’ is absent, the default value for the given type (from the list below) is implied. + <p class=note>Note that the default value need not be of the type given. + For instance, if the type required of the attribute by the author is + ‘<code class=css>px</code>’, the default could still be + ‘<code class=css>5em</code>’. + <p>The ‘<code class=css><type></code>’ keywords are: <dl> @@ -1648,37 +1655,9 @@ ‘<code class=property>inherit</code>’ and ‘<code class=property>initial</code>’), that type is implied". - <p>The ‘<code class=css>attr()</code>’ form is only valid if - the type given (or implied, if it is missing) is valid for the property. - For example, all of the following are invalid and would cause a parse-time - error (and thus cause the relevant declaration, in this case all of them, - to be ignored): - - <div class="illegal example"> - <pre> -content: attr(title, color); /* 'content' doesn't accept colors */ - -content: attr(end-of-quote, string, inherit) close-quote; -/* the 'inherit' value is not allowed there, since the result would be -'inherit close-quote', which is invalid. */ - -margin: attr(vertical, length) attr(horizontal, deg); -/* deg units are not valid at that point */ -<!-- -font: attr(weight, integer) attr(size, length)/attr(height, -integer) attr(family, string); /* invalid because -<'font-weight'>s are not integers, but identifiers. */ ---> -color: attr(color); /* 'color' doesn't accept strings */</pre> - </div> - - <p class=note>Note that the default value need not be of the type given. - For instance, if the type required of the attribute by the author is - ‘<code class=css>px</code>’, the default could still be - ‘<code class=css>5em</code>’. - <div class=example> - <p>Examples:</p> + <p>This example shows the use of attr() to visually illustrate data in an + XML file:</p> <pre> <stock> @@ -1716,9 +1695,31 @@ }</pre> </div> - <p>The ‘<code class=css>attr()</code>’ expression cannot - currently fall back onto another attribute. Future versions of CSS may - extend ‘<code class=css>attr()</code>’ in this direction. + <div class="illegal example"> + <p>All of the following examples are invalid and would cause a parse-time + error, and thus cause the relevant declaration—in this case all of + them—to be ignored:</p> + + <pre> +content: attr(title, color); /* 'content' doesn't accept colors */ + +content: attr(end-of-quote, string, inherit) close-quote; +/* the 'inherit' value is not allowed there, since the result would be +'inherit close-quote', which is invalid. */ + +margin: attr(vertical, length) attr(horizontal, deg); +/* deg units are not valid at that point */ +<!-- +font: attr(weight, integer) attr(size, length)/attr(height, +integer) attr(family, string); /* invalid because +<'font-weight'>s are not integers, but identifiers. */ +--> +color: attr(color); /* 'color' doesn't accept strings */</pre> + </div> + + <p class=note>The ‘<code class=css>attr()</code>’ expression + cannot currently fall back onto another attribute. Future versions of CSS + may extend ‘<code class=css>attr()</code>’ in this direction. <p class=issue>Should ‘<code class=css>attr()</code>’ be allowed on any property, in any source language? For example, do we expect Index: Overview.src.html =================================================================== RCS file: /sources/public/csswg/css3-values/Overview.src.html,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- Overview.src.html 10 Oct 2011 21:56:00 -0000 1.105 +++ Overview.src.html 10 Oct 2011 22:10:51 -0000 1.106 @@ -1067,7 +1067,8 @@ <p>The ''<type>'' argument (which is optional but must be present if the third argument is present) is a keyword drawn from the list below that tells the UA how to interpret the attribute value. If omitted, ''string'' is - implied.</p> + implied. If the type is not valid for where the ''attr()'' expression is + placed, the whole ''attr()'' expression is invalid.</p> <p>The ''<value>'' argument (which is optional) is a CSS value which must be valid where the ''attr()'' expression is placed. It represents a fallback @@ -1078,6 +1079,10 @@ fallback ''<value>'' is absent, the default value for the given type (from the list below) is implied.</p> + <p class='note'>Note that the default value need not be of the type given. For + instance, if the type required of the attribute by the author is + ''px'', the default could still be ''5em''.</p> + <p>The ''<type>'' keywords are:</p> <dl> @@ -1153,37 +1158,9 @@ "If the property only accepts one type of value (aside from 'inherit' and 'initial'), that type is implied".</p> - <p>The ''attr()'' form is only valid if the type given (or implied, if it - is missing) is valid for the property. For example, all of the - following are invalid and would cause a parse-time error (and thus - cause the relevant declaration, in this case all of them, to be - ignored):</p> - - <div class="illegal example"> - <pre> -content: attr(title, color); /* 'content' doesn't accept colors */ - -content: attr(end-of-quote, string, inherit) close-quote; -/* the 'inherit' value is not allowed there, since the result would be -'inherit close-quote', which is invalid. */ - -margin: attr(vertical, length) attr(horizontal, deg); -/* deg units are not valid at that point */ -<!-- -font: attr(weight, integer) attr(size, length)/attr(height, -integer) attr(family, string); /* invalid because -<'font-weight'>s are not integers, but identifiers. */ ---> -color: attr(color); /* 'color' doesn't accept strings */</pre> - </div> - - <p class='note'>Note that the default value need not be of the type given. For - instance, if the type required of the attribute by the author is - ''px'', the default could still be ''5em''.</p> - - <div class="example"> - <p>Examples:</p> + <p>This example shows the use of attr() to visually illustrate data + in an XML file:</p> <pre> <stock> @@ -1221,8 +1198,30 @@ }</pre> </div> - <p>The ''attr()'' expression cannot currently fall back onto another - attribute. Future versions of CSS may extend ''attr()'' in this + <div class="illegal example"> + <p>All of the following examples are invalid and would cause a + parse-time error, and thus cause the relevant declaration—in + this case all of them—to be ignored:</p> + + <pre> +content: attr(title, color); /* 'content' doesn't accept colors */ + +content: attr(end-of-quote, string, inherit) close-quote; +/* the 'inherit' value is not allowed there, since the result would be +'inherit close-quote', which is invalid. */ + +margin: attr(vertical, length) attr(horizontal, deg); +/* deg units are not valid at that point */ +<!-- +font: attr(weight, integer) attr(size, length)/attr(height, +integer) attr(family, string); /* invalid because +<'font-weight'>s are not integers, but identifiers. */ +--> +color: attr(color); /* 'color' doesn't accept strings */</pre> + </div> + + <p class='note'>The ''attr()'' expression cannot currently fall back onto + another attribute. Future versions of CSS may extend ''attr()'' in this direction.</p> <p class="issue">Should ''attr()'' be allowed on any property, in any
Received on Monday, 10 October 2011 22:10:55 UTC