Wren a web browser where WebAssembly runs everything, JavaScript included

Module media

Exposed to: Window. Source: api/js_web.widl.

Odin: import "wren:media".

Types

handle MediaQueryList : Object

A media query list evaluated against the page's viewport (CSSOM View matchMedia); an EventTarget whose "change" event is fired when the result changes (after a resize, a zoom, a change of the color scheme), Event_code being the new result.

Checked by the browser on every call (lookup_MediaQueryList).

enum ScreenField : i32

A dimension of the screen (CSS pixels of the monitor showing the page).

membervalue
Width0
Height1
Avail_Width2
Avail_Height3
Avail_Left4
Avail_Top5
Color_Depth6

Functions

MediaQueryList_create

MediaQueryList MediaQueryList_create(string query)

window.matchMedia(query): an invalid query is "not all" (it never matches).

Host: MediaQueryList_create :: proc(c: ^Call, query: string) -> u64

MediaQueryList_media

string MediaQueryList_media(MediaQueryList list)

mql.media: the query list serialized.

Host: MediaQueryList_media :: proc(c: ^Call, list: Api_MediaQueryList) -> string

MediaQueryList_matches

bool MediaQueryList_matches(MediaQueryList list)

mql.matches, as of the page's last style computation (or now when it never had one).

Host: MediaQueryList_matches :: proc(c: ^Call, list: Api_MediaQueryList) -> bool

Screen_get

i32 Screen_get(ScreenField field)

screen.width, screen.availHeight...

Host: Screen_get :: proc(c: ^Call, field: Api_ScreenField) -> i32

Edit this page on GitHub