Add the :open pseudo-class by josepharhar · Pull Request #10126 · whatwg/html (original) (raw)

Thanks! @domenic do you think these issues still apply with this pseudo class?

It depends exactly how they're defined. Consider a case like <input type=password> where browser A shows a picker and browser B does not show a picker. If we define this as matching :closed in browser B, then the issues do not occur: the web developer cannot write code that works differently in browser A vs. B. Whereas if we say that neither :open nor :closed match in browser B, then the web developer can easily write code that works differently in the two browsers, e.g. they might give only the correct styling to browser A because they put the correct styling in #my-input:closed { ... }.

Similarly, if we go with the "neither :open or :closed matches no-picker controls" model, then browser B adding picker support in one release would potentially cause new styles to apply, which is a compat risk for browser B.

That said, I don't feel that the interop and compat issues with revealing the picker-UI-or-not status of a control are blocking. I think they're reason to be cautious, but if all the implementers in the room are willing to eat those interop and future-compat costs, then from a HTML editor perspective, I have no objection.