Change description: Adds a visualViewport object to window that allows authors to directly query properties of the visual viewport.
Changes to API surface:
- Add a visualViewport object on window:
visualViewport = {
double scrollTop; // Relative to the layout viewport
double scrollLeft; // and read-only.
double pageX; // Relative to the document
double pageY; // and read-only.
double clientWidth; // Read-only and excludes the scrollbars
double clientHeight; // if present. These values give the number
// of CSS pixels visible in the visual viewport.
// i.e. they shrink as the user zooms in.
double scale; // Read-only. The scaling factor applied to
// the visual viewport relative to the `ideal
// viewport` (size at width=device-width). This
// is the same scale as used in the viewport
// <meta> tag.
}
-Fire a scroll event against window.visualViewport whenever the scrollTop or scrollLeft attributes change.
-Fire a resize event against window.visualViewport whenever the clientWidth or clientHeight attributes change.
Links: https://github.com/WICG/ViewportAPI
Public standards discussion: https://discourse.wicg.io/t/explicit-api-for-visual-viewport/1399
Support in other browsers:
Internet Explorer: Expressed interest (https://discourse.wicg.io/t/explicit-api-for-visual-viewport/1399)
Firefox: No public signals
Safari: No public signals
Comment 1 by bokan@chromium.org
, Aug 5 2016Blocking: 410894