Skip to content

Commit dc447e6

Browse files
committed
[css-sizing-4] Define the contain-intrinsic-* longhands. w3c#5432
1 parent aa31855 commit dc447e6

1 file changed

Lines changed: 39 additions & 21 deletions

File tree

css-sizing-4/Overview.bs

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ Intrinsic Sizes</h3>
482482
ISSUE: [[css-sizing-3#intrinsic-sizes]]
483483

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

487-
<pre class="propdef">
488-
Name: contain-intrinsic-size
489-
Value: none | <<length>>{1,2}
487+
<pre class=propdef>
488+
Name: contain-intrinsic-width, contain-intrinsic-height, contain-intrinsic-block-size, contain-intrinsic-inline-size
489+
Value: none | <<length>>
490490
Initial: none
491491
Inherited: no
492492
Applies to: elements with [=size containment=]
@@ -495,7 +495,7 @@ Overriding Contained Intrinsic Sizes: the 'contain-intrinsic-size' property</h3>
495495
Animation type: by computed value type
496496
</pre>
497497

498-
This property allows elements with [=size containment=] to specify
498+
These properties allow elements with [=size containment=] to specify
499499
an <dfn export>explicit intrinsic inner size</dfn>,
500500
causing the box to size as if its in-flow content
501501
totals to a width and height
@@ -504,6 +504,29 @@ Overriding Contained Intrinsic Sizes: the 'contain-intrinsic-size' property</h3>
504504

505505
Note: This is not always equivalent
506506
to laying out as if the element had one child of the specified [=explicit intrinsic inner size=].
507+
For example, a [=grid container=] with one child of the specified size
508+
would still size according to the specified grid,
509+
usually ending up with a larger content size than specified.
510+
511+
Values are defined as:
512+
513+
<dl dfn-type=value dfn-for="contain-intrinsic-width, contain-intrinsic-height, contain-intrinsic-block-size, contain-intrinsic-inline-size, contain-intrinsic-size">
514+
: <dfn>none</dfn>
515+
:: The corresponding axis does not have an [=explicit intrinsic inner size=].
516+
517+
: <dfn><<length>></dfn>
518+
:: The corresponding axis has an [=explicit intrinsic inner size=] of the specified <<length>>.
519+
</dl>
520+
521+
If an element has an [=explicit intrinsic inner size=] in an axis,
522+
then after laying out the element as normal for [=size containment=],
523+
the size of the contents in that axis are instead treated as being the [=explicit intrinsic inner size=]
524+
instead of what was calculated in layout,
525+
and layout is performed again if necessary.
526+
(If it has an [=explicit intrinsic inner size=] in both axises,
527+
this implies the first layout can be skipped.)
528+
529+
These four properties are part of a [=logical property group=].
507530

508531
Note: An element with [=size containment=] is laid out as if it had no contents [[!CSS-CONTAIN-1]],
509532
which in many cases this will cause the element to collapse to zero inner height.
@@ -518,23 +541,18 @@ Overriding Contained Intrinsic Sizes: the 'contain-intrinsic-size' property</h3>
518541
preserves the performance benefits of ignoring its contents for layout
519542
while still allowing it to size as if it had content.
520543

521-
Values are defined as:
544+
<pre class="propdef shorthand">
545+
Name: contain-intrinsic-size
546+
Value: [ none | <<length>> ]{1,2}
547+
</pre>
522548

523-
<dl dfn-type=value dfn-for="contain-intrinsic-size">
524-
: <dfn>none</dfn>
525-
::
526-
Does not specify an [=explicit intrinsic inner size=]
527-
for elements with [=size containment=].
528-
529-
: <dfn><<length>>{2}</dfn>
530-
::
531-
If the element has [=size containment=],
532-
specifies an [=explicit intrinsic inner size=].
533-
The first <<length>> provides the inner width of the element,
534-
the second provides the inner height.
535-
If the second <<length>> is omitted,
536-
it defaults to the same value as the first.
537-
</dl>
549+
'contain-intrinsic-size' is a shorthand property
550+
that sets the 'contain-intrinsic-width' and 'contain-intrinsic-height' properties.
551+
552+
The first value represents the 'contain-intrinsic-width' value,
553+
and the second represents the 'contain-intrinsic-height' value.
554+
If only one value is given,
555+
it applies to both properties.
538556

539557
<h4 id='cis-scrollbars'>
540558
Interaction With ''overflow: auto''</h4>

0 commit comments

Comments
 (0)