Skip to main content

module DOM



import lang::html5::DOM;


import List;
import Content;


DOM-based AST model for HTML5 including pretty printer

data HTML5Node

data HTML5Node  
= html5node(str name, list[value] kids)

data HTML5Attr

data HTML5Attr  
= html5attr(str name, value val)

function a

HTML5Node a(value kids...)

function abbr

HTML5Node abbr(value kids...)

function address

HTML5Node address(value kids...)

function area

HTML5Node area(value kids...)

function article

HTML5Node article(value kids...)

function aside

HTML5Node aside(value kids...)

function audio

HTML5Node audio(value kids...)

function b

HTML5Node b(value kids...)

function base

HTML5Node base(value kids...)

function bdi

HTML5Node bdi(value kids...)

function bdo

HTML5Node bdo(value kids...)

function blockquote

HTML5Node blockquote(value kids...)

function body

HTML5Node body(value kids...)

function br

HTML5Node br(value kids...)

function button

HTML5Node button(value kids...)

function canvas

HTML5Node canvas(value kids...)

function caption

HTML5Node caption(value kids...)

function cite

HTML5Node cite(value kids...)

function code

HTML5Node code(value kids...)

function col

HTML5Node col(value kids...)

function colgroup

HTML5Node colgroup(value kids...)

function \data

HTML5Node \data(value kids...)

function datalist

HTML5Node datalist(value kids...)

function dd

HTML5Node dd(value kids...)

function del

HTML5Node del(value kids...)

function details

HTML5Node details(value kids...)

function dfn

HTML5Node dfn(value kids...)

function dialog

HTML5Node dialog(value kids...)

function div

HTML5Node div(value kids...)

function dl

HTML5Node dl(value kids...)

function dt

HTML5Node dt(value kids...)

function em

HTML5Node em(value kids...)

function embed

HTML5Node embed(value kids...)

function fieldset

HTML5Node fieldset(value kids...)

function figcaption

HTML5Node figcaption(value kids...)

function figure

HTML5Node figure(value kids...)

HTML5Node footer(value kids...)

function form

HTML5Node form(value kids...)

function h1

HTML5Node h1(value kids...)

function h2

HTML5Node h2(value kids...)

function h3

HTML5Node h3(value kids...)

function h4

HTML5Node h4(value kids...)

function h5

HTML5Node h5(value kids...)

function h6

HTML5Node h6(value kids...)

function head

HTML5Node head(value kids...)

function header

HTML5Node header(value kids...)

function hgroup

HTML5Node hgroup(value kids...)

function hr

HTML5Node hr(value kids...)

function html

HTML5Node html(value kids...)

function i

HTML5Node i(value kids...)

function iframe

HTML5Node iframe(value kids...)

function img

HTML5Node img(value kids...)

function input

HTML5Node input(value kids...)

function ins

HTML5Node ins(value kids...)

function kbd

HTML5Node kbd(value kids...)

function keygen

HTML5Node keygen(value kids...)

function label

HTML5Node label(value kids...)

function legend

HTML5Node legend(value kids...)

function li

HTML5Node li(value kids...)

HTML5Node link(value kids...)

function main

HTML5Node main(value kids...)

function \map

HTML5Node \map(value kids...)

function mark

HTML5Node mark(value kids...)

function menu

HTML5Node menu(value kids...)

function menuitem

HTML5Node menuitem(value kids...)

function meta

HTML5Node meta(value kids...)

function meter

HTML5Node meter(value kids...)

function nav

HTML5Node nav(value kids...)

function noscript

HTML5Node noscript(value kids...)

function object

HTML5Node object(value kids...)

function ol

HTML5Node ol(value kids...)

function optgroup

HTML5Node optgroup(value kids...)

function option

HTML5Node option(value kids...)

function output

HTML5Node output(value kids...)

function p

HTML5Node p(value kids...)

function param

HTML5Node param(value kids...)

function pre

HTML5Node pre(value kids...)

function progress

HTML5Node progress(value kids...)

function q

HTML5Node q(value kids...)

function rp

HTML5Node rp(value kids...)

function rt

HTML5Node rt(value kids...)

function ruby

HTML5Node ruby(value kids...)

function s

HTML5Node s(value kids...)

function samp

HTML5Node samp(value kids...)

function script

HTML5Node script(value kids...)

function section

HTML5Node section(value kids...)

function select

HTML5Node select(value kids...)

function small

HTML5Node small(value kids...)

function source

HTML5Node source(value kids...)

function span

HTML5Node span(value kids...)

function strong

HTML5Node strong(value kids...)

function style

HTML5Node style(value kids...)

function sub

HTML5Node sub(value kids...)

function summary

HTML5Node summary(value kids...)

function sup

HTML5Node sup(value kids...)

function table

HTML5Node table(value kids...)

function tbody

HTML5Node tbody(value kids...)

function td

HTML5Node td(value kids...)

function template

HTML5Node template(value kids...)

function textarea

HTML5Node textarea(value kids...)

function tfoot

HTML5Node tfoot(value kids...)

function th

HTML5Node th(value kids...)

function thead

HTML5Node thead(value kids...)

function time

HTML5Node time(value kids...)

function title

HTML5Node title(value kids...)

function tr

HTML5Node tr(value kids...)

function track

HTML5Node track(value kids...)

function u

HTML5Node u(value kids...)

function ul

HTML5Node ul(value kids...)

function var

HTML5Node var(value kids...)

function video

HTML5Node video(value kids...)

function wbr

HTML5Node wbr(value kids...)

function abbr

HTML5Attr abbr(value val)

function about

HTML5Attr about(value val)

function accept

HTML5Attr accept(value val)

function accesskey

HTML5Attr accesskey(value val)

function action

HTML5Attr action(value val)

function align

HTML5Attr align(value val)

function allowfullscreen

HTML5Attr allowfullscreen(value val)

function alt

HTML5Attr alt(value val)

function aria

HTML5Attr aria(value val)

function async

HTML5Attr async(value val)

function autocomplete

HTML5Attr autocomplete(value val)

function autofocus

HTML5Attr autofocus(value val)

function autoplay

HTML5Attr autoplay(value val)

function border

HTML5Attr border(value val)

function challenge

HTML5Attr challenge(value val)

function char

HTML5Attr char(value val)

function charset

HTML5Attr charset(value val)

function checked

HTML5Attr checked(value val)

function cite

HTML5Attr cite(value val)

function class

HTML5Attr class(value val)

function cols

HTML5Attr cols(value val)

function colspan

HTML5Attr colspan(value val)

function command

HTML5Attr command(value val)

function content

HTML5Attr content(value val)

function contenteditable

HTML5Attr contenteditable(value val)

function contextmenu

HTML5Attr contextmenu(value val)

function controls

HTML5Attr controls(value val)

function coords

HTML5Attr coords(value val)

function \data

HTML5Attr \data(value val)

function datatype

HTML5Attr datatype(value val)

function \datetime

HTML5Attr \datetime(value val)

function \default

HTML5Attr \default(value val)

function defer

HTML5Attr defer(value val)

function dir

HTML5Attr dir(value val)

function dirname

HTML5Attr dirname(value val)

function disabled

HTML5Attr disabled(value val)

function download

HTML5Attr download(value val)

function draggable

HTML5Attr draggable(value val)

function dropzone

HTML5Attr dropzone(value val)

function enctype

HTML5Attr enctype(value val)

function \for

HTML5Attr \for(value val)

function form

HTML5Attr form(value val)

function formaction

HTML5Attr formaction(value val)

function formenctype

HTML5Attr formenctype(value val)

function formmethod

HTML5Attr formmethod(value val)

function formnovalidate

HTML5Attr formnovalidate(value val)

function formtarget

HTML5Attr formtarget(value val)

function headers

HTML5Attr headers(value val)

function height

HTML5Attr height(value val)

function hidden

HTML5Attr hidden(value val)

function high

HTML5Attr high(value val)

function href

HTML5Attr href(value val)

function hreflang

HTML5Attr hreflang(value val)

function http

HTML5Attr http(value val)

function icon

HTML5Attr icon(value val)

function id

HTML5Attr id(value val)

function inlist

HTML5Attr inlist(value val)

function ismap

HTML5Attr ismap(value val)

function itemid

HTML5Attr itemid(value val)

function itemprop

HTML5Attr itemprop(value val)

function itemref

HTML5Attr itemref(value val)

function itemscope

HTML5Attr itemscope(value val)

function itemtype

HTML5Attr itemtype(value val)

function keytype

HTML5Attr keytype(value val)

function kind

HTML5Attr kind(value val)

function label

HTML5Attr label(value val)

function lang

HTML5Attr lang(value val)

function language

HTML5Attr language(value val)

function \list

HTML5Attr \list(value val)

function local {#lang-html5-DOM-local}

HTML5Attr local_(value val)

function loop

HTML5Attr loop(value val)

function low

HTML5Attr low(value val)

function manifest

HTML5Attr manifest(value val)

function max

HTML5Attr max(value val)

function maxlength

HTML5Attr maxlength(value val)

function media

HTML5Attr media(value val)

function mediagroup

HTML5Attr mediagroup(value val)

function method

HTML5Attr method(value val)

function min

HTML5Attr min(value val)

function multiple

HTML5Attr multiple(value val)

function muted

HTML5Attr muted(value val)

function name

HTML5Attr name(value val)

function novalidate

HTML5Attr novalidate(value val)

function onabort

HTML5Attr onabort(value val)

function onafterprint

HTML5Attr onafterprint(value val)

function onbeforeprint

HTML5Attr onbeforeprint(value val)

function onbeforeunload

HTML5Attr onbeforeunload(value val)

function onblur

HTML5Attr onblur(value val)

function oncanplay

HTML5Attr oncanplay(value val)

function oncanplaythrough

HTML5Attr oncanplaythrough(value val)

function onchange

HTML5Attr onchange(value val)

function onclick

HTML5Attr onclick(value val)

function oncontextmenu

HTML5Attr oncontextmenu(value val)

function ondblclick

HTML5Attr ondblclick(value val)

function ondrag

HTML5Attr ondrag(value val)

function ondragend

HTML5Attr ondragend(value val)

function ondragenter

HTML5Attr ondragenter(value val)

function ondragleave

HTML5Attr ondragleave(value val)

function ondragover

HTML5Attr ondragover(value val)

function ondragstart

HTML5Attr ondragstart(value val)

function ondrop

HTML5Attr ondrop(value val)

function ondurationchange

HTML5Attr ondurationchange(value val)

function onemptied

HTML5Attr onemptied(value val)

function onended

HTML5Attr onended(value val)

function onerror

HTML5Attr onerror(value val)

function onfocus

HTML5Attr onfocus(value val)

function onformchange

HTML5Attr onformchange(value val)

function onforminput

HTML5Attr onforminput(value val)

function onhashchange

HTML5Attr onhashchange(value val)

function oninput

HTML5Attr oninput(value val)

function oninvalid

HTML5Attr oninvalid(value val)

function onkeydown

HTML5Attr onkeydown(value val)

function onkeypress

HTML5Attr onkeypress(value val)

function onkeyup

HTML5Attr onkeyup(value val)

function onload

HTML5Attr onload(value val)

function onloadeddata

HTML5Attr onloadeddata(value val)

function onloadedmetadata

HTML5Attr onloadedmetadata(value val)

function onloadstart

HTML5Attr onloadstart(value val)

function onmessage

HTML5Attr onmessage(value val)

function onmousedown

HTML5Attr onmousedown(value val)

function onmousemove

HTML5Attr onmousemove(value val)

function onmouseout

HTML5Attr onmouseout(value val)

function onmouseover

HTML5Attr onmouseover(value val)

function onmouseup

HTML5Attr onmouseup(value val)

function onmousewheel

HTML5Attr onmousewheel(value val)

function onoffline

HTML5Attr onoffline(value val)

function ononline

HTML5Attr ononline(value val)

function onpagehide

HTML5Attr onpagehide(value val)

function onpageshow

HTML5Attr onpageshow(value val)

function onpause

HTML5Attr onpause(value val)

function onplay

HTML5Attr onplay(value val)

function onplaying

HTML5Attr onplaying(value val)

function onpopstate

HTML5Attr onpopstate(value val)

function onprogress

HTML5Attr onprogress(value val)

function onratechange

HTML5Attr onratechange(value val)

function onredo

HTML5Attr onredo(value val)

function onreset

HTML5Attr onreset(value val)

function onresize

HTML5Attr onresize(value val)

function onscroll

HTML5Attr onscroll(value val)

function onseeked

HTML5Attr onseeked(value val)

function onseeking

HTML5Attr onseeking(value val)

function onselect

HTML5Attr onselect(value val)

function onshow

HTML5Attr onshow(value val)

function onstalled

HTML5Attr onstalled(value val)

function onstorage

HTML5Attr onstorage(value val)

function onsubmit

HTML5Attr onsubmit(value val)

function onsuspend

HTML5Attr onsuspend(value val)

function ontimeupdate

HTML5Attr ontimeupdate(value val)

function onundo

HTML5Attr onundo(value val)

function onunload

HTML5Attr onunload(value val)

function onvolumechange

HTML5Attr onvolumechange(value val)

function onwaiting

HTML5Attr onwaiting(value val)

function open

HTML5Attr open(value val)

function optimum

HTML5Attr optimum(value val)

function pattern

HTML5Attr pattern(value val)

function ping

HTML5Attr ping(value val)

function placeholder

HTML5Attr placeholder(value val)

function poster

HTML5Attr poster(value val)

function prefix

HTML5Attr prefix(value val)

function preload

HTML5Attr preload(value val)

function property

HTML5Attr property(value val)

function radiogroup

HTML5Attr radiogroup(value val)

function readonly

HTML5Attr readonly(value val)

function \rel

HTML5Attr \rel(value val)

function required

HTML5Attr required(value val)

function resource

HTML5Attr resource(value val)

function rev

HTML5Attr rev(value val)

function reversed

HTML5Attr reversed(value val)

function role

HTML5Attr role(value val)

function rows

HTML5Attr rows(value val)

function rowspan

HTML5Attr rowspan(value val)

function sandbox

HTML5Attr sandbox(value val)

function scope

HTML5Attr scope(value val)

function scoped

HTML5Attr scoped(value val)

function seamless

HTML5Attr seamless(value val)

function selected

HTML5Attr selected(value val)

function shape

HTML5Attr shape(value val)

function size

HTML5Attr size(value val)

function sizes

HTML5Attr sizes(value val)

function span

HTML5Attr span(value val)

function spellcheck

HTML5Attr spellcheck(value val)

function src

HTML5Attr src(value val)

function srcdoc

HTML5Attr srcdoc(value val)

function srclang

HTML5Attr srclang(value val)

function \start

HTML5Attr \start(value val)

function step

HTML5Attr step(value val)

function style

HTML5Attr style(value val)

function tabindex

HTML5Attr tabindex(value val)

function target

HTML5Attr target(value val)

function template

HTML5Attr template(value val)

function translate

HTML5Attr translate(value val)

function \type

HTML5Attr \type(value val)

function typeof

HTML5Attr typeof(value val)

function usemap

HTML5Attr usemap(value val)

function valign

HTML5Attr valign(value val)

function \value

HTML5Attr \value(value val)

function vocab

HTML5Attr vocab(value val)

function width

HTML5Attr width(value val)

function wrap

HTML5Attr wrap(value val)

function xml_base

HTML5Attr xml_base(value val)

function xml_id

HTML5Attr xml_id(value val)

function xml_lang

HTML5Attr xml_lang(value val)

function xml_space

HTML5Attr xml_space(value val)

function isVoid

bool isVoid(str x)

function isRawText

bool isRawText(str x)

function isEscapableRawText

bool isEscapableRawText(str x)

function isBlockLevel

bool isBlockLevel(str x)

function startTag

str startTag(str n, str attrs)

function endTag

str endTag(str n)

function startTag

str startTag(str n, {})

default str startTag(str n, set[HTML5Attr] attrs)

function attrsToString

str attrsToString(set[HTML5Attr] attrs)

function attrToString

str attrToString(html5attr(str x, value v))

function rawText

str rawText(list[value] xs)

function escapableRawText

str escapableRawText(list[value] xs)

function kidsToString

str kidsToString(list[value] kids)

function kidToString

str kidToString(HTML5Node elt)

str kidToString(HTML5Attr x)

default str kidToString(value x)

function nodeToString

str nodeToString(str n, set[HTML5Attr] attrs, list[value] kids)

function toString


pretty print HTML5Node DOM to a string

str toString(HTML5Node x)

function serve


convenience function to render the HTML5Node dom tree in the browser

Content serve(HTML5Node x)