-
Notifications
You must be signed in to change notification settings - Fork 661
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-align-3] safe vs unsafe defaults for block containers #8992
Comments
Why the "that are not scroll containers" limitation? (I'm not necessarily objecting to it; I just want to understand the reasoning.) At first glance, it seems like scroll containers may be a bit more risky since they impose a local clip on any unsafely-overflowing content that overflow off their start edge. (At least, that's how |
(posting the answer to my question after chatting with @fantasai in person): Per spec, scroll containers aren't supposed to clip stuff that gets pushed off the start edges via That's not implemented anywhere yet, but it's what the spec says is supposed to happen, and it's why this in theory isn't an issue for blocks-that-are-scroll-containers. |
The CSS Working Group just discussed
The full IRC log of that discussion<emilio> fantasai: currently when you apply align-/justify-content to flex/grid they are unsafe, but ua's are not supposed to shift stuff off the unscrollable region, but nobody implements that<emilio> ... for safe centering if the content is more than the container you clip to the top <emilio> ... the spec behavior is technically limit by the scroll-container edges but nobody implements that <emilio> ... the align is spec'd to also apply to block containers <emilio> ... currently nobody implements that except the Firefox checkout on my laptop <emilio> ... there are some concerns about web compat but also whether unsafe centering is right for block <bramus> q+ <emilio> ... I think for block layout in general safe centering by default makes more sense <emilio> ... also reduces the chances of a compat issue <emilio> ... proposal is that for block containers we default to safe alignment <emilio> Rossen_: this would be in both directions right? <emilio> fantasai: block containers don't support justify-content, just align-content <iank_> q+ <Rossen_> ack bramus <emilio> bramus: the default grid/flex has definitely tripped off authors <emilio> ... so +1 but people might rely on unsafe alignment? <emilio> fantasai: not implemented anywhere yet <Rossen_> ack iank_ <emilio> iank_: this seems fine overall <oriol> q+ <emilio> ... we find that for table cells where they fall back to vertical-alignment: middle it uses unsafe <emilio> ... as long as it's not messing with table cells seems fine <emilio> ... I don't think it's a huge compat mitigation, the biggest risk is the new bfc behavior <emilio> oriol: I'm reading that you're proposing it for block containers that are not scroll-container <emilio> ... do you want to keep this distinction? If so, why? <emilio> fantasai: for block containers that are scroll containers you don't have this unsafeness because you don't have overflow <emilio> ... your entire scrollable region is aligned and the initial scroll position changes <emilio> ... per spec, you're not supposed to shift the content <emilio> ... you're supposed to change the initial scroll position <emilio> oriol: I also wanted to ask that you mentioned that the default is unsafe, but wasn't there some magic if neither was specified? <emilio> fantasai: yeah, which nobody implements. we wouldn't do that for blocks and just default to safe which is also simplere <emilio> s/simplere/simpler <emilio> RESOLVED: default behavior for align-content on block containers is safe |
Is there a WPT test here? |
I'd like to propose making the default behavior of
align-content
besafe
rather thanunsafe
for block containers that are not scroll containers.I think this is a better default for block containers, and is likely also safer for Web-compat if we want to actually deploy this.
The text was updated successfully, but these errors were encountered: