-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cssom-view] Expose small/large viewport dimensions of the layout viewport #8709
Comments
+1 to the general idea of exposing these values but I'd not that |
Imo there should be something like Having these large/small viewport values available would help authors to prepare a layout before the virtual keyboard is actually shown. I know this has been a request from the Ionic team, amongst others (the real problem there being that the Virtual Keyboard API does not trigger a
|
The small/large viewports are equally affected by the virtual-keyboard/"interactive-widget". It's only "scrolling UI" that insets the small viewport (i.e. mobile URL bar/bottom bars). In those cases, all insetting UI should shrink the smaller viewport (i.e. we inset by the top URL bar and a bottom bar if it exists) |
Thanks for correcting me @bokand – looks like I’m gonna need more coffee than usual today 🤦♂️. Updated my previous reply to strike out that part. |
Sure! Something like One thing that I’m now thinking about is the interaction with https://drafts.csswg.org/css-viewport/#interactive-widget-section because when using Would that need an event? Or can we assume authors to read it again when a |
Yeah, I'm fine with that.
I think using existing events for ProposingExpose a new endpoint for accessing the layout viewport, either |
This should definitely be stored on |
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> ydaniv: Already resolved to export viewport object that exposes the properties you can read regarding the layout viewport<fantasai> ydaniv: on that object proposal is to expose large/small/dynamic accessors <fantasai> ydaniv: for the widht/height/block/inline properties <fantasai> ydaniv: so that developers can read those in JS <fantasai> smfr: Are these live? do they change when you scroll? <fantasai> fantasai: small/large are static... dynamic changes <fantasai> smfr: but position changes? <fantasai> fantasai: only exposes size, not position <fantasai> smfr: Do we fire an event when dynamic size changes? <fantasai> ydaniv: I think we already have those <fantasai> ydaniv: that's the resize event <fantasai> ydaniv: visual viewport exposes events, no proposal here to make this also an event target <emilio> q+ <fantasai> smfr: ok <fantasai> smfr: not sure about the timing of dynamic viewport change and event firing, might not be accurate <astearns> ack emilio <fantasai> emilio: This is not ? to the visual viewport resize <fantasai> s/?/equivalent/ <fantasai> emilio: the visual viewport size, I don't think it changes with the dynamic viewport <fantasai> emilio: changes when zooming in and out <fantasai> astearns: so continue discussing, or resolve on adding large/small/dynamic objects to window? <fantasai> smfr: Slightly concerned about .viewport being confused with visual viewport <fantasai> emilio: but that's a different discussion <fantasai> smfr: exposing these somehwere, just unsure where <emilio> q+ <fantasai> PROPOSED: We will expose large/small/dynamic as accessors with width/height/block/inline properties; TBD on which object <fantasai> ydaniv: could also resolve on makign this the layout viewport <fantasai> ydaniv: other than naming, don't think there's an objection <astearns> ack emilio <fantasai> PROPOSED: We will expose large/small/dynamic objects representing the layout viewport sizes as accessors with width/height/block/inline properties; TBD on which object <fantasai> PROPOSED: We will expose large/small/dynamic objects representing the layout viewport sizes as accessors with width/height/block/inline properties; details and which object TBD <fantasai> RESOLVED: We will expose large/small/dynamic objects representing the layout viewport sizes as accessors with width/height/block/inline properties; details and which object TBD |
I wasn’t able to attend the meeting today, so replying here now quoting from the log:
We decided on creating
These should be exposed on |
One more:
You could say that dynamic might not be needed here and that only the large and small ones are relevant. Authors can use (*) except in WebKit because pinch-zoom incorrectly affects the value … which makes the addition proposed here an extra reason to get this bug fixed. |
Correct, so perhaps this could be a chance for interop? |
I am OK with exposing these on |
I suggested it here: web-platform-tests/interop#870 |
PROPOSED ASYNC RESOLUTION: Expose these objects on /ping @astearns |
The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment. Proposed Resolution: Expose the small/large layout viewport dimensions on |
RESOLVED: Expose the small/large layout viewport dimensions on |
Currently there's no reliable way to get the small/large viewport dimensions.
There are some tricks in the wild for working with these values like inserting an element with something like
height: 100svh
and reading its height.It would be handy in some cases to have these values exposed on the
VisualViewport
interface for easy querying.I came across this when I was working on a polyfill for ViewTimeline, so I assume there are other common use-cases.
mentioning some folks who might be interested: @bramus @emilio
The text was updated successfully, but these errors were encountered: