Re: [csswg-drafts] [resize-observer] device-pixel-border-box size (#3554)

The CSS Working Group just discussed `device-pixel-border-box size`, and agreed to the following:

* `RESOLVED: Add API to get content box height and width in device pixel sizes to resize observer. Only return when requested and applies to all element.`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: device-pixel-border-box size<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/3554#issuecomment-538465771<br>
&lt;dael> astearns: Discussed device-pixel-border-box size at TPAC<br>
&lt;dael> astearns: I recall we still weren't sure how change will effect Safari. Example have now been provided. Do we have enough information on impact to Safari?<br>
&lt;dael> smfr: Saw a couple of examples. I think Chris said he ran the tests on Macbook pro retina with the fixes and it made it look better. Can't say without doing work in webkit, but I think sufficient proof this is useful. On non-apple it's well known it's necessary<br>
&lt;dael> astearns: Any other new information?<br>
&lt;dael> ??: Nothing new except demos and version of chrome that fixes<br>
&lt;astearns> s/??/chrishtr/<br>
&lt;dael> smfr: I'm surprised you could get good results. Most macbooks have default scaling. Surprised you got good results on a machine with that behavior<br>
&lt;dael> chrishtr: It's not the newest<br>
&lt;drousso> presnet+<br>
&lt;dael> [audio problems<br>
&lt;dael> chrishtr: Tested on not absolute newest, but a macbook pro retina. I think it does have value and OS scaling if it's outside of control of application those situations can't be fixed<br>
&lt;dael> smfr: What I'm interested in understanding is if on hardware with builtin scaling suc htat you never get pixel perfect is there improvement in device-pixel-border-box ? Is there value in making it optional and allow UA to not provide if it thinks it can provide better. Or do we make it required and force UA to do this when it's not going to get better<br>
&lt;dael> myles: Easy to test if you change resolution of OS in your macbook pro<br>
&lt;dael> astearns: Sounds to me like we don't have an objection to adding device-pixel-border-box size to the API, but may want another issue about behavior of API possibly making it optional?<br>
&lt;dael> chrishtr: Would app fallback be multiply css pixel width and height by device-pixel ratio if UA doesn't supply?<br>
&lt;dael> smfr: Impl will alreayd have to multiply by device-pixel-ratio. No, does multiply. Okay.<br>
&lt;dael> chrishtr: That was the point, rounding or flooring can't get consistent<br>
&lt;dael> smfr: Okay, then makes optional thing annoying<br>
&lt;dael> chrishtr: I don't know if built in scaling is higher quality but we got really good results on macbook pros even with non-1 to 1 scaling.<br>
&lt;dael> smfr: Okay<br>
&lt;dael> s/ chrishtr / ken<br>
&lt;dael> smfr: Not objecting to adding. Question if needs to be rectangle or just a size since left and top don't mean anything<br>
&lt;dael> chrishtr: Use case for canvas sizing top left not nec<br>
&lt;dael> smfr: We don't have a dom size object<br>
&lt;dael> chrishtr: Yep. More consistent to have a rect, rect does have meaning. Not used in canvas case<br>
&lt;dael> ken: Position of rect a little confusing if you consider overflow area<br>
&lt;dael> chrishtr: Does mean where it is on device window though<br>
&lt;astearns> s/ken/myles/<br>
&lt;dael> chrishtr: It's used within the native texture if there's not special scaling smfr referred to. If texture is scrolled it's still...it doesn't take into account transforms and scrolls<br>
&lt;dael> myles: Values off the top of the screen?<br>
&lt;dael> chrishtr: I think would be fine to have size only for this reason<br>
&lt;dael> chrishtr: top left doesn't seem to mean much, want to know canvas size<br>
&lt;dael> astearns: Array of 2 values or are you minting a new size objection?<br>
&lt;dael> chrishtr: I don't know. Maybe new size object?<br>
&lt;astearns> s/objection/object/<br>
&lt;dael> smfr: If it always integral?<br>
&lt;dael> chrishtr: Yeah<br>
&lt;dael> smfr: Maybe you jsut have two long on the entry<br>
&lt;dael> chrishtr: THat are just width and height<br>
&lt;dael> chrishtr: As relates to desire to add the eq method to getBoundingClientRect it would change to get device pixel width and height<br>
&lt;dael> smfr: If we agree to resizeObserver do we still need?<br>
&lt;dael> chrishtr: Don't think so, but ?? from Mozilla thought case was strong so I was okay adding<br>
&lt;dael> smfr: Which case was it?<br>
&lt;astearns> s/??/Jeff Gilbert/<br>
&lt;dael> chrishtr: You have a full screen where you don't want resizeObserver and you want a slight jump on resize frames<br>
&lt;dael> ken: Jeff also had concerns that it fires late and application would fall behind a frame which is legit concern<br>
&lt;dael> myles: You would need to executecode every frame with this. resizeObserver means code only called when need to be.<br>
&lt;fantasai> s/executecode/execute heavy calculations/<br>
&lt;dael> ken: Agree, but in experience from a dev on FF stack we felt it was important to aleviate concern. And FF intends to not recompute if layout isn't dirty<br>
&lt;tantek> regrets+<br>
&lt;dael> smfr: I don't want every getBoundingClientRect to be more expensive<br>
&lt;dael> chrishtr: Adding a new thing<br>
&lt;dael> smfr: Okay, okay. Should discuss sep.<br>
&lt;dael> chrishtr: Okay with me. Is Jeff Gilbert on? Want ot make sure he's okay to separate.<br>
&lt;dael> chrishtr: If he's not, maybe tentatively do that.<br>
&lt;dael> ken: I think Jeff would object. Not to represent his opinion, but I think he would.<br>
&lt;dael> chrishtr: Great to resolve device-pixel-border-box size makes sense and then follow-up on the other one<br>
&lt;dael> chrishtr: To make progress.<br>
&lt;dael> ken: Want progress too<br>
&lt;dael> astearns: smfr you would rather continue new API discussion or resolve to add it and continue discussion?<br>
&lt;dael> smfr: Prefer to fork into separate issue<br>
&lt;dael> fantasai: Question, says doing device-pixel-border-box size. What if person wants size of padding or content box?<br>
&lt;dael> chrishtr: Those other boxes have use cases and tracked via other issues on the spec<br>
&lt;dael> florian: But not at device pixel level the others<br>
&lt;dael> chrishtr: No. Only use case for device pixels is canvas<br>
&lt;dael> fantasai: But why wouldn't people using canvas want to paint inside the border?<br>
&lt;AmeliaBR> Wouldn't it be the content-box that is important for the canvas? Since that's what they're using in their code?<br>
&lt;dael> chrishtr: Canvas has a certain size and border is outside of that. Browser does that for you.<br>
&lt;dael> fantasai: boder box size includes border so if it's not included it's not a border box<br>
&lt;dael> chrishtr: It's the device pixel box size in case of canvas. It's actual size of canvas<br>
&lt;dael> fantasai: Then it's the content box and we should call it that and not border box<br>
&lt;dael> chrishtr: Right<br>
&lt;Zakim> fantasai, you wanted to ask about padding/content boxes<br>
&lt;dael> ken: Sounds good<br>
&lt;dael> astearns: Other discussion?<br>
&lt;dael> fantasai: Summary of proposal?<br>
&lt;dael> astearns: Add an API to get canvas height and width to resizeObserver<br>
&lt;dael> chrishtr: Actual device width and height of the canvas. When changes resizeObserver fires.<br>
&lt;dael> fantasai: I want to be clear. Adding and API which is only available on canavas element. Reflects pixel size of content box of canvas element<br>
&lt;dael> fantasai: And it has a name that is not device-pixel-border-box<br>
&lt;dael> chrishtr: Yes<br>
&lt;dael> smfr: Available for any element you resizeObserve not jsut canvas<br>
&lt;dael> fantasai: Have had various discussion on only canvas or all and want to be clear<br>
&lt;dael> chrishtr: Only use case I know is canvas. Could do it for all<br>
&lt;dael> smfr: I wonder if this should be something the user of the API request.<br>
&lt;dael> chrishtr: For any API you ask for what you want and you're saying only available on canvas?<br>
&lt;dael> smfr: ONly want browser to do computation if author asks for data<br>
&lt;dael> chrishtr: For sure. Part of draft spec to observe multiple types of boxes. You say what to observe. I agree browser should only do this if needed<br>
&lt;dael> astearns: Further question of if someone requests this on not canvas what happens<br>
&lt;dael> chrishtr: Allow or not allow is both okay. In terms of APIs implicity maybe better on all<br>
&lt;dael> smfr: Can imagine on something like video. Better on all<br>
&lt;dael> chrishtr: No impl difficulty from allowing it<br>
&lt;dael> fantasai: Add API to get content box height and width in device pixel sizes to resize observer. ONly return when requested and applies to all.<br>
&lt;dael> chrishtr: Can bikeshed name<br>
&lt;dael> florian: Not obj, but want to be cautios on all elements. pixels vs device pixels people can get confused about and I have mild concern making this too easily available people will try and use it.<br>
&lt;dael> astearns: A lot of things discussing now should be separate issues once we have draft text in place.<br>
&lt;dael> astearns: objections to adding this?<br>
&lt;dael> RESOLVED: Add API to get content box height and width in device pixel sizes to resize observer. Only return when requested and applies to all element.<br>
&lt;dael> astearns: Thanks chrishtr<br>
&lt;dael> chrishtr: I appriciate all the feedback<br>
&lt;dael> ken: Thanks for discussion<br>
&lt;dael> fantasai: Want to discuss optionality<br>
&lt;dael> astearns: Add an issue for that<br>
</details>


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

Received on Wednesday, 9 October 2019 16:45:06 UTC