Re: [csswg-drafts] [resize-observer] What should the fragment-aware behavior be when there are no fragments? (#7734)

The CSS Working Group just discussed `[resize-observer] What should the fragment-aware behavior be when there are no fragments?`, and agreed to the following:

* `RESOLVED: we will use an empty array when there are no fragments`

<details><summary>The full IRC log of that discussion</summary>
&lt;bramus> oriol: we had resolution in the past that ro should expose size of all fragments, which is exposes as an array by the API. spec is only populating single item in array (1st fagment)<br>
&lt;bramus> oriol: what should happen when el has no fragments? Do we keep 0,0 as the single entry or do we want an empty array?<br>
&lt;bramus> oriol: empty array makes more sense but there is a compat argument there bc there are scripts out there at assume the entry is there<br>
&lt;bramus> oriol: otoh if there is no fragment the size is 0x0 then the prev behavior was that the callback was not called anyway.<br>
&lt;bramus> oriol: so a change might not affect existing behavior that much<br>
&lt;bramus> oriol: can we risk with empty array orshould we go with safe bet of 1 entry in array?<br>
&lt;fantasai> I think the correct thing would be a zero-sized array<br>
&lt;TabAtkins> Empty array sounds good to me.<br>
&lt;fantasai> If we can get away with it, let's do that<br>
&lt;bramus> emilio: i think we are probably gonna have to have no item but maybe keep existing behavior and call it a day.<br>
&lt;bramus> emilio: fine with empty. if compat issue then try the other<br>
&lt;astearns> ack dbaron<br>
&lt;bramus> dbaron: i have mixed feelings about this<br>
&lt;bramus> dbaron: in one sense it seems like it is the right thing and ecourages ppl to know there are fragments<br>
&lt;bramus> dbaron: are ppl going to iterate over fragments?<br>
&lt;bramus> dbaron: having an array increases the risk devs can do wrong<br>
&lt;bramus> oriol: array we have right now, changing it is not web compatible I’m sure<br>
&lt;bramus> oriol: changing from arrays to something else that is<br>
&lt;bramus> oriol: ppl assume it is an array<br>
&lt;bramus> dbaron: i agree with you there<br>
&lt;bramus> dbaron: i am worried that an empty array - even though it increases awareness - will also lead to a lot more JS errors<br>
&lt;fantasai> I think it's reasonable. This is querying things that *don't have a box*<br>
&lt;bramus> dbaron: including future ones<br>
&lt;fantasai> Why would you query the size/position of things that don't have a box in the first place? Most people won't<br>
&lt;bramus> astearns: rough concsensus that empty array is correct thing to do<br>
&lt;bramus> astearns: fear that it leads to errors, but we can try it<br>
&lt;bramus> astearns: and if there is a webcompat issues can try the other thing<br>
&lt;bramus> dbaron: i[m fine with that, taking webcompat into account and listening to devs<br>
&lt;bramus> astearns: devs who want to process all can do the right thing<br>
&lt;bramus> emilio: i think it is a usefull thing. if we can, we should go with empty<br>
&lt;bramus> astearns: proposed resolution to we will use an empty array when there are no fragments<br>
&lt;bramus> oriol: also the case of inline elems<br>
&lt;bramus> oriol: should we treat this case of having no fragments or fragments-size-0?<br>
&lt;bramus> astearns: lets resolve on simpler case first<br>
&lt;bramus> astearns: objections?<br>
&lt;bramus> RESOLVED: we will use an empty array when there are no fragments<br>
&lt;bramus> astearns: what about other case?<br>
&lt;bramus> astearns: (non-atomic inlines)<br>
&lt;fantasai> We do have fragments in that case, should we return an array of those?<br>
&lt;bramus> astearns: they have a size of 0, so we would be returning an array of 0-size fragments<br>
&lt;bramus> astearns: oriol?<br>
&lt;bramus> oriol: no strong opinion<br>
&lt;bramus> oriol: we are special casing inline elems and ignoring their size<br>
&lt;bramus> oriol: seems arbitrary<br>
&lt;bramus> oriol: saying no fragments seems better?<br>
&lt;bramus> oriol: other option we could try to stop ignorigntthe size of the inline fragments<br>
&lt;fantasai> Returning an array of 0,0 fragments is not great. An array of the actual size of the fragments would make sense, though<br>
&lt;bramus> oriol: not sure if compat issues<br>
&lt;bramus> oriol: ppl have asked before to know the size of inline elems<br>
&lt;bramus> astearns: for purpose of this issue, we can return an empty array only if there are non-atomic inlines. should raise issue for other case. currently we dont have usefull info for inline boxes<br>
&lt;bramus> astearns: seems like it could be usesfull to do something else for inlines<br>
&lt;fantasai> since we're discussing this now, do we want to consider a resolution to just return an array of actual sizes?<br>
&lt;fantasai> if anyone has a concern with that, then we can open issue and return to it<br>
&lt;bramus> astearns: proposed resolution: given the state of inline box handling in current spec, since we have nothing useful to give the developers, we will give them empty array<br>
&lt;bramus> astearns: have separate issue for things fantasai just raised<br>
&lt;oriol> The issue is https://github.com/w3c/csswg-drafts/issues/6358<br>
&lt;astearns> ack fantasai<br>
&lt;bramus> astearns: proposed resolution: return empty array for inlines but also raise issue for returning better issue<br>
&lt;bramus> fantasai: if we are ready to decide we should do instead of postponing<br>
&lt;bramus> fantasai: i would say to leave open and not resolve<br>
&lt;bramus> astearns: can you open issue for this oriol?<br>
&lt;bramus> oriol: link already pasted in IRC<br>
&lt;bramus> astearns: leave thing for inlines open<br>
</details>


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


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

Received on Wednesday, 14 December 2022 17:32:50 UTC