1515
1616 < h1 > CSS Image Values and Replaced Content Module Level 3</ h1 >
1717
18- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 23 February
19- 2011</ h2 >
18+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 7 March 2011</ h2 >
2019
2120 < dl >
2221 < dt > Latest Version:
@@ -1415,83 +1414,69 @@ <h3 id=object-fit><span class=secno>6.4. </span> Sizing Objects: The
14151414 contents of a replaced element should be scaled relative to the box
14161415 established by its used height and width. It also enables scaling a
14171416 replaced element's contents up to a specified maximum size or down to a
1418- specified minimum size while preserving its aspect ratio.
1417+ specified minimum size while preserving its aspect ratio. This property
1418+ never affects the size of the replaced element; it only affects the size
1419+ of the contents of the replaced element.
14191420
14201421 < p > Not all replaced elements can be scaled, but images typically can.
14211422
1422- < p > The contents of a replaced element with an intrinsic aspect ratio (which
1423- may be derived from intrinsic dimensions) are scaled as follows:
1423+ < p > If the replaced element's content do not have an intrinsic aspect ratio
1424+ (which may be derived from an intrinsic width and height), all of the
1425+ values for ‘< a href ="#object-fit0 "> < code
1426+ class =property > object-fit</ code > </ a > ’ are treated as ‘< code
1427+ class =css > fill</ code > ’. Otherwise, the contents are scaled as
1428+ follows:
14241429
14251430 < dl >
14261431 < dt > fill
14271432
14281433 < dd >
1429- < p > Determine the used ‘< code class =property > height</ code > ’
1430- and ‘< code class =property > width</ code > ’ < a
1431- href ="/TR/CSS21/visudet.html "> as usual</ a > . Scale the content height and
1432- width independently so that the edges of the content just meet the edges
1433- of the box established by the used ‘< code
1434- class =property > height</ code > ’ and ‘< code
1435- class =property > width</ code > ’.</ p >
1434+ < p > Set the content's size to the < a
1435+ href ="#concrete-object-size "> < i > concrete object size</ i > </ a > obtained by
1436+ running the < i title =default-sizing > object sizing algorithm</ i > with a
1437+ < a href ="#specified-size "> < i > specified size</ i > </ a > and a < a
1438+ href ="#default-object-size "> < i > default object size</ i > </ a > equal to the
1439+ replaced element's used width and height.</ p >
1440+
1441+ < p > This will make the contents exactly fill the replaced element.</ p >
14361442
14371443 < dt > contain
14381444
14391445 < dd >
1440- < p > Determine the used ‘< code class =property > height</ code > ’
1441- and ‘< code class =property > width</ code > ’ < a
1442- href ="/TR/CSS21/visudet.html "> as usual</ a > , except if both ‘< code
1443- class =property > height</ code > ’ and ‘< code
1444- class =property > width</ code > ’ are ‘< code
1445- class =css > auto</ code > ’, and the used value of at least one of
1446- ‘< code class =property > max-width</ code > ’ and ‘< code
1447- class =property > max-height</ code > ’ is not ‘< code
1448- class =property > none</ code > ’, then compute the element's used width
1449- and used height as though the intrinsic dimensions of the contents were
1450- infinitely large numbers whose ratio is the actual intrinsic ratio of
1451- the contents.</ p >
1452-
1453- < p > Scale the contents of the element, preserving their aspect ratio, to
1454- the largest size such that the width of the contents is less than or
1455- equal to the used width of the box and the height of the contents is
1456- less than or equal to the used height of the box.</ p >
1446+ < p > Set the content's size to the largest width and height that has the
1447+ same aspect ratio as the content's intrinsic aspect ratio, and
1448+ additionally has neither width nor height larger than the replaced
1449+ element's used width and height, respectively.</ p >
14571450
14581451 < dt > cover
14591452
14601453 < dd >
1461- < p > Determine the used ‘< code class =property > height</ code > ’
1462- and ‘< code class =property > width</ code > ’ < a
1463- href ="/TR/CSS21/visudet.html "> as usual</ a > , except if both ‘< code
1464- class =property > height</ code > ’ and ‘< code
1465- class =property > width</ code > ’ are ‘< code
1466- class =css > auto</ code > ’, and the used value of at least one of
1467- ‘< code class =property > min-width</ code > ’ and ‘< code
1468- class =property > min-height</ code > ’ is not ‘< code
1469- class =css > 0</ code > ’, then compute the used width and used height
1470- of the element as though the intrinsic dimensions of the contents were
1471- infinitesimally small numbers whose ratio is the actual intrinsic ratio
1472- of the contents.</ p >
1473-
1474- < p > Scale the contents of the element, preserving their aspect ratio, to
1475- the smallest size such that the width of the contents is greater than or
1476- equal to the used width of the box and the height of the contents is
1477- greater than or equal to the height of the box.</ p >
1454+ < p > Set the content's size to the smallest width and height that has the
1455+ same aspect ratio as the content's intrinsic aspect ratio, and
1456+ additionally has neither width nor height smaller than the replaced
1457+ element's used width and height, respectively.</ p >
14781458
14791459 < dt > none
14801460
14811461 < dd >
1482- < p > Determine the used ‘< code class =property > height</ code > ’
1483- and ‘< code class =property > width</ code > ’ < a
1484- href ="/TR/CSS21/visudet.html "> as usual</ a > . If the content has an
1485- intrinsic height and width, do not scale it. Otherwise, this value must
1486- be treated as ‘< code class =css > fill</ code > ’.</ p >
1462+ < p > Set the content's size to the < a
1463+ href ="#concrete-object-size "> < i > concrete object size</ i > </ a > obtained by
1464+ running the < i title =default-sizing > object sizing algorithm</ i > with no
1465+ < a href ="#specified-size "> < i > specified size</ i > </ a > , and a < a
1466+ href ="#default-object-size "> < i > default object size</ i > </ a > equal to the
1467+ replaced element's used width and height.</ p >
14871468
14881469 < dt > scale-down < b class =issue > better name?</ b >
14891470
14901471 < dd >
1491- < p > This value must act identically to ‘< code
1492- class =css > none</ code > ’ or ‘< code
1493- class =css > contain</ code > ’, whichever would make the contents
1494- smaller.</ p >
1472+ < p > Size the content as if ‘< code class =property > none</ code > ’
1473+ or ‘< code class =property > contain</ code > ’ were specified,
1474+ whichever would result in a smaller size.</ p >
1475+
1476+ < p class =note > Note that both ‘< code
1477+ class =property > none</ code > ’ and ‘< code
1478+ class =property > contain</ code > ’ respect the content's intrinsic
1479+ aspect ratio, so the concept of "smaller" is well-defined.</ p >
14951480 </ dl >
14961481
14971482 < p class =issue > ISSUE: ‘< code class =property > none</ code > ’ and
@@ -1500,10 +1485,11 @@ <h3 id=object-fit><span class=secno>6.4. </span> Sizing Objects: The
15001485 is there existing content behavior (perhaps surrounding <object> ) that
15011486 requires one of these values?
15021487
1503- < p > The ‘< code class =property > overflow</ code > ’ property
1504- determines how to render parts of the replaced element's content that
1505- extend beyond the edges of its box. See the ‘< a
1506- href ="#object-position0 "> < code
1488+ < p > If the content does not completely fill the replaced element, the
1489+ unfilled space shows the replaced element's background. The ‘< code
1490+ class =property > overflow</ code > ’ property determines how to render
1491+ parts of the replaced element's content that extend beyond the edges of
1492+ its box. See the ‘< a href ="#object-position0 "> < code
15071493 class =property > object-position</ code > </ a > ’ property for positioning
15081494 the object with respect to the element's box.
15091495
@@ -1526,6 +1512,16 @@ <h3 id=object-fit><span class=secno>6.4. </span> Sizing Objects: The
15261512 to the fit attribute in < a href ="#SMIL10 "
15271513 rel =biblioentry > [SMIL10]<!--{{SMIL10}}--> </ a > .
15281514
1515+ < p class =note > Note: Per the < i title =object-negotiation > CSS⇋Object
1516+ Negotiation</ i > algorithm, the < a href ="#concrete-object-size "> < i > concrete
1517+ object size</ i > </ a > (or, in this case, the size of the content) does not
1518+ directly scale the object itself - it is merely passed to the object as
1519+ information about the size of the visible canvas. How to then draw into
1520+ that size is up to the image format. In particular, raster images always
1521+ scale to the given size, while SVG uses the given size as the size of the
1522+ "SVG Viewport" (a term defined by SVG) and then uses the values of several
1523+ attributes on the root <svg> element to determine how to draw itself.
1524+
15291525 < p > User agents MAY accept ‘< code
15301526 class =property > image-fit</ code > ’ as an alias for ‘< a
15311527 href ="#object-fit0 "> < code class =property > object-fit</ code > </ a > ’, as
0 commit comments