|
15 | 15 | dt + dt::before { content: ", "; } |
16 | 16 | dt { display: inline; } |
17 | 17 | :not(code) var { font-style: normal; color: #005A9C; } |
| 18 | + td > small { display: block; } |
18 | 19 | </style> |
19 | 20 | <link href="../default.css" rel=stylesheet type="text/css"> |
20 | 21 | <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet |
|
27 | 28 |
|
28 | 29 | <h1>CSS Values and Units Module Level 3</h1> |
29 | 30 |
|
30 | | - <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 22 May 2012</h2> |
| 31 | + <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 23 May 2012</h2> |
31 | 32 |
|
32 | 33 | <dl> |
33 | 34 | <dt>This version: |
34 | 35 |
|
35 | 36 | <dd><a |
36 | | - href="http://www.w3.org/TR/2012/ED-css3-values-20120522/">http://www.w3.org/TR/2012/ED-css3-values-20120522/</a> |
| 37 | + href="http://www.w3.org/TR/2012/ED-css3-values-20120523/">http://www.w3.org/TR/2012/ED-css3-values-20120523/</a> |
37 | 38 |
|
38 | 39 | <dt>Latest version: |
39 | 40 |
|
@@ -297,9 +298,12 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2> |
297 | 298 | References: ‘<code class=css>attr()</code>’</a> |
298 | 299 | </ul> |
299 | 300 |
|
| 301 | + <li><a href="#required-ranges"><span class=secno>9. </span> Appendix A: |
| 302 | + Recommended Minimum Ranges and Precision of Computed Values</a> |
| 303 | + |
300 | 304 | <li class=no-num><a href="#acknowledgments">Acknowledgments</a> |
301 | 305 |
|
302 | | - <li><a href="#conformance"><span class=secno>9. </span> Conformance</a> |
| 306 | + <li class=no-num><a href="#conformance"> Conformance</a> |
303 | 307 | <ul class=toc> |
304 | 308 | <li><a href="#conventions"><span class=secno>9.1. </span> Document |
305 | 309 | conventions</a> |
@@ -747,16 +751,13 @@ <h2 id=numeric-types><span class=secno>4. </span> Numeric Data Types</h2> |
747 | 751 |
|
748 | 752 | <p> Properties may restrict numeric values to some range. If the value is |
749 | 753 | outside the allowed range, the declaration is invalid and must be <a |
750 | | - href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignored</a>. For |
751 | | - unrestricted values, UAs must support at least up to ±2<sup>24</sup>-1; |
752 | | - unsupported values must be clamped to the closest supported value. When |
753 | | - arithmetic is performed with numeric types (for example, in the calc() |
754 | | - expression, or when doing unit conversions), if the result is outside the |
755 | | - UAs's supported range, it must also be clamped to the closest supported |
756 | | - value. |
| 754 | + href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignored</a>. |
757 | 755 |
|
758 | | - <p> UAs must support at least 3 digits of precision after the decimal point |
759 | | - in numeric values. |
| 756 | + <p> CSS theoretically supports infinite precision and infinite ranges for |
| 757 | + all value types; however in reality implementations have finite capacity. |
| 758 | + The recommended minimum ranges and precision, and the required rounding |
| 759 | + and clamping rules, are given in <a href="#required-ranges">Appendix |
| 760 | + A</a>. |
760 | 761 |
|
761 | 762 | <h3 id=integers><span class=secno>4.1. </span> Integers: the ‘<a |
762 | 763 | href="#integer-value"><code class=css><integer></code></a>’ type</h3> |
@@ -1890,13 +1891,105 @@ <h3 id=attr-notation><span class=secno>8.3. </span> Attribute References: |
1890 | 1891 | versions of CSS may extend ‘<a href="#attr"><code |
1891 | 1892 | class=css>attr()</code></a>’ in this direction. |
1892 | 1893 |
|
| 1894 | + <h2 id=required-ranges><span class=secno>9. </span> Appendix A: Recommended |
| 1895 | + Minimum Ranges and Precision of Computed Values</h2> |
| 1896 | + |
| 1897 | + <p> For unrestricted values, the recommended minimum range and precision of |
| 1898 | + computed values is given in the table below. |
| 1899 | + |
| 1900 | + <table class=data> |
| 1901 | + <thead> |
| 1902 | + <tr> |
| 1903 | + <th>Type |
| 1904 | + |
| 1905 | + <th>Recommended Minimum Precision |
| 1906 | + |
| 1907 | + <th>Recommended Minimum Maximum (Absolute Value) |
| 1908 | + |
| 1909 | + <tbody> |
| 1910 | + <tr> |
| 1911 | + <th><a href="#integer-value"><var><integer></var></a> |
| 1912 | + |
| 1913 | + <td>1 |
| 1914 | + |
| 1915 | + <td>2<sup>24</sup>−1 |
| 1916 | + |
| 1917 | + <tr> |
| 1918 | + <th><a href="#number-value"><var><number></var></a> |
| 1919 | + |
| 1920 | + <td>0.01 <small>(within the range -100 < <var>x</var> < |
| 1921 | + 100)</small> |
| 1922 | + |
| 1923 | + <td>2<sup>17</sup>−1 |
| 1924 | + |
| 1925 | + <tr> |
| 1926 | + <th><a href="#percentage-value"><var><percentage></var></a> |
| 1927 | + |
| 1928 | + <td>0.01% <small>(within the range -100 < <var>x</var> < |
| 1929 | + 100)</small> |
| 1930 | + |
| 1931 | + <td>(2<sup>17</sup>−1)% |
| 1932 | + |
| 1933 | + <tr> |
| 1934 | + <th><a href="#length-value"><var><length></var></a> |
| 1935 | + |
| 1936 | + <td>0.1px |
| 1937 | + |
| 1938 | + <td>(2<sup>24</sup>−1)px |
| 1939 | + |
| 1940 | + <tr> |
| 1941 | + <th><a href="#angle-value"><var><angle></var></a> |
| 1942 | + |
| 1943 | + <td>0.1deg |
| 1944 | + |
| 1945 | + <td>(2<sup>24</sup>−1)deg |
| 1946 | + |
| 1947 | + <tr> |
| 1948 | + <th><a href="#time-value"><var><time></var></a> |
| 1949 | + |
| 1950 | + <td>1ms |
| 1951 | + |
| 1952 | + <td>(2<sup>24</sup>−1)ms |
| 1953 | + |
| 1954 | + <tr> |
| 1955 | + <th><a href="#frequency-value"><var><frequency></var></a> |
| 1956 | + |
| 1957 | + <td>0.01Hz |
| 1958 | + |
| 1959 | + <td>(2<sup>17</sup>−1)Hz |
| 1960 | + </table> |
| 1961 | + |
| 1962 | + <p> Values outside the supported range must be clamped into the supported |
| 1963 | + range. Values specified with an unsupported amount of precision must be |
| 1964 | + rounded to the closest supported value; except that values that are not |
| 1965 | + equal to, but would round to, either zero or the boundary of a closed |
| 1966 | + range, are rounded away from that value rather than to it. |
| 1967 | + |
| 1968 | + <div class=example> |
| 1969 | + <p> For example, in a UA that only supports a precision of 0.01, an |
| 1970 | + ‘<code class=property>opacity</code>’ value of ‘<code |
| 1971 | + class=css>0.9999</code>’ would round to ‘<code |
| 1972 | + class=css>0.99</code>’, not ‘<code class=css>1.0</code>’, and would |
| 1973 | + therefore cause the element to create a stacking context. Similarly, a |
| 1974 | + ‘<code class=css>flex-grow</code>’ value of ‘<code |
| 1975 | + class=css>0.001</code>’ would round to ‘<code |
| 1976 | + class=css>0.01</code>’, not ‘<code class=css>0</code>’, and would |
| 1977 | + therefore be flexible. |
| 1978 | + </div> |
| 1979 | + |
| 1980 | + <p> When arithmetic is performed with numeric types (for example, in the |
| 1981 | + ‘<a href="#calc"><code class=css>calc()</code></a>’ expression), if |
| 1982 | + the result is unsupported it must also be clamped/rounded as necessary. |
| 1983 | + <span class=note> Note this means that rounding errors <em>may</em> |
| 1984 | + accumulate. </span> |
| 1985 | + |
1893 | 1986 | <h2 class=no-num id=acknowledgments>Acknowledgments</h2> |
1894 | 1987 |
|
1895 | 1988 | <p>Comments and suggestions from Giovanni Campagna, Christoph Päper, Keith |
1896 | 1989 | Rarick, Alex Mogilevsky, Ian Hickson, David Baron, Edward Welbourne, Boris |
1897 | 1990 | Zbarsky, Björn Höhrmann and Michael Day improved this module. |
1898 | 1991 |
|
1899 | | - <h2 id=conformance><span class=secno>9. </span> Conformance</h2> |
| 1992 | + <h2 class=no-num id=conformance> Conformance</h2> |
1900 | 1993 |
|
1901 | 1994 | <h3 id=conventions><span class=secno>9.1. </span> Document conventions</h3> |
1902 | 1995 |
|
|
0 commit comments