- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Thu, 15 Sep 2022 23:47:26 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `overflow clip on SVG elements and flex layout`, and agreed to the following: * ``RESOLVED: in the UA style sheet, we keep `svg { overflow: hidden; }` `` * `RESOLVED: in the flex spec, for auto min sizing, instead of saying scroll container, we read the computed overflow property value` * `RESOLVED: overflow:hidden on replaced elements gets coerced to overflow:clip at paint time` <details><summary>The full IRC log of that discussion</summary> <heycam> Topic: overflow clip on SVG elements and flex layout<br> <heycam> github: https://github.com/w3c/csswg-drafts/issues/7714<br> <heycam> khush: this concerns how the min width / min-height auto is computed for a flex child<br> <heycam> ... spec says that if an element is a scroll container, the min-width/height will be 0<br> <heycam> ... but if not a scroll container, then it's content based min size<br> <heycam> ... the two cases where it's not a scroll container, is if overflow is clip/hidden<br> <heycam> ... previous change made replaced elements [...]<br> <heycam> ... SVG has for a long time had `overflow: hidden` in the UA style sheet<br> <heycam> ... now we're setting overflow:clip, it causes this layout behavior<br> <heycam> ... before, min-width/height would be 0<br> <heycam> ... but now it's computing to the content based min size<br> <heycam> Ian: we got many bugs<br> <heycam> khush: fun part is that was accidentally rolled out to stable channel<br> <heycam> ... have to keep this behavior for compat<br> <heycam> ... options are to first add min-width/height:0 to the UA style sheet, which when combined with overlfow:clip gives you the preivous behavior<br> <heycam> ... but now we have different compat problems<br> <heycam> ... second option is to special case it<br> <heycam> ... either in the layout computation spot. clip behaves this way except for SVG<br> <heycam> ... other option is that we don't set the overflow:clip in the UA style sheet only for SVG, and at layout time the previous behavior continues to apply, but at paint time we use it as if it's clip<br> <heycam> ... it'd have to be a used value time thing<br> <emilio> q+<br> <heycam> ... used value would be different in paint time<br> <heycam> fantasai: maybe should've gone over #7144 first<br> <heycam> dholbert: I'm fond of the third option, keeping overflow:hidden SVG. is there a reason we need to change SVG?<br> <heycam> Ian: mainly for consistency<br> <heycam> ... we didn't perceive the compat risk<br> <fantasai> +1 to keeping overflow:hidden on svg<br> <heycam> ... only weird quirk is that at layout time, when we're looking at overflow, pretend overflow means clip at paint time<br> <heycam> ... at paint time<br> <heycam> s/layout time/paint time/<br> <heycam> dholbert: where is that used value magic? already exists?<br> <heycam> ... seems orthogonal to this<br> <heycam> fantasai: maybe we should switch to 7144<br> <Rossen_> ack emilio<br> <heycam> emilio: I have a question. overflow:clip by default on SVG, it changes the sizing behavior<br> <heycam> Ian: so min-content sizes<br> <heycam> ... auto min size will be 0<br> <heycam> emilio: if I load the test case in the first comment, and set overflow:clip/hidden, I don't see any layout change<br> <heycam> khush: flex layout was implemented first, so where it's supposed to check is this a scroll container or not, it looks at overflow value<br> <heycam> ... assumes it's not a scroll container only if overlfow:visible, but we are also now checking for clip<br> <heycam> ... this is a change in the process of landing<br> <heycam> emilio: right now SVG is not a scroll container<br> <heycam> Ian: but it does have overflow:hidden<br> <heycam> emilio: right now that decision is based on scrollable overflow<br> <heycam> Ian: computed overflow property value<br> <heycam> emilio: and you are changing that?<br> <heycam> ... but you want SVG to keep behaving the same way?<br> <heycam> Ian: the flexbox auto min size thing likely needs to say look at the computed value of overflow, rather than "scroll container"<br> <heycam> ... could make that narrower<br> <heycam> ... it becomes a used value, after layout thing<br> <heycam> emilio: I'm still confused<br> <heycam> ... I see a different if I set overflow:visible on the SVG, but not if I set overflow:clip<br> <heycam> Ian: we currently don't support overflow:clip<br> <heycam> dholbert: in Firefox I see a difference<br> <heycam> Ian: but that's not the compat concern<br> <dholbert> (If I add `overflow:clip` to https://github.com/w3c/csswg-drafts/issues/7714#issue-1366802020 , then the green thing gets wider)<br> <heycam> ... overflow visible/clip should behave the same<br> <heycam> ... but we changed the UA style sheet from hidden to clip, and that broke things<br> <heycam> emilio: maybe not change the UA style sheet?<br> <heycam> ... since it doesn't create a scroll container either<br> <heycam> Ian: at layout time you use the computed value of overflow, like we do right now<br> <heycam> ... to determine if we apply the auto min size<br> <heycam> ... and at paint time, we convert this to a used value of overflow:cip<br> <heycam> emilio: but that's basically what happens now?<br> <heycam> Ian: differences are overflow clip margin will start to apply<br> <heycam> khush: in terms of the changes in the UA sheet, we can skip setting overflow:clip, but we still need the overflow clip margin box for it to work with these elements<br> <heycam> khush: overflow-clip: margin-box<br> <heycam> ... so we'll skip setting overflow:clip, leave it as hidden<br> <heycam> emilio: proposed solution only changes the UA sheet?<br> <heycam> emilio: do we need to add magic to make overflow:hidden to behave like overflow:clip for SVG, rather than letting authors do it?<br> <heycam> Ian: we had a resolution that overflow:hidden would behave as overflow:clip<br> <heycam> ... it basically behaves like that anyway<br> <heycam> ... this is harmonizing<br> <heycam> emilio: bit unfortunatey<br> <heycam> s/unfortunatey/unfortunate/<br> <heycam> Ian: the coercion would apply to all the replaced elements, not just SVG<br> <heycam> ... if they're overflow:hidden<br> <heycam> emilio: as long as you're a replaced element<br> <heycam> ... you don't get weird cases where there's only clip on one axis<br> <heycam> ... as long as this is well tested<br> <heycam> khush: I promise!<br> <heycam> dholbert: the thing where you check the computed value for flex layout purposes, I think that already matches what we already do internally, and it's what the spec used to say<br> <heycam> ... it results to 0 if overflow is hidden/scroll/auto<br> <heycam> ... but the spec now says scroll container<br> <heycam> ... so we might want to consider reverting that, and explicitly defer to computed overflow value<br> <heycam> Ian: I think I'd prefer that<br> <heycam> ... in summary, part 1: in the UA style sheet, we keep `svg { overflow: hidden; }`. part 2: in the flex spec, for auto min sizing, instead of saying scroll container, we read the computed overflow property value<br> <heycam> ... part 3: which may already be specced, is overflow:hidden on replaced elements gets coerced to overflow:clip at paint time<br> <heycam> dholbert: you can't do scrollTop on an <img><br> <heycam> khush: part 3 was resolved in #7144<br> <fantasai> +1<br> <heycam> khush: one other thing, for SVG, we're still keeping overflow-clip-margin in the UA sheet<br> <heycam> RESOLVED: in the UA style sheet, we keep `svg { overflow: hidden; }`<br> <heycam> RESOLVED: in the flex spec, for auto min sizing, instead of saying scroll container, we read the computed overflow property value<br> <heycam> RESOLVED: overflow:hidden on replaced elements gets coerced to overflow:clip at paint time<br> <heycam> <br dur="13m"><br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7714#issuecomment-1248761712 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 15 September 2022 23:47:28 UTC