- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 17 Jul 2024 16:59:43 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[cssom-view] No way to access the viewport size without losing precision.`, and agreed to the following: * `RESOLVED: add .width and .height as doubles to the layout viewport interface` <details><summary>The full IRC log of that discussion</summary> <TabAtkins> emilio: we've discussed in the past, making innerWidth and innerHeight not round is not compatible, it breaks things<br> <TabAtkins> emilio: but we recently decided to add an object to the Window that represents the layout viewport (mainly for segments stuff)<br> <TabAtkins> emilio: But it sounds like a good place to expose the full double-precision viewport dimensions<br> <TabAtkins> emilio: So they'll do the same as innerHeight/Width, but without the weird rounding<br> <flackr> +1<br> <TabAtkins> emilio: Proposal is to add ... unsure if we decided it to be window.viewport or window.layoutViewport, but whatever, add .width and .height<br> <TabAtkins> astearns: Idle thought that maybe this should have a slightly different name to indicate it shouldn't be rounded, but nm, that sounds awful<br> <TabAtkins> emilio: Before we had this new object, best proposal i could come up with was .innerWidthDouble or .innerWidthUnrounded<br> <TabAtkins> emilio: but those are bad<br> <TabAtkins> emilio: MDN and the spec could have a note about the difference<br> <TabAtkins> flackr: Another bad alternative would be to have a gBCR() api on one of these objects, those also return doubles<br> <TabAtkins> emilio: Right, but top and left would be 0 always<br> <TabAtkins> flackr: You *could* imagine them being the scroll position...<br> <TabAtkins> astearns: that sounds worse<br> <TabAtkins> emilio: There's other issues to expose the other layout viewport things (small/big/etc)<br> <TabAtkins> emilio: But I think .width and .height should do the right thing.<br> <TabAtkins> emilio: And consider other names for the small/large viewport sizes<br> <TabAtkins> astearns: Anyone remember if it's .viewport or .layoutViewport?<br> <TabAtkins> emilio: I think we punted on the name in the preivous call<br> <TabAtkins> astearns: So proposal is to add .width and .height as doubles to the layout viewport interface<br> <TabAtkins> RESOLVED: add .width and .height as doubles to the layout viewport interface<br> <emilio> TabAtkins: when we have these box sizes, I'm always confused about whether they have scrollbars or not, do we need variants to account for that?<br> <TabAtkins> emilio: I think right now the way to do that is document.scrollingElement.scrollWidth, or clientWidth<br> <TabAtkins> emilio: Which I agree isn't great<br> <TabAtkins> emilio: I'm also not sure if those round or not off the top of my head<br> <TabAtkins> emilio: but gBCR() gets around it<br> <TabAtkins> emilio: we shoudl have a separate issue<br> <TabAtkins> TabAtkins: agreed<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5260#issuecomment-2233774193 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 17 July 2024 16:59:44 UTC