Skip to content
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

Is 100dvh clamped between 100svh and 100lvh? #14

Closed
bramus opened this issue Aug 22, 2022 · 6 comments
Closed

Is 100dvh clamped between 100svh and 100lvh? #14

bramus opened this issue Aug 22, 2022 · 6 comments
Labels

Comments

@bramus
Copy link
Collaborator

bramus commented Aug 22, 2022

The Dynamic Viewport is “sized with dynamic consideration of any UA interfaces that are dynamically expanded and retracted”.

As that expanded state is equal to the Small Viewport and that retracted state the Large Viewport, one could derive that the Dynamic Viewport and its units are clamped between the Small and Large Viewport Units.

In practice this is the case, except when over-pinch-zooming out in browsers that support allow this gesture (i.e. WebKit on Mobile). In those browsers, the dvh unit exceeds the lvh size.

RPReplay_Final1661174012.mov

It seems like the dvh unit here follows window.innerHeight which also grows – see #9

Should dvh be clamped? Or should we allow this, and explicitly define it as allowed?

@bramus bramus added the Viewport Units svh/dvh/lvh/vh label Aug 22, 2022
@bramus bramus changed the title Is 100dvh clamped between 10svh and 100lvh? Is 100dvh clamped between 100svh and 100lvh? Aug 22, 2022
@bramus
Copy link
Collaborator Author

bramus commented Aug 24, 2022

We touched upon this during #4 but not in too much detail. On the one hand It does feel weird that the dvh value can become larger than the largest viewport size. On the other hand it is somewhat logical that an element with a size of 100dv would cover the whole area – as an author you do not want content to bleed out from the bottom of it.

Another way to look at it, might be that it could be expected that the page retains its aspect ratio as you pinch-zoom out. This would prevent this behavior where the Layout Viewport’s height keeps on growing as you pinch-zoom-out.

@dcrousso mentioned that there most likely has gone some design consideration behind the existing behavior on iOS. To be checked internally at Apple.

@bramus
Copy link
Collaborator Author

bramus commented Aug 24, 2022

Just checked this on desktop Safari for comparison: there it resizes the Layout Viewport with respect to its aspect-ratio when over pinch-zooming out.

image

@jensimmons
Copy link

Please ask this question at the CSSWG:
https://github.com/w3c/csswg-drafts/issues

@fantasai
Copy link

fantasai commented Aug 25, 2022

Totally fine if people want to talk through these issues in a smaller group before actually flagging it for the CSSWG agenda (we do this all the time), but agree with @jensimmons that issues around clarifying the CSS specs belong in the CSSWG repo.

@bramus
Copy link
Collaborator Author

bramus commented Sep 7, 2022

Discussed during #20. @dcrousso talked with WebKit engineers and it seems reasonable to clamp it indeed.

We need to verify this at the CSSWG.

@bramus
Copy link
Collaborator Author

bramus commented Sep 19, 2022

Filed w3c/csswg-drafts#7764 at the CSS WG to follow up on the definition.

Additionally, this feedback on the exposed Safari behavior was submitted using the Safari Feedback Form. No confirmation of receipt was sent.

This issue is filed as a result of the Interop 2022 Viewport Investigation Effort1. It was originally discussed at #14, with people from Apple/WebKit attending.

As shown in the video included in the issue, Safari on iOS does something weird when over pinch-zooming out: the Layout Viewport becomes very tall as the canvas becomes more narrow, and the dvh unit grows along with that.

The dvh unit should be between the svh and lvh unit. A clarficiation was also asked at the CSS WG2

Also note the behavior of Safari on Desktop mentioned in the issue.

Footnotes

  1. https://github.com/web-platform-tests/interop-2022-viewport/

  2. https://github.com/w3c/csswg-drafts/issues/7764

@bramus bramus closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants