Modernize hidden and contenteditable attributes, undeprecate scope (breaking)#368
Open
balat wants to merge 3 commits into
Open
Modernize hidden and contenteditable attributes, undeprecate scope (breaking)#368balat wants to merge 3 commits into
balat wants to merge 3 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
hiddennow takes an enumerated argument[<Hidden |Until_found ]instead of no argument. This is required to express thehidden="until-found"state. A barehidden(orhidden=""/hidden="hidden") parses as`Hidden.a_hidden ()→ After:a_hiddenHidden`contenteditablenow takes an enumerated argument[<True |False |Plaintext_only ]instead of a boolean, to express thecontenteditable="plaintext-only"state. A barecontenteditableparses as ``True ``.a_contenteditable true→ After:a_contenteditableTrue`Both use a named value type (
hidden_value,contenteditable_value) routed to the existingvariant_or_emptyPPX parser, following thereferrerpolicyprecedent, so the PPX/JSX handle the bare and empty forms.Non-breaking
scope: thescopeattribute on table header cells is part of the HTML living standard (valuesrow,col,rowgroup,colgroup); it was wrongly marked[@@ocaml.deprecated] "Not supported in HTML5".Notes
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.hidden/contenteditablewill need trivial call-site updates; this is expected for a major release.Tests updated in
test_ppx.mlandtest_jsx.re(bare, until-found, plaintext-only), with the unit-parser coverage kept viadisabled.