You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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|<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 [=<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.
0 commit comments