Files
servo/components/script_bindings/webidls/VisualViewport.webidl
Steven Novaryo b68d277c55 script: Add stub VisualViewport Interface (#41372)
Add placeholder implementation of DOM `VisualViewport` according to the
spec https://drafts.csswg.org/cssom-view/#visualviewport. This is the
first step of implementing the interface and syncing it with the
`PinchZoom` struct that we had in the `Embedder`.

Since this interface's is not accurate and couldn't fulfill it's
purpose, it would be gated behind a preference
`dom_visual_viewport_enabled` and would be open after the interface had
been integrated with `PinchZoom`, viewport resizing, and viewport
scroll.

Testing: Existing WPT Test.
Part of: #41341

---------

Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
2025-12-23 09:56:13 +00:00

24 lines
746 B
Plaintext

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://drafts.csswg.org/cssom-view/#the-visualviewport-interface
[Pref="dom_visual_viewport_enabled", Exposed=Window]
interface VisualViewport : EventTarget {
readonly attribute double offsetLeft;
readonly attribute double offsetTop;
readonly attribute double pageLeft;
readonly attribute double pageTop;
readonly attribute double width;
readonly attribute double height;
readonly attribute double scale;
attribute EventHandler onresize;
attribute EventHandler onscroll;
attribute EventHandler onscrollend;
};