Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the popover API and for the name attribute on details elements. #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* Add support for the clip-path presentation attribute
(#333 by Martin @MBodin Bodin)

* Add support for the `popover` API and for the `name` attribute on
`<details>` elements
(#341 by @SylvainBoilard)

# 4.6.0

* Update for OCaml 5.0 and drop support for OCaml 4.2.0
Expand Down
14 changes: 14 additions & 0 deletions lib/html_f.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ struct
let a_onabort = Xml.event_handler_attrib "onabort"
let a_onafterprint = Xml.event_handler_attrib "onafterprint"
let a_onbeforeprint = Xml.event_handler_attrib "onbeforeprint"
let a_onbeforetoggle = Xml.event_handler_attrib "onbeforetoggle"
let a_onbeforeunload = Xml.event_handler_attrib "onbeforeunload"
let a_onblur = Xml.event_handler_attrib "onblur"
let a_oncanplay = Xml.event_handler_attrib "oncanplay"
Expand Down Expand Up @@ -151,6 +152,7 @@ struct
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"
Expand Down Expand Up @@ -374,6 +376,14 @@ struct

let a_placeholder = string_attrib "placeholder"

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_poster = uri_attrib "poster"

let a_preload x =
Expand Down Expand Up @@ -1002,6 +1012,7 @@ struct
| `Yes -> "yes"
| `No -> "no"
| `Auto -> "auto"
| `Manual -> "manual"
| `Circle -> "circle"
| `Poly -> "poly"
| `Alternate -> "alternate"
Expand Down Expand Up @@ -1039,6 +1050,9 @@ struct
| `Url -> "url"
| `Text -> "text"
| `Decimal -> "decimal"
| `Hide -> "hide"
| `Show -> "show"
| `Toggle -> "toggle"
| `Other s -> s

let string_of_input_type = function
Expand Down
8 changes: 8 additions & 0 deletions lib/html_sigs.mli
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ module type T = sig
val a_onabort : Xml.event_handler -> [> | `OnAbort] attrib
val a_onafterprint : Xml.event_handler -> [> | `OnAfterPrint] attrib
val a_onbeforeprint : Xml.event_handler -> [> | `OnBeforePrint] attrib
val a_onbeforetoggle : Xml.event_handler -> [> | `OnBeforeToggle] attrib
val a_onbeforeunload : Xml.event_handler -> [> | `OnBeforeUnload] attrib
val a_onblur : Xml.event_handler -> [> | `OnBlur] attrib
val a_oncanplay : Xml.event_handler -> [> | `OnCanPlay] attrib
Expand Down Expand Up @@ -215,6 +216,7 @@ module type T = sig
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
Expand Down Expand Up @@ -343,6 +345,12 @@ module type T = sig

val a_placeholder : text wrap -> [> | `Placeholder] attrib

val a_popover : [< | `Auto | `Manual] wrap -> [> | `Popover] attrib

val a_popovertarget : text wrap -> [> | `Popovertarget] attrib

val a_popovertargetaction : [< | `Hide | `Show | `Toggle] wrap -> [> | `Popovertargetaction] attrib

val a_poster : Xml.uri wrap -> [> | `Poster] attrib

val a_preload : [< | `None | `Metadata | `Audio] wrap -> [> | `Preload] attrib
Expand Down
13 changes: 12 additions & 1 deletion lib/html_types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ type core =
| `Hidden
| `Id
| i18n
| `Popover
| `Spellcheck
| `Style_Attr
| `Tabindex
Expand All @@ -312,6 +313,7 @@ type core =
type events =
[
| `OnAbort
| `OnBeforeToggle
| `OnBlur
| `OnCanPlay
| `OnCanPlayThrough
Expand Down Expand Up @@ -357,6 +359,7 @@ type events =
| `OnSubmit
| `OnSuspend
| `OnTimeUpdate
| `OnToggle
| `OnTouchStart
| `OnTouchEnd
| `OnTouchMove
Expand Down Expand Up @@ -2090,6 +2093,8 @@ type input_attrib =
| `Name
| `Pattern
| `Placeholder
| `Popovertarget
| `Popovertargetaction
| `ReadOnly
| `Required
| `Size
Expand Down Expand Up @@ -2144,6 +2149,8 @@ type button_attrib =
| `Formnovalidate
| `Formtarget
| `Name
| `Popovertarget
| `Popovertargetaction
| `Text_Value
| `Button_Type
]
Expand Down Expand Up @@ -2233,7 +2240,7 @@ type details_content = [ | flow5 ]

type details_content_fun = [ | flow5 ]

type details_attrib = [ | common | `Open ]
type details_attrib = [ | common | `Open | `Name ]

(* NAME: summary, KIND: star, TYPE: [= common ],[= phrasing ], [=`Summary], ARG: [= phrasing ], ATTRIB: OUT: [=`Summary] *)
type summary = [ | `Summary ]
Expand Down Expand Up @@ -2401,6 +2408,7 @@ type big_variant =
| `One
| `Zero
| `Auto
| `Manual
| `No
| `Yes
| `Defer
Expand All @@ -2418,6 +2426,9 @@ type big_variant =
| `Text
| `Decimal
| `Search
| `Hide
| `Show
| `Toggle
]

type sandbox_token =
Expand Down