Re: [csswg-drafts] [css-contain-3] Inconsistent handling of known and unknown features jeopardizes backward compatibility (#7551)

The CSS Working Group just discussed `[css-contain-3] Inconsistent handling of known and unknown features jeopardizes backward compatibility`.

<details><summary>The full IRC log of that discussion</summary>
&lt;bramus> miriam: discussed before but implementers have been pushing back<br>
&lt;bramus> miriam: issue that in CQ we are just looking to see if it resolve to true or false but that something to resolve against<br>
&lt;bramus> miriam: in that finding container step we look at question ask: if looking for width we are looking for container with inline size set<br>
&lt;bramus> miriam: height block size, both<br>
&lt;bramus> miriam: problem if when asking for width or height, it can resolve true even though half of it is recognized<br>
&lt;bramus> miriam: feels fine for now, as it could become recognized later<br>
&lt;bramus> miriam: as we add queries it not only changes if it resolve to true or false but also which container to look at<br>
&lt;bramus> miriam: causing possible backwards compat issue<br>
&lt;bramus> miriam: where something resolves differently whether its recognized as a query feature or not<br>
&lt;bramus> miriam:<br>
&lt;bramus> miriam: some vendors have shipped, so changing now is a breaking change<br>
&lt;bramus> miriam: would love to resolve sooner than later<br>
&lt;bramus> miriam:<br>
&lt;bramus> miriam: resolved previously was to split on the or [missed]<br>
&lt;bramus> miriam: browsers said that would be difficult and not logic to split on or<br>
&lt;bramus> miriam: other direciton sth with unknown query feature can match container<br>
&lt;bramus> astearns: there is no container that can asnwer all sides of the query<br>
&lt;bramus> miriam: yes<br>
&lt;bramus> miriam: width or height would then not resolve<br>
&lt;oriol> q+<br>
&lt;astearns> zakim, open queue<br>
&lt;Zakim> ok, astearns, the speaker queue is open<br>
&lt;astearns> q+ oriol<br>
&lt;astearns> ack JonathanNeal<br>
&lt;bramus> s/width or height/width or unkonwn/<br>
&lt;bramus> miriam: width or height would also not match<br>
&lt;astearns> ack oriol<br>
&lt;bramus> oriol: agree that there are problems with or. what if you have [missed] and? seems strange<br>
&lt;bramus> oriol: also want to consider third option to consider: could be possible that each queried feature could evaluate to different container<br>
&lt;astearns> s/[missed]/negated and/<br>
&lt;bramus> oriol: that is what we do with container units<br>
&lt;bramus> astearns: not sure I understand<br>
&lt;bramus> oriol: for example at container rule "width > 100px and height > 100px"<br>
&lt;bramus> oriol: parent that only has inline size witll be able to match height. other parent would match the width query<br>
&lt;bramus> oriol: might be confusing though.<br>
&lt;bramus> oriol: just wanted to list for completeness<br>
&lt;bramus> oriol: fine with 2nd option: if feature not recognize, just resolve as unknown<br>
&lt;bramus> miriam: in the or case it could resolve on one side of the query still<br>
&lt;florian> q+<br>
&lt;bramus> oriol: we would resolve each feature against the nearest container that supports it and if there is an unknown  feature that we do not support by any ancesstor then it would resolve entirely to unknown<br>
&lt;bramus> bramus: a unknown is then false?<br>
&lt;bramus> oriol: it does not apply the rule<br>
&lt;TabAtkins> (I'm strong against resolving a single query against multiple elements.)<br>
&lt;bramus> oriol: it only becomes false at the top level<br>
&lt;bramus> astearns: option 3 would allow to keep prev resolution<br>
&lt;bramus> astearns: would get past implementer objection?<br>
&lt;TabAtkins> q+<br>
&lt;bramus> oriol: what are the objections? probably third option more complex than option 2. havent considered if easy to implement  or not<br>
&lt;astearns> ack florian<br>
&lt;dbaron> I do feel that it's strange that @container (width > 100px) { @container (height > 100px) { ... } } is different from @container ((width > 100px) and (height > 100px)) { ...}, and I think oriol's option 3 fixes that... but it's also strange on itself, and maybe we should be thinking about use of container names as the "good practice" and these being sorts of error cases.<br>
&lt;bramus> florian: I understand optoin 3 and find it interesting. fairly hard time deciding whether that is confusing to authors or not<br>
&lt;bramus> florian: opens up extra possibility<br>
&lt;bramus> florian: would need examples to back up any reasoning<br>
&lt;astearns> ack TabAtkins<br>
&lt;bramus> TabAtkins: in the discussion with anti he was having a different view of optoin 1?<br>
&lt;bramus> TabAtkins: rahter than looking at query and using that as a prefilter for containers to look at, we instead will look at each possible container and if the query can be resolved against that we will do that, otherwise unknonwn<br>
&lt;florian> s/find it interesting/find it interesting in the abstract/<br>
&lt;bramus> TabAtkins: in the case "width or height" will work on inline-size container because container can handle a part of that<br>
&lt;bramus> TabAtkins: but if you do "width and height" this would fail because of the 1 unkown<br>
&lt;bramus> TabAtkins: that was optoin 1, right?<br>
&lt;bramus> miriam: no, dont think so but that could work<br>
&lt;florian> s/to authors or not/to authors or opens up a new and maybe convenient option/<br>
&lt;bramus> TabAtkins: dont really understand what antti’s understanding is so I can‘t comment on what it might mean<br>
&lt;bramus> TabAtkins: but what I said is what I voted for<br>
&lt;bramus> miriam: that would work, as does oriol’s proposal<br>
&lt;bramus> miriam: I dont see problems with oriols proposal and potentially does match author intent<br>
&lt;bramus> TabAtkins: disagree with that. you almost certainly want both conditions to match against same element, not a parent higher up<br>
&lt;astearns> agrees single container evaluation makes more sense<br>
&lt;bramus> TabAtkins: (mentions dbaron‘s note)<br>
&lt;astearns> ack dbaron<br>
&lt;bramus> TabAtkins: while you may want to target 1 element, you almost never want to target 2<br>
&lt;bradk> +1 to what Tab said<br>
&lt;TabAtkins> TabAtkins: While you might sometimes want to write nested queries and target the same element both times, you probably never want to write a single query and have it target two separate elements<br>
&lt;bramus> dbaron: trying to understand option 1. it seems very strange to me that you would take a query "height or width" and then evaluate against 1 part of that against 1 element and ignore the 2nd part of the query<br>
&lt;bramus> dbaron: seems strange. would expect to evaluate against a single element that answers to all parts<br>
&lt;bramus> TabAtkins: that’s the compat issue: unknown query<br>
&lt;bramus> florian: no element<br>
&lt;bramus> miriam: option 1 may have been poorly written<br>
&lt;bramus> miriam: i think tab’s and oriol’s could work<br>
&lt;bramus> miriam: 1 container or loosen that?<br>
&lt;bramus> dbaron: could tab clarify?<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> So then my proposal: attempt to match the queries against each possible container. If the container *can* match a given query, good; if not, it evaluates to unknown. (Unknown queries are always unknown.) Then if the top-levle result is unknown, move to the next possible container.<br>
&lt;bramus> fantasai: RE 1 container or 2: it does seem weird that combining […]. if you wanted to match against single container we have explicity type argument right?<br>
&lt;bramus> miriam: no, we don’t<br>
&lt;bramus> fantasai: ok, all implicit<br>
&lt;bramus> fantasai: if we had explicit type then author could define<br>
&lt;astearns> ack dbaron<br>
&lt;TabAtkins> So (true or unknown) will match, (true and unknown) will fail to match (and stop), (false or unknown) will continue looking.<br>
&lt;bramus> dbaron: auto-finding parent based on query might be bad idea. it should search using name or nearest<br>
&lt;bramus> miriam: that creates other probs such as style queries where we determined that you usually want direct parent so elements are style container by default so that you can query nearest but we dont want them getting in the way of size queries. going with nearest is going to be fragile.<br>
&lt;bramus> TabAtkins: my proposal is going to match nearest that can possibly match. in worst case its going to be […] right away.<br>
&lt;bramus> astearns: I see couple of ways forward<br>
&lt;oriol> q+<br>
&lt;bramus> astearns: resolve on tab’s reworking of option 1 or take back to issue<br>
&lt;dbaron> I'm OK with Tab's proposal.<br>
&lt;bramus> astearns: anyone need more time to review?<br>
&lt;astearns> ack oriol<br>
&lt;bramus> oriol: not sure if I understand proposal; what does it mean that container matches query?<br>
&lt;bramus> TabAtkins: it means that you satisfy the contditiions to potentially mathc. mainly that you have right container type.<br>
&lt;bramus> oriol: how do the binary operators work?<br>
&lt;bramus> TabAtkins: if you arent capable of matching, then evaluates to unkown. e.g. inline size vs width and height, one will be true/false and other unknown. if finale result at top level is unknown: skip and move up tree. if true/false: use that.<br>
&lt;bramus> TabAtkins: true + unknown = skip<br>
&lt;bramus> TabAtkins: true and false = false<br>
&lt;bramus> florian: i am going back to issue and throwing some examples in issue<br>
&lt;fantasai> s/am going/would like to go/<br>
&lt;astearns> ack dbaron<br>
&lt;fantasai> s/throwing/throw/<br>
&lt;bramus> dbaron: weird consequence of tabs proposal: nested containers: inner one has inline and outer one haas both containmenbts. there is going to be a point where you siwtch from using inner one to outer one. that jump seems pretty weird<br>
&lt;florian> s/examples in issue/examples in issue to compare Tab's option and Oriol's/<br>
&lt;bramus> dbaron: i guess we need to work through examples<br>
&lt;bramus> astearns: OK. let’s take back to issue<br>
&lt;dbaron> dbaron: ... to see if it does backwards jumping or not<br>
&lt;fantasai> I believe with Tab's logic you would choose different containers depending on whether you support 'unknown'<br>
&lt;bramus> miriam: other part of this: do we need use counters as this is breaking?<br>
&lt;fantasai> s/would/might/<br>
&lt;bramus> astearns: good idea. put it in issue.<br>
</details>


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


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

Received on Wednesday, 18 January 2023 17:34:30 UTC