diff --git a/CHANGES.md b/CHANGES.md index 9f625a7ad..057b5df07 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,62 @@ # NEXT +* Fix the development-profile build with recent compilers: anonymize + unused functor parameters in printer and functor signatures + (warning 67) +* Add the global attributes `popover` (`a_popover`), `inert` (`a_inert`), + `enterkeyhint` (`a_enterkeyhint`), `autocapitalize` (`a_autocapitalize`), + `autocorrect` (`a_autocorrect`), `writingsuggestions` + (`a_writingsuggestions`), `nonce` (`a_nonce`), `slot` (`a_slot`) and + `is` (`a_is`); allow `` `Auto`` for the `dir` attribute +* Add the microdata global attributes `itemscope`, `itemtype`, `itemid`, + `itemprop` and `itemref` +* Add the `part` and `exportparts` global attributes (CSS Shadow Parts) +* Add the `popovertarget` and `popovertargetaction` attributes on + buttons and inputs, and the `command` and `commandfor` attributes + (Invoker Commands) on buttons +* Add the `loading`, `decoding` and `fetchpriority` attributes on images, + and the `srcdoc`, `allow` and `loading` attributes on iframes; also + allow `crossorigin`, `usemap` and `referrerpolicy` on images +* Add the `as` (`a_as`), `imagesrcset` and `imagesizes` attributes on + links, the `nomodule` attribute on scripts, and the `blocking` + attribute on links, scripts and styles. The `Wrapped_functions` + module type has a new `string_of_blocking` function. +* Add the `ping` attribute on `a` and `area`; also allow + `referrerpolicy` there +* Add the `dirname` attribute on inputs and textareas and the `capture` + attribute (W3C HTML Media Capture) on inputs; also allow + `autocomplete` on selects and textareas +* Add the `type` attribute of ordered lists (`a_ol_type`), the `abbr` + attribute on th cells, the `closedby` attribute on dialogs, and allow + `media` on meta. The `Wrapped_functions` module type has a new + `string_of_ol_type` function. +* Add the `playsinline` and `disablepictureinpicture` attributes on + videos and the `disableremoteplayback` attribute on audios and videos +* Add the declarative shadow DOM attributes on templates: + `shadowrootmode`, `shadowrootdelegatesfocus`, `shadowrootclonable` + and `shadowrootserializable` +* Add the pointer event handler attributes (`a_onpointerdown`, etc.), + `a_onwheel` and `a_onauxclick` +* Add the missing global event handler attributes: `a_onbeforeinput`, + `a_onbeforematch`, `a_onbeforetoggle`, `a_oncancel`, `a_oncontextlost`, + `a_oncontextrestored`, `a_oncopy`, `a_oncut`, `a_onpaste`, + `a_oncuechange`, `a_onscrollend`, `a_onsecuritypolicyviolation`, + `a_onslotchange` and `a_ontoggle` +* Add the window event handler attributes `a_onlanguagechange`, + `a_onrejectionhandled` and `a_onunhandledrejection` on body +* Allow the `dialog` value for the `method` and `formmethod` attributes, + and add the newer `sandbox` tokens (`allow-downloads`, `allow-modals`, + `allow-orientation-lock`, `allow-popups-to-escape-sandbox`, + `allow-presentation`, `allow-top-navigation-by-user-activation`, + `allow-top-navigation-to-custom-protocols`) +* Add support for the `s` element +* Add support for the `bdi` element +* Add support for the `search` element +* Add support for the `data` element +* Add support for the `slot` element +* Add support for the `track` element and its `kind`, `srclang` + (as `a_track_srclang`) and `default` attributes; `audio` and `video` + now accept an optional `?tracks` argument * Fix typo `whitout` in type definition (#324 by Martin @MBodin Bodin) * Add support for the clip-path presentation attribute diff --git a/lib/html_f.ml b/lib/html_f.ml index d163a82e4..38c12bb85 100644 --- a/lib/html_f.ml +++ b/lib/html_f.ml @@ -41,7 +41,8 @@ struct Xml_print.compose_doctype "html" [] let emptytags = [ "area"; "base"; "br"; "col"; "command"; "embed"; "hr"; "img"; - "input"; "keygen"; "link"; "meta"; "param"; "source"; "wbr" ] + "input"; "keygen"; "link"; "meta"; "param"; "source"; "track"; + "wbr" ] end type 'a wrap = 'a W.t @@ -113,11 +114,20 @@ struct let a_onafterprint = Xml.event_handler_attrib "onafterprint" let a_onbeforeprint = Xml.event_handler_attrib "onbeforeprint" let a_onbeforeunload = Xml.event_handler_attrib "onbeforeunload" + let a_onbeforeinput = Xml.event_handler_attrib "onbeforeinput" + let a_onbeforematch = Xml.event_handler_attrib "onbeforematch" + let a_onbeforetoggle = Xml.event_handler_attrib "onbeforetoggle" let a_onblur = Xml.event_handler_attrib "onblur" + let a_oncancel = Xml.event_handler_attrib "oncancel" let a_oncanplay = Xml.event_handler_attrib "oncanplay" let a_oncanplaythrough = Xml.event_handler_attrib "oncanplaythrough" let a_onchange = Xml.event_handler_attrib "onchange" let a_onclose = Xml.event_handler_attrib "onclose" + let a_oncontextlost = Xml.event_handler_attrib "oncontextlost" + let a_oncontextrestored = Xml.event_handler_attrib "oncontextrestored" + let a_oncopy = Xml.event_handler_attrib "oncopy" + let a_oncut = Xml.event_handler_attrib "oncut" + let a_oncuechange = Xml.event_handler_attrib "oncuechange" let a_ondurationchange = Xml.event_handler_attrib "ondurationchange" let a_onemptied = Xml.event_handler_attrib "onemptied" let a_onended = Xml.event_handler_attrib "onended" @@ -126,10 +136,16 @@ struct let a_onformchange = Xml.event_handler_attrib "onformchange" let a_onforminput = Xml.event_handler_attrib "onforminput" let a_onhashchange = Xml.event_handler_attrib "onhashchange" + let a_onlanguagechange = Xml.event_handler_attrib "onlanguagechange" + let a_onrejectionhandled = + Xml.event_handler_attrib "onrejectionhandled" + let a_onunhandledrejection = + Xml.event_handler_attrib "onunhandledrejection" let a_oninput = Xml.event_handler_attrib "oninput" let a_oninvalid = Xml.event_handler_attrib "oninvalid" let a_onoffline = Xml.event_handler_attrib "onoffline" let a_ononline = Xml.event_handler_attrib "ononline" + let a_onpaste = Xml.event_handler_attrib "onpaste" let a_onpause = Xml.event_handler_attrib "onpause" let a_onplay = Xml.event_handler_attrib "onplay" let a_onplaying = Xml.event_handler_attrib "onplaying" @@ -142,15 +158,20 @@ struct let a_onredo = Xml.event_handler_attrib "onredo" let a_onresize = Xml.event_handler_attrib "onresize" let a_onscroll = Xml.event_handler_attrib "onscroll" + let a_onscrollend = Xml.event_handler_attrib "onscrollend" + let a_onsecuritypolicyviolation = + Xml.event_handler_attrib "onsecuritypolicyviolation" let a_onseeked = Xml.event_handler_attrib "onseeked" let a_onseeking = Xml.event_handler_attrib "onseeking" let a_onselect = Xml.event_handler_attrib "onselect" let a_onshow = Xml.event_handler_attrib "onshow" + let a_onslotchange = Xml.event_handler_attrib "onslotchange" let a_onstalled = Xml.event_handler_attrib "onstalled" let a_onstorage = Xml.event_handler_attrib "onstorage" let a_onsubmit = Xml.event_handler_attrib "onsubmit" let a_onsuspend = Xml.event_handler_attrib "onsuspend" let a_ontimeupdate = Xml.event_handler_attrib "ontimeupdate" + let a_ontoggle = Xml.event_handler_attrib "ontoggle" let a_onundo = Xml.event_handler_attrib "onundo" let a_onunload = Xml.event_handler_attrib "onunload" let a_onvolumechange = Xml.event_handler_attrib "onvolumechange" @@ -163,6 +184,7 @@ struct let a_onmousewheel = Xml.event_handler_attrib "onmousewheel" (** Javascript mouse events *) + let a_onauxclick = Xml.mouse_event_handler_attrib "onauxclick" let a_onclick = Xml.mouse_event_handler_attrib "onclick" let a_oncontextmenu = Xml.mouse_event_handler_attrib "oncontextmenu" let a_ondblclick = Xml.mouse_event_handler_attrib "ondblclick" @@ -178,6 +200,21 @@ struct let a_onmouseover = Xml.mouse_event_handler_attrib "onmouseover" let a_onmousemove = Xml.mouse_event_handler_attrib "onmousemove" let a_onmouseout = Xml.mouse_event_handler_attrib "onmouseout" + let a_onwheel = Xml.mouse_event_handler_attrib "onwheel" + + (** Javascript pointer events *) + let a_onpointercancel = Xml.mouse_event_handler_attrib "onpointercancel" + let a_onpointerdown = Xml.mouse_event_handler_attrib "onpointerdown" + let a_onpointerenter = Xml.mouse_event_handler_attrib "onpointerenter" + let a_onpointerleave = Xml.mouse_event_handler_attrib "onpointerleave" + let a_onpointermove = Xml.mouse_event_handler_attrib "onpointermove" + let a_onpointerout = Xml.mouse_event_handler_attrib "onpointerout" + let a_onpointerover = Xml.mouse_event_handler_attrib "onpointerover" + let a_onpointerup = Xml.mouse_event_handler_attrib "onpointerup" + let a_ongotpointercapture = + Xml.mouse_event_handler_attrib "ongotpointercapture" + let a_onlostpointercapture = + Xml.mouse_event_handler_attrib "onlostpointercapture" (** Javascript touch events *) let a_ontouchstart = Xml.touch_event_handler_attrib "ontouchstart" @@ -274,6 +311,10 @@ struct let a_name = string_attrib "name" + let a_abbr = string_attrib "abbr" + + let a_allow = string_attrib "allow" + let a_allowfullscreen = constant_attrib "allowfullscreen" @@ -286,6 +327,15 @@ struct let a_autocomplete x = user_attrib C.string_of_autocomplete "autocomplete" x + let a_autocapitalize x = + user_attrib C.string_of_big_variant "autocapitalize" x + + let a_autocorrect x = + user_attrib C.onoff_of_bool "autocorrect" x + + let a_as x = + user_attrib C.string_of_big_variant "as" x + let a_async = constant_attrib "async" @@ -307,6 +357,12 @@ struct let a_challenge = string_attrib "challenge" + let a_closedby x = + user_attrib C.string_of_big_variant "closedby" x + + let a_capture x = + user_attrib C.string_of_big_variant "capture" x + let a_contenteditable ce = bool_attrib "contenteditable" ce @@ -318,9 +374,14 @@ struct let a_dir x = user_attrib C.string_of_big_variant "dir" x + let a_dirname = string_attrib "dirname" + let a_draggable d = bool_attrib "draggable" d + let a_enterkeyhint x = + user_attrib C.string_of_big_variant "enterkeyhint" x + let a_form = string_attrib "form" let a_formaction = uri_attrib "formaction" @@ -339,6 +400,22 @@ struct let a_icon = uri_attrib "icon" + let a_inert = + constant_attrib "inert" + + let a_is = string_attrib "is" + + let a_itemscope = + constant_attrib "itemscope" + + let a_itemtype = space_sep_attrib "itemtype" + + let a_itemid = uri_attrib "itemid" + + let a_itemprop = space_sep_attrib "itemprop" + + let a_itemref = space_sep_attrib "itemref" + let a_ismap = constant_attrib "ismap" @@ -346,6 +423,15 @@ struct let a_list = string_attrib "list" + let a_loading x = + user_attrib C.string_of_big_variant "loading" x + + let a_decoding x = + user_attrib C.string_of_big_variant "decoding" x + + let a_fetchpriority x = + user_attrib C.string_of_big_variant "fetchpriority" x + let a_loop = constant_attrib "loop" @@ -362,6 +448,11 @@ struct let a_inputmode x = user_attrib C.string_of_big_variant "inputmode" x + let a_nomodule = + constant_attrib "nomodule" + + let a_nonce = string_attrib "nonce" + let a_novalidate = constant_attrib "novalidate" @@ -372,8 +463,36 @@ struct let a_pattern = string_attrib "pattern" + let a_ping = space_sep_attrib "ping" + + let a_playsinline = + constant_attrib "playsinline" + + let a_disablepictureinpicture = + constant_attrib "disablepictureinpicture" + + let a_disableremoteplayback = + constant_attrib "disableremoteplayback" + let a_placeholder = string_attrib "placeholder" + let a_part = space_sep_attrib "part" + + let a_exportparts = comma_sep_attrib "exportparts" + + let a_popover x = + user_attrib C.string_of_big_variant "popover" x + + let a_popovertarget = string_attrib "popovertarget" + + let a_popovertargetaction x = + user_attrib C.string_of_big_variant "popovertargetaction" x + + let a_command x = + user_attrib C.string_of_big_variant "command" x + + let a_commandfor = string_attrib "commandfor" + let a_poster = uri_attrib "poster" let a_preload x = @@ -390,9 +509,15 @@ struct let a_reversed = constant_attrib "reversed" + let a_blocking x = + user_attrib C.string_of_blocking "blocking" x + let a_sandbox x = user_attrib C.string_of_sandbox "sandbox" x + let a_writingsuggestions = + bool_attrib "writingsuggestions" + let a_spellcheck sc = bool_attrib "spellcheck" sc @@ -402,20 +527,50 @@ struct let a_seamless = constant_attrib "seamless" + let a_shadowrootmode x = + user_attrib C.string_of_big_variant "shadowrootmode" x + + let a_shadowrootdelegatesfocus = + constant_attrib "shadowrootdelegatesfocus" + + let a_shadowrootclonable = + constant_attrib "shadowrootclonable" + + let a_shadowrootserializable = + constant_attrib "shadowrootserializable" + let a_sizes sizes = user_attrib C.string_of_sizes "sizes" sizes + let a_slot = string_attrib "slot" + let a_span = int_attrib "span" - (*let a_srcdoc*) + let a_srcdoc = string_attrib "srcdoc" + let a_srclang = string_attrib "srclang" + let a_kind x = + user_attrib C.string_of_big_variant "kind" x + + let a_track_srclang = string_attrib "srclang" + + let a_default = + constant_attrib "default" + let a_srcset = srcset_attrib "srcset" + let a_imagesrcset = srcset_attrib "imagesrcset" + + let a_imagesizes = comma_sep_attrib "imagesizes" + let a_img_sizes = comma_sep_attrib "sizes" let a_start = int_attrib "start" + let a_ol_type x = + user_attrib C.string_of_ol_type "type" x + let a_step step = user_attrib C.string_of_step "step" step @@ -605,6 +760,9 @@ struct let time = star "time" + let data ~value ?(a = []) elts = + Xml.node ~a: ((a_value value) :: a) "data" elts + let var = star "var" let a = star "a" @@ -629,6 +787,8 @@ struct let u = star "u" + let s = star "s" + let small = star "small" let sub = star "sub" @@ -650,6 +810,8 @@ struct let bdo ~dir ?(a = []) elts = Xml.node ~a: ((a_dir dir) :: a) "bdo" elts + let bdi = star "bdi" + let a_datetime = string_attrib "datetime" let a_shape x = @@ -679,18 +841,27 @@ struct let template = star "template" + let slot = star "slot" + let article = star "article" let aside = star "aside" let main = star "main" - let video_audio name ?src ?srcs ?(a = []) elts = + let search = star "search" + + let video_audio name ?src ?srcs ?tracks ?(a = []) elts = let a = match src with | None -> a | Some uri -> (a_src uri) :: a in + let elts = + match tracks with + | None -> elts + | Some tracks -> W.append tracks elts + in match srcs with | None -> Xml.node name ~a elts | Some srcs -> Xml.node name ~a (W.append srcs elts) @@ -715,6 +886,9 @@ struct let source = terminal "source" + let track ~src ?(a = []) () = + Xml.leaf ~a: ((a_src src) :: a) "track" + let meter = star "meter" let output_elt = star "output" @@ -873,12 +1047,21 @@ struct module Xml = Xml let string_of_sandbox_token = function + | `Allow_downloads -> "allow-downloads" | `Allow_forms -> "allow-forms" + | `Allow_modals -> "allow-modals" + | `Allow_orientation_lock -> "allow-orientation-lock" | `Allow_pointer_lock -> "allow-pointer-lock" | `Allow_popups -> "allow-popups" - | `Allow_top_navigation -> "allow-top-navigation" + | `Allow_popups_to_escape_sandbox -> "allow-popups-to-escape-sandbox" + | `Allow_presentation -> "allow-presentation" | `Allow_same_origin -> "allow-same-origin" | `Allow_script -> "allow-scripts" + | `Allow_top_navigation -> "allow-top-navigation" + | `Allow_top_navigation_by_user_activation -> + "allow-top-navigation-by-user-activation" + | `Allow_top_navigation_to_custom_protocols -> + "allow-top-navigation-to-custom-protocols" let string_of_linktype = function | `Alternate -> "alternate" @@ -963,6 +1146,7 @@ struct | `Rtl -> "rtl" | `Get -> "GET" | `Post -> "POST" + | `Dialog -> "dialog" | `Formnovalidate -> "formnovalidate" | `Hidden -> "hidden" | `Ismap -> "ismap" @@ -971,6 +1155,10 @@ struct | `Open -> "open" | `None -> "none" | `Metadata -> "metadata" + | `Subtitles -> "subtitles" + | `Captions -> "captions" + | `Descriptions -> "descriptions" + | `Chapters -> "chapters" | `Audio -> "audio" | `Pubdate -> "pubdate" | `Required -> "required" @@ -1002,6 +1190,47 @@ struct | `Yes -> "yes" | `No -> "no" | `Auto -> "auto" + | `Manual -> "manual" + | `Hint -> "hint" + | `On -> "on" + | `Off -> "off" + | `Enter -> "enter" + | `Done -> "done" + | `Go -> "go" + | `Previous -> "previous" + | `Send -> "send" + | `Sentences -> "sentences" + | `Words -> "words" + | `Characters -> "characters" + | `Lazy -> "lazy" + | `Eager -> "eager" + | `Sync -> "sync" + | `High -> "high" + | `Low -> "low" + | `User -> "user" + | `Environment -> "environment" + | `Closerequest -> "closerequest" + | `Closed -> "closed" + | `Document -> "document" + | `Embed -> "embed" + | `Fetch -> "fetch" + | `Font -> "font" + | `Image -> "image" + | `Object -> "object" + | `Script -> "script" + | `Style -> "style" + | `Track -> "track" + | `Video -> "video" + | `Worker -> "worker" + | `Show -> "show" + | `Hide -> "hide" + | `Toggle -> "toggle" + | `Show_modal -> "show-modal" + | `Close -> "close" + | `Request_close -> "request-close" + | `Show_popover -> "show-popover" + | `Hide_popover -> "hide-popover" + | `Toggle_popover -> "toggle-popover" | `Circle -> "circle" | `Poly -> "poly" | `Alternate -> "alternate" @@ -1101,6 +1330,19 @@ struct | None -> "any" + let string_of_blocking_token = function + | `Render -> "render" + + let string_of_ol_type = function + | `Decimal -> "1" + | `Lower_alpha -> "a" + | `Upper_alpha -> "A" + | `Lower_roman -> "i" + | `Upper_roman -> "I" + + let string_of_blocking l = + String.concat " " (List.map string_of_blocking_token l) + let string_of_sandbox l = String.concat " " (List.map string_of_sandbox_token l) diff --git a/lib/html_f.mli b/lib/html_f.mli index 647c57c49..4c3ae76eb 100644 --- a/lib/html_f.mli +++ b/lib/html_f.mli @@ -46,7 +46,7 @@ module Wrapped_functions (** Similar to {!Make} but with a custom set of wrapped functions. *) module Make_with_wrapped_functions (Xml : Xml_sigs.T) - (C : Html_sigs.Wrapped_functions with module Xml = Xml) + (_ : Html_sigs.Wrapped_functions with module Xml = Xml) (Svg : Svg_sigs.T with module Xml := Xml) : Html_sigs.Make(Xml)(Svg).T with type +'a elt = Xml.elt diff --git a/lib/html_sigs.mli b/lib/html_sigs.mli index 60750f6c7..c6b9aa17f 100644 --- a/lib/html_sigs.mli +++ b/lib/html_sigs.mli @@ -176,11 +176,20 @@ module type T = sig val a_onafterprint : Xml.event_handler -> [> | `OnAfterPrint] attrib val a_onbeforeprint : Xml.event_handler -> [> | `OnBeforePrint] attrib val a_onbeforeunload : Xml.event_handler -> [> | `OnBeforeUnload] attrib + val a_onbeforeinput : Xml.event_handler -> [> | `OnBeforeInput] attrib + val a_onbeforematch : Xml.event_handler -> [> | `OnBeforeMatch] attrib + val a_onbeforetoggle : Xml.event_handler -> [> | `OnBeforeToggle] attrib val a_onblur : Xml.event_handler -> [> | `OnBlur] attrib + val a_oncancel : Xml.event_handler -> [> | `OnCancel] attrib val a_oncanplay : Xml.event_handler -> [> | `OnCanPlay] attrib val a_oncanplaythrough : Xml.event_handler -> [> | `OnCanPlayThrough] attrib val a_onchange : Xml.event_handler -> [> | `OnChange] attrib val a_onclose : Xml.event_handler -> [> | `OnClose] attrib + val a_oncontextlost : Xml.event_handler -> [> | `OnContextLost] attrib + val a_oncontextrestored : Xml.event_handler -> [> | `OnContextRestored] attrib + val a_oncopy : Xml.event_handler -> [> | `OnCopy] attrib + val a_oncut : Xml.event_handler -> [> | `OnCut] attrib + val a_oncuechange : Xml.event_handler -> [> | `OnCueChange] attrib val a_ondurationchange : Xml.event_handler -> [> | `OnDurationChange] attrib val a_onemptied : Xml.event_handler -> [> | `OnEmptied] attrib val a_onended : Xml.event_handler -> [> | `OnEnded] attrib @@ -189,11 +198,13 @@ module type T = sig val a_onformchange : Xml.event_handler -> [> | `OnFormChange] attrib val a_onforminput : Xml.event_handler -> [> | `OnFormInput] attrib val a_onhashchange : Xml.event_handler -> [> | `OnHashChange] attrib + val a_onlanguagechange : Xml.event_handler -> [> | `OnLanguageChange] attrib val a_oninput : Xml.event_handler -> [> | `OnInput] attrib val a_oninvalid : Xml.event_handler -> [> | `OnInvalid] attrib val a_onmousewheel : Xml.event_handler -> [> | `OnMouseWheel] attrib val a_onoffline : Xml.event_handler -> [> | `OnOffLine] attrib val a_ononline : Xml.event_handler -> [> | `OnOnLine] attrib + val a_onpaste : Xml.event_handler -> [> | `OnPaste] attrib val a_onpause : Xml.event_handler -> [> | `OnPause] attrib val a_onplay : Xml.event_handler -> [> | `OnPlay] attrib val a_onplaying : Xml.event_handler -> [> | `OnPlaying] attrib @@ -204,17 +215,26 @@ module type T = sig val a_onratechange : Xml.event_handler -> [> | `OnRateChange] attrib val a_onreadystatechange : Xml.event_handler -> [> | `OnReadyStateChange] attrib val a_onredo : Xml.event_handler -> [> | `OnRedo] attrib + val a_onrejectionhandled : + Xml.event_handler -> [> | `OnRejectionHandled] attrib + val a_onunhandledrejection : + Xml.event_handler -> [> | `OnUnhandledRejection] attrib val a_onresize : Xml.event_handler -> [> | `OnResize] attrib val a_onscroll : Xml.event_handler -> [> | `OnScroll] attrib + val a_onscrollend : Xml.event_handler -> [> | `OnScrollEnd] attrib + val a_onsecuritypolicyviolation : + Xml.event_handler -> [> | `OnSecurityPolicyViolation] attrib val a_onseeked : Xml.event_handler -> [> | `OnSeeked] attrib val a_onseeking : Xml.event_handler -> [> | `OnSeeking] attrib val a_onselect : Xml.event_handler -> [> | `OnSelect] attrib val a_onshow : Xml.event_handler -> [> | `OnShow] attrib + val a_onslotchange : Xml.event_handler -> [> | `OnSlotChange] attrib val a_onstalled : Xml.event_handler -> [> | `OnStalled] attrib val a_onstorage : Xml.event_handler -> [> | `OnStorage] attrib val a_onsubmit : Xml.event_handler -> [> | `OnSubmit] attrib val a_onsuspend : Xml.event_handler -> [> | `OnSuspend] attrib val a_ontimeupdate : Xml.event_handler -> [> | `OnTimeUpdate] attrib + val a_ontoggle : Xml.event_handler -> [> | `OnToggle] attrib val a_onundo : Xml.event_handler -> [> | `OnUndo] attrib val a_onunload : Xml.event_handler -> [> | `OnUnload] attrib val a_onvolumechange : Xml.event_handler -> [> | `OnVolumeChange] attrib @@ -227,6 +247,7 @@ module type T = sig (** {4 Mouse events} *) + val a_onauxclick : Xml.mouse_event_handler -> [> | `OnAuxClick] attrib val a_onclick : Xml.mouse_event_handler -> [> | `OnClick] attrib val a_oncontextmenu : Xml.mouse_event_handler -> [> | `OnContextMenu] attrib val a_ondblclick : Xml.mouse_event_handler -> [> | `OnDblClick] attrib @@ -242,6 +263,25 @@ module type T = sig val a_onmouseover : Xml.mouse_event_handler -> [> | `OnMouseOver] attrib val a_onmousemove : Xml.mouse_event_handler -> [> | `OnMouseMove] attrib val a_onmouseout : Xml.mouse_event_handler -> [> | `OnMouseOut] attrib + val a_onwheel : Xml.mouse_event_handler -> [> | `OnWheel] attrib + + (** {4 Pointer events} + + In the DOM, pointer events inherit from mouse events, so the + handlers use {!Xml.mouse_event_handler}. *) + + val a_onpointercancel : Xml.mouse_event_handler -> [> | `OnPointerCancel] attrib + val a_onpointerdown : Xml.mouse_event_handler -> [> | `OnPointerDown] attrib + val a_onpointerenter : Xml.mouse_event_handler -> [> | `OnPointerEnter] attrib + val a_onpointerleave : Xml.mouse_event_handler -> [> | `OnPointerLeave] attrib + val a_onpointermove : Xml.mouse_event_handler -> [> | `OnPointerMove] attrib + val a_onpointerout : Xml.mouse_event_handler -> [> | `OnPointerOut] attrib + val a_onpointerover : Xml.mouse_event_handler -> [> | `OnPointerOver] attrib + val a_onpointerup : Xml.mouse_event_handler -> [> | `OnPointerUp] attrib + val a_ongotpointercapture : + Xml.mouse_event_handler -> [> | `OnGotPointerCapture] attrib + val a_onlostpointercapture : + Xml.mouse_event_handler -> [> | `OnLostPointerCapture] attrib (** {4 Touch events} *) val a_ontouchstart : Xml.touch_event_handler -> [> | `OnTouchStart] attrib @@ -257,6 +297,15 @@ module type T = sig (** {3 Other attributes} *) + val a_abbr : text wrap -> [> | `Abbr] attrib + (** Alternative label of a header cell, for reference in other + cells. + @see abbr attribute documentation. *) + + val a_allow : text wrap -> [> | `Allow] attrib + (** Permissions policy of an iframe. + @see allow documentation. *) + val a_allowfullscreen : unit -> [> | `Allowfullscreen] attrib val a_allowpaymentrequest : unit -> [> | `Allowpaymentrequest] attrib @@ -264,6 +313,23 @@ module type T = sig val a_autocomplete : autocomplete_option wrap -> [> | `Autocomplete] attrib (** @see autocomplete documentation. *) + val a_autocapitalize : + [< | `Off | `None | `On | `Sentences | `Words | `Characters ] wrap -> + [> | `Autocapitalize] attrib + (** @see autocapitalize documentation. *) + + val a_autocorrect : (bool[@onoff]) wrap -> [> | `Autocorrect] attrib + (** @see autocorrect documentation. *) + + val a_as : + [< | `Audio | `Document | `Embed | `Fetch | `Font | `Image | `Object + | `Script | `Style | `Track | `Video | `Worker ] wrap -> + [> | `As] attrib + (** Destination of a preload link. This covers the destinations + listed by MDN; other spec destinations can be produced with + {!Unsafe.string_attrib}. + @see as documentation. *) + val a_async : unit -> [> | `Async] attrib val a_autofocus : unit -> [> | `Autofocus] attrib @@ -282,16 +348,37 @@ module type T = sig val a_challenge : text wrap -> [> | `Challenge] attrib + val a_closedby : + [< | `Any | `Closerequest | `None ] wrap -> [> | `Closedby] attrib + (** User actions that can close a dialog. + @see closedby documentation. *) + + val a_capture : [< | `User | `Environment ] wrap -> [> | `Capture] attrib + (** Preferred camera for file inputs capturing media. Defined by + the W3C HTML Media Capture specification. The bare form of the + attribute is not supported by the PPX; use an explicit value. + @see capture documentation. *) + val a_contenteditable : bool wrap -> [> | `Contenteditable] attrib val a_contextmenu : idref wrap -> [> | `Contextmenu] attrib val a_controls : unit -> [> | `Controls] attrib - val a_dir : [< | `Rtl | `Ltr] wrap -> [> | `Dir] attrib + val a_dir : [< | `Rtl | `Ltr | `Auto] wrap -> [> | `Dir] attrib + + val a_dirname : text wrap -> [> | `Dirname] attrib + (** Name of the form control field used to submit the element's + text directionality. + @see dirname documentation. *) val a_draggable : bool wrap -> [> | `Draggable] attrib + val a_enterkeyhint : + [< | `Enter | `Done | `Go | `Next | `Previous | `Search | `Send ] wrap -> + [> | `Enterkeyhint] attrib + (** @see enterkeyhint documentation. *) + val a_form : idref wrap -> [> | `Form] attrib val a_formaction : Xml.uri wrap -> [> | `Formaction] attrib @@ -308,12 +395,49 @@ module type T = sig val a_icon : Xml.uri wrap -> [> | `Icon] attrib + val a_inert : unit -> [> | `Inert] attrib + (** @see inert documentation. *) + + val a_is : text wrap -> [> | `Is] attrib + (** Name of a customized built-in element. + @see is documentation. *) + + val a_itemscope : unit -> [> | `Itemscope] attrib + (** Microdata: creates a new item. + @see itemscope documentation. *) + + val a_itemtype : string list wrap -> [> | `Itemtype] attrib + (** Microdata: space-separated list of vocabulary URLs for the item. + @see itemtype documentation. *) + + val a_itemid : Xml.uri wrap -> [> | `Itemid] attrib + (** Microdata: global identifier of the item. + @see itemid documentation. *) + + val a_itemprop : string list wrap -> [> | `Itemprop] attrib + (** Microdata: space-separated list of names of the property. + @see itemprop documentation. *) + + val a_itemref : idrefs wrap -> [> | `Itemref] attrib + (** Microdata: additional elements to crawl to find the + name-value pairs of the item. + @see itemref documentation. *) + val a_ismap : unit -> [> | `Ismap] attrib val a_keytype : text wrap -> [> | `Keytype] attrib val a_list : idref wrap -> [> | `List] attrib + val a_loading : [< | `Lazy | `Eager ] wrap -> [> | `Loading] attrib + (** @see loading documentation. *) + + val a_decoding : [< | `Sync | `Async | `Auto ] wrap -> [> | `Decoding] attrib + (** @see decoding documentation. *) + + val a_fetchpriority : [< | `High | `Low | `Auto ] wrap -> [> | `Fetchpriority] attrib + (** @see fetchpriority documentation. *) + val a_loop : unit -> [> | `Loop] attrib val a_low : float_number wrap -> [> | `Low] attrib @@ -333,6 +457,15 @@ module type T = sig [> `Inputmode] attrib (** @see inputmode documentation. *) + val a_nomodule : unit -> [> | `Nomodule] attrib + (** Indicates that a classic script must not run in browsers that + support module scripts. + @see nomodule documentation. *) + + val a_nonce : text wrap -> [> | `Nonce] attrib + (** Cryptographic nonce used by Content Security Policy. + @see nonce documentation. *) + val a_novalidate : unit -> [> | `Novalidate] attrib val a_open : unit -> [> | `Open] attrib @@ -341,8 +474,61 @@ module type T = sig val a_pattern : text wrap -> [> | `Pattern] attrib + val a_ping : string list wrap -> [> | `Ping] attrib + (** Space-separated list of URLs to ping when following the + hyperlink. + @see ping documentation. *) + val a_placeholder : text wrap -> [> | `Placeholder] attrib + val a_playsinline : unit -> [> | `Playsinline] attrib + (** Indicates that a video is to be played inline, within the + element's playback area. + @see playsinline documentation. *) + + val a_disablepictureinpicture : unit -> [> | `Disablepictureinpicture] attrib + (** Defined by the W3C Picture-in-Picture specification. + @see disablepictureinpicture documentation. *) + + val a_disableremoteplayback : unit -> [> | `Disableremoteplayback] attrib + (** Defined by the W3C Remote Playback specification. + @see disableremoteplayback documentation. *) + + val a_part : string list wrap -> [> | `Part] attrib + (** Space-separated list of part names of the element, exposed to + shadow-tree styling. Defined by the CSS Shadow Parts + specification, not by the HTML standard. + @see part documentation. *) + + val a_exportparts : text list wrap -> [> | `Exportparts] attrib + (** Comma-separated list of part mappings ([name] or + [name:exposed-name]) forwarded from a nested shadow tree. + Defined by the CSS Shadow Parts specification, not by the HTML + standard. + @see exportparts documentation. *) + + val a_popover : [< | popover_value] wrap -> [> | `Popover] attrib + (** In HTML, a bare [popover] attribute is equivalent to + [popover="auto"]. + @see popover documentation. *) + + val a_popovertarget : idref wrap -> [> | `Popovertarget] attrib + (** Id of the popover element to control with a button. + @see popovertarget documentation. *) + + val a_popovertargetaction : + [< | `Show | `Hide | `Toggle ] wrap -> [> | `Popovertargetaction] attrib + (** @see popovertargetaction documentation. *) + + val a_command : [< | command_value] wrap -> [> | `Command] attrib + (** Action to perform on the element targeted by a button + (Invoker Commands API). + @see command documentation. *) + + val a_commandfor : idref wrap -> [> | `Commandfor] attrib + (** Id of the element a button command targets. + @see commandfor documentation. *) + val a_poster : Xml.uri wrap -> [> | `Poster] attrib val a_preload : [< | `None | `Metadata | `Audio] wrap -> [> | `Preload] attrib @@ -359,22 +545,69 @@ module type T = sig val a_reversed : unit -> [> | `Reversed] attrib + val a_blocking : [< | blocking_token ] list wrap -> [> | `Blocking] attrib + (** Space-separated list of operations blocked on the fetching of + a script, style sheet or style-relevant link. + @see blocking documentation. *) + val a_sandbox : [< | sandbox_token ] list wrap -> [> | `Sandbox] attrib val a_spellcheck : bool wrap -> [> | `Spellcheck] attrib + val a_writingsuggestions : bool wrap -> [> | `Writingsuggestions] attrib + (** @see writingsuggestions documentation. *) + val a_scoped : unit -> [> | `Scoped] attrib val a_seamless : unit -> [> | `Seamless] attrib + val a_shadowrootmode : [< | `Open | `Closed ] wrap -> [> | `Shadowrootmode] attrib + (** Declarative shadow root mode, for template elements. + @see shadowrootmode documentation. *) + + val a_shadowrootdelegatesfocus : unit -> [> | `Shadowrootdelegatesfocus] attrib + (** @see shadowrootdelegatesfocus documentation. *) + + val a_shadowrootclonable : unit -> [> | `Shadowrootclonable] attrib + (** @see shadowrootclonable documentation. *) + + val a_shadowrootserializable : unit -> [> | `Shadowrootserializable] attrib + (** @see shadowrootserializable documentation. *) + val a_sizes : (number * number) list option wrap -> [> | `Sizes] attrib + val a_slot : text wrap -> [> | `Slot] attrib + (** Name of the shadow tree slot the element is assigned to. + @see slot documentation. *) + val a_span : number wrap -> [> | `Span] attrib + val a_srcdoc : text wrap -> [> | `Srcdoc] attrib + (** Inline HTML document of an iframe, given as escaped text. + @see srcdoc documentation. *) + (** @deprecated Use {!a_xml_lang} instead. *) val a_srclang : nmtoken wrap -> [> | `XML_lang] attrib [@@ocaml.deprecated "Use a_xml_lang instead."] + val a_kind : + [< | `Subtitles | `Captions | `Descriptions | `Chapters | `Metadata] + wrap -> [> | `Kind] attrib + (** How a text track is meant to be used, for [track] elements. + @see + kind attribute documentation on MDN *) + + val a_track_srclang : languagecode wrap -> [> | `Srclang] attrib + [@@reflect.attribute "srclang" ["track"]] + (** Language of the text track data, for [track] elements. *) + + val a_default : unit -> [> | `Default] attrib + (** Indicates that a text track is to be enabled if the user's + preferences do not indicate that another track would be more + appropriate. + @see + default attribute documentation on MDN *) + type image_candidate = [ `Url of uri | `Url_width of uri * number @@ -382,11 +615,24 @@ module type T = sig val a_srcset : image_candidate list wrap -> [> | `Srcset] attrib + val a_imagesrcset : image_candidate list wrap -> [> | `Imagesrcset] attrib + (** Images to preload, for link elements with [rel=preload] and + [as=image]. + @see imagesrcset documentation. *) + + val a_imagesizes : text list wrap -> [> | `Imagesizes] attrib + (** @see imagesizes documentation. *) + val a_img_sizes : text list wrap -> [> | `Img_sizes] attrib [@@reflect.attribute "sizes" ["img"]] val a_start : number wrap -> [> | `Start] attrib + val a_ol_type : [< | ol_type] wrap -> [> | `Ol_Type] attrib + [@@reflect.attribute "type" ["ol"]] + (** Numbering type of an ordered list. + @see type attribute documentation. *) + val a_step : float_number option wrap -> [> | `Step] attrib val a_translate : [< | `Yes | `No] wrap -> [> | `Translate] attrib @@ -500,10 +746,10 @@ module type T = sig val a_minlength : number wrap -> [> | `Minlength] attrib val a_method : - [< | `Get | `Post] wrap -> [> | `Method] attrib + [< | `Get | `Post | `Dialog] wrap -> [> | `Method] attrib val a_formmethod : - [< | `Get | `Post] wrap -> [> | `Formmethod] attrib + [< | `Get | `Post | `Dialog] wrap -> [> | `Formmethod] attrib val a_multiple : unit -> [> | `Multiple] attrib @@ -759,6 +1005,11 @@ module type T = sig val main : ([< | main_attrib], [< | main_content_fun], [> | main]) star + val search : + ([< | search_attrib], [< | search_content_fun], [> | search]) star + (** @see + search element documentation on MDN *) + (** {3 Grouping content} *) val p : ([< | p_attrib], [< | p_content_fun], [> | p]) star @@ -807,6 +1058,10 @@ module type T = sig val u : ([< | u_attrib], [< | u_content_fun], [> | u]) star + val s : ([< | s_attrib], [< | s_content_fun], [> | s]) star + (** @see + s element documentation on MDN *) + val small : ([< | small_attrib], [< | small_content_fun], [> | small]) star @@ -822,6 +1077,10 @@ module type T = sig dir: [< | `Ltr | `Rtl] wrap -> ([< | bdo_attrib], [< | bdo_content_fun], [> | bdo]) star + val bdi : ([< | bdi_attrib], [< | bdi_content_fun], [> | bdi]) star + (** @see + bdi element documentation on MDN *) + val abbr : ([< | abbr_attrib], [< | abbr_content_fun], [> | abbr]) star val br : ([< | br_attrib], [> | br]) nullary @@ -847,6 +1106,14 @@ module type T = sig val time : ([< | time_attrib], [< | time_content_fun], [> | time]) star + val data : + value: text wrap -> + ([< | data_attrib], [< | data_content_fun], [> | data]) star + (** [data ~value content] represents [content] together with its + machine-readable [value] attribute. + @see + data element documentation on MDN *) + val var : ([< | var_attrib], [< | var_content_fun], [> | var]) star (** {3 Hypertext} *) @@ -886,12 +1153,14 @@ module type T = sig val audio : ?src:Xml.uri wrap -> ?srcs:(([< | source] elt) list_wrap) -> + ?tracks:(([< | track] elt) list_wrap) -> ([< | audio_attrib], 'a, [> 'a audio ]) star [@@reflect.element "audio_video"] val video : ?src:Xml.uri wrap -> ?srcs: (([< | source] elt) list_wrap) -> + ?tracks:(([< | track] elt) list_wrap) -> ([< | video_attrib], 'a, [> 'a video]) star [@@reflect.element "audio_video"] @@ -899,6 +1168,12 @@ module type T = sig val source : ([< | source_attrib], [> | source]) nullary + val track : + src: Xml.uri wrap -> + ([< | track_attrib], [> | track]) nullary + (** @see + track element documentation on MDN *) + val area : alt: text wrap -> ([< @@ -1077,6 +1352,10 @@ module type T = sig (** @see Template element documentation on MDN *) + val slot : ([< | slot_attrib], 'a, [> | 'a slot]) star + (** @see + slot element documentation on MDN *) + val meta : ([< | meta_attrib], [> | meta]) nullary (** {3 Style Sheets} *) @@ -1241,6 +1520,11 @@ module type Wrapped_functions = sig val string_of_numbers : (Html_types.numbers, string) Xml.W.ft + val string_of_blocking : + ([< Html_types.blocking_token] list, string) Xml.W.ft + + val string_of_ol_type : ([< Html_types.ol_type], string) Xml.W.ft + val string_of_sandbox : ([< Html_types.sandbox_token] list, string) Xml.W.ft diff --git a/lib/html_types.mli b/lib/html_types.mli index 6318f0962..6eaac87a7 100644 --- a/lib/html_types.mli +++ b/lib/html_types.mli @@ -289,20 +289,36 @@ type i18n = [ | `XML_lang | `Lang ] type core = [ | `Accesskey + | `Autocapitalize + | `Autocorrect | `Class | `Contenteditable | `Contextmenu | `Dir | `Draggable + | `Enterkeyhint + | `Exportparts | `Hidden | `Id + | `Inert | i18n + | `Is + | `Itemid + | `Itemprop + | `Itemref + | `Itemscope + | `Itemtype + | `Nonce + | `Part + | `Popover + | `Slot | `Spellcheck | `Style_Attr | `Tabindex | `Translate | `Title | `User_data + | `Writingsuggestions | `XMLns ] @@ -312,13 +328,23 @@ type core = type events = [ | `OnAbort + | `OnAuxClick + | `OnBeforeInput + | `OnBeforeMatch + | `OnBeforeToggle | `OnBlur + | `OnCancel | `OnCanPlay | `OnCanPlayThrough | `OnChange | `OnClick | `OnClose | `OnContextMenu + | `OnContextLost + | `OnContextRestored + | `OnCopy + | `OnCut + | `OnCueChange | `OnDblClick | `OnDrag | `OnDragEnd @@ -342,6 +368,18 @@ type events = | `OnMouseMove | `OnMouseOut | `OnMouseWheel + | `OnWheel + | `OnPointerCancel + | `OnPointerDown + | `OnPointerEnter + | `OnPointerLeave + | `OnPointerMove + | `OnPointerOut + | `OnPointerOver + | `OnPointerUp + | `OnGotPointerCapture + | `OnLostPointerCapture + | `OnPaste | `OnPause | `OnPlay | `OnPlaying @@ -349,14 +387,18 @@ type events = | `OnRateChange | `OnReadyStateChange | `OnScroll + | `OnScrollEnd + | `OnSecurityPolicyViolation | `OnSeeked | `OnSeeking | `OnSelect | `OnShow + | `OnSlotChange | `OnStalled | `OnSubmit | `OnSuspend | `OnTimeUpdate + | `OnToggle | `OnTouchStart | `OnTouchEnd | `OnTouchMove @@ -447,6 +489,7 @@ type (+'interactive, +'noscript, +'regular, +'media) transparent = | `Del of 'regular | `Object of 'regular | `Object_interactive of 'regular + | `Slot of 'regular | `Audio_interactive of 'media | `Video_interactive of 'media | `Audio of 'media @@ -461,6 +504,7 @@ type (+'noscript, +'regular, +'media) transparent_without_interactive = | `Object of 'regular | `Canvas of 'regular | `Map of 'regular + | `Slot of 'regular | `Audio of 'media | `Video of 'media ] @@ -474,6 +518,7 @@ type (+'interactive, +'regular, +'media) transparent_without_noscript = | `Map of 'regular | `Object of 'regular | `Object_interactive of 'regular + | `Slot of 'regular | `Video of 'media | `Audio of 'media | `Video_interactive of 'media @@ -490,6 +535,7 @@ type (+'interactive, +'noscript, +'regular) transparent_without_media = | `Canvas of 'regular | `Object of 'regular | `Object_interactive of 'regular + | `Slot of 'regular ] (** Metadata without title *) @@ -550,6 +596,7 @@ type core_phrasing = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -561,11 +608,13 @@ type core_phrasing = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `Img | `Img_interactive @@ -590,6 +639,7 @@ type core_phrasing_without_noscript = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -601,11 +651,13 @@ type core_phrasing_without_noscript = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `Img | `Img_interactive | `Picture | `B @@ -628,6 +680,7 @@ type core_phrasing_without_interactive = | `Script | `Svg | `Samp + | `S | `Ruby | `Q | `Mark @@ -638,11 +691,13 @@ type core_phrasing_without_interactive = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -665,6 +720,7 @@ type core_phrasing_without_media = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -678,11 +734,13 @@ type core_phrasing_without_media = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -721,10 +779,10 @@ type (+'a, +'b) between_phrasing_and_phrasing_without_interactive = phrasing_without_noscript, phrasing, phrasing_without_media) transparent - > `Abbr `B `Bdo `Br `Canvas `Cite `Code `Command - `Datalist `Del `Dfn `Em `I `Img `Picture `Ins `Kbd `Map `Mark `Meter - `Noscript `Object `PCDATA `Progress `Q `Ruby `Samp `Script - `Small `Span `Strong `Sub `Sup `Svg `Template `Time `U `Var `Wbr ] as 'a) + > `Abbr `B `Bdi `Bdo `Br `Canvas `Cite `Code `Command + `Data `Datalist `Del `Dfn `Em `I `Img `Picture `Ins `Kbd `Map `Mark `Meter + `Noscript `Object `PCDATA `Progress `Q `Ruby `S `Samp `Script + `Slot `Small `Span `Strong `Sub `Sup `Svg `Template `Time `U `Var `Wbr ] as 'a) (** Phrasing without the interactive markups *) type phrasing_without_dfn = @@ -743,6 +801,7 @@ type phrasing_without_dfn = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -753,11 +812,13 @@ type phrasing_without_dfn = | `I | `Em | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -783,6 +844,7 @@ type phrasing_without_label = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -791,11 +853,13 @@ type phrasing_without_label = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -819,6 +883,7 @@ type phrasing_without_progress = | `Small | `Script | `Samp + | `S | `Img | `Img_interactive | `Picture | `Ruby @@ -831,12 +896,14 @@ type phrasing_without_progress = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Button | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -861,6 +928,7 @@ type phrasing_without_time = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -870,11 +938,13 @@ type phrasing_without_time = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -902,6 +972,7 @@ type phrasing_without_meter = | `Small | `Script | `Samp + | `S | `Ruby | `Q | `Mark @@ -911,11 +982,13 @@ type phrasing_without_meter = | `Em | `Dfn | `Datalist + | `Data | `Command | `Code | `Cite | `Br | `Bdo + | `Bdi | `B | `Abbr | `PCDATA @@ -940,6 +1013,7 @@ type core_flow5 = | `Details | `Main | `Dialog + | `Search ] type core_flow5_without_interactive = @@ -958,6 +1032,7 @@ type core_flow5_without_interactive = | `Dl | `Main | `Dialog + | `Search ] type core_flow5_without_noscript = @@ -977,6 +1052,7 @@ type core_flow5_without_noscript = | `Details | `Main | `Dialog + | `Search ] type core_flow5_without_media = [ @@ -995,6 +1071,7 @@ type core_flow5_without_media = | `Details | `Main | `Dialog + | `Search ] type flow5_without_interactive = @@ -1039,6 +1116,7 @@ type flow5_without_table = | `Details | `Main | `Dialog + | `Search | (flow5_without_interactive, flow5_without_noscript, flow5, flow5_without_media) transparent ] @@ -1065,6 +1143,7 @@ type flow5_without_interactive_header_footer = | `Dl | `Main | `Dialog + | `Search | (flow5_without_noscript, flow5, flow5_without_media) transparent_without_interactive ] @@ -1092,18 +1171,19 @@ type flow5_without_header_footer = | `Details | `Main | `Dialog + | `Search | (flow5_without_interactive_header_footer, flow5_without_noscript, flow5, flow5_without_media) transparent ] type +'a between_flow5_and_flow5_without_interactive_header_footer = - [< flow5 > `Abbr `Address `Article `Aside `Audio `B `Bdo `Blockquote `Br - `Button `Canvas `Cite `Code `Command `Datalist `Del `Dfn `Dialog `Div `Dl `Em + [< flow5 > `Abbr `Address `Article `Aside `Audio `B `Bdi `Bdo `Blockquote `Br + `Button `Canvas `Cite `Code `Command `Data `Datalist `Del `Dfn `Dialog `Div `Dl `Em `Fieldset `Figure `Form `H1 `H2 `H3 `H4 `H5 `H6 `Hgroup `Hr `I `Img `Picture `Input `Ins `Kbd `Keygen `Label `Map `Mark `Menu `Meter `Nav `Noscript - `Object `Ol `Output `P `PCDATA `Pre `Progress `Q `Ruby `Samp `Script - `Section `Select `Small `Span `Strong `Style `Sub `Sup `Svg `Table + `Object `Ol `Output `P `PCDATA `Pre `Progress `Q `Ruby `S `Samp `Script + `Search `Section `Select `Slot `Small `Span `Strong `Style `Sub `Sup `Svg `Table `Template `Textarea `Time `U `Ul `Var `Video `Wbr] as 'a type (+'a, +'b) between_flow5_and_flow5_without_header_footer = @@ -1113,13 +1193,13 @@ type (+'a, +'b) between_flow5_and_flow5_without_header_footer = flow5_without_media) transparent > `A `Abbr `Address `Article `Aside `Audio `Audio_interactive `B - `Bdo `Blockquote `Br `Button `Canvas `Cite `Code `Command - `Datalist `Del `Details `Dfn `Dialog `Div `Dl `Em `Embed `Fieldset + `Bdi `Bdo `Blockquote `Br `Button `Canvas `Cite `Code `Command + `Data `Datalist `Del `Details `Dfn `Dialog `Div `Dl `Em `Embed `Fieldset `Figure `Form `H1 `H2 `H3 `H4 `H5 `H6 `Hgroup `Hr `I `Iframe `Img `Img_interactive `Picture `Input `Ins `Kbd `Keygen `Label `Map `Mark `Menu `Meter `Nav `Noscript `Object `Object_interactive - `Ol `Output `P `PCDATA `Pre `Progress `Q `Ruby `Samp `Script - `Section `Select `Small `Span `Strong `Style `Sub `Sup `Svg + `Ol `Output `P `PCDATA `Pre `Progress `Q `Ruby `S `Samp `Script + `Search `Section `Select `Slot `Small `Span `Strong `Style `Sub `Sup `Svg `Table `Template `Textarea `Time `U `Ul `Var `Video `Video_interactive `Wbr ] as 'a @@ -1139,6 +1219,7 @@ type flow5_without_form = | `Details | `Main | `Dialog + | `Search | (flow5_without_interactive, flow5_without_noscript, flow5, flow5_without_media) transparent ] @@ -1163,6 +1244,7 @@ type flow5_without_sectioning_heading_header_footer_address = | `Details | `Main | `Dialog + | `Search | (flow5_without_interactive, flow5_without_noscript, flow5, flow5_without_media) transparent ] @@ -1210,6 +1292,7 @@ type body_attrib = | `OnBeforePrint | `OnBeforeUnload | `OnHashChange + | `OnLanguageChange | `OnMessage | `OnOffLine | `OnOnLine @@ -1217,9 +1300,11 @@ type body_attrib = | `OnPageShow | `OnPopState | `OnRedo + | `OnRejectionHandled | `OnResize | `OnStorage | `OnUndo + | `OnUnhandledRejection | `OnUnload ] @@ -1387,6 +1472,15 @@ type main_content_fun = [ | flow5 ] type main_attrib = [ | common ] +(* NAME: search, KIND: star, TYPE: [= common ], [= flow5 ], [=`Search], ARG: [= flow5 ], ATTRIB: OUT: [=`Search] *) +type search = [ | `Search ] + +type search_content = [ | flow5 ] + +type search_content_fun = [ | flow5 ] + +type search_attrib = [ | common ] + (* NAME: p, KIND: star, TYPE: [= common ], [=phrasing ], [=`P], ARG: [=phrasing ], ATTRIB: OUT: [=`P] *) type p = [ | `P ] @@ -1421,7 +1515,7 @@ type dialog_content = [ | flow5 ] type dialog_content_fun = [ | flow5 ] -type dialog_attrib = [ | common | `Open ] +type dialog_attrib = [ | common | `Open | `Closedby ] (* NAME: div, KIND: star, TYPE: [= common ], [= flow5 ], [=`Div], ARG: [= flow5 ], ATTRIB: OUT: [=`Div] *) type div = [ | `Div ] @@ -1439,7 +1533,7 @@ type ol_content = [ | `Li of [ | common | `Int_Value ] ] type ol_content_fun = [ | `Li of [ | common | `Int_Value ] ] -type ol_attrib = [ | common | `Reversed | `Start ] +type ol_attrib = [ | common | `Reversed | `Start | `Ol_Type ] (* NAME: li, KIND: star, TYPE: [= common | `Int_Value] as 'a, [=flow5 ], [=`Li of 'a], ARG: [=flow5 ], ATTRIB: OUT: [=`Li of 'a] *) type li_content = [ | flow5 ] @@ -1559,6 +1653,15 @@ type u_content_fun = [ | phrasing ] type u_attrib = [ | common ] +(* NAME: s, KIND: star, TYPE: [= common ], [= phrasing ], [=`S], ARG: [= phrasing ], ATTRIB: OUT: [=`S] *) +type s = [ | `S ] + +type s_content = [ | phrasing ] + +type s_content_fun = [ | phrasing ] + +type s_attrib = [ | common ] + (* NAME: small, KIND: star, TYPE: [= common ], [= phrasing ], [=`Small], ARG: [= phrasing ], ATTRIB: OUT: [=`Small] *) type small = [ | `Small ] @@ -1613,6 +1716,15 @@ type bdo_content_fun = [ | phrasing ] type bdo_attrib = [ | common ] +(* NAME: bdi, KIND: star, TYPE: [= common ],[= phrasing ],[= `Bdi ], ARG: [= phrasing ], ATTRIB: OUT: [= `Bdi ] *) +type bdi = [ | `Bdi ] + +type bdi_content = [ | phrasing ] + +type bdi_content_fun = [ | phrasing ] + +type bdi_attrib = [ | common ] + (* NAME: abbr, KIND: star, TYPE: [= common ], [=phrasing ], [=`Abbr], ARG: [=phrasing ], ATTRIB: OUT: [=`Abbr] *) type abbr = [ | `Abbr ] @@ -1712,6 +1824,15 @@ type strong_content_fun = [ | phrasing ] type strong_attrib = [ | common ] +(* NAME: data, KIND: star, TYPE: [= common ], [= phrasing ], [=`Data], ARG: [= phrasing ], ATTRIB: OUT: [=`Data] *) +type data = [ | `Data ] + +type data_content = [ | phrasing ] + +type data_content_fun = [ | phrasing ] + +type data_attrib = [ | common ] + (* NAME: time, KIND: star, TYPE: [= common |`Datetime |`Pubdate], [= phrasing_without_time ], [=`Time], ARG: [= phrasing_without_time ], ATTRIB: OUT: [=`Time] *) type time = [ | `Time ] @@ -1739,7 +1860,7 @@ type 'a a = [ | `A of 'a ] type a_ = [ `A of a_content ] (* should not be used as it may break *) type a_attrib = [ | common | `Href | `Hreflang | `Media | `Rel | `Target | `Mime_type - | `Download + | `Download | `Ping | `Referrerpolicy ] (* NAME: del, KIND: star, TYPE: [= common | `Cite | `Datetime ], 'a,[=`Del of 'a], ARG: 'a, ATTRIB: OUT: [=`Del of 'a] *) @@ -1769,16 +1890,18 @@ type iframe_content_fun = [ | `PCDATA ] type iframe_attrib = [ | common + | `Allow | `Allowfullscreen | `Allowpaymentrequest | `Src - | (*| `Srcdoc*) - `Name + | `Srcdoc + | `Name | `Sandbox | `Seamless | `Width | `Height | `Referrerpolicy + | `Loading ] type object__content = [ | flow5 | `Param ] @@ -1821,7 +1944,11 @@ type img = [ `Img ] type img_interactive = [ `Img | `Img_interactive ] type img_content = notag type img_content_fun = notag -type img_attrib = [ | common | `Height | `Ismap | `Width | `Srcset | `Img_sizes] +type img_attrib = + [ | common | `Height | `Ismap | `Width | `Srcset | `Img_sizes + | `Crossorigin | `Usemap | `Referrerpolicy + | `Loading | `Decoding | `Fetchpriority + ] (* Attributes used by audio and video. *) type media_attrib = @@ -1832,6 +1959,7 @@ type media_attrib = | `Loop | `Muted | `Controls + | `Disableremoteplayback ] type 'a audio = [ | `Audio of 'a ] @@ -1860,6 +1988,8 @@ type video_attrib = | `Poster | `Width | `Height + | `Playsinline + | `Disablepictureinpicture ] (* NAME: canvas, KIND: star, TYPE: [= common |`Width |`Height],'a, [=`Canvas of 'a], ARG: 'a, ATTRIB: OUT: [=`Canvas of 'a] *) @@ -1880,6 +2010,15 @@ type source_content_fun = notag type source_attrib = [ | common | `Src | `Srcset | `Mime_type | `Media ] +(* NAME: track, KIND: nullary, TYPE: [= common |`Kind |`Srclang |`Label |`Default ], [=`Track], ARG: notag, ATTRIB: OUT: [=`Track] *) +type track = [ | `Track ] + +type track_content = notag + +type track_content_fun = notag + +type track_attrib = [ | common | `Kind | `Srclang | `Label | `Default ] + (* NAME: area, KIND: nullary, TYPE: [= common | `Alt | `Coords | `Shape| `Target | `Rel | `Media| `Hreflang | `Mime_type],[=`Area], ARG: notag, ATTRIB: OUT: [=`Area] *) type area = [ | `Area ] @@ -1899,6 +2038,8 @@ type area_attrib = | `Hreflang | `Mime_type | `Download + | `Ping + | `Referrerpolicy ] (* NAME: map, KIND: plus, TYPE: [=common | `Name ],'a, [=`Map of 'a], ARG: 'a, ATTRIB: OUT: [=`Map of 'a] *) @@ -1999,7 +2140,7 @@ type th_content = [ | flow5 ] type th_content_fun = [ | flow5 ] -type th_attrib = [ | common | `Colspan | `Headers | `Rowspan | `Scope ] +type th_attrib = [ | common | `Colspan | `Headers | `Rowspan | `Scope | `Abbr ] (* NAME: tr, KIND: star, TYPE: [= common ],[= `Td | `Th ], [=`Tr], ARG: [= `Td | `Th ], ATTRIB: OUT: [=`Tr] *) type tr = [ | `Tr ] @@ -2099,6 +2240,10 @@ type input_attrib = | `Value | `Width | `Inputmode + | `Popovertarget + | `Popovertargetaction + | `Dirname + | `Capture ] type textarea = [ | `Textarea ] @@ -2118,6 +2263,8 @@ type textarea_attrib = | `Wrap | `Rows | `Cols + | `Dirname + | `Autocomplete ] type textarea_content = [ | `PCDATA ] @@ -2146,6 +2293,10 @@ type button_attrib = | `Name | `Text_Value | `Button_Type + | `Popovertarget + | `Popovertargetaction + | `Command + | `Commandfor ] (* NAME: select, KIND: star, TYPE: [= common |`Autofocus | `Multiple | `Name | `Size | `Form | `Disabled ], [ `Optgroup | `Option ],[=`Select], ARG: [ `Optgroup | `Option ], ATTRIB: OUT: [=`Select] *) @@ -2157,6 +2308,7 @@ type select_content_fun = [ | `Optgroup | `Option ] type select_attrib = [ | common | `Autofocus | `Multiple | `Name | `Size | `Form | `Disabled | `Required + | `Autocomplete ] (* NAME: datalist, KIND: nullary, TYPE: [= common ], [=`Datalist], ARG: notag, ATTRIB: OUT: [=`Datalist] *) @@ -2280,7 +2432,8 @@ type meta_content = notag type meta_content_fun = notag -type meta_attrib = [ | common | `Http_equiv | `Name | `Content | `Charset | `Property ] +type meta_attrib = + [ | common | `Http_equiv | `Name | `Content | `Charset | `Property | `Media ] (* NAME: style, KIND: star, TYPE: [= common | `Media | `Mime_type | `Scoped ], [= `PCDATA ], [=`Style], ARG: [= `PCDATA ], ATTRIB: OUT: [=`Style] *) type style = [ | `Style ] @@ -2289,13 +2442,14 @@ type style_content = [ | `PCDATA ] type style_content_fun = [ | `PCDATA ] -type style_attrib = [ | common | `Media | `Mime_type | `Scoped ] +type style_attrib = [ | common | `Media | `Mime_type | `Scoped | `Blocking ] type script = [ | `Script ] type script_attrib = [ | common | subresource_integrity | `Async | `Charset | `Src | `Defer | `Script_type + | `Blocking | `Fetchpriority | `Nomodule | `Referrerpolicy ] type script_content = [ | `PCDATA ] @@ -2305,12 +2459,27 @@ type script_content_fun = [ | `PCDATA ] (* NAME: template, KIND: star, TYPE: [= common ], [= flow5 ], [=`Template], ARG: [= flow5 ], ATTRIB: OUT: [=`Template] *) type template = [ | `Template ] -type template_attrib = [ | common ] +type template_attrib = + [ | common + | `Shadowrootmode + | `Shadowrootdelegatesfocus + | `Shadowrootclonable + | `Shadowrootserializable + ] type template_content = [ | flow5 ] type template_content_fun = [ | flow5 ] +(* NAME: slot, KIND: star, TYPE: [= common | `Name ],'a, [=`Slot of 'a], ARG: 'a, ATTRIB: OUT: [=`Slot of 'a] *) +type 'a slot = [ | `Slot of 'a ] + +type slot_content = flow5 +type slot_ = slot_content slot +type slot_content_fun = flow5 + +type slot_attrib = [ | common | `Name ] + (* NAME: link, KIND: nullary, TYPE: [= common | `Hreflang | `Media | `Rel | `Href | `Sizes | `Mime_type ], [=`Link], ARG: notag, ATTRIB: OUT: [=`Link] *) type link = [ | `Link ] @@ -2321,6 +2490,8 @@ type link_content_fun = notag type link_attrib = [ | common | subresource_integrity | `Hreflang | `Media | `Rel | `Href | `Sizes | `Mime_type + | `As | `Imagesrcset | `Imagesizes | `Blocking | `Fetchpriority + | `Disabled | `Referrerpolicy ] type picture = [ | `Picture ] @@ -2347,6 +2518,7 @@ type big_variant = | `Selected | `Get | `Post + | `Dialog | `Checked | `Disabled | `ReadOnly @@ -2367,6 +2539,10 @@ type big_variant = | `Open | `Audio | `Metadata + | `Subtitles + | `Captions + | `Descriptions + | `Chapters | `None | `Pubdate | `Required @@ -2401,8 +2577,52 @@ type big_variant = | `One | `Zero | `Auto + | `Manual + | `Hint | `No | `Yes + | `On + | `Off + | `Enter + | `Done + | `Go + | `Next + | `Previous + | `Send + | `Sentences + | `Words + | `Characters + | `Show + | `Hide + | `Toggle + | `Show_modal + | `Close + | `Request_close + | `Show_popover + | `Hide_popover + | `Toggle_popover + | `Other of string + | `Lazy + | `Eager + | `Sync + | `High + | `Low + | `User + | `Environment + | `Any + | `Closerequest + | `Closed + | `Document + | `Embed + | `Fetch + | `Font + | `Image + | `Object + | `Script + | `Style + | `Track + | `Video + | `Worker | `Defer | `Verbatim | `Latin @@ -2421,12 +2641,21 @@ type big_variant = ] type sandbox_token = - [ `Allow_forms + [ `Allow_downloads + | `Allow_forms + | `Allow_modals + | `Allow_orientation_lock | `Allow_pointer_lock | `Allow_popups - | `Allow_top_navigation + | `Allow_popups_to_escape_sandbox + | `Allow_presentation | `Allow_same_origin - | `Allow_script ] + | `Allow_script + | `Allow_top_navigation + | `Allow_top_navigation_by_user_activation + | `Allow_top_navigation_to_custom_protocols ] + +type blocking_token = [ `Render ] type input_type = @@ -2457,3 +2686,21 @@ type input_type = type script_type = [ `Javascript | `Module | `Mime of string ] type autocomplete_option = [ `On | `Off | `Tokens of string list] + +type popover_value = [ `Auto | `Manual | `Hint ] + +(** Values of the [type] attribute of ordered lists. The serialized + values are case-sensitive ("1", "a", "A", "i", "I"). *) +type ol_type = + [ `Decimal | `Lower_alpha | `Upper_alpha | `Lower_roman | `Upper_roman ] + +(** Values for the [command] attribute of button elements. Custom + commands (starting with [--]) use the [`Other] constructor. *) +type command_value = + [ `Show_modal + | `Close + | `Request_close + | `Show_popover + | `Hide_popover + | `Toggle_popover + | `Other of string ] [@@reflect.total_variant] diff --git a/lib/svg_f.mli b/lib/svg_f.mli index 476c15fbe..0375f48e6 100644 --- a/lib/svg_f.mli +++ b/lib/svg_f.mli @@ -99,7 +99,7 @@ module Wrapped_functions (** Similar to {!Make} but with a custom set of wrapped functions. *) module Make_with_wrapped_functions (Xml : Xml_sigs.T) - (C : Svg_sigs.Wrapped_functions with module Xml = Xml) + (_ : Svg_sigs.Wrapped_functions with module Xml = Xml) : Svg_sigs.Make(Xml).T with type +'a elt = Xml.elt and type +'a attrib = Xml.attrib diff --git a/lib/xml_print.mli b/lib/xml_print.mli index 782fa56a7..54a5fc927 100644 --- a/lib/xml_print.mli +++ b/lib/xml_print.mli @@ -103,7 +103,7 @@ module type TagList = sig val emptytags : string list end (** Printers for raw XML modules. *) module Make_fmt (Xml : Xml_sigs.Iterable) - (I : TagList) + (_ : TagList) : Xml_sigs.Pp with type elt := Xml.elt (** {2 Deprecated functors} @@ -113,7 +113,7 @@ module Make_fmt module Make (Xml : Xml_sigs.Iterable) - (I : TagList) + (_ : TagList) (O : Xml_sigs.Output) : Xml_sigs.Printer with type out := O.out and type xml_elt := Xml.elt [@@ocaml.deprecated "Use Xml_print.Make_fmt instead."] @@ -129,7 +129,7 @@ module Make_typed module Make_simple (Xml : Xml_sigs.Iterable) - (I : TagList) + (_ : TagList) : Xml_sigs.Simple_printer with type xml_elt := Xml.elt [@@ocaml.deprecated "Use Xml_print.Make_fmt instead."] diff --git a/syntax/attribute_value.ml b/syntax/attribute_value.ml index 4630d6e11..d53994c7f 100644 --- a/syntax/attribute_value.ml +++ b/syntax/attribute_value.ml @@ -580,6 +580,24 @@ let script_type = let sandbox = spaces variant +let blocking = spaces variant + +(* The values of the ol type attribute are case-sensitive ("a" and + "A" are distinct), so the generic variant parser cannot be used. *) +let ol_type ?separated_by:_ ?default:_ loc name s = + begin match s with + | "1" -> Some [%expr `Decimal] + | "a" -> Some [%expr `Lower_alpha] + | "A" -> Some [%expr `Upper_alpha] + | "i" -> Some [%expr `Lower_roman] + | "I" -> Some [%expr `Upper_roman] + | _ -> Common.error loc "Invalid value %s in attribute %s" s name + end [@metaloc loc] + +let popover = variant_or_empty "Auto" + +let command = total_variant Html_types_reflected.command_value + let in_ = total_variant Svg_types_reflected.in_value let in2 = in_ diff --git a/syntax/attribute_value.mli b/syntax/attribute_value.mli index 339afa6bd..f5814b151 100644 --- a/syntax/attribute_value.mli +++ b/syntax/attribute_value.mli @@ -220,6 +220,10 @@ val script_type : parser These parsers are named after the attribute for which they are used. *) val sandbox : parser +val blocking : parser +val ol_type : parser +val popover : parser +val command : parser val in_ : parser val in2 : parser val xmlns : parser diff --git a/syntax/element_content.ml b/syntax/element_content.ml index 8a352cc75..ce20cb412 100644 --- a/syntax/element_content.ml +++ b/syntax/element_content.ml @@ -160,12 +160,17 @@ let object_ ~lang ~loc ~name children = let audio_video ~lang ~loc ~name children = let sources, others = partition (html "source") children in + let tracks, others = partition (html "track") others in - if sources <> [] then - (Labelled "srcs", Common.list_wrap_value lang loc sources) :: - star ~lang ~loc ~name others - else - star ~lang ~loc ~name others + let sources = + if sources = [] then [] + else [Labelled "srcs", Common.list_wrap_value lang loc sources] + in + let tracks = + if tracks = [] then [] + else [Labelled "tracks", Common.list_wrap_value lang loc tracks] + in + sources @ tracks @ star ~lang ~loc ~name others let table ~lang ~loc ~name children = let caption, others = partition (html "caption") children in diff --git a/test/test_html.ml b/test/test_html.ml index c64d4f1c5..bfa1c3798 100644 --- a/test/test_html.ml +++ b/test/test_html.ml @@ -6,10 +6,161 @@ let html_elements = "html elements", tyxml_tests Html.[ dialog ~a:[a_open ()] [div []], "
" ; + "s", + p [s [txt "old price"]], + "

old price

" ; + + "form method dialog", + form ~a:[a_method `Dialog] [], + "
" ; + + "iframe sandbox tokens", + iframe ~a:[a_sandbox [`Allow_downloads; `Allow_modals; + `Allow_popups_to_escape_sandbox]] [], + "" ; + + "bdi", + p [bdi [txt "user123"]], + "

user123

" ; + + "search", + search [p [txt "results"]], + "

results

" ; + + "data", + p [data ~value:"42" [txt "forty-two"]], + "

forty-two

" ; + + "slot", + div [slot ~a:[a_name "icon"] [txt "fallback"]], + "
fallback
" ; + + "track", + video ~tracks:[ + track ~src:"video_en.vtt" + ~a:[a_kind `Subtitles; a_track_srclang "en"; + a_label "English"; a_default ()] () + ] [], + "" ; + "div", div [a []], "
" ; + "global event handlers", + div ~a:[a_onbeforetoggle "b()"; a_ontoggle "t()"; a_oncopy "c()"; + a_onpaste "p()"; a_onscrollend "s()"] [], + "
" ; + + "pointer events", + div ~a:[a_onpointerdown "d()"; a_onwheel "w()"; a_onauxclick "a()"] [], + "
" ; + + "declarative shadow DOM", + div [template ~a:[a_shadowrootmode `Open; a_shadowrootdelegatesfocus (); + a_shadowrootclonable (); a_shadowrootserializable ()] + [p [txt "shadow"]]], + "
" ; + + "video attributes", + video ~a:[a_playsinline (); a_disablepictureinpicture (); + a_disableremoteplayback ()] [], + "" ; + + "ol type", + ol ~a:[a_ol_type `Upper_roman; a_start 3] [li [txt "x"]], + "
  1. x
" ; + + "th abbr", + tablex [tbody [tr [th ~a:[a_abbr "Pop."] [txt "Population"]]]], + "
Population
" ; + + "dialog closedby", + dialog ~a:[a_closedby `Closerequest] [div []], + "
" ; + + "form control attributes", + div [ + input ~a:[a_input_type `File; a_capture `Environment] () ; + input ~a:[a_input_type `Text; a_name "comment"; + a_dirname "comment.dir"] () ; + textarea ~a:[a_dirname "t.dir"; a_autocomplete `Off] (txt "") ; + select ~a:[a_autocomplete `Off] [] + ], + "
" + ^ "" + ^ "" + ^ "
" ; + + "a ping", + p [a ~a:[a_href "/x"; a_ping ["https://t.example/ping"]; + a_referrerpolicy `No_referrer] [txt "x"]], + "

x

" ; + + "script nomodule", + script ~a:[a_nomodule (); a_blocking [`Render]] (txt ""), + "" ; + + "img loading", + img ~src:"x.png" ~alt:"x" + ~a:[a_loading `Lazy; a_decoding `Async; a_fetchpriority `Low] (), + "\"x\"" ; + + "iframe srcdoc", + iframe ~a:[a_srcdoc "

Hi

"; a_allow "fullscreen"; a_loading `Lazy] [], + "" ; + + "popovertarget", + button ~a:[a_popovertarget "pop"; a_popovertargetaction `Toggle] + [txt "Toggle"], + "" ; + + "invoker commands", + div [ + button ~a:[a_commandfor "dlg"; a_command `Show_modal] [txt "Open"] ; + button ~a:[a_commandfor "dlg"; a_command (`Other "--my-cmd")] + [txt "Custom"] + ], + "
" + ^ "
" ; + + "shadow parts", + div ~a:[a_part ["label"; "value"]; + a_exportparts ["inner-label"; "inner-value:value"]] [], + "
" ; + + "microdata", + div ~a:[a_itemscope (); a_itemtype ["https://schema.org/Person"]; + a_itemid "urn:isbn:123"; a_itemref ["a"; "b"]] + [span ~a:[a_itemprop ["name"]] [txt "X"]], + "
" + ^ "X
" ; + + "global attributes", + div ~a:[a_popover `Auto; a_inert (); a_dir `Auto; + a_autocapitalize `Words; a_autocorrect true; + a_writingsuggestions false; a_enterkeyhint `Go; + a_nonce "n0nce"; a_slot "myslot"; a_is "word-count"] [], + "
" ; + "input", input ~a:[a_formaction "post.html"; a_formmethod `Post] (), ""; diff --git a/test/test_jsx.re b/test/test_jsx.re index 18a5d4a7c..481c5ba68 100644 --- a/test/test_jsx.re +++ b/test/test_jsx.re @@ -186,6 +186,34 @@ let attribs = ( [|}]], + [script ~a:[a_nomodule (); a_src "a.js"] (txt "") ]; + + "img loading", + [[%html {|x|}]], + [img ~src:"x.png" ~alt:"x" + ~a:[a_loading `Eager; a_decoding `Auto; a_fetchpriority `High] () ]; + + "iframe srcdoc", + [[%html {||}]], + [iframe ~a:[a_srcdoc "hello"; a_allow "fullscreen"; a_loading `Lazy] [] ]; + + "popovertarget", + [[%html {||}]], + [button ~a:[a_popovertarget "p"; a_popovertargetaction `Toggle] + [txt "x"] ]; + + "invoker commands", + [[%html {||}]], + [button ~a:[a_commandfor "d"; a_command `Request_close] [txt "x"] ]; + + "custom command", + [[%html {||}]], + [button ~a:[a_commandfor "d"; a_command (`Other "--my-cmd")] [txt "x"] ]; + + "shadow parts", + [[%html {||}]], + [span ~a:[a_part ["label"; "value"]; a_exportparts ["a"; "b:c"]] [] ]; + + "microdata", + [[%html {|
X
|}]], + [div ~a:[a_itemscope (); a_itemtype ["https://schema.org/Person"]; + a_itemid "urn:isbn:123"; a_itemref ["a"; "b"]] + [span ~a:[a_itemprop ["name"]] [txt "X"]] ]; + + "popover bare", + [[%html {|
|}]], + [div ~a:[a_popover `Auto] [] ]; + + "popover manual", + [[%html {|
|}]], + [div ~a:[a_popover `Manual] [] ]; + + "global attributes", + [[%html {|
|}]], + [div ~a:[a_inert (); a_dir `Auto; a_autocapitalize `Sentences; + a_autocorrect false; a_writingsuggestions true; + a_enterkeyhint `Send; a_nonce "n"; a_slot "s"; + a_is "my-elt"] [] ]; + + "track in video", + [[%html {||}]], + [video ~tracks:[track ~src:"v.vtt" + ~a:[a_kind `Subtitles; a_track_srclang "en"; a_default ()] ()] []]; + "picture", [[%html {|
test picture/img.png