-
Notifications
You must be signed in to change notification settings - Fork 26
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
Visual viewport handling (pinch-zoom) #244
Comments
If the scroll is being reset, I think it makes sense for the pinch-zoom to be reset as well. Should this be just tied to scroll or are you thinking of proposing another option to the API to control pinch-zoom reset separately? |
Tying it to scroll would be my preference. I'm not sure when you'd want one but not the other. |
It looks like the spec concept is https://wicg.github.io/visual-viewport/#definition-of-the-visual-viewport . Indeed it's not specced how this interacts with navigations. But I think it's quite observable, given the existence of the visual viewport API or just some of the stuff mentioned in https://wicg.github.io/visual-viewport/#intro about We should probably file a Chrome bug to make Chrome change this as part of scroll soon-ish, so that changing it later isn't a breaking change. And maybe we should throw something non-normative into the navigation API spec discussing this so that others can interoperably follow. Then we can work on the larger project of speccing the interaction of visual viewport with navigations. |
+1
Just FYI this recently got moved into CSSOM-View so references and changes should target that going forward.
I think it should be? (mostly). The missing piece is reliably changing the page scale from a web platform test - Chrome's test driver implementation does allow pinch-zooming in a WPT by simulating a pinch using two touch pointers. I've used this in a few recents WPTs (example) Sadly this doesn't work in Safari (which doesn't support touch on desktop) or Firefox (which doesn't implement touch pointers, bug) |
Heh, I see, that uses testdriver to actually literally pinch-zooms. Seems pretty good then, I think! |
With MPA cross-document push/replace, Chrome (at least) seems to reset pinch-zoom, which seems to make sense as it could otherwise leave the user looking at something incomplete/confusing.
Should the Navigation API do the same with default scroll handling?
In Chrome (at least), reloads preserve pinch-zooming. It seems like it tries to preserve pinch-zoom on traversal. It works well with bfcache traversals, but for cross-document traversals it seems buggy (the zoom level seems the same but the viewport is in the wrong place).
I guess whether the Navigation API should restore pinch-zoom would depend on whether it should be spec'd for regular navigations.
The text was updated successfully, but these errors were encountered: