Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-sizing-3] web-compat/impl check for max-width percentages’ min-content compression #6348

Open
fantasai opened this issue Jun 3, 2021 · 0 comments
Labels

Comments

@fantasai
Copy link
Collaborator

fantasai commented Jun 3, 2021

When we introduced special compression rules for replaced elements in #765 (see #765 (comment) ), we resolved to make max-width percentages apply the same compression to semi-replaced elements (e.g. INPUT) as width percentages (since they're consistent for replaced elements such as IMG). But this hasn't been implemented yet, so opening this bug to track implementation and Web-compat.

Mozilla bug seems to be https://bugzilla.mozilla.org/show_bug.cgi?id=1388840 (@dbaron had patches but hasn't posted them?)

@fantasai fantasai added the css-sizing-3 Current Work label Jun 3, 2021
aethanyc added a commit to aethanyc/gecko-dev that referenced this issue Jul 21, 2021
… only to form controls when computing specified size suggestion.

In Bug 1585485, if replaced elements and some form control elements have
percentage part in their preferred size, we apply CSS Sizing 5.2.2 [1]
to them to compress their min-content contribution to zero when
computing their specified size suggestion.

The bug was fixed to match the Chromium's behavior. However, in reality
Chromium only applies this rule to form control elements, but not to
replaced elements like <img>. So again, we need to tweak our behavior.

Note: Depending on w3c/csswg-drafts#6348, we
may need to check percentage max main size to decide whether to apply
the compress rule.

I've verified that the added test passes on Chrome 92 on my Linux
machine via:

```
./mach wpt testing/web-platform/tests/css/css-flexbox/flex-item-compressible-003.html --product chrome
```

[1] CSS Sizing 5.2.2 https://drafts.csswg.org/css-sizing-3/#min-content-zero
aethanyc added a commit to aethanyc/gecko-dev that referenced this issue Jul 21, 2021
… only to form controls when computing flex item's specified size suggestion.

In Bug 1585485, if replaced elements and some form control elements have
percentage part in their preferred size, we apply CSS Sizing 5.2.2 [1]
to them to compress their min-content contribution to zero when
computing their specified size suggestion.

The bug was fixed to match the Chromium's behavior. However, in reality
Chromium only applies this rule to form control elements, but not to
replaced elements like <img>. So again, we need to tweak our behavior.

Note: Depending on w3c/csswg-drafts#6348, we
may need to check percentage max main size to decide whether to apply
the compress rule.

I've verified that the added test passes on Chrome 92 on my Linux
machine via:

```
./mach wpt testing/web-platform/tests/css/css-flexbox/flex-item-compressible-003.html --product chrome
```

[1] CSS Sizing 5.2.2 https://drafts.csswg.org/css-sizing-3/#min-content-zero
aethanyc added a commit to aethanyc/gecko-dev that referenced this issue Jul 21, 2021
…n computing flex item's specified size suggestion.

In Bug 1585485, if a replaced element or a form control elements listed
in the CSS Sizing 5.2.2 [1] has percentage in their preferred size, we
apply rule 5.2.2 to it to effectively compress its auto min size down to
zero in flexbox (via zeroing its specified size suggestion).

Bug 1585485 was fixed to match the Chromium's behavior specifically to
compress <input>. However, in reality Chromium only applies this rule to
form control elements, but not to replaced elements like <img>. So
again, we need to tweak our behavior.

Note: Depending on w3c/csswg-drafts#6348, we
may need to check percentage max main size to decide whether to apply
the compress rule or not.

I've verified that the added test passes on Chrome 92 on my Linux
machine via:

```
./mach wpt testing/web-platform/tests/css/css-flexbox/flex-item-compressible-003.html --product chrome
```

[1] https://drafts.csswg.org/css-sizing-3/#min-content-zero
@fantasai fantasai added the Target Revision: Next Remove when done. label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant