[csswg-drafts] [css-box] Clarify whether box-sizing should be considered when resolving padding percent values (#6509)

andyjakubowski has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-box] Clarify whether box-sizing should be considered when resolving padding percent values ==
It’s unclear to me whether the spec expects implementations to take box-sizing into account when resolving padding percent values against the inline size of the containing block.

The definition of `padding` in [css-box](https://drafts.csswg.org/css-box-4/#padding-shorthand) specifies that percentages are resolved against *the logical width aka inline size of the containing block*. That is reiterated in both [css-flexbox](https://drafts.csswg.org/css-flexbox-1/#item-margins) and [css-grid](https://drafts.csswg.org/css-grid-2/#item-margins).

It’s been my impression that whenever there’s no explicit mention of *inner* or *outer* size, then *size* refers to “whatever `box-sizing` specifies”, that is either `content-box` or `border-box`.

However, the implementations that I checked (Gecko, WebKit, Blink) all seem to resolve padding percent values against the **inner** inline size of the containing block.

There are a few explanations I can think of:
1. My interpretation that simply saying “size” implies accounting for `box-sizing` is incorrect.
2. My interpretation is correct, and the spec does want implementations to account for `box-sizing`, but they don’t.
3. My interpretation is correct, and the spec should clarify that padding percent values should be resolved against the *inner* inline size of the containing block.

Could you please clarify if any of these is right?

I’m leaning toward implementing what other browsers have implemented, that is always resolving padding percentage values against the inner inline size of the containing block.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6509 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 11 August 2021 13:52:36 UTC