From 40716d5fef3919e7ef582a55c5e27009231e2aec Mon Sep 17 00:00:00 2001 From: Vincent Balat Date: Thu, 16 Jul 2026 12:11:46 +0200 Subject: [PATCH 1/3] Fix unused functor parameter warnings (warning 67) Recent compilers in the dune development profile treat warning 67 (unused functor parameter) as an error, which breaks make build and the CI on every platform. The parameters are only used for their side effects on behavior, not in the result signatures, so they can be anonymous. --- CHANGES.md | 3 +++ lib/html_f.mli | 2 +- lib/svg_f.mli | 2 +- lib/xml_print.mli | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9f625a7ad..5c1dfba19 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # NEXT +* Fix the development-profile build with recent compilers: anonymize + unused functor parameters in printer and functor signatures + (warning 67) * 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.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/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."] From 9fd297fb0883012c2f62a414a90dd224ae7d0c81 Mon Sep 17 00:00:00 2001 From: Vincent Balat Date: Thu, 16 Jul 2026 13:05:07 +0200 Subject: [PATCH 2/3] Undeprecate the scope attribute The scope attribute on table header cells is part of the HTML living standard (its values are row, col, rowgroup and colgroup); it was wrongly marked deprecated as "Not supported in HTML5". --- CHANGES.md | 2 ++ lib/html_sigs.mli | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5c1dfba19..413ca7050 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,8 @@ * Fix the development-profile build with recent compilers: anonymize unused functor parameters in printer and functor signatures (warning 67) +* Undeprecate the `scope` attribute: it is valid in the HTML living + standard on table header cells * Fix typo `whitout` in type definition (#324 by Martin @MBodin Bodin) * Add support for the clip-path presentation attribute diff --git a/lib/html_sigs.mli b/lib/html_sigs.mli index 60750f6c7..ba7d73ebc 100644 --- a/lib/html_sigs.mli +++ b/lib/html_sigs.mli @@ -602,8 +602,9 @@ module type T = sig val a_scope : [< | `Row | `Col | `Rowgroup | `Colgroup] wrap -> [> | `Scope] attrib - [@@ocaml.deprecated "Not supported in HTML5"] - (** @deprecated Not supported in HTML5 *) + (** Specifies the cells that a header cell applies to. + @see + scope attribute documentation on MDN *) val a_summary : text wrap -> [> | `Summary] attrib [@@ocaml.deprecated "Move content elsewhere or to a child"] From a7a1edc1dad5a6e3e52e510e2eabd548fea7ae19 Mon Sep 17 00:00:00 2001 From: Vincent Balat Date: Thu, 16 Jul 2026 13:10:11 +0200 Subject: [PATCH 3/3] Modernize the hidden and contenteditable attributes (breaking) The hidden attribute now takes an enumerated argument ([`Hidden | `Until_found]) instead of no argument, and contenteditable takes an enumerated argument ([`True | `False | `Plaintext_only]) instead of a boolean. This lets one express the until-found and plaintext-only states added to the standard. A bare attribute parses as `Hidden and `True respectively. Both use a named value type routed to the variant_or_empty PPX parser, following the referrerpolicy precedent. Spec: https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute and https://html.spec.whatwg.org/multipage/interaction.html#attr-contenteditable --- CHANGES.md | 5 +++++ lib/html_f.ml | 12 ++++++++---- lib/html_sigs.mli | 13 +++++++++++-- lib/html_types.mli | 8 ++++++++ syntax/reflect/reflect.ml | 6 ++++++ test/test_jsx.re | 14 +++++++++++++- test/test_ppx.ml | 24 ++++++++++++++++++++---- 7 files changed, 71 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 413ca7050..e5dfc98e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,11 @@ * Fix the development-profile build with recent compilers: anonymize unused functor parameters in printer and functor signatures (warning 67) +* Breaking: the `hidden` attribute now takes an enumerated argument + ([`Hidden | `Until_found]) instead of no argument, and + `contenteditable` takes an enumerated argument + ([`True | `False | `Plaintext_only]) instead of a boolean, to + support the until-found and plaintext-only states * Undeprecate the `scope` attribute: it is valid in the HTML living standard on table header cells * Fix typo `whitout` in type definition diff --git a/lib/html_f.ml b/lib/html_f.ml index d163a82e4..5d603706b 100644 --- a/lib/html_f.ml +++ b/lib/html_f.ml @@ -307,8 +307,8 @@ struct let a_challenge = string_attrib "challenge" - let a_contenteditable ce = - bool_attrib "contenteditable" ce + let a_contenteditable x = + user_attrib C.string_of_big_variant "contenteditable" x let a_contextmenu = string_attrib "contextmenu" @@ -332,8 +332,8 @@ struct let a_formtarget = string_attrib "formtarget" - let a_hidden = - constant_attrib "hidden" + let a_hidden x = + user_attrib C.string_of_big_variant "hidden" x let a_high = float_attrib "high" @@ -1001,6 +1001,10 @@ struct | `One -> "1" | `Yes -> "yes" | `No -> "no" + | `True -> "true" + | `False -> "false" + | `Plaintext_only -> "plaintext-only" + | `Until_found -> "until-found" | `Auto -> "auto" | `Circle -> "circle" | `Poly -> "poly" diff --git a/lib/html_sigs.mli b/lib/html_sigs.mli index ba7d73ebc..d15f9c63f 100644 --- a/lib/html_sigs.mli +++ b/lib/html_sigs.mli @@ -282,7 +282,12 @@ module type T = sig val a_challenge : text wrap -> [> | `Challenge] attrib - val a_contenteditable : bool wrap -> [> | `Contenteditable] attrib + val a_contenteditable : + contenteditable_value wrap -> [> | `Contenteditable] attrib + (** A bare [contenteditable] attribute is equivalent to + [contenteditable="true"]. + @see + contenteditable attribute documentation on MDN *) val a_contextmenu : idref wrap -> [> | `Contextmenu] attrib @@ -302,7 +307,11 @@ module type T = sig val a_formtarget : text wrap -> [> | `Formtarget] attrib - val a_hidden : unit -> [> | `Hidden] attrib + val a_hidden : hidden_value wrap -> [> | `Hidden] attrib + (** A bare [hidden] attribute is equivalent to [hidden="hidden"]; + use [`Until_found] for the hidden-until-found state. + @see