Re: [csswg-drafts] [css-position-4] Consider removing the overlay property (#13200)

The CSS Working Group just discussed `[css-position-4] Consider removing the overlay property`.

<details><summary>The full IRC log of that discussion</summary>
&lt;kbabbitt> jarhar: overlay property I feel like has become a bit of a developer issue<br>
&lt;kbabbitt> ... to this day I'm still helping people out with demos where something doesn't work because they forgot overlay in list of properties to transition<br>
&lt;kbabbitt> ... all these cases seems like a no-brainer with the stuff set up with a display animation<br>
&lt;kbabbitt> ... should be able to figure out that element should be kept in top layer until end of animation<br>
&lt;kbabbitt> ... thinking of ways to remove overlay<br>
&lt;kbabbitt> ... could wait until element becomes display:none<br>
&lt;kbabbitt> ... started seeing things that concerned me with this<br>
&lt;lwarlow> q+<br>
&lt;kbabbitt> ... said a lot in the issue already<br>
&lt;kbabbitt> ... there was in my last comment, referenced 2 things, a Chrome regression bug where someone was expecting display:block to return a popover from top layer to document flow<br>
&lt;kbabbitt> ... jake archibald had an example that becaome a tooltip and then went to document flow<br>
&lt;kbabbitt> ... remove overlay and keep things in top layer until display:none, these two examnples wouldn't work properly anymore<br>
&lt;kbabbitt> ... another idea I had was, maybe we can do something smarty with looking at display animations<br>
&lt;kbabbitt> ... if there's currently an animation for display on this element, we can keep in top layter until animation finishes<br>
&lt;kbabbitt> ... thought about this more again a few minutes ago and posted another comment<br>
&lt;kbabbitt> ... in hide popover steps, update pseudo classes<br>
&lt;kbabbitt> ... to give author CSS time to start a display aniation<br>
&lt;kbabbitt> ... query element afterwards to see if a display animation started<br>
&lt;kbabbitt> ... if sio, wait for it to finish and then remove from top layer<br>
&lt;kbabbitt> ... if not, remove from top layer right now<br>
&lt;kbabbitt> ... good indication author is not trying to do a top layer animation<br>
&lt;kbabbitt> ... was thinking about prototyping some of this stuff, didn't finish but started<br>
&lt;masonf> qq+<br>
&lt;ntim> q+<br>
&lt;kbabbitt> ... any thoughts on whether this is a good idea or bad idea?<br>
&lt;emilio> q+<br>
&lt;kbabbitt> masonf: my original prototype for popover was designed this way, it worked very nicely<br>
&lt;astearns> ack masonf<br>
&lt;Zakim> masonf, you wanted to react to emilio<br>
&lt;astearns> ack lwarlow<br>
&lt;flackr> q+<br>
&lt;kbabbitt> lwarlow: 2 points<br>
&lt;kbabbitt> ... is part of the issue the overlay property and people not remembering it because it's only in Chromium?<br>
&lt;kbabbitt> ... documentation concern more than implementation one<br>
&lt;kbabbitt> ... if we need a signal that this is top layer in some other situation, overlay property seems to make sense<br>
&lt;kbabbitt> ... if we did not get rid of it, idea of looking at display property doesn't work because you might have a popover going to in page and actually hiding<br>
&lt;kbabbitt> ... one thing you could look at is position property as well<br>
&lt;kbabbitt> ... does position property get updated to e.g. static which would return to in page flow<br>
&lt;kbabbitt> ... can say okay they're moving to in page flow rather than hiding<br>
&lt;kbabbitt> ... and could use that plus display check to see if this should happen or not<br>
&lt;kbabbitt> ... don't know if there would be other use cases to solve, might be one idea<br>
&lt;astearns> ack ntim<br>
&lt;kbabbitt> ntim: one suggestion I had on issue was to make overlay a longhand of display<br>
&lt;jarhar9> the popover element is position:fixed whether its open or closed, so by default it wouldn't currently change its position<br>
&lt;kbabbitt> ... so if you transition display that would transition overlay as well so you wouldn't need to specify both<br>
&lt;flackr> +1 was going to suggest the same thing, transitioning display should implicitly transition overlay<br>
&lt;kbabbitt> ... brings up some of the previous questions about shorthanding<br>
&lt;kbabbitt> ... but I think it solves this nicely without any magic<br>
&lt;astearns> ack emilio<br>
&lt;keithamus> q+<br>
&lt;kbabbitt> emilio: that seems a bit, wanted to suggest something similar, but thinking more about it, I think I disagree ... if you make display a shorthand, then setting display:none also uunsets overlay<br>
&lt;keithamus> q-<br>
&lt;kbabbitt> ... but setting display something else also does<br>
&lt;kbabbitt> ... need to make display ... need a bit of magic at the very least<br>
&lt;kbabbitt> ntim: some of this is in UA stylesheet, sets overlay !important alreadyh<br>
&lt;kbabbitt> ... transition will happen anyway because of that<br>
&lt;kbabbitt> flackr: from value would have overlay<br>
&lt;keithamus> q+<br>
&lt;kbabbitt> emilio: then you need to serialize it somehow, getComputedStyle of display<br>
&lt;kbabbitt> ntim: some font properties are reset-only<br>
&lt;kbabbitt> ... don't necessarily need to serialize for some shorthands<br>
&lt;kbabbitt> emilio: a shorthand either serializes its value or empty string<br>
&lt;kbabbitt> ... so gCS for display would serialize empty string which would be weird<br>
&lt;kbabbitt> astearns: let's set aside details of shorthanding strategy until we get through queue<br>
&lt;kbabbitt> emilio: another proposal related to that, transition property display also expands to overlay<br>
&lt;kbabbitt> ... that's a bit more scoped maybe<br>
&lt;kbabbitt> astearns: not sure I get that suggestion<br>
&lt;astearns> ack flackr<br>
&lt;kbabbitt> flackr: a lot of what I was going to say has been covered, was going to suggest same thing that transitioning display should implicitly transition overlay<br>
&lt;kbabbitt> ... how we do that is a technical question, emilio's suggestion of this being some magic in transition may be a good one<br>
&lt;jarhar9> expanding transition-property:display to overlay but not expanding display:block to also do overlay makes sense i think<br>
&lt;kbabbitt> ... one reason I think we should do this instead of display magic is you end up with weird cases where you can hae a display animation whose values are the same but that causes overlay to stick<br>
&lt;kbabbitt> ... hard to explain to developers if this is internal magic, easier if it's actually doing a transition on overlay propertu<br>
&lt;astearns> ack dbaron<br>
&lt;kbabbitt> dbaron: 2 things, one is, to reiterate point that part of what's going on is that we have a property ... goal here with overlay property wqas to have a property authors couldn't change except by transitioning<br>
&lt;kbabbitt> ... which is a little wierd<br>
&lt;kbabbitt> ... only thing that sets is !important rules in UA sheet<br>
&lt;kbabbitt> ... that docukment when something is in the top layer<br>
&lt;kbabbitt> ... but then we allow it to be transitioned so authors can mess with timing of when change happens, but not with the fact that it's happening<br>
&lt;kbabbitt> ... I think I'm more okay with emilio's suggestion of making it specific to transition-propertuy<br>
&lt;kbabbitt> ... broader shorthanding would have interesting implications for serialization and other things I don't think we want to take on here<br>
&lt;astearns> ack keithamus<br>
&lt;kbabbitt> ... shorthanding relationship specific to transition-property soundsl ike a plausible solution<br>
&lt;kbabbitt> keithamus: border-image on border shorthand doesn't serialize<br>
&lt;kbabbitt> ... weird side ffect is you can't express border shorthand after border-image<br>
&lt;bramus> Same with a bunch of animation-* properties<br>
&lt;kbabbitt> ... a bit of a user gotcha, understand you can't express overlay property ,might be weird side effects<br>
&lt;astearns> ack fantasai<br>
&lt;kbabbitt> fantasai: just wanted to point out, additional considerations outside ths cope of this discyussion<br>
&lt;kbabbitt> ... often. need to preserve anchoring relationship<br>
&lt;kbabbitt> ... UA styles applyed to modal to state modal-ness and at which point it disappears<br>
&lt;kbabbitt> ... can affect animations in awkward ways<br>
&lt;keithamus> q+<br>
&lt;kbabbitt> ... don't have solutions, just more problems<br>
&lt;astearns> ack keithamus<br>
&lt;flackr> q+<br>
&lt;kbabbitt> keithamus: if I remember, in Gecko the dialog's modalness is part of its top layer ness<br>
&lt;kbabbitt> ... happen at the same time<br>
&lt;lwarlow> q+<br>
&lt;kbabbitt> ... but we don't implement overlayu<br>
&lt;kbabbitt> ... agree implicit anchor has same awkwardness<br>
&lt;astearns> ack flackr<br>
&lt;kbabbitt> ... if you don't do these in tandem, gets you into weird states where you might reposition in the middle of an animation<br>
&lt;kbabbitt> flackr: haven't thought through details but one approach to solve related properties would be to transition them as well<br>
&lt;kbabbitt> ... maybe this is getting into broader ... maybe we should have a transition shorthand for all properties changing during modality change<br>
&lt;astearns> ack lwarlow<br>
&lt;kbabbitt> ... that'd be a way I could imagine style engine handling this potentially<br>
&lt;kbabbitt> lwarlow: on the modal pseudo class implicit popover, yes it's awkward engine needs to keep 3 states in sync<br>
&lt;kbabbitt> ... I think we have a spec PR that fixes this, don't think it's that big a deal<br>
&lt;ntim> q+<br>
&lt;kbabbitt> ... popover data implicit = null, set modal = false, and one after the other in each of these ases<br>
&lt;kbabbitt> ... in reality I think it's fine<br>
&lt;kbabbitt> ... having said that I think webkit does ? similarly<br>
&lt;kbabbitt> ... they don't do overlay, haven't shipped it<br>
&lt;kbabbitt> ... don't think 3 states managed together is that hard once spec has it<br>
&lt;emilio> q+<br>
&lt;astearns> ack ntim<br>
&lt;kbabbitt> ntim: also question of position UA styles<br>
&lt;kbabbitt> ... where a modal dialog has top something left something right something<br>
&lt;kbabbitt> ... I know jarhar had a PR to solve that<br>
&lt;kbabbitt> ... by magically applying UA styles during transiton<br>
&lt;kbabbitt> ... but I'm not very satisified with that, but that's a different issue<br>
&lt;kbabbitt> ... don't need to solve here<br>
&lt;astearns> ack emilio<br>
&lt;kbabbitt> emilio: there's some precedent in things that take property name lists to take magic keywor4ds<br>
&lt;kbabbitt> .... will-change for instance<br>
&lt;kbabbitt> ... will-change: draw for example<br>
&lt;kbabbitt> ... could consider something similar here<br>
&lt;kbabbitt> astearns: we've been discussing how to deal with the animations of things moving to and from top layer<br>
&lt;iank_> "scroll-position | contents | &lt;custom-ident>"<br>
&lt;kbabbitt> ... but the issue started with describing the overlay property's existence being a footgun<br>
&lt;kbabbitt> ... are just adding a footgun to this problem by adding magic to transition-property?<br>
&lt;kbabbitt> flackr: disagree. footgun was that develkopers forgot to specify<br>
&lt;keithamus> q+<br>
&lt;kbabbitt> ... making way to animate this more automatic is addressing this footgun<br>
&lt;kbabbitt> astearns: jarhar9 do you agree? are you okay keeping this property and adding stuff to make it work?<br>
&lt;astearns> ack keithamus<br>
&lt;kbabbitt> jarhar9: yes<br>
&lt;ntim> :modal pseudo-class issue: https://github.com/w3c/csswg-drafts/issues/13594<br>
&lt;kbabbitt> keithamus: is there more magic required if you had, could hold stuff in top layer forever if you set animation timing to a large number<br>
&lt;kbabbitt> ... could open a popover and hold in top layer forever with a long animation<br>
&lt;masonf> q+<br>
&lt;kbabbitt> ... might need more magic there to circumvent those issues<br>
&lt;lwarlow> Do we actually need to make any change? Is the status quo not okay?<br>
&lt;astearns> ack masonf<br>
&lt;kbabbitt> masonf: is that an attack vector? could just do with popover manual yourself<br>
&lt;kbabbitt> keithamus: circumvention where you could close ... popover manual is not issue but modal dialog is, makes rest of page inert<br>
&lt;kbabbitt> ... if held open with animation, even pressing escape twice would not dismiss<br>
&lt;lwarlow> q+<br>
&lt;kbabbitt> masonf: but modality and top layer are different things<br>
&lt;kbabbitt> ... this should not hold modaliuty, should hold top layer<br>
&lt;kbabbitt> keithamus: then it gets tricky<br>
&lt;kbabbitt> ... contradicts earlier discussion that these are same state<br>
&lt;kbabbitt> ... gets tricky becquse you're top layer dialog that isn't modal<br>
&lt;fantasai> masonf, that'll mean that `:modal` styles top matching though, right?<br>
&lt;kbabbitt> lwarlow: ? exist to prevent navigation<br>
&lt;kbabbitt> ... double pressing escape is not a problem<br>
&lt;kbabbitt> ... none of these are attack vectors<br>
&lt;kbabbitt> masonf: right<br>
&lt;kbabbitt> astearns: I think we need to take this back to the issue an dhave a detailed proposal for how we deal with exit animations if we keep overlay property<br>
&lt;kbabbitt> ... once we have that we can get a resolution<br>
</details>


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


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

Received on Wednesday, 29 April 2026 17:01:24 UTC