Unofficial Draft
Copyright © 2026 the document editors/authors. Text is available under the Creative Commons Attribution 4.0 International Public License; additional terms may apply.
This specification defines extensions to the Web platform available in ChromeOS. These extensions are restricted to allowlisted Isolated Web Apps running on ChromeOS.
This document is a specification of ChromeOS-specific APIs for allowlisted Isolated Web Apps. It has no official standing of any kind and does not represent the support or consensus of any standards organization.
ChromeOS provides specialized APIs to allowlisted Isolated Web Apps
(IWAs) to enable native-like integration with the operating system. This
specification defines extensions to the Window interface that enable
custom window shaping.
The Window Shape API allows allowlisted IWAs to customize the shape of their window, enabling non-rectangular layouts.
Since this API allows changing the visible shape of the window, it could be used to create invisible or extremely small windows to perform malicious actions without the user's knowledge. To mitigate this:
The coordinates and dimensions of the DOMRectReadOnly objects
passed to setShape() are specified in Device Independent
Pixels (DIPs) within the local coordinate space of the operating
system window. At 100% page zoom, 1 DIP corresponds to 1 CSS pixel.
When the user agent applies the shape to the underlying operating system window:
DOMRectReadOnly
properties (x, y, width, height) accept floating-point
numbers, the host operating system window shape primitives operate
on integer pixel boundaries. When applying the shape, fractional DIP
coordinate values are truncated to integers and clamped to the range
of a 32-bit signed integer.
devicePixelRatio is not 1.0), the host window
compositor automatically scales DIP coordinates by the display's
device scale factor to determine physical device pixel boundaries.
Developers do not need to perform manual coordinate scaling.
The Window Shape API extends the Window interface.
WebIDLpartial interface Window {
Promise<undefined> setShape(sequence<DOMRectReadOnly> rects);
};
setShape() method
The setShape(|rects|) method customizes the shape of the
window. When called, the user agent does the following steps:
InvalidStateError and return
promise.
TypeError and return promise.
x, y, width, or height is not finite,
reject promise with a TypeError and return promise.
width is less than 0 or rect's height is less
than 0, reject promise with a TypeError and return
promise.
width is greater than or equal to 10 and rect's
height is greater than or equal to 10, set
hasMinimumSizeRect to true.
x, y, width, and
height set to the corresponding values from rect truncated
to an integer and clamped to the range of a 32-bit signed
integer, to convertedRects.
TypeError and return promise.
InvalidStateError and abort these steps.
InvalidStateError and abort these
steps.
undefined.Referenced in: