Re: [csswg-drafts] [selectors] Add `:open` or `:top-layer` pseudo class (#7319)

The CSS Working Group just discussed `[selectors] Add :open or :top-layer pseudo class`, and agreed to the following:

* ``RESOLVED: start work on an `:open` pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.``
* ``RESOLVED: start work on an `:open` as a pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.``

<details><summary>The full IRC log of that discussion</summary>
&lt;astearns> topic: [selectors] Add :open or :top-layer pseudo class<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/7319<br>
&lt;argyle> astearns: mason, i assume you'll take this<br>
&lt;argyle> masonf: we have discussed this before, in june, initially propsoed as a top layer psudo class. we need something like this for the popup api<br>
&lt;argyle> masonf: general conclusion in open ui and reading issues in css, we'd prefer to do something like :open<br>
&lt;argyle> masonf: liek  a selector that matches thigns open. both modals and dialogs included<br>
&lt;chris> that would include open details elements?<br>
&lt;argyle> masonf: both modal and non modal, details elements, popup api, possibily select<br>
&lt;astearns> chris: yes<br>
&lt;dbaron> s/both modal and non modal/dialogs (both modal and non modal)/<br>
&lt;argyle> masonf: agenda on open ui today to discuss for a different psuedo class for select<br>
&lt;argyle> masonf: general consensus and hoping to heaer resolution on an open speudo class<br>
&lt;argyle> astearns: queue up if you havce questions<br>
&lt;TabAtkins> +1<br>
&lt;bramus> +1 for `:open`<br>
&lt;astearns> ack fantasai<br>
&lt;chris> +1 for :open<br>
&lt;argyle> fantasai: may not have fully followed it, say its a details element that's oepn, this would match open?<br>
&lt;argyle> masonf: correct<br>
&lt;argyle> masonf: even tho it's not in the top layer, the :open class is unrelated<br>
&lt;astearns> masonf: this is no longer a top-layer only thing<br>
&lt;argyle> fantasai: is it going to match things like form controls while open?<br>
&lt;argyle> masonf: that's debatable. there was discussoin on select whether or not we should allow it to be visible as a thing<br>
&lt;astearns> q+ ntim<br>
&lt;argyle> masonf: some platforms done preovide a calendar picker<br>
&lt;argyle> fantasai: i like  the idea of :open, useful in a number of cases, hesistant to add it due to ambiguous points. we need a definition that covers all the current and future elements, so we have a consistent story for what open means<br>
&lt;argyle> fantasai: a clear definition where any person can look at an html element they have a clear idea of whether it can be open or not<br>
&lt;masonf> q?<br>
&lt;astearns> ack ntim<br>
&lt;masonf> q+<br>
&lt;argyle> ntim: if you put the open attr on dialog, it will visually appear open because of the user agent stylesheet, but on the dom side it wont be considered open ,what should we match for that case?<br>
&lt;argyle> masonf: in what sense wont it be open? it will be visible<br>
&lt;argyle> ntim: it wont be tracked as open but will be visible. if you dialog.setAttribute('open', true) as opposed to dialog.showModal()<br>
&lt;argyle> masonf: difference will be whether or not events are fired?<br>
&lt;fantasai> I just want to record strong +1 to plinss's comment https://github.com/w3c/csswg-drafts/issues/7319#issuecomment-1193026841<br>
&lt;argyle> ntim: attr will confused the browser because, especially, if you put :open and then .showModal(), or wierd combinations, you end up in a broken state<br>
&lt;plinss> q+<br>
&lt;argyle> ntim: dom doesnt consider just setting hte open attribute to be having the dialog open. the UA will use the open attribute. maybe one thing we could do is<br>
&lt;argyle> ntim: make the pseudo class match the dom state and change the UA to use the new pseudo class.<br>
&lt;argyle> ntim: and make the pseudo match the dom state. so you dont have confusion between visually open and ..<br>
&lt;argyle> masonf: there is an open issue for dialog. open attribute behaves wiedly in various cases<br>
&lt;argyle> masonf: this proposal you make could be good tho<br>
&lt;argyle> masonf: but i'd like to propoe a working definition for open, for things that can visually open and close, and when they are open it matches :open<br>
&lt;argyle> ntim: i think if you want to define a def for dialog, we need tor esolve whichd efinition of open we want to take first<br>
&lt;argyle> masonf: that's what i'm proposing, open things match :open<br>
&lt;argyle> ntim: like visually oepn, via show or attribute change?<br>
&lt;emilio> q+<br>
&lt;argyle> masonf: the current dialog beavhior is funny, but i think, if you add the open attibute to a dialog, it becomes visible, i expect the pseudo class to match<br>
&lt;argyle> astearns: mason were you on the Q to respond to tim? have you done that?<br>
&lt;argyle> masonf: yes i've done that<br>
&lt;astearns> ack masonf<br>
&lt;astearns> ack plinss<br>
&lt;argyle> plinss: first i'm generally in favor of an open pseudo, i agree with fantasai that we need a clear definition, like in the HTML spec. this thing is in the modal state, how it gets in and out of the state. i dont think we should have this in the CSS spec, that this is openish<br>
&lt;fantasai> s/have this/have/<br>
&lt;masonf> q+<br>
&lt;argyle> plinss: needs a hard definition.<br>
&lt;argyle> plinss: my other bigger concern is, coming from TAG perspective, we have a problem of managing this kind of state<br>
&lt;argyle> plinss: this isnt welld efined on web platform, this is a mess<br>
&lt;argyle> plinss: there's areas where things are controlled with an attribute, a property, and with toggles() we can open with a CSS property<br>
&lt;argyle> plinss: if css can do that, we can get into circularity issues<br>
&lt;fantasai> s/toggles()/CSS Toggle spec/<br>
&lt;argyle> plinss: we need to take a step back and make sure it all plays nicely together<br>
&lt;argyle> TabAtkins: we shouldnt have circularity here<br>
&lt;bkardell_> would like to say that I like what plinss is saying here<br>
&lt;fantasai> +1<br>
&lt;argyle> plinss: one of the things i understand for toggles, offered defined elements, something like details with open with a toggle, shouhld that represent this pseudo class?<br>
&lt;argyle> TabAtkins: that's entirely author controlled<br>
&lt;bkardell_> q+<br>
&lt;dbaron> The :open pseudo-class should reflect something that is open according to the markup language and its api.<br>
&lt;argyle> plinss: now i have an independent method for opening and closing things. one or more of these may interact well the others<br>
&lt;argyle> plinss: if an author is building ac ustom element, they should be able to use a simlilar method the pljatform has<br>
&lt;argyle> plinss: so if an author is building a custom element with open/close, they should have a way to interact with this. if we say toggle()'s is the way to do that, we need to know how it shoulhd all work<br>
&lt;fantasai> s/well the others/well the others. There are multiple ways to make something open, and this is getting all weird and inconsistent/<br>
&lt;argyle> astearns: can we pospone this to a future call and have a separate discussion about<br>
&lt;argyle> TabAtkins: the design of it will be about getting to his concern more directly, which i believe will resolve concerns here<br>
&lt;argyle> TabAtkins: the issues you're bringing up has been true for CSS's lifetime, it can do something that triggers off something thats emulatable by hand<br>
&lt;argyle> TabAtkins: nothign new about :open that makes it wierder than anything else<br>
&lt;argyle> fantasai: depends on how you define it<br>
&lt;argyle> TabAtkins: secondly, looping toggle()'s, only circularity if it's a pure CSS loop<br>
&lt;argyle> TabAtkins: if toggle()'s can hook up to something that can reflect :open, it woulud be dependent on toggle() state, that is intentially not controllable by css.<br>
&lt;argyle> astearns: the toggle() state is ddriven by js and user interaction<br>
&lt;argyle> astearns: i'd like to close this off for now, and go back to the queue<br>
&lt;argyle> astearns: but, i'd like to constrain this so we can get to a resoution or choose not to<br>
&lt;argyle> astearns: just about whether we start work on an :open pseudo<br>
&lt;masonf> - Proposed resolution: add `:open` as a pseudo class, which matches things that are in an "open" state. We need to define that state carefully.<br>
&lt;argyle> astearns: lots of things to elaborate on that can be separate issues, i want to drill down to objections to starting work, not figuring out details<br>
&lt;astearns> ack emilio<br>
&lt;argyle> emilio: was going to say omething about what mason said, about the pseudo class, i dont think we shoul duse the attribute for htis. it's a separate issue and i'm happy to punt on this. dont need to discuss the rest<br>
&lt;astearns> ack masonf<br>
&lt;dbaron> s/rest/rest.  But I think that :open should be based on the UA-internal state that happens from openDialog./<br>
&lt;argyle> masonf: plus one yours and put a resolution into the chat. agree i'd like resolution on :open interest, then more issues for precision<br>
&lt;argyle> masonf: regards to :modal, something similar to that would be great today. needs a careful definition too<br>
&lt;argyle> masonf: there is no :modal definition in the HTML spec<br>
&lt;argyle> rreno: there is one<br>
&lt;argyle> masonf: but it's missing :fullscreen definitions, etc<br>
&lt;argyle> masonf: there's a defnition of  a modal dialog, but not :modal<br>
&lt;astearns> ack dbaron<br>
&lt;argyle> astearns: david you're next<br>
&lt;argyle> dbaron: was going to support the idea that if we agree to do this, and say that we need formal definitions of what :open is, where markup defines what it si to be open, so the htmlm spec would have those defs, this would addreess some of peters other concerns, based on suggestions mason gave, dialog and details and maybe seleect, and so on<br>
&lt;argyle> dbaron: i'm thinking then, through the process of writing those def formally, you avoid the circularity issues of a more vague definition<br>
&lt;masonf> +1 dbaron, well said<br>
&lt;astearns> ack bkardell_<br>
&lt;argyle> bkardell_: i dont object to us starting to define the speudo class, i do agree with david that the act of defining it can deal with alot fo this<br>
&lt;argyle> bkardell_: state doesnt necessarily mean the same thing all the time<br>
&lt;argyle> bkardell_: we have contorls that are unchanging, they're immutable in their, that have particula rmeaning<br>
&lt;argyle> bkardell_: there's other things, where plinss was detailing, something like summary/details, where perhaps it's not always shhown with a contorl nature, sometimes you want it open, sometimes you want it closed<br>
&lt;argyle> bkardell_: they're matters of display, they're in the domain of css<br>
&lt;argyle> bkardell_: i favor us having a wider discussion and careful articulation of that<br>
&lt;argyle> bkardell_: and how it all plays together<br>
&lt;argyle> bkardell_: i think that's important to make good progress<br>
&lt;astearns> ack fantasai<br>
&lt;argyle> fantasai: :modal was more straight forward, i think we can come up with a conceptual def of :oepn, and have the HTML spec define it, dont think HTML spec should only define it<br>
&lt;argyle> fantasai: we want the html spec as it evovles, and other languages, to be able to easily and clearly understand what it should match when its :open<br>
&lt;argyle> fantasai: i dont think we have a clear idea of what that means yet, and has intent to add something like this until we have a proposal, wheere everyone agrees ont he delineation where we can extrapolate clearlyl withohut arbitrary decisions because it's not a clear def that cuts through all the open or not open items<br>
&lt;argyle> fantasai: i'm not opposed to working on it, i wouljd be opposed to adding it to the spec right now, until some of these questions are answered enough where we can make a fairly clear argument for each element whether it's open or close.<br>
&lt;masonf> +1 to fantasai's point that we need a conceptual definition. At least at the same level of detail as we have for :modal.<br>
&lt;argyle> fantasai: can try to draw the line, and then use that to extrapolate. but i dont want to add something so fuzzy that we end up making decisions that are inconistent over time cuz we can come up with someting clear enough<br>
&lt;masonf> - Proposed resolution: add `:open` as a pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.<br>
&lt;TabAtkins> I fundamentally don't understand where this is coming from. We proposed the elements it would match. There's an open question about if any &lt;input>s should, which can be quickly argued and answered in the thread.<br>
&lt;argyle> astearns: are you ok working on that resolution? in this issue? until the point at which fantasai and the rest of the group agree it's ready to go into the spec?<br>
&lt;argyle> masonf: we agree with my propiosed resolution?<br>
&lt;argyle> astearns: makes sense to me<br>
&lt;argyle> astearns: anyone want to make changes to the proposed resolution?<br>
&lt;argyle> fantasai: they work on defining an :open instead of just add it<br>
&lt;argyle> astearns: start work on an :open speudo class, in the issue<br>
&lt;dbaron> s/they work/say work/<br>
&lt;masonf> Proposed resolution: start work on an `:open` as a pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.<br>
&lt;argyle> astearns: any other amendments to the proposed resolution?<br>
&lt;chrishtr> + to this resolution<br>
&lt;masonf> Proposed resolution: start work on an `:open` pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.<br>
&lt;argyle> astearns any objections?<br>
&lt;tantek> +1<br>
&lt;argyle> astearns: alirght we're resolved to start work on an :open pseudo<br>
&lt;masonf> RESOLVED: start work on an `:open` pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.<br>
&lt;argyle> astearns: ty mason<br>
&lt;argyle> masonf: ty<br>
&lt;argyle> astearns: anything else on this issue today?<br>
&lt;argyle> RESOLVED: start work on an `:open` as a pseudo class, which matches things that are in an "open" state. We need to define that state carefully, with a general conceptual definition that can be used by HTML for the specifics per-element.<br>
&lt;masonf> thank you for not holding on to the time box. :-)<br>
</details>


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


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

Received on Wednesday, 24 August 2022 16:55:20 UTC