-
Notifications
You must be signed in to change notification settings - Fork 711
[css-sizing] Resolved value of min size properties doesn't round-trip #11716
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
Comments
The CSS Working Group just discussed The full IRC log of that discussion<TabAtkins> oriol: Sizing 3 changed the initial value of min size properties. Was '0', now is 'auto'<TabAtkins> oriol: but for back-compat, on block/inline-blcok/inline/table, when you use gCS() 'auto' can serialize as 0 <TabAtkins> oriol: problem is Sizing 4 added aspect-ratio, and that makes 'auto' behave differently than 0 on those boxes <iank_> q+ <TabAtkins> oriol: so if you use gCS() you see 0, but it has a different meaning. if you assign it back, the value changes. <TabAtkins> oriol: so I propose if aspect-ratio is a non-initial value, the "auto can serialize to 0" hack isn't applied <TabAtkins> oriol: hopefully webcompatible to change <emilio> q+ <astearns> ack iank_ <TabAtkins> iank_: i'm a little concerned. we already had auto problem for flex/grid, min-size:auto was treated differently too <TabAtkins> iank_: didn't roundtrip there either <TabAtkins> iank_: a little concerned that if gCS() starts returning 'auto' things could break. scared about compat. <TabAtkins> iank_: mostly because this is the default <TabAtkins> iank_: but width/height also don't fully roundtrip anyway <TabAtkins> emilio: i think they do in gecko, blink has some bugs with scrollbars <TabAtkins> iank_: nah, height:auto vs explciit value changes definiteness, which affects %s <astearns> ack emilio <TabAtkins> iank_: so the idea that width/height roundtrips is a spec fiction <TabAtkins> emilio: similar concern. i think in principle we should probably do this, but it does scare me compat-wise <TabAtkins> emilio: can try it, see what happens <TabAtkins> emilio: middle ground, maybe less scary, is doing this for layout boxes where we know it makes a difference, like for flex items <TabAtkins> emilio: but still not sure it's worth <TabAtkins> oriol: you mentioned flex items, for those it's alreayd the case, 'auto' serializes to 'auto'. it only serializes to 0 for block/inline/inline-block/tab le <TabAtkins> oriol: so only *those* will change, and only when aspect-ratio is a non-initial value <TabAtkins> astearns: out of time. can resolve to try fixing this roundtripping, or take it back to the issue. ian, emilio, preference? <TabAtkins> iank_: can we put it at start of call nexte week? want to check some things. I didn't realize we were alreayd doing this for flex/grid items. <TabAtkins> emilio: same. I think this makes it a bit less scary. <TabAtkins> astearns: so let's take it back to the issue. we'll revisit next week. |
BTW, this is the logic in browsers.
|
I'm ok with special casing aspect-ratio returning auto now. |
Same. |
The CSS Working Group just discussed
The full IRC log of that discussion<TabAtkins> oriol: summarizing last time...<TabAtkins> oriol: min-height and min-width have initial value of 'auto' but for back-compat gCS() returns 0 on all elements except flex and grid items <TabAtkins> oriol: however, Sizing 4 added a new effect to 'auto', when you're using aspect-ratio <TabAtkins> oriol: so it's not equivalent to zero on those elements <TabAtkins> oriol: so my proposal was that if aspect-ratio had a non-initial value, gCS() would stay as 'auto' rather than becoming 0 <TabAtkins> oriol: Ian wanted to time to check on stuff, he just said he's okay with this special-casing, not sure if he means the proposal <weinig> q+ <TabAtkins> TabAtkins: I read his comment as meaning your proposal, yeah <TabAtkins> weinig: Is there a known compat concern with just returning auto always for min size properties? <TabAtkins> weinig: do we think it'll actually break sites? <TabAtkins> oriol: Not sure <astearns> ack weinig <TabAtkins> oriol: Possibly the editors that said it originally have an idea. but changing that seems riskier. <TabAtkins> oriol: so not suggesting changing that for now, can do another issue to investigate <TabAtkins> dbaron: I think changing a behavior that's small-integer number of years old is much less scary than changing a 20yo behavior <TabAtkins> weinig: fair enough, just wanted to mention it <astearns> ack fantasai <TabAtkins> fantasai: yeah, because this affects the initial value, which is what you'll usually get back for it, and for a property that's 20+ years old <TabAtkins> fantasai: we didn't do a compat analysis, but we suspected there would be a problem <dbaron> I'm dating it back to when getComputedStyle was interoperable, which I think is newer than the min-width/min-height properties! :-) <TabAtkins> astearns: so the proposed resolution si that when aspect-ratio is non-initial, then min-size:auto serializes as 'auto' in gCS() (rather than being censored to 0) <TabAtkins> dholbert: in both axises, right? <TabAtkins> oriol: yes <TabAtkins> RESOLVED: When aspect-ratio is non-initial, then min-size:auto serializes as 'auto' in gCS() (rather than being censored to 0) |
One edge case that we need to clarify... Our above-quoted resolution was conditioned on What about non-initial values of I tend to think those should behave as the initial value for this new behavior as well (i.e. we should still return |
I would rather keep it simple and just check whether Otherwise: even if the spec doesn't say it in these terms, it can be said that |
That's fair, I'm happy with that (and that matches the letter of the resolution, so no change needed). One other edge case: what should we do for elements in a I tend to think we should continue returning |
(I'm writing a WPT for this now, BTW, hence why I'm thinking about these edge cases. :) ) |
Yeah, seems reasonable to keep the "It also resolves to zero when no box is generated" even if |
I've got a WPT posted, for now called "css/cssom/getComputedStyle-resolved-min-size-auto.html", in this phabricator review for Mozilla's bug on implementing this spec change. It notably does assume that boxes in
|
Ah right, I didn't initially realize that @Loirooriol's quote was in fact a spec quote. The
...which handles the |
…putedStyle, for elements with non-default 'aspect-ratio'. r=TYLin This is the behavior that was resolved on in w3c/csswg-drafts#11716 I'm including a WPT that exercises a bunch of different cases where 'auto' is or isn't preserved in getComputedStyle. Differential Revision: https://phabricator.services.mozilla.com/D243234
…putedStyle, for elements with non-default 'aspect-ratio'. r=TYLin This is the behavior that was resolved on in w3c/csswg-drafts#11716 I'm including a WPT that exercises a bunch of different cases where 'auto' is or isn't preserved in getComputedStyle. Differential Revision: https://phabricator.services.mozilla.com/D243234
…or elements with non-default 'aspect-ratio'. This is the behavior that was resolved on in w3c/csswg-drafts#11716 I'm including a WPT that exercises a bunch of different cases where 'auto' is or isn't preserved in getComputedStyle. Differential Revision: https://phabricator.services.mozilla.com/D243234 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1956578 gecko-commit: 6b9e820b1f3df0b5447c14e0a5a9af2b160cd09b gecko-reviewers: TYLin
…or elements with non-default 'aspect-ratio'. This is the behavior that was resolved on in w3c/csswg-drafts#11716 I'm including a WPT that exercises a bunch of different cases where 'auto' is or isn't preserved in getComputedStyle. Differential Revision: https://phabricator.services.mozilla.com/D243234 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1956578 gecko-commit: 6b9e820b1f3df0b5447c14e0a5a9af2b160cd09b gecko-reviewers: TYLin
…putedStyle, for elements with non-default 'aspect-ratio'. r=TYLin This is the behavior that was resolved on in w3c/csswg-drafts#11716 I'm including a WPT that exercises a bunch of different cases where 'auto' is or isn't preserved in getComputedStyle. Differential Revision: https://phabricator.services.mozilla.com/D243234
…putedStyle, for elements with non-default 'aspect-ratio'. r=TYLin This is the behavior that was resolved on in w3c/csswg-drafts#11716 I'm including a WPT that exercises a bunch of different cases where 'auto' is or isn't preserved in getComputedStyle. Differential Revision: https://phabricator.services.mozilla.com/D243234
There is interoperability among Gecko, Blink and WebKit: the resolved value of
min-height
doesn't round-trip. Awful.This is because of CSS Sizing 3: https://drafts.csswg.org/css-sizing-3/#valdef-width-auto
This was fine because
min-height: auto
used to behave as zero. But CSS Sizing 4 went and changed that, without taking care of the resolved value: https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimumHopefully it's not too late to change.
The text was updated successfully, but these errors were encountered: