Re: [csswg-drafts] [css-overscroll] Whether to move position:fixed elements during overscrolling (#6299)

The CSS Working Group just discussed `[css-overscroll] Whether to move position:fixed elements during overscrolling`, and agreed to the following:

* `RESOLVED: fixed-position elements whose scroller is not their containing block do not participate in overscroll`
* `RESOLVED: the former statement also applies to sticky element when stuck`

<details><summary>The full IRC log of that discussion</summary>
&lt;emeyer> Topic: [css-overscroll] Whether to move position:fixed elements during overscrolling<br>
&lt;emeyer> github: https://github.com/w3c/csswg-drafts/issues/6299<br>
&lt;emeyer> ben m: A lot of browsers had fixed element not participating in overscroll, but two browsers have the participate and WebKit still has a bug open.<br>
&lt;TabAtkins> q+<br>
&lt;smfr> q+<br>
&lt;flackr> q+<br>
&lt;emeyer> …There are use cases to do both.  Can we formalize this and get it in the spec?<br>
&lt;emeyer> astearns: Do we have any spec text asserting one way or the other?<br>
&lt;emeyer> ben: I didn’t find any.<br>
&lt;astearns> ack TabAtkins<br>
&lt;emeyer> TabAtkins: I don’t have a strong opinion here, both options seem potentially reasonable.  Does anyone have overscroll on non-root situations?<br>
&lt;emeyer> Ben: Edge and Chrome don’t have overscroll on subscrollers.<br>
&lt;smfr> Apple platforms have overscroll on subscrollers<br>
&lt;emeyer> TabAtkins: It would be nice of non-root scroller behavior was similar to fixed-position and the root scrollers.<br>
&lt;emeyer> s/nice of/nice if/<br>
&lt;astearns> ack smfr<br>
&lt;emeyer> smfr: Apple platforms have overscroll on subscrollers, have shipped that for many years.<br>
&lt;emeyer> TabAtkins: What’s the abspos behavior?<br>
&lt;emeyer> smfr: If a scroll isn’t a container block, then the abspos will follow, meaning overscroll will apply.<br>
&lt;emeyer> …I think the rest here is that on the root, abspos will dissociate from the scorlling context.<br>
&lt;chrishtr> q+<br>
&lt;emeyer> …Potentially you can get negative offsets, depending on the implementation of scrolling.<br>
&lt;astearns> ack flackr<br>
&lt;emeyer> flackr: There’s no specification of what should be done for overscroll, and it can be quite different platform to platform.  Maybe we should have guidelines.<br>
&lt;emeyer> …It would be awkward to reflect Android behavior.  I realize this would result in developer-positioned things being out of alignment from positioned content.<br>
&lt;TabAtkins> Agree with flackr - overscroll shouldn't be reflected into APIs (or at least, not the normal ones; maybe we could produce specialized query APIs that reflect this). It's a transitory effect and UA-specific.<br>
&lt;smfr> q+<br>
&lt;emeyer> …Anything you’re trying to keep in alignment will often get out of sync during normal scrolling.<br>
&lt;astearns> ack smfr<br>
&lt;emeyer> smfr: I agree with a lot of what was just said.  We consider overscroll as an unstable state.  We’re willing to let things be not entirely correct.<br>
&lt;emeyer> astearns: flackr was saying overscroll is a stretch, not a translation.<br>
&lt;emeyer> flackr: On Android, content that’s at the top is still at the top, but it’s stretched by some amount.<br>
&lt;emeyer> smfr: So it’s like a rubber sheet that stretches more at the edge?<br>
&lt;astearns> ack chrishtr<br>
&lt;emeyer> flackr: Yep.<br>
&lt;emeyer> chrishtr: I agree we shouldn’t expose thing to developers during scroll.  For overscroll on non-root scrollers, I would expect the right behavior to be that overscroll only applies to content that’s scrolled.<br>
&lt;flackr> q+ to mention sticky can be similar when it is still free to move<br>
&lt;emeyer> …Abspos is different than fixedpos because they have different containing blocks.<br>
&lt;astearns> ack flackr<br>
&lt;Zakim> flackr, you wanted to mention sticky can be similar when it is still free to move<br>
&lt;flackr> +1<br>
&lt;TabAtkins> On reflection, yeah, fixposes aren't fixed wrt the root scroller, but to the viewport, which is "outside" the root scroller; this is indeed consistent with the abspos behavior for subscrollers.<br>
&lt;smfr> q+<br>
&lt;emeyer> flackr: Under certain circumstances, stickypos feels very similar to fixedpos.  This is the sort of case where we might want to exclude stickpos.<br>
&lt;astearns> ack smfr<br>
&lt;emeyer> smfr: I agree sticky should have the same treatment as fixed when it responds to the viewport.<br>
&lt;emeyer> …Do we want authors to be able to pick how overscrolls happen?<br>
&lt;emeyer> flackr: Fixed will not respect overscroll, is the proposal.  We could add a way to opt out of that in the future.<br>
&lt;TabAtkins> Agreed when stickypos is sticky to the viewport that it should *remain* sticky to the viewport when the content is overscrolling, same logic as fixpos.<br>
&lt;emeyer> …Not reflected in getBound and clientRect.<br>
&lt;iank_> i wonder if that'd break existing apps that use fixed-pos as a sidebar.<br>
&lt;flackr> s/flackr/chrishtr<br>
&lt;emeyer> smfr: On Apple platforms, overscroll affects scroll position.  My concern is that things could get more complicated.<br>
&lt;emeyer> flackr: On Chrome, we don’t have negative scroll position.<br>
&lt;TabAtkins> Letting overscroll be *detectable* makes sense; don't think it needs to be detectable *by the scrollOffset*<br>
&lt;TabAtkins> because it'll be UA-specific to do so<br>
&lt;flackr> +1<br>
&lt;emeyer> smfr: intersection observer might also be affected.<br>
&lt;emeyer> astearns: Do you want to look through those things before we resolve?<br>
&lt;TabAtkins> fixpos *and* stickpos that stick to the viewport<br>
&lt;emeyer> smfr: I’m okay saying UAs can choose what to do.<br>
&lt;iank_> how difficult is it to add a switch for this?<br>
&lt;emeyer> astearns: Sounds like you are suggesting merely a note about this interaction.  I was hoping we could get something like overscroll is not defined, we do resolve that fixedpos do not participate in that behavior.<br>
&lt;emeyer> smfr: I think we also have to specify the client coordinate APIs.<br>
&lt;emeyer> flackr: We have to allow platofrms to diverge on how they represent overscroll.<br>
&lt;emeyer> iank_: How difficult would it be to add a switch to control this behavior?<br>
&lt;emeyer> …with regards to the fixedpos.<br>
&lt;emeyer> smfr: I don’t think it would be hard but we’d have to figure out what it applies to.<br>
&lt;emeyer> iank_: A global flag would be easier than per-element for you?<br>
&lt;emeyer> smfr: Yes.<br>
&lt;emeyer> iank_: People use fixedpos for different things.  There’s clear use cases for if you want them to move or not.  I worry we’ll make some subset of people unhappy either way.<br>
&lt;emeyer> smfr: Fixedpos layout should be defined is that it’s relative to the viewport.  If you add alternate behaviors, you have to define a lot more.<br>
&lt;chrishtr> The proposed note will be compatible with sidebars, since it seems best for them not to overscroll<br>
&lt;emeyer> iank_: We already have this complexity with abs and fixed pos.  They resolve against two different rectangles.<br>
&lt;emeyer> smfr: We certainly have code that only applies to sticky or fixed.<br>
&lt;emeyer> …It’s complicated and I’d prefer not to make it more complicated.<br>
&lt;emeyer> iank_: I can see circumstances where you want fixed pos to move with overscroll, and others where you don’t.<br>
&lt;emeyer> flMy high-level view is that things that move with scroll should be affected by overscroll.<br>
&lt;emeyer> (previous was from flackr)<br>
&lt;emeyer> astearns: We  have WebKit considering it a bug that these things do move, do we have bugs on Firefox complaining that they don’t?<br>
&lt;emeyer> emilio: We used to have them moved, and we changed so they didn’t.<br>
&lt;emeyer> astearns: It sound like the only thing we can come to consensus on today is a non-normative note that browsers _may_ do what they like.  I’m reluctant to do something that weak.<br>
&lt;chrishtr> q+<br>
&lt;emeyer> TabAtkins: I don’t think we have to be that weak.  Simon’s asking for us to specify the non-moving behavior.  Are there strong objections to us doing that, Simon?<br>
&lt;emeyer> smfr: Seems like it’s adding a non-consistency to the specs.<br>
&lt;emilio> q+<br>
&lt;emeyer> TabAtkins: We certainly wouldn’t be getting worse, since there’s no spec text right now.<br>
&lt;emeyer> astearns: I’d be reluctant to resolve without having gone through all the JS APIs.  We don’t want to make things incoherent.<br>
&lt;astearns> ack chrishtr<br>
&lt;emeyer> chrishtr: Non-nomative note that says SHOULD as opposed to MAY?<br>
&lt;astearns> ack emeyer<br>
&lt;astearns> ack emilio<br>
&lt;emeyer> emilio: QA filed a bug mentioning things didn’t match between browsers.<br>
&lt;emeyer> …We certainly haven’t recieved complaints about the Chrome behavior.<br>
&lt;emeyer> astearns: Could do a non-normative SHOULD note.<br>
&lt;emeyer> fremy: Not sure of the point of making it non-normative if it says SHOULD.<br>
&lt;emeyer> s/fremy/fantasai/<br>
&lt;fremy> scribenick: fremy<br>
&lt;bmathwig> +1 to that<br>
&lt;fremy> chrishtr: when we make it non-normative, the practical result is that chromium considers changing the behavior<br>
&lt;fremy> astearns: the proposal is thus to add a normative should for this<br>
&lt;fremy> astearns: would anyone object to this?<br>
&lt;fremy> RESOLVED: fixed-position elements whose scroller is not their containing block do not participate in overscroll<br>
&lt;flackr> +1 support for sticky<br>
&lt;fremy> TabAtkins: also sticky<br>
&lt;fremy> astearns: any objection to adding sticky?<br>
&lt;fremy> RESOLVED: the former statement also applies to sticky element when stuck<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/4549#issuecomment-1067389586<br>
&lt;dbaron> no, you want to fix the github back to the original<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/6299<br>
</details>


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


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

Received on Wednesday, 23 March 2022 16:56:50 UTC