Skip to content

Commit ef45dff

Browse files
committed
[css-sizing] Specify how to handle %s in width/max-width/etc when finding min-content contribution on replaced elements. Addresses #765.
1 parent 5b271fe commit ef45dff

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

css-sizing-3/Overview.bs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,20 @@ Intrinsic Contributions</h3>
424424
that contains only that box,
425425
if that hypothetical float's containing block is zero-sized/infinitely-sized.
426426

427+
However, in the case of a [=replaced element|replaced=] box with a percentage-based 'width'/'max-width'/'height'/'max-height',
428+
the percentage is resolved to zero
429+
when calculating the <a>min-content contribution</a> in the corresponding axis.
430+
431+
<div class=example>
432+
For example,
433+
an <{input}> assigned ''width: calc(50% + 50px)''
434+
has a <a>min-content contribution</a> of ''50px'',
435+
plus any horizontal margin/border/padding.
436+
</div>
437+
438+
Note: We are not 100% sure if zeroing out a percentage 'max-width' on form controls is web-compatible.
439+
See <a href="https://github.com/w3c/csswg-drafts/issues/765">Issue 765</a>.
440+
427441
Note: This specification does not define how to determine these sizes.
428442
Please refer to [[CSS2]],
429443
the relevant CSS specification for that display type,

0 commit comments

Comments
 (0)