Re: [csswg-drafts] [css-align][css-position][css-anchor-position] Introduce "document containing block" for some purposes? (#10861)

The CSS Working Group just discussed `[css-align][css-position][css-anchor-position] Introduce "document containing block" for some purposes?`, and agreed to the following:

* `RESOLVED: Adopt the concept of document containing block (better name TBD) into position-4 and have anchor positioning use it by default instead of ICB`
* `RESOLVED: Publish FPWD of position-4`

<details><summary>The full IRC log of that discussion</summary>
&lt;kbabbitt> TabAtkins: Anchor positioning exposes details of the containg block a lot more than abspos did<br>
&lt;kbabbitt> ...generally this works just fine, inset-area cares about how it's positioned relative to cb<br>
&lt;kbabbitt> ...or if it's outside, it's an exceptional case and is also handled fine<br>
&lt;kbabbitt> ...exception is when you're fixpos, because then you end up using the ICB which while is reasonably sized, is not a reasonably positioned rect<br>
&lt;kbabbitt> ...ICB just sits at the top of the document<br>
&lt;fantasai> scribe+<br>
&lt;kbabbitt> ...and most of the document is outside of that rectangle<br>
&lt;kbabbitt> ...which means that almost all of your acnhors need the exceptional behavior of anchor outside of CB<br>
&lt;kbabbitt> ...while we have as reasonable as we can behavior, it's not ideal<br>
&lt;kbabbitt> ...all an error case and always recovering<br>
&lt;kbabbitt> ....all you really want for something like an element acnhored to something far down is to avoid flowing outside the bounds of the doc<br>
&lt;kbabbitt> ...e.g. offscreen<br>
&lt;kbabbitt> ...and that doesn't work well in the case we have here<br>
&lt;kbabbitt> ...what you want is a CB that is the size of the visible document<br>
&lt;kbabbitt> ...what that means is part of this issue<br>
&lt;kbabbitt> ...My proposal is that this sort of request is useful outside of anchor positioning<br>
&lt;kbabbitt> ...relatively common for people within a scrollable area to position in the bottom right area of ths scrollable content<br>
&lt;kbabbitt> ...can't do that today wiothout an additional wrapper<br>
&lt;kbabbitt> ...if you go to the bottom right with insets and it positions you in th ebottom right of the scroll container not the scrollable content<br>
&lt;kbabbitt> ....people work around that today by using a replos wrapper around all of their scrollable content<br>
&lt;kbabbitt> ...so their abospos can go to the bottom right of the scroll container<br>
&lt;kbabbitt> ...making this behavior easier to opt into, and making anchor positioning generally work better when your CB is the document is worth fixing<br>
&lt;kbabbitt> ...my proposal is that we have a new concept: the document containing block<br>
&lt;kbabbitt> ...which is a rectangle size to contain all the stuff in the document<br>
&lt;kbabbitt> ...we use that by default for anchor position ing if we would use the ICB<br>
&lt;kbabbitt> ...also have some way to explicitly opt normal abspos into being able to reference this concept both for document and for any scrollable content<br>
&lt;kbabbitt> ...two big questions: first what is this rectangle, how do you define it in a way that's reasonbly chjeap<br>
&lt;kbabbitt> ...iank_ has an answer that works in Chrome and sounds approximately right<br>
&lt;kbabbitt> ...don't know how generalizable that is<br>
&lt;Rossen0> q+<br>
&lt;kbabbitt> iank_: when you calculate the scrollable overflow for a scroll container<br>
&lt;kbabbitt> ...you need to know where the end ? is<br>
&lt;kbabbitt> ...and that's one of the calculations that goes into the whole scrollable area<br>
&lt;kbabbitt> ...e.g. for grid this is defined as the end of the grid<br>
&lt;kbabbitt> ...this is relatively cheap, the calculation is only based on the in-flow children at that point<br>
&lt;emilio> q+<br>
&lt;kbabbitt> ...w/o transforms, usually what people wnat for this calculation<br>
&lt;kbabbitt> TabAtkins:: other questio would be how we can let normal abposes opt into it<br>
&lt;kbabbitt> ...probably a position subproperty, don't want to solve for it now, can still devault anchor positioning to right default today<br>
&lt;kbabbitt> Rossen0: I missed the reasoning about, does top line get redefined as well?<br>
&lt;miriam> q+<br>
&lt;kbabbitt> ...so that when you scroll, that positioned element also gets scrolled with it?<br>
&lt;kbabbitt> TabAtkins: No, the DCB will start still at the top left of the entire ducoument just like ICB, will just grow downward and rightward to contain entire contents of the page<br>
&lt;kbabbitt> iank_: not growing into negative space beyond the scrollable region<br>
&lt;kbabbitt> ...there are cases .eg in rtl container where right would stay 0 and flips like that<br>
&lt;Rossen0> ack Rossen0<br>
&lt;Rossen0> ack fantasai<br>
&lt;kbabbitt> fantasai: curious about the definition in the inline axis<br>
&lt;kbabbitt> ...this totally makes sense, we probably want a similar concept for non-document scrollers<br>
&lt;kbabbitt> ...agree with most of what you're trying to do here<br>
&lt;kbabbitt> iank_: easiest thing is unify behavior when we fixed the end point for the scrollable behavior<br>
&lt;kbabbitt> TabAtkins: I'm calling it DCB, need a better name<br>
&lt;kbabbitt> ...intend it applies equally to other scrollers, if your anchor is inside a scroller you want same behavior<br>
&lt;miriam> q- (I was going to ask about applying to other scrollers)<br>
&lt;miriam> q-<br>
&lt;kbabbitt> fantasai: you're suggesting for inline axis we calculate padding ??? I agree with that<br>
&lt;Rossen0> q?<br>
&lt;Rossen0> Rossen<br>
&lt;kbabbitt> ...have to think about exactly where else it would be used, using it for anchor positioning seems reasonable<br>
&lt;Rossen0> ack Rossen<br>
&lt;kbabbitt> iank_: when I as doing webdev stuff, I ran into this problem constantly<br>
&lt;flackr> +1<br>
&lt;kbabbitt> emilio: agree this a good thing in general<br>
&lt;kbabbitt> ...esp when you get into edge cases e.g. rtl<br>
&lt;kbabbitt> ...having something that consistentl covers scrollable areas gets tricky<br>
&lt;fantasai> s/we calculate padding ???/we use the point where we attach the inline padding?/<br>
&lt;kbabbitt> ...2 questions, one: with regards to scrollable padding we add, you mean that CB would be included or excluded?<br>
&lt;kbabbitt> iank_: included<br>
&lt;kbabbitt> emilio: so it would cover everything, sounds good<br>
&lt;kbabbitt> iank_: we're not changing the fact that abspose references padding box by default<br>
&lt;Rossen0> q+<br>
&lt;kbabbitt> fantasai: any box that is scrollable when it gerneates a CB, genreates 2 CBs, inner and outer<br>
&lt;Rossen0> ack emilio<br>
&lt;kbabbitt> ...I guess it generates 3, you have the content one too<br>
&lt;kbabbitt> emilio: if you have something that overflows that cb, you have something that scrolls down<br>
&lt;Rossen4> q?<br>
&lt;kbabbitt> iank_: the reason the padding edge definition is useful is, you don't need to calculate the entire scrollable area<br>
&lt;kbabbitt> iank_: based on flow content this is where the padding edge is, then you run abspos layout<br>
&lt;kbabbitt> iank_: then you gather up scrollable area<br>
&lt;kbabbitt> fantasai: this comes from when we decided to add padding to scrollable ??? ... it only considers input<br>
&lt;TabAtkins> s/input/in-flow content/<br>
&lt;kbabbitt> emilio: sounds good<br>
&lt;fantasai> s/???/area/<br>
&lt;kbabbitt> iank_: that ? is also nice because it doesn't consider transforms<br>
&lt;TabAtkins> s/?/box/<br>
&lt;kbabbitt> emilio: wonder if there are use cases like, I want to ? the whole scrollbar<br>
&lt;kbabbitt> iank_: [missed]<br>
&lt;Rossen4> ack fantasai<br>
&lt;Rossen4> ack Rossen<br>
&lt;kbabbitt> fantasai: we've got each box generates 3 CBs, inflow CB which is content area, local CB which is this padding edge that takes over the area that scrolls, then outer CB which is the background attachment scroll box<br>
&lt;kbabbitt> ...we need better terms for these<br>
&lt;kbabbitt> ...in your comment you suggested position area would be one way to capture this entire area<br>
&lt;kbabbitt> ...that reads really well<br>
&lt;kbabbitt> ...issue says only when there's a valid anchor<br>
&lt;kbabbitt> ...do we make position area do it always since it doesnt rely on anchor><br>
&lt;kbabbitt> TabAtkins: potentially. I feel like that's a bit hacky and probably wnat CB control to be done via a more focused properly, more things in that vein you want to select between<br>
&lt;kbabbitt> ...somewhat uninclined to fix things in this hacky way but could be convinced in another issue<br>
&lt;kbabbitt> fantasai: making it contidional on the validity of anchor is a little weird<br>
&lt;kbabbitt> ...making it not that would be great, I have a few ideas<br>
&lt;kbabbitt> Rossen4: the position area bounds you define is based on the static content only but it doesn't include any abspos content?<br>
&lt;kbabbitt> TabAtkins: correct, no abspos no transforms<br>
&lt;fantasai> I'm thinking maybe `position-area` always applies, it's just that if you have no valid anchor then you always get the entire area<br>
&lt;kbabbitt> Rossen4: what about relative<br>
&lt;kbabbitt> &lt;crosstalk><br>
&lt;kbabbitt> iank_: it does not include relative<br>
&lt;kbabbitt> iank_: when it comes to adding padding to scrollable end, we have basically alignment on that<br>
&lt;TabAtkins> q?<br>
&lt;kbabbitt> Rossen4: sounds like a very useful feature<br>
&lt;kbabbitt> TabAtkins: suggest resolution: Adopt the concept of document containing block (better name TBD) into position-4 and have anchor positioning use it by default instead of ICB<br>
&lt;kbabbitt> Rossen4: additional comments or objections?<br>
&lt;flackr> +1<br>
&lt;kbabbitt> fantasai: we should proably actually publish position-4<br>
&lt;kbabbitt> RESOLVED: Adopt the concept of document containing block (better name TBD) into position-4 and have anchor positioning use it by default instead of ICB<br>
&lt;kbabbitt> [discussion about contents of position-4]<br>
&lt;kbabbitt> Rossen4: any objection on publishing FPWD of position-4?<br>
&lt;kbabbitt> RESOLVED: Publish FPWD of position-4<br>
</details>


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


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

Received on Friday, 27 September 2024 18:35:53 UTC