OCaml HTML5 parser/serialiser based on Python's JustHTML
1(** HTML5 content categories.
2
3 This module defines the content categories used in HTML5 to classify elements
4 based on their characteristics and allowed contexts. Elements can belong to
5 multiple categories.
6
7 @see <https://html.spec.whatwg.org/multipage/dom.html#content-models> WHATWG HTML Specification *)
8
9(** Content category type. *)
10type t =
11 | Metadata
12 (** Metadata content sets up the presentation or behavior of the rest of
13 the content, or sets up the relationship of the document with other
14 documents, or conveys other "out of band" information. *)
15 | Flow
16 (** Most elements that are used in the body of documents and applications
17 are categorized as flow content. *)
18 | Sectioning
19 (** Sectioning content is content that defines the scope of headings and
20 footers. *)
21 | Heading
22 (** Heading content defines the heading of a section (whether explicitly
23 marked up using sectioning content elements, or implied by the heading
24 content itself). *)
25 | Phrasing
26 (** Phrasing content is the text of the document, as well as elements that
27 mark up that text at the intra-paragraph level. *)
28 | Embedded
29 (** Embedded content is content that imports another resource into the
30 document, or content from another vocabulary that is inserted into the
31 document. *)
32 | Interactive
33 (** Interactive content is content that is specifically intended for user
34 interaction. *)
35 | Palpable
36 (** As a general rule, elements whose content model allows any flow content
37 or phrasing content should have at least one node in its contents that
38 is palpable content and that does not have the hidden attribute specified. *)
39 | Script_supporting
40 (** Script-supporting elements are those that do not represent anything
41 themselves (i.e., they are not rendered), but are used to support scripts. *)
42 | Form_associated
43 (** Form-associated elements can have a form owner. *)
44 | Listed
45 (** Listed form-associated elements have a form attribute that can point
46 to a form element. *)
47 | Labelable
48 (** Labelable form-associated elements can be associated with label elements. *)
49 | Submittable
50 (** Submittable form-associated elements can be used for constructing the
51 entry list when a form element is submitted. *)
52 | Resettable
53 (** Resettable form-associated elements are affected when a form element
54 is reset. *)
55 | Autocapitalize_inheriting
56 (** Some elements inherit the autocapitalize attribute from their form owner. *)
57 | Transparent
58 (** Transparent content models adopt the content model of their parent
59 element. *)
60
61(** {1 Predicates} *)
62
63val to_string : t -> string
64(** [to_string category] returns a string representation of the category. *)
65
66val compare : t -> t -> int
67(** [compare c1 c2] compares two categories for ordering. *)
68
69val equal : t -> t -> bool
70(** [equal c1 c2] returns [true] if the categories are equal. *)