|
11 | 11 | rel=dcterms.rights>
|
12 | 12 | <meta content="CSS Values and Units Module Level 3" name=dcterms.title>
|
13 | 13 | <meta content=text name=dcterms.type>
|
14 |
| - <meta content=2013-12-06 name=dcterms.date> |
| 14 | + <meta content=2013-12-18 name=dcterms.date> |
15 | 15 | <meta content="Håkon Wium Lie" name=dcterms.creator>
|
16 | 16 | <meta content="Tab Atkins" name=dcterms.creator>
|
17 | 17 | <meta content="Elika J. Etemad" name=dcterms.creator>
|
|
42 | 42 | <h1 class=p-name>CSS Values and Units Module Level 3</h1>
|
43 | 43 |
|
44 | 44 | <h2 class="no-num no-toc">Editor's Draft <span class=dt-updated><span
|
45 |
| - class=value title=20131206> 6 December 2013</span></span></h2> |
| 45 | + class=value title=20131218>18 December 2013</span></span></h2> |
46 | 46 |
|
47 | 47 | <dl>
|
48 | 48 | <dt>This version:</dt>
|
49 |
| - <!--<dd><a class="u-url" href="http://dev.w3.org/csswg/css-values/">http://www.w3.org/TR/2013/CR-css3-values-20131206/</a></dd>--> |
| 49 | + <!--<dd><a class="u-url" href="http://dev.w3.org/csswg/css-values/">http://www.w3.org/TR/2013/CR-css3-values-20131218/</a></dd>--> |
50 | 50 |
|
51 | 51 | <dd><a class=u-url
|
52 | 52 | href="http://dev.w3.org/csswg/css-values/">http://dev.w3.org/csswg/css-values/</a>
|
@@ -1639,7 +1639,31 @@ <h4 id=calc-computed-value><span class=secno>8.1.3. </span> Computed Value</h4>
|
1639 | 1639 | <p class=note> Thus, the computed value of a ‘<a href="#calc"><code
|
1640 | 1640 | class=css>calc()</code></a>’ expression can be represented as either a
|
1641 | 1641 | number or a tuple of a dimension and a percentage.
|
1642 |
| - <!-- http://lists.w3.org/Archives/Public/www-style/2010May/0001.html |
| 1642 | + |
| 1643 | + <div class=example> |
| 1644 | + <p> For example, ‘<code class=property>background-position</code>’ has |
| 1645 | + special behavior for percentage values, different from lengths: |
| 1646 | + |
| 1647 | + <pre> |
| 1648 | +.foo { |
| 1649 | + width: 200px; |
| 1650 | + background-image: url(bg.png); |
| 1651 | + background-position: left 50%; |
| 1652 | + /* different than: */ |
| 1653 | + background-position: left 100px; |
| 1654 | + /* despite 50% of 200px being 100px */ |
| 1655 | +}</pre> |
| 1656 | + |
| 1657 | + <p> Due to this, ‘<code class=property>background-position</code>’ |
| 1658 | + preserves the percentage in a ‘<a href="#calc"><code |
| 1659 | + class=css>calc()</code></a>’ rather than resolving it directly into a |
| 1660 | + length, so that an expression like ‘<code |
| 1661 | + class=css>background-position: left calc(50% + 20px)</code>’ properly |
| 1662 | + centers the background and then shifts it ‘<code |
| 1663 | + class=css>20px</code>’ to the right, rather than placing its <em>left |
| 1664 | + edge</em> 20px off of center. |
| 1665 | + </div> |
| 1666 | + <!-- http://lists.w3.org/Archives/Public/www-style/2010May/0001.html |
1643 | 1667 | This has notes on how we should handle things when calc() is extended to
|
1644 | 1668 | handle unit mult/div. Related to this is <unit>mod<unit>, which can return
|
1645 | 1669 | 0 and thus introduce computed-time division-by-zero. -->
|
|
0 commit comments