@@ -245,21 +245,20 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
245245 < ul class =toc >
246246 < li > < a href ="#sizing-terms "> < span class =secno > 5.1. </ span > Object-Sizing
247247 Terminology</ a >
248- < ul class =toc >
249- < li > < a href ="#specified-and-default-sizes "> < span class =secno > 5.1.1.
250- </ span > Specified and Default Object Sizes</ a >
251- </ ul >
252248
253249 < li > < a href ="#object-negotiation "> < span class =secno > 5.2. </ span >
254250 CSS⇋Object Negotiation</ a >
255251
256252 < li > < a href ="#default-sizing "> < span class =secno > 5.3. </ span > Default
257253 Concrete Object Size Resolution</ a >
258254
259- < li > < a href ="#object-fit "> < span class =secno > 5.4. </ span > Sizing Objects:
255+ < li > < a href ="#object-sizing-examples "> < span class =secno > 5.4. </ span >
256+ Examples of CSS Object Sizing</ a >
257+
258+ < li > < a href ="#object-fit "> < span class =secno > 5.5. </ span > Sizing Objects:
260259 the ‘< code class =property > object-fit</ code > ’ property</ a >
261260
262- < li > < a href ="#object-position "> < span class =secno > 5.5 . </ span >
261+ < li > < a href ="#object-position "> < span class =secno > 5.6 . </ span >
263262 Positioning Objects: the ‘< code
264263 class =property > object-position</ code > ’ property</ a >
265264 </ ul >
@@ -1707,129 +1706,6 @@ <h3 id=sizing-terms><span class=secno>5.1. </span> Object-Sizing
17071706 < a href ="#specified-size "> < i > specified size</ i > </ a > are missing
17081707 dimensions.
17091708 </ dl >
1710-
1711- < h4 id =specified-and-default-sizes > < span class =secno > 5.1.1. </ span >
1712- Specified and Default Object Sizes</ h4 >
1713-
1714- < p > When sizing an object using the < a
1715- href ="#default-sizing-algorithm "> < i > default sizing algorithm</ i > </ a > , the
1716- < a href ="#specified-size "> < i > specified size</ i > </ a > and < a
1717- href ="#default-object-size "> < i > default object size</ i > </ a > can vary based
1718- on the context of the object and various CSS properties. This section
1719- defines these for the various contexts in which an ‘< a
1720- href ="#image-type "> < code class =css > <image> </ code > </ a > ’ component
1721- value can appear in CSS 2.1 and CSS3 Backgrounds & Borders. Newer
1722- modules that accept an ‘< a href ="#image-type "> < code
1723- class =css > <image> </ code > </ a > ’ component value in a new context
1724- must define the < a href ="#specified-size "> < i > specified size</ i > </ a > and < a
1725- href ="#default-object-size "> < i > default object size</ i > </ a > in that
1726- context.
1727-
1728- < p class =note > This section is normative, but is not intended to contradict
1729- anything stated in CSS2.1 or CSS3 Backgrounds & Borders. Any
1730- contradiction should be taken as an error in this spec and reported.
1731-
1732- < dl >
1733- < dt > ‘< code class =property > background-image</ code > ’
1734-
1735- < dd >
1736- < p > If ‘< code class =property > background-size</ code > ’ is
1737- ‘< code class =css > cover</ code > ’ or ‘< code
1738- class =css > contain</ code > ’, the < a
1739- href ="#specified-size "> < i > specified size</ i > </ a > has a "cover" or
1740- "contain" constraint, respectively. Otherwise, if ‘< code
1741- class =property > background-size</ code > ’ specifies a
1742- non-‘< code class =css > auto</ code > ’ width and/or height, the
1743- < a href ="#specified-size "> < i > specified size</ i > </ a > is that width and/or
1744- height. If ‘< code class =property > background-repeat</ code > ’
1745- is ‘< code class =css > round</ code > ’ in either dimension, the
1746- < a href ="#specified-size "> < i > specified size</ i > </ a > also has a rounding
1747- constraint in that dimension.</ p >
1748-
1749- < p > The < a href ="#default-object-size "> < i > default object size</ i > </ a > is
1750- the < a
1751- href ="http://www.w3.org/TR/css3-background/#background-positioning-area "> background
1752- positioning area</ a > . < a href ="#CSS3BG "
1753- rel =biblioentry > [CSS3BG]<!--{{CSS3BG}}--> </ a > </ p >
1754-
1755- < dt > ‘< code class =property > list-style-image</ code > ’
1756-
1757- < dd > The < a href ="#specified-size "> < i > specified size</ i > </ a > has no
1758- constraints. The < a href ="#default-object-size "> < i > default object
1759- size</ i > </ a > is a 1em square.
1760-
1761- < dt > ‘< code class =property > border-image</ code > ’
1762-
1763- < dd >
1764- < p > When initially sizing an image (before slicing it), the < a
1765- href ="#specified-size "> < i > specified size</ i > </ a > has no constraints, and
1766- the < a href ="#default-object-size "> < i > default object size</ i > </ a > is the
1767- < a href ="http://www.w3.org/TR/css3-background/#border-image-area "> border
1768- image area</ a > . < a href ="#CSS3BG "
1769- rel =biblioentry > [CSS3BG]<!--{{CSS3BG}}--> </ a > .</ p >
1770-
1771- < p > When sizing the slices, the top and bottom slices' < a
1772- href ="#specified-size "> < i > specified size</ i > </ a > s have a height equal to
1773- the top/bottom ‘< code
1774- class =property > border-image-width</ code > ’, the left and right
1775- slices' < a href ="#specified-size "> < i > specified size</ i > </ a > s have a
1776- width equal to the left/right ‘< code
1777- class =property > border-image-width</ code > ’, and the corner slices'
1778- < a href ="#specified-size "> < i > specified size</ i > </ a > s have widths and
1779- heights equal to the ‘< code
1780- class =property > border-image-width</ code > ’ for the two sides
1781- they're a part of. If the first keyword of ‘< code
1782- class =property > border-image-repeat</ code > ’ is ‘< code
1783- class =css > round</ code > ’, the top and bottom slices' < a
1784- href ="#specified-size "> < i > specified size</ i > </ a > s have a horizontal
1785- rounding constraint. If the second keyword of ‘< code
1786- class =property > border-image-repeat</ code > ’ is ‘< code
1787- class =css > round</ code > ’, the left and right slices' < i > specifies
1788- size</ i > s have a vertical rounding constraint.</ p >
1789-
1790- < p > The middle slice is sized specially to match the width of the
1791- top/bottom slices and the height of the left/right slices, and so is not
1792- covered by this sizing algorithm.</ p >
1793-
1794- < p > The < a href ="#default-object-size "> < i > default object size</ i > </ a > for
1795- each slice is the size of the border image area part they are associated
1796- with.</ p >
1797-
1798- < dt > ‘< code class =property > cursor</ code > ’
1799-
1800- < dd > The < a href ="#specified-size "> < i > specified size</ i > </ a > has no
1801- constraints. The < a href ="#default-object-size "> < i > default object
1802- size</ i > </ a > is a UA-defined size that should be based on the size of a
1803- typical cursor on the UA's operating system. < a href ="#CSS21 "
1804- rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a >
1805-
1806- < dt > ‘< code class =property > content</ code > ’ (non-replaced)
1807-
1808- < dd > The < a href ="#specified-size "> < i > specified size</ i > </ a > has no
1809- constraints. The < a href ="#default-object-size "> < i > default object
1810- size</ i > </ a > is the largest rectangle that has a 2:1 width:height ratio,
1811- is no larger than 300px width and 150px height, and has a width that fits
1812- in the device. < a href ="#CSS21 "
1813- rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a > .
1814-
1815- < dt > replaced elements
1816-
1817- < dd > Replaced elements are not sized by the < a
1818- href ="#default-sizing-algorithm "> < i > default sizing algorithm</ i > </ a > .
1819- Instead, CSS 2.1 defines how to size them in sections < a
1820- href ="http://www.w3.org/TR/CSS2/visudet.html#min-max-widths "> 10.4</ a > and
1821- < a
1822- href ="http://www.w3.org/TR/CSS2/visudet.html#min-max-heights "> 10.7</ a > .
1823- < a href ="#CSS21 " rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a >
1824-
1825- < dt > contents of replaced elements
1826-
1827- < dd > The < a href ="#specified-size "> < i > specified size</ i > </ a > is defined by
1828- ‘< a href ="#object-fit0 "> < code
1829- class =property > object-fit</ code > </ a > ’. The < a
1830- href ="#default-object-size "> < i > default object size</ i > </ a > is the used
1831- width and height of the replaced element.
1832- </ dl >
18331709 <!-- ====================================================================== -->
18341710
18351711 < h3 id =object-negotiation > < span class =secno > 5.2. </ span > CSS⇋Object
@@ -1975,10 +1851,112 @@ <h3 id=default-sizing><span class=secno>5.3. </span> Default Concrete
19751851 that the < a href ="#concrete-object-size "> < i > concrete object size</ i > </ a >
19761852 has the same aspect ratio as the object's intrinsic aspect ratio (and
19771853 analogously for a < a href ="#specified-size "> < i > specified size</ i > </ a > with
1978- a vertical rounding constraint but no width).</ p >
1854+ a vertical rounding constraint but no width).
1855+
1856+ < h3 id =object-sizing-examples > < span class =secno > 5.4. </ span > Examples of
1857+ CSS Object Sizing</ h3 >
1858+
1859+ < div class =example >
1860+ < p > The following examples show how the < a
1861+ href ="http://www.w3.org/TR/CSS21/ "> CSS 2.1</ a > and < a
1862+ href ="http://www.w3.org/TR/css3-background/ "> CSS3 Backgrounds &
1863+ Borders</ a > sizing algorithms correspond to concepts defined in this
1864+ specification.
1865+
1866+ < dl >
1867+ < dt > ‘< code class =property > background-image</ code > ’
1868+
1869+ < dd > The rules for calculating the < a
1870+ href ="#concrete-object-size "> < i > concrete object size</ i > </ a > of a
1871+ background are defined in < a
1872+ href ="http://www.w3.org/TR/CSS21/colors.html#background-properties "> CSS2.1§14.2.1</ a >
1873+ and < a
1874+ href ="http://www.w3.org/TR/css3-background/#the-background-size "> CSS3BG§3.9</ a > .
1875+ CSS2.1 uses the < a href ="#default-sizing-algorithm "> < i > default sizing
1876+ algorithm</ i > </ a > with no < a href ="#specified-size "> < i > specified
1877+ size</ i > </ a > and the < i > background positioning area</ i > as the < a
1878+ href ="#default-object-size "> < i > default object size</ i > </ a > . < a
1879+ href ="#CSS21 " rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a > In CSS3,
1880+ ‘< code class =property > background-size</ code > ’ property can
1881+ give a sizing constraint, invoking either the < a
1882+ href ="#default-sizing-algorithm "> < i > default sizing algorithm</ i > </ a > or
1883+ one of the < i title ="contain constraint "> contain</ i > or < i
1884+ title ="cover constraint "> cover</ i > constraints. The concrete object size
1885+ is further adjusted in later steps if ‘< code
1886+ class =property > background-repeat</ code > ’ has a ‘< code
1887+ class =css > round</ code > ’ value. < a href ="#CSS3BG "
1888+ rel =biblioentry > [CSS3BG]<!--{{CSS3BG}}--> </ a >
1889+
1890+ < dt > ‘< code class =property > list-style-image</ code > ’
1891+
1892+ < dd > The rules for calculating the < a
1893+ href ="#concrete-object-size "> < i > concrete object size</ i > </ a > of a
1894+ list-style image are defined in < a
1895+ href ="http://www.w3.org/TR/CSS21/generate.html#propdef-list-style-image "> CSS2.1§12.5.1</ a > .
1896+ They use the < a href ="#default-sizing-algorithm "> < i > default sizing
1897+ algorithm</ i > </ a > with no < a href ="#specified-size "> < i > specified
1898+ size</ i > </ a > and a < a href ="#default-object-size "> < i > default object
1899+ size</ i > </ a > of 1em square.
1900+
1901+ < dt > ‘< code class =property > border-image</ code > ’
1902+
1903+ < dd > Border images are sized twice: first the entire image is sized to
1904+ determine the slice points, then the slices are sized to decorate the
1905+ border. The first sizing operation is defined in < a
1906+ href ="http://www.w3.org/TR/css3-background/#the-border-image-slice "> CSS3BG§6.2</ a >
1907+ and uses the < a href ="#default-sizing-algorithm "> < i > default sizing
1908+ algorithm</ i > </ a > with no < a href ="#specified-size "> < i > specified
1909+ size</ i > </ a > , and the < a
1910+ href ="http://www.w3.org/TR/css3-background/#border-image-area "> border
1911+ image area</ a > as the < a href ="#default-object-size "> < i > default object
1912+ size</ i > </ a > . The second operation is defined in < a
1913+ href ="http://www.w3.org/TR/css3-background/#border-image-process "> CSS3BG§6.2</ a > :
1914+ the < a href ="#default-sizing-algorithm "> < i > default sizing
1915+ algorithm</ i > </ a > is used to determine an initial size for each slice
1916+ with the corresponding < i > border image area</ i > part as the default
1917+ object size. By default the < a href ="#specified-size "> < i > specified
1918+ size</ i > </ a > matches this < a href ="#default-object-size "> < i > default
1919+ object size</ i > </ a > ; however the ‘< code
1920+ class =property > border-image-repeat</ code > ’ property can drop the
1921+ specified size in one or more directions and may also apply an
1922+ additional rounding step. < a href ="#CSS3BG "
1923+ rel =biblioentry > [CSS3BG]<!--{{CSS3BG}}--> </ a >
1924+
1925+ < dt > ‘< code class =property > cursor</ code > ’
1926+
1927+ < dd > The rules for calculating the < a
1928+ href ="#concrete-object-size "> < i > concrete object size</ i > </ a > of a cursor
1929+ are defined in < a
1930+ href ="http://www.w3.org/TR/CSS21/ui.html#cursor-props "> CSS2.1 § 18.1:
1931+ Cursors</ a > . The < a href ="#default-object-size "> < i > default object
1932+ size</ i > </ a > is a UA-defined size that should be based on the size of a
1933+ typical cursor on the UA's operating system. < a href ="#CSS21 "
1934+ rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a >
1935+
1936+ < dt > replaced elements
1937+
1938+ < dd > < a href ="http://www.w3.org/TR/CSS21/ "> CSS 2.1</ a > defines the sizing
1939+ of replaced elements (including those inserted as < a
1940+ href ="http://www.w3.org/TR/CSS21/generate.html#content "> generated
1941+ content</ a > ) in sections < a
1942+ href ="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width "> 10.3.2</ a > ,
1943+ < a
1944+ href ="http://www.w3.org/TR/CSS2/visudet.html#min-max-widths "> 10.4</ a > ,
1945+ < a
1946+ href ="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height "> 10.6.2</ a > ,
1947+ and < a
1948+ href ="http://www.w3.org/TR/CSS2/visudet.html#min-max-heights "> 10.7</ a > .
1949+ < a href ="#CSS21 " rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a > The
1950+ ‘< a href ="#object-fit0 "> < code
1951+ class =property > object-fit</ code > </ a > ’ property defined below
1952+ defines how the < a href ="#concrete-object-size "> < i > concrete object
1953+ size</ i > </ a > corresponds to the element's used width and height; by
1954+ default they coincide.
1955+ </ dl >
1956+ </ div >
19791957 <!-- ====================================================================== -->
19801958
1981- < h3 id =object-fit > < span class =secno > 5.4 . </ span > Sizing Objects: the
1959+ < h3 id =object-fit > < span class =secno > 5.5 . </ span > Sizing Objects: the
19821960 ‘< a href ="#object-fit0 "> < code
19831961 class =property > object-fit</ code > </ a > ’ property</ h3 >
19841962
@@ -2118,7 +2096,7 @@ <h3 id=object-fit><span class=secno>5.4. </span> Sizing Objects: the
21182096 attributes on the root <svg> element to determine how to draw itself.</ p >
21192097 <!-- ====================================================================== -->
21202098
2121- < h3 id =object-position > < span class =secno > 5.5 . </ span > Positioning Objects:
2099+ < h3 id =object-position > < span class =secno > 5.6 . </ span > Positioning Objects:
21222100 the ‘< a href ="#object-position0 "> < code
21232101 class =property > object-position</ code > </ a > ’ property</ h3 >
21242102
@@ -2874,10 +2852,10 @@ <h2 class=no-num id=index>Index</h2>
28742852 title ="<linear-gradient> "> < strong > 4.1.1.</ strong > </ a >
28752853
28762854 < li > object-fit, < a href ="#object-fit0 "
2877- title =object-fit > < strong > 5.4 .</ strong > </ a >
2855+ title =object-fit > < strong > 5.5 .</ strong > </ a >
28782856
28792857 < li > object-position, < a href ="#object-position0 "
2880- title =object-position > < strong > 5.5 .</ strong > </ a >
2858+ title =object-position > < strong > 5.6 .</ strong > </ a >
28812859
28822860 < li > objects, < a href ="#objects " title =objects > < strong > 5.</ strong > </ a >
28832861
0 commit comments