Module Dom_html

module Dom_html : sig..end

DOM HTML binding

This is a partial binding to the DOM HTML API.


CSS style declaration

class type cssStyleDeclaration = object..end

Events

type ('a, 'b) event_listener = ('a, 'b) Dom.event_listener

The type of event listener functions. The first type parameter 'a is the type of the target object; the second parameter 'b is the type of the event object.

type mouse_button =  | No_button | Left_button | Middle_button | Right_button
class type event = object..end
class type mouseEvent = object..end
class type keyboardEvent = object..end
class type wheelEvent = object..end
class type mouseScrollEvent = object..end
class type touchEvent = object..end
class type touchList = object..end
class type touch = object..end
class type eventTarget = object..end

Common properties of event target objects: onclick, onkeypress, ...

class type popStateEvent = object..end
class type storageEvent = object..end
class type storage = object..end

Storage

HTML elements

class type nodeSelector = object..end
class type tokenList = object..end
class type element = object..end

Properties common to all HTML elements

class type clientRect = object..end

Rectangular box (used for element bounding boxes)

class type clientRectList = object..end
class type ['a]collection = object..end

Collection of HTML elements

class type htmlElement = element
class type headElement = object..end
class type linkElement = object..end
class type titleElement = object..end
class type metaElement = object..end
class type baseElement = object..end
class type styleElement = object..end
class type bodyElement = element
class type formElement = object..end
class type optGroupElement = object..end
class type optionElement = object..end
class type selectElement = object..end
class type inputElement = object..end
class type textAreaElement = object..end
class type buttonElement = object..end
class type labelElement = object..end
class type fieldSetElement = object..end
class type legendElement = object..end
class type uListElement = element
class type oListElement = element
class type dListElement = element
class type liElement = element
class type divElement = element
class type paragraphElement = element
class type headingElement = element
class type quoteElement = object..end
class type preElement = element
class type brElement = element
class type hrElement = element
class type modElement = object..end
class type anchorElement = object..end
class type imageElement = object..end
class type objectElement = object..end
class type paramElement = object..end
class type areaElement = object..end
class type mapElement = object..end
class type scriptElement = object..end
class type tableCellElement = object..end
class type tableRowElement = object..end
class type tableColElement = object..end
class type tableSectionElement = object..end
class type tableCaptionElement = element
class type tableElement = object..end
type videoElement

Canvas object

type context
val _2d_ : context
type canvasPattern
class type canvasElement = object..end
class type canvasRenderingContext2D = object..end
class type canvasGradient = object..end
class type textMetrics = object..end
class type imageData = object..end
class type canvasPixelArray = object..end
val pixel_get : canvasPixelArray Js.t -> int -> int
val pixel_set : canvasPixelArray Js.t -> int -> int -> unit

Document objects

class type document = object..end
val document : document Js.t

The current document

Window objects

class type location = object..end

Location information

class type history = object..end

Browser history information

class type undoManager = object..end

Undo manager

class type selection = object..end

Information on current selection

class type navigator = object..end

Navigator information

type interval_id
type timeout_id
class type window = object..end

Specification of window objects

val window : window Js.t

The current window

val _requestAnimationFrame : (unit -> unit) Js.callback -> unit

Call the appropriate requestAnimationFrame method variant (depending on the navigator), or sleep for a short amount of time when there no such method is provided. We currently prefix the function name with as underscore as the interface of this function is not completely standardized yet. Thus, we leave the room to a function with a possibly refined type.

class type frameSetElement = object..end
class type frameElement = object..end
class type iFrameElement = object..end

Event handlers

val no_handler : ('a, 'b) event_listener

see Dom.no_handler

val handler : 
  ((#event as 'a) Js.t -> bool Js.t) ->
  ('b, 'a Js.t) event_listener

see Dom.handler

val full_handler : 
  ('a -> (#event as 'b) Js.t -> bool Js.t) ->
  ('a, 'b Js.t) event_listener

see Dom.full_handler

val invoke_handler : ('a, 'b) event_listener -> 'a -> 'b -> bool Js.t

see Dom.invoke_handler

val eventTarget : #event Js.t -> element Js.t

see Dom.eventTarget

val eventRelatedTarget : #mouseEvent Js.t -> element Js.t Js.opt

Returns this event related target.

module