Skip to content

Commit 43913c1

Browse files
committed
[css-images-4][css-images-4] Put object-view-box in L5 per WG resolution #7058
1 parent b99b505 commit 43913c1

File tree

2 files changed

+107
-83
lines changed

2 files changed

+107
-83
lines changed

css-images-4/Overview.bs

-83
Original file line numberDiff line numberDiff line change
@@ -2017,89 +2017,6 @@ Color Stop “Fixup”</h4>
20172017
Sizing Images and Objects in CSS {#sizing}
20182018
==========================================
20192019

2020-
<!--
2021-
███████ ██ ██ ████████
2022-
██ ██ ██ ██ ██ ██
2023-
██ ██ ██ ██ ██ ██
2024-
██ ██ ███████ ██ ██ ███████ ████████
2025-
██ ██ ██ ██ ██ ██
2026-
██ ██ ██ ██ ██ ██
2027-
███████ ███ ████████
2028-
-->
2029-
2030-
Setting The Viewbox: the 'object-view-box' property {#the-object-view-box}
2031-
--------------------------------------------------------------------------
2032-
2033-
<pre class=propdef>
2034-
Name: object-view-box
2035-
Value: none | <<basic-shape-rect>>
2036-
Initial: none
2037-
Applies to: [=replaced elements=]
2038-
Inherited: no
2039-
Percentages: n/a
2040-
Computed value: specified keyword, or computed <basic-shape> function
2041-
Animation Type: as <basic-shape> if possible, otherwise discrete
2042-
</pre>
2043-
2044-
The 'object-view-box' property
2045-
specifies a "view box" over an element,
2046-
similar to the <{svg/viewBox|&lt;svg viewBox>}> attribute,
2047-
zooming or panning over the element's contents.
2048-
2049-
<dl dfn-type=value dfn-for=object-view-box>
2050-
: <dfn>none</dfn>
2051-
::
2052-
The element does not have a view box.
2053-
2054-
: <dfn><<basic-shape-rect>></dfn>
2055-
::
2056-
If the element does not have both a [=natural width=]
2057-
and a [=natural height=],
2058-
this value has no effect,
2059-
similar to ''object-view-box/none''.
2060-
2061-
Otherwise, specifies a view box for the element.
2062-
2063-
First, resolve the <<basic-shape-rect>>
2064-
against a [=&lt;basic-shape>/reference box=] formed by the element's
2065-
[=natural sizes=]
2066-
to obtain the element's view box.
2067-
2068-
For all purposes,
2069-
the element is now treated as having [=natural sizes=]
2070-
equal to the view box's width and height.
2071-
If the element had a [=natural aspect ratio=],
2072-
it's now treated as instead having the same ratio as the view box.
2073-
Further adjustments to the size/position of the element's contents,
2074-
such as 'object-position' or 'object-fit',
2075-
are similarly performed on the view box instead.
2076-
2077-
When the element is painted,
2078-
its contents are scaled and translated
2079-
such that the element's contents
2080-
retain the same position and size,
2081-
relative to the view box's final size and position,
2082-
that they had when the view box was determined (above).
2083-
2084-
Issue: Have not yet defined what happens if the view box is zero-area.
2085-
It's an error case,
2086-
so precise behavior isn't important;
2087-
just need to see what impls want to do about it.
2088-
</dl>
2089-
2090-
Note: Some replaced elements might have a built-in notion of a "view box",
2091-
such as the <{svg}> element.
2092-
Unless otherwise specified,
2093-
this property does not interact with such notions;
2094-
the built-in notion has its effect as normal,
2095-
producing a replaced element with [=natural sizes=],
2096-
then this property applies on top of that.
2097-
2098-
<div class=example>
2099-
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.
2100-
</div>
2101-
2102-
21032020
<!--
21042021
███████ ████████ ██ ████████ ██████ ████████ ████████ ████ ████████
21052022
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██

css-images-5/Overview.bs

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<pre class='metadata'>
2+
Title: CSS Images Module Level 5
3+
Status: ED
4+
Work Status: Exploring
5+
Shortname: css-images
6+
Level: 5
7+
Group: csswg
8+
ED: https://drafts.csswg.org/css-images-5/
9+
TR: https://www.w3.org/TR/css-images-5/
10+
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/, w3cid 42199
11+
Editor: Elika J. Etemad / fantasai, Invited Expert, http://fantasai.inkedblade.net/contact, w3cid 35400
12+
Editor: Lea Verou, Invited Expert, http://lea.verou.me/about, w3cid 52258
13+
Abstract: This module contains the features of CSS level 4 relating to the <<image>> type and replaced elements.
14+
It includes and extends the functionality of CSS level 2 [[CSS2]] and in the previous level of this specification [[css-images-4]].
15+
Default Highlight: css
16+
</pre>
17+
18+
Introduction {#intro}
19+
=====================
20+
21+
This is a diff spec over [[!css-images-4]].
22+
23+
Sizing Images and Objects in CSS {#sizing}
24+
==========================================
25+
26+
<!--
27+
███████ ██ ██ ████████
28+
██ ██ ██ ██ ██ ██
29+
██ ██ ██ ██ ██ ██
30+
██ ██ ███████ ██ ██ ███████ ████████
31+
██ ██ ██ ██ ██ ██
32+
██ ██ ██ ██ ██ ██
33+
███████ ███ ████████
34+
-->
35+
36+
Setting The Viewbox: the 'object-view-box' property {#the-object-view-box}
37+
--------------------------------------------------------------------------
38+
39+
<pre class=propdef>
40+
Name: object-view-box
41+
Value: none | <<basic-shape-rect>>
42+
Initial: none
43+
Applies to: [=replaced elements=]
44+
Inherited: no
45+
Percentages: n/a
46+
Computed value: specified keyword, or computed <basic-shape> function
47+
Animation Type: as <basic-shape> if possible, otherwise discrete
48+
</pre>
49+
50+
The 'object-view-box' property
51+
specifies a "view box" over an element,
52+
similar to the <{svg/viewBox|&lt;svg viewBox>}> attribute,
53+
zooming or panning over the element's contents.
54+
55+
<dl dfn-type=value dfn-for=object-view-box>
56+
: <dfn>none</dfn>
57+
::
58+
The element does not have a view box.
59+
60+
: <dfn><<basic-shape-rect>></dfn>
61+
::
62+
If the element does not have both a [=natural width=]
63+
and a [=natural height=],
64+
this value has no effect,
65+
similar to ''object-view-box/none''.
66+
67+
Otherwise, specifies a view box for the element.
68+
69+
First, resolve the <<basic-shape-rect>>
70+
against a [=&lt;basic-shape>/reference box=] formed by the element's
71+
[=natural sizes=]
72+
to obtain the element's view box.
73+
74+
For all purposes,
75+
the element is now treated as having [=natural sizes=]
76+
equal to the view box's width and height.
77+
If the element had a [=natural aspect ratio=],
78+
it's now treated as instead having the same ratio as the view box.
79+
Further adjustments to the size/position of the element's contents,
80+
such as 'object-position' or 'object-fit',
81+
are similarly performed on the view box instead.
82+
83+
When the element is painted,
84+
its contents are scaled and translated
85+
such that the element's contents
86+
retain the same position and size,
87+
relative to the view box's final size and position,
88+
that they had when the view box was determined (above).
89+
90+
Issue: Have not yet defined what happens if the view box is zero-area.
91+
It's an error case,
92+
so precise behavior isn't important;
93+
just need to see what impls want to do about it.
94+
</dl>
95+
96+
Note: Some replaced elements might have a built-in notion of a "view box",
97+
such as the <{svg}> element.
98+
Unless otherwise specified,
99+
this property does not interact with such notions;
100+
the built-in notion has its effect as normal,
101+
producing a replaced element with [=natural sizes=],
102+
then this property applies on top of that.
103+
104+
<div class=example>
105+
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.
106+
</div>
107+

0 commit comments

Comments
 (0)