w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.46k stars 658 forks source link

[css-sizing] Nobody follows the spec about cyclic percentages in min sizing properties #10969

Open Loirooriol opened 2 weeks ago

Loirooriol commented 2 weeks ago

https://drafts.csswg.org/css-sizing-3/#min-percentage-contribution

For the min size properties, as well as for margins and paddings (and gutters), a cyclic percentage is resolved against zero for determining intrinsic size contributions.

That's a lie, nobody does this for the min size properties, and WebKit doesn't do it either for margins. Instead, the entire value is treated as zero, just like for preferred and max size properties.

<!DOCTYPE html>
<div style="width: 0">
  <div style="display: inline-block; border: 5px solid cyan">
    <div style="min-width: calc(50px + 0%)"></div>
  </div>
  <div style="display: inline-block; border: 5px solid magenta">
    <div style="padding-left: calc(50px + 0%)"></div>
  </div>
  <div style="display: inline-block; border: 5px solid orange">
    <div style="margin-left: calc(50px + 0%)"></div>
  </div>
</div>
Spec & Servo Gecko Blink WebKit

Agenda+ to reflect reality (or change the implementations?).

bfgeek commented 2 weeks ago

We changed our behaviour on purpose to match Firefox due to: https://github.com/w3c/csswg-drafts/issues/2297#issuecomment-365467459