Skip to content

Commit

Permalink
[css-sizing-4] Replace the intrinsic-* properties with contain-intrin…
Browse files Browse the repository at this point in the history
…sic-size, per WG resolution. Closes w3c#4531.
  • Loading branch information
tabatkins authored and Jordan Taylor committed May 13, 2020
1 parent fa8f82c commit ae0f01a
Showing 1 changed file with 40 additions and 52 deletions.
92 changes: 40 additions & 52 deletions css-sizing-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -612,69 +612,57 @@ Max-content Sizes in Constrained-height Multi-column Layout</h3>


<h3 id='intrinsic-size-override'>
Overriding Intrinsic Sizes: the 'intrinsic-*' properties</h3>
Overriding Contained Intrinsic Sizes: the 'contain-intrinsic-size' property</h3>

<pre class="propdef">
Name: intrinsic-block-size, intrinsic-inline-size, intrinsic-height, intrinsic-width
Value: legacy | auto | <<length>>
Initial: legacy
Name: contain-intrinsic-size
Value: none | <<length>>{1,2}
Initial: none
Inherited: no
Applies to: all elements except [=non-replaced=] [=inlines=]
Computed value: as specified, with <<length-percentage>> values computed
Applies to: elements with [=size containment=]
Computed value: as specified, with <<length>> values computed
Percentages: n/a
Animation type: by computed value type
</pre>

The 'intrinsic-*' properties determine
whether the [=intrinsic sizes=] of a box
are calculated from sizes derived from its content
(as defined by the rest of this chapter),
or from a specified <dfn export>explicit intrinsic inner size</dfn>.
Values are defined as follows:

<dl dfn-type=value dfn-for="intrinsic-block-size, intrinsic-inline-size, intrinsic-height, intrinsic-width, intrinsic-size">
: <dfn>legacy</dfn>
::
Does not specify an [=explicit intrinsic inner size=] of the box
in the relevant axis.
(Intrinsic sizes are thus determined in various ways
based on examining the content of the box as usual.
See [[#intrinsic]], for example.)


: <dfn>auto</dfn>

This property allows elements with [=size containment=] to specify
an <dfn export>explicit intrinsic inner size</dfn>,
causing the box to size as if it had contents
with a combined width and height
matching the specified [=explicit intrinsic inner size=]
(rather than sizing as if it were empty).

Note: An element with [=size containment=] is laid out as if it had no contents [[!CSS-CONTAIN-1]],
which in many cases this will cause the element to collapse to zero inner height.
This can be corrected with an explicit 'height' chosen to show the expected contents,
but that can have unintended effects in some layout systems,
such as Flex and Grid Layout,
which treat an explicit 'height' as a stronger command
than an implicit content-based height.
The element thus might lay out substantially differently than it would have
were it simply filled with content up to that height.
Providing an [=explicit intrinsic inner size=] for the element
preserves the performance benefits of ignoring its contents for layout
while still allowing it to size as if it had content.

Values are defined as:

<dl dfn-type=value dfn-for="contain-intrinsic-size">
: <dfn>none</dfn>
::
If 'overflow' is not ''visible'' in the relevant axis,
specifies a zero [=explicit intrinsic inner size=]
in that axis.
Otherwise same as ''legacy''.
Does not specify an [=explicit intrinsic inner size=]
for elements with [=size containment=].

: <dfn><<length>></dfn>
: <dfn><<length>>{2}</dfn>
::
Specifies an [=explicit intrinsic inner size=]
in the relevant axis.
If the element has [=size containment=],
specifies an [=explicit intrinsic inner size=].
The first <<length>> provides the inner width of the element,
the second provides the inner height.
If the second <<length>> is omitted,
it defaults to the same value as the first.
</dl>

Note: The value of 'intrinsic-*' in one axis has no affect on the other axis.

<pre class="propdef shorthand">
Name: intrinsic-size
Value: <<'intrinsic-width'>> <<'intrinsic-height'>>?
</pre>

The 'intrinsic-size' property is a [=shorthand=]
for setting all the 'intrinsic-*' properties in one declaration.

The first value sets 'intrinsic-width',
and the second value sets 'intrinsic-height'.
If the second value is omitted,
it defaults to the first.

Issue: When we figure out how to make other physical x/y shorthands,
like 'background-size',
work with logical sizes,
we'll apply the same logic here.


<!--
██████ ███████ ██ ██ ████████ ████████ ████ ████████ ██████
Expand Down

0 comments on commit ae0f01a

Please sign in to comment.