Brr.Document
Document
objects
type t = El.document
The type for Document objects. See G.document
for the global object.
find_el_by_id d id
is the element of the document with id
attribute equal to id
(if any).
find_els_by_name d n
is the list of elements of the document with name
attribute equal to n
.
root d
is the document's root element.
body d
is the document's body element.
Warning. Technically this could be null
if your script loads too early. It's a bit inconvenient to have it as an option though so we raise a JavaScript error if that happens; see here on the way to load your script so that it does not.
head d
is the document's head element.
active_el d
is the document's active element, that is the one that has the focus (if any).
title d
is the document title.
set_title d t
sets the document title.
module Visibility_state : sig ... end
Visibility state enumeration.
val visibility_state : t -> Visibility_state.t
visibility_state d
is the visibility state of d
. Use the Ev.visibilitychange
event to watch for changes.
pointer_lock_element d
is the element that currently locks the pointer (if any).
exit_pointer_lock d
exits pointer lock mode. The future determines when the corresponding Ev.pointerlockchange
on d
has fired.
Use El.request_fullscreen
to get into fullscreen mode.
val fullscreen_available : t -> bool
fullscreen_available d
is true
if fullscreen functionality is supported and can be used.
fullscreen_element d
is the element that is being currently presented in fullscreen mode (if any).
val exit_fullscreen : t -> unit Fut.or_error
exit_fullscreen d
exits fullscreen mode.