Skip to content

Modernize hidden and contenteditable attributes, undeprecate scope (breaking)#368

Open
balat wants to merge 3 commits into
masterfrom
html-modernize-breaking
Open

Modernize hidden and contenteditable attributes, undeprecate scope (breaking)#368
balat wants to merge 3 commits into
masterfrom
html-modernize-breaking

Conversation

@balat

@balat balat commented Jul 16, 2026

Copy link
Copy Markdown
Member

This is the breaking-change counterpart to #366. It modernizes the typing of two enumerated attributes to match the HTML living standard, and fixes one wrong deprecation.

Breaking changes

  • hidden now takes an enumerated argument [< Hidden | Until_found ] instead of no argument. This is required to express the hidden="until-found" state. A bare hidden (or hidden="" / hidden="hidden") parses as `Hidden.
    • Before: a_hidden () → After: a_hidden Hidden`
  • contenteditable now takes an enumerated argument [< True | False | Plaintext_only ]instead of a boolean, to express thecontenteditable="plaintext-only"state. A barecontenteditableparses as ``True ``.
    • Before: a_contenteditable true → After: a_contenteditable True`

Both use a named value type (hidden_value, contenteditable_value) routed to the existing variant_or_empty PPX parser, following the referrerpolicy precedent, so the PPX/JSX handle the bare and empty forms.

Non-breaking

  • Undeprecate scope: the scope attribute on table header cells is part of the HTML living standard (values row, col, rowgroup, colgroup); it was wrongly marked [@@ocaml.deprecated] "Not supported in HTML5".

Notes

  • Per discussion, this PR intentionally does not remove any obsolete element or attribute (keygen, command, the deprecated attributes, etc.), and does not introduce dedicated pointer/wheel/clipboard handler types in Xml_sigs.T (that would break every Xml implementation and needs to be coordinated with js_of_ocaml-tyxml and eliom). Those remain in the backlog for a later, larger major release.
  • The first commit is the shared CI fix from Fix unused functor parameter warnings breaking the CI #367 (warning 67); it will disappear from the diff once Fix unused functor parameter warnings breaking the CI #367 is merged and this branch is rebased on master.
  • Downstream (js_of_ocaml-tyxml, eliom) that construct hidden/contenteditable will need trivial call-site updates; this is expected for a major release.

Tests updated in test_ppx.ml and test_jsx.re (bare, until-found, plaintext-only), with the unit-parser coverage kept via disabled.

balat added 3 commits July 16, 2026 12:11
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.
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".
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant