- From: Tab Atkins Jr.. via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 10 Oct 2011 23:47:16 +0000
- To: public-css-commits@w3.org
Update of /sources/public/csswg/css3-values In directory hutz:/tmp/cvs-serv1916 Modified Files: Overview.html Overview.src.html Log Message: Editorial tweaks to calc() Index: Overview.html =================================================================== RCS file: /sources/public/csswg/css3-values/Overview.html,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- Overview.html 10 Oct 2011 23:36:37 -0000 1.111 +++ Overview.html 10 Oct 2011 23:47:14 -0000 1.112 @@ -278,8 +278,8 @@ <li><a href="#functional-notation"><span class=secno>9. </span> Functional Notations</a> <ul class=toc> - <li><a href="#calc"><span class=secno>9.1. </span> Calculations: - ‘<code class=css>calc()</code>’, ‘<code + <li><a href="#calc"><span class=secno>9.1. </span> Mathematical + Expressions: ‘<code class=css>calc()</code>’, ‘<code class=css>min()</code>’ and ‘<code class=css>max()</code>’</a> @@ -782,11 +782,11 @@ ‘<a href="#percentage-value"><code class=css><percentage></code></a>’ type</h3> - <p>A percentage value is denoted by <dfn + <p>A <dfn id=percentage>percentage</dfn> value is denoted by <dfn id=percentage-value><code><percentage></code></dfn>, consists of a <a href="#number-value"><i><number></i></a> immediately followed by a percent sign ‘<code class=css>%</code>’. It corresponds to - the <code>PERCENTAGE</code> token in the <a + the <a href="#percentage"><code>PERCENTAGE</code></a> token in the <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">grammar</a>. <p>Percentage values are always relative to another value, for example a @@ -1297,15 +1297,19 @@ <!-- -->content: counter(list-item) ". "; <!-- -->width: calc(50% - 2em);</pre> - <h3 id=calc><span class=secno>9.1. </span> Calculations: ‘<a - href="#calc0"><code class=css>calc()</code></a>’, ‘<a - href="#min"><code class=css>min()</code></a>’ and ‘<a - href="#max"><code class=css>max()</code></a>’</h3> + <h3 id=calc><span class=secno>9.1. </span> Mathematical Expressions: + ‘<a href="#calc0"><code class=css>calc()</code></a>’, + ‘<a href="#min"><code class=css>min()</code></a>’ and + ‘<a href="#max"><code class=css>max()</code></a>’</h3> <p>The <dfn id=calc0>calc()</dfn>, <dfn id=min>min()</dfn>, and <dfn - id=max>max()</dfn> functions allow mathematical expressions to be used as - component values. They can be used wherever <a - href="#length-value"><code><length></code></a>, <a + id=max>max()</dfn> functions allow mathematical expressions with addition + (‘<code class=css>+</code>’), subtraction (‘<code + class=css>-</code>’), multiplication (‘<code + class=css>*</code>’), division (‘<code + class=css>/</code>’), and modulus (‘<code + class=css>mod</code>’) to be used as component values. They can be + used wherever <a href="#length-value"><code><length></code></a>, <a href="#frequency-value"><code><frequency></code></a>, <a href="#angle-value"><code><angle></code></a>, <a href="#time-value"><code><time></code></a>, or <a @@ -1337,6 +1341,9 @@ <pre>.box { width: min(10% + 20px, 300px) }</pre> </div> + <p class=issue>Add less trivial examples, particularly involving parens or + nesting. + <p>The expression language of these functions is described by the grammar and prose below. @@ -1350,22 +1357,26 @@ unit : ["+"|"-"]? [ NUMBER | DIMENSION | PERCENTAGE | min | max | "(" S* sum S* ")" ];</pre> - <div class=note> - <p>Additionally, the following redefinition is made to the informative - grammar appearing in <a href="http://www.w3.org/TR/CSS2/grammar.html">CSS - 2.1 Appendix G</a>:</p> + <p class=note>Note that the grammar requires spaces around binary + ‘<code class=css>+</code>’ and ‘<code + class=css>-</code>’ operators. The ‘<code + class=css>*</code>’, ‘<code class=css>/</code>’, and + ‘<code class=css>mod</code>’ operators do not require spaces. - <pre> + <p>Additionally, the following redefinition is made to the informative + grammar appearing in <a href="http://www.w3.org/TR/CSS2/grammar.html">CSS + 2.1 Appendix G</a>: + + <pre> term : unary_operator? [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* | TIME S* | FREQ S* ] | STRING S* | IDENT S* | URI S* | hexcolor | function<ins> | math</ins> ;</pre> - </div> - <p>The expression has a <dfn id=resolved-type>resolved type</dfn>, which is - one of ‘<code class=css><length></code>’, ‘<code + <p>A math expression has a <dfn id=resolved-type>resolved type</dfn>, which + is one of ‘<code class=css><length></code>’, ‘<code class=css><frequency></code>’, ‘<code class=css><angle></code>’, ‘<code class=css><time></code>’, or ‘<code @@ -1381,9 +1392,10 @@ class=css><length></code>’, ‘<a href="#deg"><code class=css>deg</code></a>’ is ‘<code class=css><angle></code>’, etc.). If percentages are accepted in - the context in which the expression is placed, a <code>PERCENTAGE</code> - token has the type of the value that percentages are relative to; - otherwise, an expression containing percentages is invalid. + the context in which the expression is placed, a <a + href="#percentage"><code>PERCENTAGE</code></a> token has the type of the + value that percentages are relative to; otherwise, a math expression + containing percentages is invalid. <p>Operators form sub-expressions, which gain types based on their arguments. To make expressions simpler, operators have restrictions on the @@ -1427,7 +1439,7 @@ </div> <p>Given the complexities of width and height calculations on table cells - and table elements, expressions involving percentages for widths and + and table elements, math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables MAY be treated as if ‘<code class=property>auto</code>’ had been @@ -2309,6 +2321,9 @@ <li><a href="#number-value"><code><number></code></a>, <a href="#number-value" title="<number>"><strong>4.2.</strong></a> + <li>percentage, <a href="#percentage" + title=percentage><strong>4.3.</strong></a> + <li><a href="#percentage-value"><code><percentage></code></a>, <a href="#percentage-value" title="<percentage>"><strong>4.3.</strong></a> Index: Overview.src.html =================================================================== RCS file: /sources/public/csswg/css3-values/Overview.src.html,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- Overview.src.html 10 Oct 2011 23:36:37 -0000 1.114 +++ Overview.src.html 10 Oct 2011 23:47:14 -0000 1.115 @@ -449,7 +449,7 @@ <h3 id="percentages"> Percentages: the ''<percentage>'' type</h3> - <p>A percentage value is denoted by + <p>A <dfn>percentage</dfn> value is denoted by <dfn id="percentage-value"><code><percentage></code></dfn>, consists of a <i><number></i> immediately followed by a percent sign ''%''. It corresponds to the <code>PERCENTAGE</code> token in the @@ -865,11 +865,12 @@ <!-- -->width: calc(50% - 2em);</pre> <h3 id="calc"> -Calculations: ''calc()'', ''min()'' and ''max()''</h3> +Mathematical Expressions: ''calc()'', ''min()'' and ''max()''</h3> <p>The <dfn>calc()</dfn>, <dfn>min()</dfn>, and <dfn>max()</dfn> functions - allow mathematical expressions to be used as component values. They - can be used wherever + allow mathematical expressions with addition (''+''), subtraction (''-''), + multiplication (''*''), division (''/''), and modulus (''mod'') to be used + as component values. They can be used wherever <code><length></code>, <code><frequency></code>, <code><angle></code>, @@ -903,6 +904,9 @@ <pre>.box { width: min(10% + 20px, 300px) }</pre> </div> + <p class='issue'>Add less trivial examples, particularly involving parens + or nesting.</p> + <p>The expression language of these functions is described by the grammar and prose below. @@ -917,21 +921,23 @@ unit : ["+"|"-"]? [ NUMBER | DIMENSION | PERCENTAGE | min | max | "(" S* sum S* ")" ];</pre> - <div class='note'> - <p>Additionally, the following redefinition is made to the informative - grammar appearing in - <a href="http://www.w3.org/TR/CSS2/grammar.html">CSS 2.1 Appendix G</a>:</p> + <p class='note'>Note that the grammar requires spaces around binary ''+'' + and ''-'' operators. The ''*'', ''/'', and ''mod'' operators do not require + spaces.</p> - <pre> + <p>Additionally, the following redefinition is made to the informative + grammar appearing in + <a href="http://www.w3.org/TR/CSS2/grammar.html">CSS 2.1 Appendix G</a>:</p> + + <pre> term : unary_operator? [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* | TIME S* | FREQ S* ] | STRING S* | IDENT S* | URI S* | hexcolor | function<ins> | math</ins> ;</pre> - </div> - <p>The expression has a <dfn>resolved type</dfn>, which is one of + <p>A math expression has a <dfn>resolved type</dfn>, which is one of ''<length>'', ''<frequency>'', ''<angle>'', ''<time>'', or ''<number>''. The <i>resolved type</i> must be valid for where the expression is placed; otherwise, the expression is invalid. @@ -941,7 +947,7 @@ by its unit (''cm'' is ''<length>'', ''deg'' is ''<angle>'', etc.). If percentages are accepted in the context in which the expression is placed, a <code>PERCENTAGE</code> token has the type of the value that - percentages are relative to; otherwise, an expression containing + percentages are relative to; otherwise, a math expression containing percentages is invalid.</p> <p>Operators form sub-expressions, which gain types based on their arguments. @@ -981,9 +987,9 @@ </div> <p>Given the complexities of width and height calculations on table cells - and table elements, expressions involving percentages for widths and heights - on table columns, table column groups, table rows, table row groups, and - table cells in both auto and fixed layout tables MAY be treated as if + and table elements, math expressions involving percentages for widths and + heights on table columns, table column groups, table rows, table row groups, + and table cells in both auto and fixed layout tables MAY be treated as if 'auto' had been specified.</p> <h3 id="cycle">
Received on Monday, 10 October 2011 23:47:19 UTC