Skip to content

Commit c6d881f

Browse files
committed
[css-images-4] Add object-view-box and object-overflow. #7058
1 parent 68b3891 commit c6d881f

File tree

1 file changed

+143
-14
lines changed

1 file changed

+143
-14
lines changed

css-images-4/Overview.bs

+143-14
Original file line numberDiff line numberDiff line change
@@ -1557,13 +1557,13 @@ Conic Gradient Examples</h4>
15571557
</div>
15581558

15591559
<!--
1560-
████████ ████████ ████████ ████████ ███ ████████ ████ ██ ██ ██████
1561-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██
1562-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██
1563-
████████ ██████ ████████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ████
1564-
██ ██ ██ ██ ██ █████████ ██ ██ ██ ████ ██ ██
1565-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██
1566-
██ ██ ████████ ██ ████████ ██ ██ ██ ████ ██ ██ ██████
1560+
████████ ████████ ████████ ████████ ███ ████████
1561+
██ ██ ██ ██ ██ ██ ██ ██ ██
1562+
██ ██ ██ ██ ██ ██ ██ ██ ██
1563+
████████ ██████ ████████ ██████ ██ ██ ██
1564+
██ ██ ██ ██ ██ █████████ ██
1565+
██ ██ ██ ██ ██ ██ ██ ██
1566+
██ ██ ████████ ██ ████████ ██ ██ ██
15671567
-->
15681568

15691569
<h3 id='repeating-gradients'>
@@ -1921,6 +1921,84 @@ Color Stop “Fixup”</h4>
19211921
Sizing Images and Objects in CSS {#sizing}
19221922
==========================================
19231923

1924+
<!--
1925+
███████ ██ ██ ████████
1926+
██ ██ ██ ██ ██ ██
1927+
██ ██ ██ ██ ██ ██
1928+
██ ██ ███████ ██ ██ ███████ ████████
1929+
██ ██ ██ ██ ██ ██
1930+
██ ██ ██ ██ ██ ██
1931+
███████ ███ ████████
1932+
-->
1933+
1934+
Setting The Viewbox: the 'object-view-box' property {#the-object-view-box}
1935+
--------------------------------------------------------------------------
1936+
1937+
<pre class=propdef>
1938+
Name: object-view-box
1939+
Value: none | <basic-shape-rect>
1940+
Initial: none
1941+
Applies to: [=replaced elements=]
1942+
Inherited: no
1943+
Percentages: n/a
1944+
Computed value: specified keyword, or computed <basic-shape> function
1945+
Animation Type: as <basic-shape> if possible, otherwise discrete
1946+
</pre>
1947+
1948+
The 'object-view-box' property
1949+
specifies a "view box" over an element,
1950+
similar to the <{svg/viewBox|&lt;svg viewBox>}> attribute,
1951+
zooming or panning over the element's contents.
1952+
1953+
<dl dfn-type=value dfn-for=object-view-box>
1954+
: <dfn>none</dfn>
1955+
::
1956+
The element does not have a view box.
1957+
1958+
: <dfn><<basic-shape-rect>></dfn>
1959+
::
1960+
If the element does not have both a [=natural width=]
1961+
and a [=natural height=],
1962+
this value has no effect,
1963+
similar to ''object-view-box/none''.
1964+
1965+
Otherwise, specifies a view box for the element.
1966+
1967+
First, resolve the <<basic-shape-rect>>
1968+
against a [=&lt;basic-shape>/reference box=] formed by the element's
1969+
[=natural sizes=]
1970+
to obtain the element's view box.
1971+
1972+
For all purposes,
1973+
the element is now treated as having [=natural sizes=]
1974+
equal to the view box's width and height.
1975+
If the element had a [=natural aspect ratio=],
1976+
it's now treated as instead having the same ratio as the view box.
1977+
(Notably, 'object-fit', 'object-position',
1978+
and the resolution of the element's own size in layout
1979+
all use the view box's size instead.)
1980+
1981+
When the element is painted,
1982+
its contents are scaled and translated
1983+
such that the portion of the element originally covered by the view box
1984+
(relative to its original [=natural sizes=])
1985+
exactly fills the [=concrete object size=]
1986+
determined for it.
1987+
</dl>
1988+
1989+
Note: Some replaced elements might have a built-in notion of a "view box",
1990+
such as the <{svg}> element.
1991+
Unless otherwise specified,
1992+
this property does not interact with such notions;
1993+
the built-in notion has its effect as normal,
1994+
producing a replaced element with [=natural sizes=],
1995+
then this property applies on top of that.
1996+
1997+
<div class=example>
1998+
Issue: example here. Need a basic one showing off zooming in, one showing off zooming out, and one showing off interaction with object-fit to display how the parts outside the viewbox can still be painted.
1999+
</div>
2000+
2001+
19242002
<!--
19252003
███████ ████████ ██ ████████ ██████ ████████ ████████ ████ ████████
19262004
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
@@ -2026,17 +2104,68 @@ Sizing Objects: the 'object-fit' property {#the-object-fit}
20262104
(a term defined by SVG)
20272105
and then uses the values of several attributes on the root <code>&lt;svg></code> element to determine how to draw itself.
20282106

2107+
2108+
Overflowing Objects: the 'object-overflow' property {#the-object-overflow}
2109+
--------------------------------------------------------------------------
2110+
2111+
<pre class=propdef>
2112+
Name: object-overflow
2113+
Value: clip | visible
2114+
Initial: clip
2115+
Applies to: replaced elements
2116+
Inherited: no
2117+
Percentages: n/a
2118+
Computed value: as specified
2119+
Animation type: discrete
2120+
</pre>
2121+
2122+
The 'object-overflow' property specifies
2123+
how replaced elements render any content
2124+
that overflows their [=content box=].
2125+
2126+
<dl dfn-type=value dfn-for=object-overflow>
2127+
: <dfn>clip</dfn>
2128+
:: The box's content is clipped to its [=content box=],
2129+
and the UA must not allow the content to be scrolled by any means
2130+
to display the overflowing content.
2131+
2132+
Note: Replaced elements can render their contents in any way they wish;
2133+
for example, the content <em>itself</em> might be scrollable
2134+
and provide scrollbars and similar affordances,
2135+
such as the contents of an HTML <{iframe}> element.
2136+
But if that content rectangle overflows the content box
2137+
of the element,
2138+
<em>it</em> must not expose the overflowing parts of itself
2139+
in any way.
2140+
2141+
: <dfn>visible</dfn>
2142+
:: There is no special handling of overflow;
2143+
that is, the box’s content is rendered outside the box
2144+
if positioned there.
2145+
The box is not a [=scroll container=].
2146+
2147+
Any content that as a result
2148+
is rendered outside of the [=content box=]
2149+
is treated as [=ink overflow=].
2150+
</dl>
2151+
2152+
<div class=example>
2153+
Issue: example here, showing a combo with object-view-box to get an image of something with a built-in shadow to render the shadow outside of the box.
2154+
</div>
2155+
2156+
2157+
20292158
Image Processing {#image-processing}
20302159
====================================
20312160

20322161
<!--
2033-
████ ██ ██ ███ █████████████ ████████ ████████ ██████ ███████ ██ ██ ██ ████████ ████ ███████ ██ ██
2034-
██ ███ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██
2035-
██ ████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██
2036-
██ ██ ███ ██ ██ ██ ██ ████ ██████ ███████ ████████ ██████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
2037-
██ ██ ██ █████████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████
2038-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███
2039-
████ ██ ██ ██ ██ ██████ ████████ ██ ██ ████████ ██████ ███████ ████████ ███████ ██ ████ ███████ ██ ██
2162+
████ ████████ ████████ ██████
2163+
██ ██ ██ ██ ██ ██
2164+
██ ██ ██ ██ ██
2165+
██ ███████ ████████ ██████ ██████
2166+
██ ██ ██ ██ ██
2167+
██ ██ ██ ██ ██ ██
2168+
████ ██ ██ ████████ ██████
20402169
-->
20412170

20422171
Overriding Image Resolutions: the 'image-resolution' property {#the-image-resolution}

0 commit comments

Comments
 (0)