Re: [csswg-drafts] [css-conditional] Make CSSSupportsRule expose whether its condition is met (#4240)

The CSS Working Group just discussed `CSSSupportsRule should expose bool`, and agreed to the following:

* `RESOLVED: Add .matches to CSSMediaRule and CSSSupportsRule`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: CSSSupportsRule should expose bool<br>
&lt;faceless> present- (got to dash)<br>
&lt;TabAtkins> github: https://github.com/w3c/csswg-drafts/issues/4240<br>
&lt;astearns> ack chris<br>
&lt;TabAtkins> chris: Perfectly reasonable to have a getter to know whether the condition matches<br>
&lt;TabAtkins> chris: Most discussion is bikeshedding the name, not whether it shoudl exist or not<br>
&lt;TabAtkins> chris: Interested if there's arguments against<br>
&lt;fantasai> TabAtkins: Definitely should exist, could recreate by running it through existing APIs<br>
&lt;astearns> ack dbaron<br>
&lt;emilio> q+<br>
&lt;TabAtkins> dbaron: agree it shoudl exist. At some point when I drafted the IDL I made a common base class for supports and media. Might not exist now, but if we make a bool like this we should make it common between the rules<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> STrong agree<br>
&lt;TabAtkins> fantasai: Yeah, suggest putting it on CSSConditionRule superclass, which does exist<br>
&lt;TabAtkins> fantasai: emailio pointed out it's tricky on @container rules since they rely on the element being matched as well<br>
&lt;TabAtkins> fantasai: But we should have consistent naming even if it's individual methods on each subclass<br>
&lt;astearns> ack emilio<br>
&lt;TabAtkins> emilio: Yeah, superclass is tricky because CQs shouldn't have it<br>
&lt;TabAtkins> emilio: I think the API for CQs would look a bit different, would be a function that takes an element, and it would force layout, etc<br>
&lt;TabAtkins> emilio: So I think it should exist, but not on the superclass<br>
&lt;TabAtkins> TabAtkins: I suggest we just define a getter on the subclasses it makes sense for, yeah<br>
&lt;fantasai> ...<br>
&lt;fantasai> TabAtkins: .matches works, already on MQlist<br>
&lt;fantasai> TabAtkins: meaning carries over well<br>
&lt;TabAtkins> emilio: fwiw, "matches" is what we use internally in Gecko<br>
&lt;TabAtkins> chris: .met would work, but okay with .matches too<br>
&lt;TabAtkins> fantasai: Happy to go with .matches since MQList already has it<br>
&lt;chris> fine with matches<br>
&lt;fantasai> s/.../fantasai: Sure, but what's it called?/<br>
&lt;TabAtkins> astearns: So proposed resolution to add .matches to the relevant conditional rules<br>
&lt;TabAtkins> dholbert: Q about subclasses vs superclass<br>
&lt;TabAtkins> dholbert: Can we put in an intermediate superclass so it's shared?<br>
&lt;fantasai> TabAtkins: IDL supports this, but it is an observable change<br>
&lt;chris> emilio could you propose some IDL in the issue?<br>
&lt;fantasai> TabAtkins: we thought it would be useful for ConditionalRule, but less clear if it's worth it for this<br>
&lt;fantasai> astearns: Which rules are affected?<br>
&lt;emilio> chris: sure, `readonly attribute boolean matches;` on the two individual rules?<br>
&lt;fantasai> TabAtkins: @media and @supports<br>
&lt;TabAtkins> yeah, that's the IDL<br>
&lt;TabAtkins> RESOLVED: Add .matches to CSSMediaRule and CSSSupportsRule<br>
</details>


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


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

Received on Wednesday, 27 July 2022 16:31:19 UTC