- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 19 Feb 2025 16:52:40 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[css-sizing] Nobody follows the spec about cyclic percentages in preferred&max sizing properties of replaced element`, and agreed to the following: * `RESOLVED: See if implementations can match the spec and revisit issue later.` <details><summary>The full IRC log of that discussion</summary> <fantasai> oriol: When calculating intrinsic contributions, percentages are cyclic. Spec says what to do.<br> <fantasai> oriol: In preferred and max properties, they typically behave as initial value of the property<br> <fantasai> oriol: But spec says if element is replaced, for min-content contribution only, you resolve the cyclic percentages against zero<br> <fantasai> oriol: It doesn't say treat everything as zero, just resolve percentages as zero<br> <fantasai> oriol: so calc(length + percentage) would still have the lenght<br> <fantasai> oriol: but nobody implements this<br> <fantasai> oriol: Treating as zero instead<br> <fantasai> oriol: This avoids some minor problems, e.g. it's possible given spec that the min-content contribution would be larger than when properly resolved<br> <TabAtkins> Yeah, unless there's a compat restriction, treating `calc(100px + 0%)` as 0 is a ton of nonsense, that's what we were trying to avoid. :(<br> <fantasai> oriol: Given everyone treats as zero, probably should spec that<br> <astearns> ack fantasai<br> <fantasai> fantasai: Intention of spec was to preserve the author-specified minimum as much as we could<br> <fantasai> fantasai: e.g. if they wanted min-width: calc(10px + 5%)<br> <fantasai> fantasai: we'd give them the 10px, which is what they'd get in a zero-sized container<br> <fantasai> fantasai: I don't know if it's Web-compatible, but if it is, I'd prefer to follow the spec.<br> <fantasai> oriol: Would prefer to match spec to reality, unless people are willing to change.<br> <TabAtkins> fantasai: Ian, what od you think the web-compat is likely on this one?<br> <TabAtkins> fantasai: because i think the spec behavior is better<br> <fantasai> iank_: Not really sure what Web-compat would be. Would be pretty straightforward to query how often calc() appears inside a min-width/height<br> <fantasai> iank_: though wouldn't know how often we're depending on the intrinsic size there<br> <fantasai> emilio: what about min greater than max... need to compute both<br> <fantasai> emilio: and do extra work<br> <fantasai> emilio: Suppose you're in this case where min is bigger than max, spec says we clamp it<br> <fantasai> emilio: then we also need to compute the max<br> <fantasai> fantasai: min trumps max, so... why?<br> <fantasai> emilio: if you set min-width: max-content; and width: min-content; ...<br> <fantasai> emilio: that doesn't make sense<br> <fantasai> emilio: As long as we don't change what clamps what it's fine<br> <fantasai> emilio: does the spec define that?<br> <fantasai> iank_: falls out<br> <fantasai> iank_: only really important for content contributions, not for min-content/max-content values<br> <fantasai> emilio: would be nice if max-content didn't give me a value smaller than min-content<br> <fantasai> iank_: max-content on an element itself isn't using min-width, it's only for the content contribution<br> <fantasai> emilio: you have 2 identical elements, and say you hit this case<br> <fantasai> emilio: style one with width: max-content; and one with width: min-content;<br> <fantasai> emilio: ...<br> <fantasai> emilio: maybe it's not an issue<br> <fantasai> oriol: For example CSS Grid etc. assume min-content is smaller than max-content<br> <fantasai> oriol: but I wrote a testcase where min-content contribution is 100px and max-content contribution is 50px<br> <fantasai> oriol: you could get a smaller sized [missed]<br> <fantasai> oriol: which seems weird<br> <fantasai> emilio: unfortunate... maybe ok if it already happens<br> <fantasai> iank_: It's possible, so we have to clamp them all the time. E.g. happens with negative margins.<br> <fantasai> iank_: we have to clamp max-content by min-content already<br> <fantasai> astearns: I think I'm hearing we're not that interested in speccing reality in this case, prefer trying to get implementations to match the spec. Anyone willing to volunteer to experiment with this?<br> <fantasai> emilio: I do have a slight preference to spec reality, but not opposed to trying this out<br> <fantasai> emilio: also don't think I'll have time in the short term<br> <fantasai> iank_: I would also prefer to spec reality, but we could try to do it. Not that difficult for us to do this change.<br> <fantasai> iank_: could see what fallout there is<br> <TabAtkins> fantasai: My feeling from authoring perspective is it makes a bit more sense if we can do it as specced<br> <TabAtkins> fantasai: so that's where i'm at<br> <fantasai> astearns: That's where I'm at, too.<br> <fantasai> astearns: we could leave this issue open, invite experimentation, and come back to it in some number of months and see if anyone had a chance to try implementing the spec<br> <fantasai> fantasai: that seems reasonable<br> <fantasai> astearns: Does that work for you oriol?<br> <fantasai> oriol: That's fine, just having a spec that doesn't reflect reality...<br> <fantasai> oriol: especially following one, we in servo implemented the spec, and then realized we're not doing the same as other browsers<br> <fantasai> oriol: not great for new browsers<br> <fantasai> astearns: so you had done some experiments! Did you notice the difference? Inform compat?<br> <fantasai> oriol: Maybe I should have merged the two issues...<br> <fantasai> oriol: This one is for replaced elements, we did what other browsers do<br> <fantasai> oriol: The next issue is about min size property for all elements<br> <fantasai> oriol: we implemented the spec, and we are failing some WPT tests because these tests are expecting the browsers behavior and not the spec<br> <fantasai> astearns: test failures are one thing, because tests can have mistakes<br> <fantasai> astearns: those test failures, have you seen what difference it would make from authoring perspective?<br> <fantasai> oriol: I don't recall much<br> <fantasai> oriol: not many tests, maybe 2 tests<br> <fantasai> oriol: I think it wasn't very important<br> <fantasai> oriol: but Servo is very experimental, can't use to browse real websites, so can't inform about web-compat<br> <fantasai> oriol: In the other issue I linked some tests<br> <fantasai> astearns: Let's table this issue for now see if we can have implementations follow the spec<br> <fantasai> astearns: because I do agree from author perspective it is better to preserve at least some of the intent<br> <fantasai> astearns: Should we do the same for the next issue?<br> <fantasai> oriol: yes, it can be the same<br> <fantasai> astearns: OK, for these we will see if we can get implementations to match and revisit<br> <fantasai> RESOLVED: See if implementations can match the spec and revisit issue later.<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11452#issuecomment-2669214167 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 19 February 2025 16:52:41 UTC