Re: [csswg-drafts] [mediaqueries][css-contain] How to evaluate `<ratio>` queries? (#8244)

The CSS Working Group just discussed ``[mediaqueries][css-contain] How to evaluate `<ratio>` queries?``, and agreed to the following:

* `RESOLVED: aspect-ratio queries are always true (except when it can't apply at all)`
* `RESOLVED: Accept Oriol's option 1 (0/0 is comparable with itself, but false when compared with any other ratio)`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> oriol: CQs have the ability to compare the aspect-ratio to a value<br>
&lt;TabAtkins> oriol: You can also do in MQs, but more difficult to get into the degenerate cases there, so the CQ case is more important<br>
&lt;TabAtkins> oriol: So what should happen if you eval aspect-ratio in a boolean context?<br>
&lt;TabAtkins> oriol: Typically it's true if the feature is true when equal to any non-zero value<br>
&lt;TabAtkins> oriol: But should that apply here?<br>
&lt;TabAtkins> oriol: And do all 0/N ratios work the same?<br>
&lt;TabAtkins> oriol: Propose three options:<br>
&lt;TabAtkins> oriol: 1) Check if any ratio evaluates to true (not exlcuding a 0 ratio)<br>
&lt;TabAtkins> oriol: 2) Check if any ratio other than 0/0 would be true - treat *this* special ratio as the "none"<br>
&lt;TabAtkins> oriol: 3) Check if any non-degenerate ratio evals to true<br>
&lt;TabAtkins> oriol: And then there's a question of how to compare different ratios<br>
&lt;TabAtkins> oriol: If a ratio is > a value, how to compare if one is degenerate?<br>
&lt;fantasai> TabAtkins: taking up separately seems fine<br>
&lt;fantasai> TabAtkins: For the first, I propose a 4th option: all ratios are always true<br>
&lt;fantasai> TabAtkins: because there's no actual zero value<br>
&lt;fantasai> oriol: I guess that could work, too<br>
&lt;fantasai> TabAtkins: I don't think there's any meaningful behavior existing, so don't need to worry about it<br>
&lt;fantasai> florian: Conceptually the only one to answer false about is "I don't have a screen, I don't have an aspect ratio"<br>
&lt;fantasai> Rossen_: what about 0x0 viewport?<br>
&lt;Rossen_> ack fantasai<br>
&lt;TabAtkins> fantasai: Two options that could make sense is Tab's proposal with florian's amendment: only false if you don't have a viewport at all<br>
&lt;TabAtkins> fantasai: Even 0/0 is a ratio<br>
&lt;TabAtkins> fantasai: Other option is any degenerate ratio is false<br>
&lt;TabAtkins> fantasai: Includign zero<br>
&lt;TabAtkins> Rossen_: When printing, what's the a-r?<br>
&lt;TabAtkins> fantasai: page size<br>
&lt;fantasai> TabAtkins: We don't have a way to express "no viewport at all"...<br>
&lt;fantasai> TabAtkins: I'm fine with FLorian's amendment<br>
&lt;fantasai> Rossen_: other opinions?<br>
&lt;TabAtkins> (in effect, it's never false then)<br>
&lt;fantasai> Rossen_: Then proposed to choose option 4, false in the case of no viewport<br>
&lt;fantasai> oriol: This would only be for media queries<br>
&lt;TabAtkins> oriol: So always true in CQ, since there's always an element?<br>
&lt;TabAtkins> fantasai: I mean an aural browser could exist that doesn't have sizing<br>
&lt;fantasai> fantasai: Could have a non-visual browser, then can't have a box<br>
&lt;TabAtkins> florian: That's a broader question - geometry questions in a non-visual browser is a wider issue<br>
&lt;TabAtkins> proposed resolution: aspect-ratio queries in a boolean context are always true<br>
&lt;TabAtkins> RESOLVED: aspect-ratio queries are always true (except when it can't apply at all)<br>
&lt;TabAtkins> oriol: So othe rissue is comparison<br>
&lt;TabAtkins> oriol: [missed]<br>
&lt;TabAtkins> oriol: ratios of the form N/0 are all equal, and all greater than finites<br>
&lt;TabAtkins> oriol: I think this is straightforward, but would like confirmation<br>
&lt;TabAtkins> oriol: But then have to say what to do with 0/0<br>
&lt;TabAtkins> oriol: Doesn't fit into the expanded real line<br>
&lt;TabAtkins> oriol: I proposed some options<br>
&lt;TabAtkins> oriol: 1) Model this as a special value outside the real line - you can compare ratios in the real line, or outside the real line, but not mixed<br>
&lt;TabAtkins> oriol: 2) Instaed of 0/0 being special, it's a value in the interval that's unknowable<br>
&lt;TabAtkins> oriol: So we'd get unknown when comparing with real numbers<br>
&lt;TabAtkins> oriol: 3) Basically the same but with some other cases degenerate.<br>
&lt;TabAtkins> oriol: I'm leaning towards the first option<br>
&lt;TabAtkins> oriol: You can look at the tables I made for brwoser behavior<br>
&lt;TabAtkins> oriol: But I propose option 1 - always true or false, but comparing 0/0 with any real ratio is always false<br>
&lt;fantasai> TabAtkins: I agree, and I think Oriol's option 1 makes sense<br>
&lt;TabAtkins> Summary: 0/0 == 0/0 is true, 0/0 with any other ratio is false.<br>
&lt;TabAtkins> Rossen_: Objections?<br>
&lt;fantasai> wfm, given Tab's summary<br>
&lt;TabAtkins> RESOLVED: Accept Oriol's option 1 (0/0 is comparable with itself, but false when compared with any other ratio)<br>
</details>


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


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

Received on Thursday, 2 February 2023 01:00:48 UTC