2828
2929 < h1 > CSS Values and Units Module Level 3</ h1 >
3030
31- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 12 July 2012</ h2 >
31+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 16 July 2012</ h2 >
3232
3333 < dl >
3434 < dt > This version:
3535
3636 < dd > < a
37- href ="http://www.w3.org/TR/2012/ED-css3-values-20120712 / "> http://www.w3.org/TR/2012/ED-css3-values-20120712 /</ a >
37+ href ="http://www.w3.org/TR/2012/ED-css3-values-20120716 / "> http://www.w3.org/TR/2012/ED-css3-values-20120716 /</ a >
3838
3939 < dt > Latest version:
4040
@@ -1564,14 +1564,23 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
15641564 Values: ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’</ h3 >
15651565
15661566 < p > The < dfn id =toggle > toggle()</ dfn > expression allows descendant elements
1567- to cycle over a list of values instead of inheriting the same value. The
1568- syntax of the ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’
1569- expression is:
1567+ to cycle over a list of values instead of inheriting the same value.
15701568
1571- < pre > toggle( <value> # )</ pre >
1569+ < div class =example >
1570+ < p > The following example makes < code > <em> </ code > elements italic in
1571+ general, but makes them normal if they're inside something that's italic:
1572+
1573+
1574+ < pre > em { font-style: toggle(italic, normal); }</ pre >
1575+ </ div >
1576+
1577+ < p > The syntax of the ‘< a href ="#toggle "> < code
1578+ class =css > toggle()</ code > </ a > ’ expression is:
1579+
1580+ < pre > toggle( <value> < a href ="#component-multipliers "> #</ a > )</ pre >
15721581
15731582 < p > where < var > <value> </ var > is any CSS value that is valid where the
1574- expression is placed, and which doesn't contain any top-level commas. If
1583+ expression is placed, and that doesn't contain any top-level commas. If
15751584 any of the values inside are not valid, then the entire ‘< a
15761585 href ="#toggle "> < code class =css > toggle()</ code > </ a > ’ expression is
15771586 invalid. The ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’
@@ -1589,49 +1598,52 @@ <h3 id=toggle-notation><span class=secno>8.2. </span> Toggling Between
15891598
15901599 < p > The value represented by ‘< a href ="#toggle "> < code
15911600 class =css > toggle()</ code > </ a > ’ is determined by comparing the inherited
1592- value < var > I</ var > (i.e. the computed value on the parent, or, for the
1593- root, the initial value) to the computed values < var > C< sub > n</ sub > </ var >
1594- returned by the < var > n</ var > -th argument to ‘< a href ="#toggle "> < code
1595- class =css > toggle()</ code > </ a > ’. For the earliest
1596- < var > C< sub > n</ sub > </ var > such that < var > C< sub > n</ sub > </ var > =
1597- < var > I</ var > , the value returned by toggle is < var > C< sub > n+1</ sub > </ var > .
1598- However, if this < var > C< sub > n</ sub > </ var > is the last value, or if there
1599- are no < var > C< sub > n</ sub > </ var > that equal < var > I</ var > , the computed
1600- value of the first value is returned instead.
1601+ value < var > I</ var > (i.e. the < a
1602+ href ="http://www.w3.org/TR/CSS21/cascade.html#computed-value "> computed
1603+ value</ a > on the parent, or, for the root, the initial value) to the
1604+ computed values < var > C< sub > n</ sub > </ var > returned by the < var > n</ var > -th
1605+ argument to ‘< a href ="#toggle "> < code class =css > toggle()</ code > </ a > ’.
1606+ For the earliest < var > C< sub > n</ sub > </ var > such that
1607+ < var > C< sub > n</ sub > </ var > = < var > I</ var > , the value returned by toggle is
1608+ < var > C< sub > n+1</ sub > </ var > . However, if this < var > C< sub > n</ sub > </ var > is
1609+ the last value, or if there are no < var > C< sub > n</ sub > </ var > that equal
1610+ < var > I</ var > , the computed value of the first value is returned instead.
16011611
16021612 < div class =example >
1603- < pre >
1604- /* make em elements italic , but make them normal if they're inside
1605- something that's italic */
1606- em { font-style: toggle(italic, normal); } </ pre >
1607- </ div >
1613+ < p > The following example cycles markers for nested lists, so that a top
1614+ level list has < code > disc </ code > -shaped markers , but nested lists use
1615+ < code > circle </ code > , then < code > square </ code > , then < code > box </ code > , and
1616+ then repeat through the list of marker shapes, starting again (for the
1617+ 5th list deep) with < code > disc </ code > .
16081618
1609- < div class =example >
16101619 < pre >
1611- /* cycle between markers for nested lists, so that the top level has
1612- disk markers, but nested lists use circle, square, box, and then
1613- (for the 5th list deep) repeat */
16141620 ul { list-style-type: disc; }
16151621 ul ul { list-style-type: toggle(disc, circle, square, box); }</ pre >
16161622 </ div >
16171623
1618- < p class =note > Note that "computed values" are abstract sets of values, not
1619- particular serializations, so comparison between computed values should
1620- always be unambiguous and have the expected result. For example, ‘< code
1621- class =property > box-shadow</ code > ’ computed values are just two offsets,
1622- a blur, a spread, and a color, so the declarations ‘< code
1623- class =css > box-shadow: 1px 1px blue;</ code > ’ and ‘< code
1624- class =css > box-shadow: 1px 1px 0px blue;</ code > ’ produce identical
1625- computed values. If the "Computed Value" line of a property definition
1626- seems to define something ambiguous or overly strict, please < a
1627- href ="#status "> provide feedback</ a > so we can fix it.
1628-
16291624 < p class =note > Note that ‘< a href ="#toggle "> < code
16301625 class =css > toggle()</ code > </ a > ’ explicitly looks at the computed value of
16311626 the parent, so it works even on non-inherited properties. This is similar
16321627 to the ‘< a href ="#inherit "> < code class =css > inherit</ code > </ a > ’
16331628 keyword, which is works even on non-inherited properties.
16341629
1630+ < p class =note > Note that the < a
1631+ href ="http://www.w3.org/TR/CSS21/cascade.html#computed-value "> computed
1632+ value</ a > of a property is an abstract set of values, not a particular
1633+ serialization < a href ="#CSS21 "
1634+ rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a > , so comparison between
1635+ computed values should always be unambiguous and have the expected result.
1636+ For example, a Level 2 < a
1637+ href ="http://www.w3.org/TR/CSS21/colors.html#propdef-background-position "> ‘< code
1638+ class =property > background-position</ code > ’</ a > computed value is just
1639+ two offsets, each represented as an absolute length or a percentage, so
1640+ the declarations ‘< code class =css > background-position: top
1641+ center</ code > ’ and ‘< code class =css > background-position: 50%
1642+ 0%</ code > ’ produce identical computed values. If the "Computed Value"
1643+ line of a property definition seems to define something ambiguous or
1644+ overly strict, please < a href ="#status "> provide feedback</ a > so we can fix
1645+ it.
1646+
16351647 < h3 id =attr-notation > < span class =secno > 8.3. </ span > Attribute References:
16361648 ‘< a href ="#attr "> < code class =css > attr()</ code > </ a > ’</ h3 >
16371649 <!--
0 commit comments