Re: [csswg-drafts] [css-position][css-anchor-position] Splitting Scrollable Containing Blocks (#12607)

The CSS Working Group just discussed `[css-position][css-anchor-position] Splitting Scrollable Containing Blocks`.

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> fantasai: [whiteboard time]<br>
&lt;emilio> fantasai: we have several different concepts of containing blocks<br>
&lt;emilio> ... position: fixed is the viewport, outside of the scrollable area<br>
&lt;emilio> ... position: absolute positions relative to the ICB<br>
&lt;emilio> ... for a scroll container we have the ICB behavior<br>
&lt;emilio> ... you can't get the fixed behavior unless you attach it to a wrapper around the scroll container<br>
&lt;emilio> ... when we were discussing anchor pos, and your anchor is towards the bottom<br>
&lt;emilio> ... the bottom of the icb is up there<br>
&lt;emilio> ... we floor it at the anchor which ends up with a containing block rect which is zero-height<br>
&lt;emilio> ... what you want is to create the nine-grid to create the thing to the whole scrollable area<br>
&lt;emilio> ... and we resolved to do that (use a representation of the 'in-flow scrollable area')<br>
&lt;emilio> ... for other scroll containers we don't have the ability to switch to the scrollport itself<br>
&lt;emilio> ... for anchor positioning this is particularly important<br>
&lt;emilio> q+<br>
&lt;emilio> ... because you want to trigger fallback<br>
&lt;emilio> ... so we need some kind of distinction<br>
&lt;emilio> ... there are other use cases for this outside of anchor pos, it's just a more pressing issue with it because of fallback<br>
&lt;emilio> ... so tab and i discussed syntactic switches, for {scrollport, icb-equivalent-thing, in-flow-scrollable-area}<br>
&lt;emilio> ... in order to allow the author to distinguish this we need new syntax<br>
&lt;emilio> ... we automatically decide on this for anchor pos<br>
&lt;emilio> ... would be nice to allow authors to change it, also we can't for other absposes r/n<br>
&lt;emilio> ... our proposal is to split `position` into three: `position-type: static/relative/sticky/absolute`<br>
&lt;astearns> q+<br>
&lt;emilio> ... `position-attachment: auto | local | fixed | scroll;` (local is icb, fixed is scrollport, scroll is in-flow-scrollable-area)<br>
&lt;astearns> (all of these details are in the first comment in the issue)<br>
&lt;emilio> ... `position-container: nearest | furthest | &lt;custom-ident>;`<br>
&lt;SebastianZ> q+<br>
&lt;emilio> ... `nearest` gets you to nearest positioned element (abspos behavior), farthest is root (except when transformed) (fixedpos behavior)<br>
&lt;emilio> ... `position: absolute` would expand to `absolute auto nearest`<br>
&lt;emilio> ... `auto` behaves as `local` or `scroll` depending on whether you're anchor positioned<br>
&lt;emilio> ... `position: fixed` would expand to `absolute fixed farthest`<br>
&lt;emilio> ... that's the outline of the proposal<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: I wanted dto double-check some eof the shorthand expansions, but I think it looks reasonable overall<br>
&lt;TabAtkins> emilio: if you have position-attachment:scroll and your CB isn't a scroll container...<br>
&lt;TabAtkins> fantasai: the attachment values only change things for scroll containers. any other element, it does nothing<br>
&lt;TabAtkins> emilio: i'd probably start without the container custom-ident, seems a bit complex<br>
&lt;TabAtkins> fantasai: yeah, that's just from another issue. don't need it in the syntax right this moment<br>
&lt;TabAtkins> emilio: and presumably these are paired..<br>
&lt;TabAtkins> emilio: position-attachment and container are useless unless you specify pos:absolute<br>
&lt;TabAtkins> emilio: but no reason to do them with position:relative<br>
&lt;ydaniv> emilio: I find  it weird that position:fixed expands to container<br>
&lt;ydaniv> ... breaks my mental model<br>
&lt;TabAtkins> emilio: my mental model of position-fixed is about the container rather than attachment, but that's because in impl we parent it to a box outside the root scroller<br>
&lt;TabAtkins> emilio: if we impl this proposal we might change internally how we do pos:fixed to match this<br>
&lt;TabAtkins> emilio: in general this makes sense tho<br>
&lt;TabAtkins> emilio: probably want to leave out the custom ident stuff for now<br>
&lt;TabAtkins> SebastianZ: [somewhat missed]<br>
&lt;TabAtkins> emilio: you have the root scroller, it's a box outside of that which is the viewport<br>
&lt;TabAtkins> emilio: we parent a fixpos to that "box"<br>
&lt;TabAtkins> emilio: this changes it to instead attach to the scroller itself<br>
&lt;TabAtkins> emilio: rather than a pretend ancestor<br>
&lt;TabAtkins> q+<br>
&lt;emilio> astearns: Couple things<br>
&lt;emilio> ... you've raised the posibility of this isn't implementable because of the shorthandifying<br>
&lt;emilio> ... iank_ says it's not so bad<br>
&lt;emilio> ... but I don't think it addresses the issues we've hit in the past when shorthandifying<br>
&lt;fantasai> s/not so bad/not so bad to avoid shorthanding/<br>
&lt;emilio> TabAtkins: ian wants to not shorthandify, and says that is not so bad<br>
&lt;fantasai> s/... iank_/TabAtkins: iank_<br>
&lt;emilio> astearns: the other thing is that ian suggested for position container we could have just `auto | &lt;custom-ident>`, but if we don't have the `&lt;custom-ident>` we could leave that right?<br>
&lt;astearns> ack astearns<br>
&lt;emilio> fantasai: it's useful to attach to the root regardless<br>
&lt;emilio> TabAtkins: being able to be at the root without being fixed<br>
&lt;astearns> ack SebastianZ<br>
&lt;emilio> ... is useful for anchor pos to be in the top layer<br>
&lt;emilio> emilio: but the top layer doesn't scroll with the document right?<br>
&lt;emilio> q+<br>
&lt;emilio> SebastianZ: I think this could also solve changing the sticky position container<br>
&lt;emilio> ... regarding the default position-container is weird, is there an auto?<br>
&lt;emilio> fantasai: you don't need that. Assuming we can shorthandify then the expansion takes care of selecting the right default<br>
&lt;emilio> ... we could make it auto, but it'd be nice to be consistent<br>
&lt;emilio> emilio: you don't really need to shorthandify, and you could still not have auto<br>
&lt;emilio> ... you'd omit the default<br>
&lt;fantasai> s/consistent/avoid automagic where possible/<br>
&lt;emilio> SebastianZ: re. nearest and farthest I was thinking viewport. For fixed positioned it's the viewport<br>
&lt;emilio> fantasai: you can get trapped by a transform<br>
&lt;emilio> SebastianZ: fair<br>
&lt;bramus> q+<br>
&lt;emilio> SebastianZ: regarding custom-ident you'd need a separate property for that<br>
&lt;emilio> fantasai: yeah that'd be nice if we go down that path, and we'd need a separate<br>
&lt;emilio> SebastianZ: why custom-ident and not dashed-ident?<br>
&lt;emilio> fantasai: that's what we meant, should be dashed-ident<br>
&lt;emilio> SebastianZ: finally do we want to extend position shorthand?<br>
&lt;emilio> fantasai: yeah it should take the combination of all keywords<br>
&lt;astearns> ack TabAtkins<br>
&lt;emilio> TabAtkins: assuming that we can't shorthandify for a moment<br>
&lt;emilio> ... we could add an auto value that keys off the position property<br>
&lt;emilio> ... so position would remain as is, but `position-{container,attachment}` would have an auto value<br>
&lt;emilio> ... which would choose the right default<br>
&lt;emilio> emilio: I thought not shorthandifying would just expand the position syntax<br>
&lt;astearns> zakim, close queue<br>
&lt;Zakim> ok, astearns, the speaker queue is closed<br>
&lt;emilio> TabAtkins: while I agree having the shorthand would be more ideal, I agree with iank_ that not shorthanding would be not as bad<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: want to confirm whether fixpos behavior includes the scrollbars gutters<br>
&lt;TabAtkins> emilio: rn we have weird inconsistent beahvior<br>
&lt;TabAtkins> emilio: should be sorted out<br>
&lt;TabAtkins> emilio: assuming mostly what pos:fixed is doing...<br>
&lt;TabAtkins> fantasai: should probably just match position:fixed yeah<br>
&lt;TabAtkins> bramus: issue 8099 is concerned with that<br>
&lt;TabAtkins> bramus: effect of scrollbar-gutter on the viewport<br>
&lt;fantasai> -> https://github.com/w3c/csswg-drafts/issues/8099<br>
&lt;TabAtkins> emilio: regarding shorthand vs not<br>
&lt;TabAtkins> emilio: imagine we would expand 'position' longhand to just contain these extra values<br>
&lt;TabAtkins> fantasai: they have to cascade and interact<br>
&lt;TabAtkins> TabAtkins: you misunderstand, Emilio proposed putting the entire syntax into 'position'<br>
&lt;TabAtkins> emilio: yeah, I think I kinda prefer that<br>
&lt;TabAtkins> fantasai: so we'd have these "conceptual" longhands<br>
&lt;TabAtkins> emilio: yeah, like display-inside vs outside<br>
&lt;astearns> ack bramus<br>
&lt;TabAtkins> fantasai: yeah that sounds better than independent properties that cascade badly<br>
&lt;TabAtkins> bramus: also wanted to point to issue 7475<br>
&lt;emilio> bramus: I also wanted to point to 7475<br>
&lt;emilio> ... flackr filed it to give authors an option to where to pos-fix your elements<br>
&lt;emilio> ... would this solve it?<br>
&lt;emilio> fantasai: it's a different thing<br>
&lt;emilio> ... but if we fix that it could be part of these properties<br>
&lt;emilio> fantasai: I'd be ok with proposing the syntax model without the longhands, just all into position for now, then decide if we can/want to split it<br>
&lt;emilio> ... so just the `position` syntax without the longhands<br>
&lt;fantasai> Proposal would be `position: &lt;type> || &lt;attachment> || &lt;container>`<br>
&lt;fantasai> without the longhands possible<br>
&lt;emilio> astearns: I'd be uncomfortable resolving on it r/n, let's take it back to the issue<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12607#issuecomment-3209880133 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 21 August 2025 10:09:14 UTC