@@ -17,8 +17,6 @@ Abstract: This module contains the features of CSS level 3 relating to the <<ima
17
17
definitions for interpolating several <<image>> types,
18
18
and several properties controlling the interaction of replaced elements and CSS's layout models.
19
19
At Risk : 'image-orientation'
20
- At Risk : [[#interpolating-gradients]]
21
- At Risk : recursive interpolation of ''cross-fade()'' arguments
22
20
Issue Tracking : Tracker http://www.w3.org/Style/CSS/Tracker/products/27
23
21
Previous Version : https://www.w3.org/TR/2012/CR-css3-images-20120417/
24
22
Previous Version : https://www.w3.org/TR/2012/WD-css3-images-20120112/
@@ -93,10 +91,7 @@ Image Values: the <<image>> type {#image-values}
93
91
94
92
The <<image>> value type denotes a 2D image.
95
93
It can be a
96
- <a href="#url-notation">url reference</a> ,
97
- a <a href="#cross-fade-function">cross-fade expression combining two images</a> ,
98
- <!-- an <a href="#image-notation">image notation</a> , -->
99
- <!-- <a href="#element-reference">element reference</a> , -->
94
+ <a href="#url-notation">url reference</a>
100
95
or a <a href="#gradients">color gradient</a> .
101
96
Its syntax is:
102
97
@@ -966,7 +961,7 @@ Sizing Images and Objects in CSS {#sizing}
966
961
As well, a document may contain many other types of objects,
967
962
such as video, plugins, or nested documents.
968
963
These images and objects
969
- (just <dfn noexport lt local-lt=object>objects</dfn> hereafter)
964
+ (just <dfn noexport local-lt=object>objects</dfn> hereafter)
970
965
may offer many types of sizing information to CSS,
971
966
or none at all.
972
967
This section defines generically the size negotiation model between the object and the CSS layout algorithms.
@@ -1590,127 +1585,13 @@ Determining How To Scale an Image: the 'image-rendering' property {#the-image-re
1590
1585
Interpolation {#interpolation}
1591
1586
==============================
1592
1587
1593
- This section describes how to interpolate between new value types defined in this specification,
1594
- for use with modules such as CSS Transitions and CSS Animations.
1595
-
1596
- If an algorithm below simply states that two values should be "interpolated" or "transitioned" without further details,
1597
- then the value should be interpolated as described by the Transitions spec.
1598
- Otherwise, the algorithm may reference a variable <var> t</var>
1599
- in its detailed description of the interpolation.
1600
- This is a number which starts at 0% and goes to 100%,
1601
- and is set to a value that represents the progress through the transition,
1602
- based on the duration of the transition,
1603
- the elapsed time,
1604
- and the timing function in use.
1605
- For example, with a linear timing function and a 1s duration,
1606
- after .3s <var> t</var> is equal to 30%.
1607
-
1608
- Interpolating <<image>> {#interpolating-images}
1609
- -----------------------------------------------
1610
-
1611
- All images can be interpolated,
1612
- though some special types of images
1613
- (like some gradients)
1614
- have their own special interpolation rules.
1615
- In general terms,
1616
- images are interpolated by scaling them to the size of the start image
1617
- and cross-fading the two while they transition to the size of the end image.
1618
-
1619
- In specific terms,
1620
- at each point in the interpolation
1621
- the image is equal to <code> cross-fade( (100% - <var> t</var> ) <var> start image</var> , <var> end image</var> )</code> .
1622
-
1623
- Issue: Special-case interpolating to/from no image,
1624
- like "background-image: url(foo);" to "background-image: none;".
1625
-
1626
-
1627
- Interpolating cross-fade() {#interpolating-image-combinations}
1628
- --------------------------------------------------------------
1629
-
1630
- The three components of ''cross-fade()'' are interpolated independently.
1631
- Note this may result in nested ''cross-fade()'' notations.
1632
-
1633
- Interpolating <<gradient>> {#interpolating-gradients}
1634
- -----------------------------------------------------
1635
-
1636
- Issue: This section needs review and improvement.
1637
- In particular, I believe the handling of linear-gradient() is incomplete -
1638
- I think we want to specifically interpolate the "length" of the gradient line
1639
- (the distance between 0% and 100%)
1640
- between the starting and ending positions explicitly,
1641
- so it doesn't grow and then shrink over a single animation.
1642
-
1643
- Gradient images can be interpolated directly in CSS transitions and animations,
1644
- smoothly animating from one gradient to another.
1645
- There are only a few restrictions on what gradients are allowed to be interpolated:
1646
-
1647
- 1. Both the starting and ending gradient must be expressed with the same function.
1648
- (For example, you can transition from a ''linear-gradient()'' to a ''linear-gradient()'' ,
1649
- but not from a ''linear-gradient()'' to a ''radial-gradient()'' or a ''repeating-linear-gradient()'' .)
1650
-
1651
- 2. Both the starting and ending gradient must have the same number of <<color-stop>> s.
1652
- For this purpose, all repeating gradients are considered to have infinite color stops,
1653
- and thus all repeating gradients match in this respect.
1654
-
1655
- 3. Neither gradient uses a combination of <<length>> and <<percentage>> color stops.
1656
-
1657
- If the two gradients satisfy all of those constraints,
1658
- they must be interpolated as described below.
1659
- If they fail the third one only,
1660
- they must be abruptly transitioned at 50%
1661
- (unless otherwise specified by a future specification).
1662
- If they fail either of the first two constraints,
1663
- they must be interpolated using ''cross-fade()''
1664
- as for generic images.
1665
-
1666
- Note: The abrupt transition at 50% is so that content will not rely on cross-fading,
1667
- and smarter interpolation rules can be added for this case in the future.
1668
-
1669
- 1. Convert both the start and end gradients to their explicit forms:
1670
-
1671
- : For linear gradients:
1672
- :: * If the direction is specified as an <<angle>> ,
1673
- it is already in its explicit form.
1674
-
1675
- * Otherwise,
1676
- change its direction to an <<angle>> in [''0deg'' ,''360deg'' )
1677
- that would produce an equivalent rendering.
1678
-
1679
- If both the start and end gradients had their direction specified with keywords,
1680
- and the absolute difference between the angles their directions mapped to is greater than 180deg,
1681
- add 360deg to the direction of the gradient with the smaller angle.
1682
- <span class='note'> This ensures that a transition from, for example,
1683
- "to left" (270deg) to "to top" (0deg)
1684
- rotates the gradient a quarter-turn clockwise,
1685
- as expected,
1686
- rather than rotating three-quarters of a turn counter-clockwise.</span>
1687
-
1688
- : For radial gradients:
1689
- :: * If the size is specified as two <<length>> s or <<percentage>> s,
1690
- it is already in its explicit form.
1691
-
1692
- * Otherwise, the size must be changed to a pair of <<length>> s
1693
- that would produce an equivalent ending-shape.
1694
- If the <<ending-shape>> was specified as ''circle'' ,
1695
- change it to ''ellipse'' .
1696
-
1697
- 2. Interpolate each component and color-stop of the gradients independently.
1698
- For linear gradients,
1699
- the only component is the angle.
1700
- For radial gradients,
1701
- the components are the horizontal and vertical position of the center
1702
- and the horizontal and vertical axis lengths.
1703
-
1704
- 3. To interpolate a color-stop,
1705
- first match each color-stop in the start gradient
1706
- to the corresponding color-stop at the same index in the end gradient.
1707
- For repeating gradients,
1708
- the first specified color-stop in the start and end gradients
1709
- are considered to be at the same index,
1710
- and all other color-stops following and preceding are indexed appropriately,
1711
- repeating and shifting each gradient's list of color-stops as needed.
1712
- Then, for each pair of color-stops,
1713
- interpolate the position and color independently.
1588
+ Interpolation of <<image>> values is not defined in this level.
1589
+ Implementations must abruptly transition them
1590
+ (at 50% transition progress, like other unsupported interpolations),
1591
+ unless otherwise defined by a future specification.
1592
+
1593
+ Note: CSS Images Level 4 is expected to define specialized interpolation for gradients,
1594
+ and define that all other images interpolate by cross-fading.
1714
1595
1715
1596
<!--
1716
1597
██████ ████████ ████████ ████ ███ ██ ████ ████████ ███ ████████ ████ ███████ ██ ██
@@ -1735,9 +1616,6 @@ Serialization {#serialization}
1735
1616
joining space-separated tokens with a single space,
1736
1617
and following each serialized comma with a single space.
1737
1618
1738
- For ''cross-fade()'' ,
1739
- always serialize the <<percentage>> .
1740
-
1741
1619
<div class='example'>
1742
1620
For example, a gradient specified as:
1743
1621
@@ -1781,8 +1659,6 @@ Changes Since the <a href="https://www.w3.org/TR/2012/CR-css3-images-20120417/">
1781
1659
and the <<angle>> values deprecated.
1782
1660
- Added the 'image-rendering' property
1783
1661
- Added the ''cross-fade()'' notation
1784
- - Defined <a href="#interpolation">Interpolation</a>
1785
- - Defined <a href="#serialization">Serialization</a>
1786
1662
1787
1663
<h3 class=no-num id=changes-last-call>
1788
1664
Changes Since Last Call</h3>
0 commit comments