Contact emails
yma...@chromium.org, bo...@chromium.org
Spec
There is no spec outlining how the APIs below should work under pinch to zoom.
Summary
This change modifies the following API methods outlined in the CSSOM View Module to be relative to the layout viewport:
core/frame/Window.idl
long innerWidth;
long innerHeight;
double scrollX;
double scrollY;
double pageXOffset;
double pageYOffset;
scroll(double x, double y);
scrollTo(double x, double y);
scrollBy(double x, double y);
core/dom/Element.idl
double scrollTop;
double scrollLeft;
Motivation
Having window.scroll properties being relative to the visual viewport breaks some pages under pinch-zoom.
Consider this example:
Go to http://www.nytimes.com/
Pinch-zoom in
Android/Pixel: Two-finger zoom in gesture on the screen
Macbook: Two-finger zoom in gesture on trackpad
Click on the gear button in the top right corner to bring down the fixed-style settings menu.
Expected: The settings menu pops up right beneath the gear button
Actual: The settings menu pops up at an offset from the gear button
The plan is to have all APIs reflect the layout viewport.
Compatibility Risk
No significant compatibility risk. The way the above methods should work under pinch zoom is not specified. Firefox and safari have a different pinch to zoom model. Currently, IE follows the same model as us and this change is a step in convincing them that the above methods should be relative to the layout viewport.
Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Link to entry on the feature dashboard
https://www.chromestatus.com/feature/4876804200333312
Requesting approval to ship?
Yes
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
*: (We could improve #4 by only scrolling the layout viewport when the visual viewport reaches the edge of the layout viewport, rather than scrolling it whenever the visual viewport moves -- i.e. "Pin to outer viewport (bump scroll)" of http://johnmellor.net/static/pinch-zoom-position-fixed/ -- this would make it significantly easier to access fixed position toolbars whilst zoomed in. But that's orthogonal to this change.)