From 8a73364bbf8762d917b98617e7f57c128d823143 Mon Sep 17 00:00:00 2001 From: Idir Lankri Date: Tue, 12 Apr 2022 16:31:30 +0200 Subject: [PATCH 1/4] Cleanup: Clean some whitespaces Use spaces for indentation and remove trailing whitespaces. --- CHANGES.md | 4 ++-- lib/svg_sigs.mli | 2 +- test/test_jsx.re | 2 +- test/test_ppx.ml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b77ca3fc1..7459b20f0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,7 +20,7 @@ # 4.4.0 -* Add support for Reason's JSX syntax with a new `tyxml-jsx` package +* Add support for Reason's JSX syntax with a new `tyxml-jsx` package (#254 by Joris Giovannangeli and Gabriel Radanne with help from Ulrik Strid and Louis Roché) * Modernize the handling of toplevel printers for utop. @@ -28,7 +28,7 @@ ## Elements and attributes -* Add `allowfullscreen`, `allowpaymentrequest`, `referrerpolicy` attributes +* Add `allowfullscreen`, `allowpaymentrequest`, `referrerpolicy` attributes (#242 by Thibault Suzanne) * Allow `crossorigin` attribute for script element (#243 by Thibault Suzanne) diff --git a/lib/svg_sigs.mli b/lib/svg_sigs.mli index 5219b1ac0..df70ed08e 100644 --- a/lib/svg_sigs.mli +++ b/lib/svg_sigs.mli @@ -963,7 +963,7 @@ module type T = sig [@@ocaml.deprecated "Use txt instead"] (** @deprecated Use txt instead *) - (** {2 Conversion with untyped representation} + (** {2 Conversion with untyped representation} WARNING: These functions do not ensure HTML or SVG validity! You should always explicitly given an appropriate type to the output. diff --git a/test/test_jsx.re b/test/test_jsx.re index 41fef377b..769b10cd5 100644 --- a/test/test_jsx.re +++ b/test/test_jsx.re @@ -81,7 +81,7 @@ let basics = ( }, ], [p([a([])])], - ) + ) ], ), ); diff --git a/test/test_ppx.ml b/test/test_ppx.ml index cbdec1c89..57d5333a9 100644 --- a/test/test_ppx.ml +++ b/test/test_ppx.ml @@ -147,7 +147,7 @@ let basics = "ppx basics", HtmlTests.make Html.[ "datalist", [[%html {| - + |}]], [datalist ~children:(`Options [option ~a:[a_value "foo"] (txt "foo")]) ()]; From 333a52987b251dc1494d711cc5e0b6f38e721a31 Mon Sep 17 00:00:00 2001 From: Idir Lankri Date: Tue, 12 Apr 2022 16:21:26 +0200 Subject: [PATCH 2/4] SVG: Fix the definition of the type `Svg_types.animation` Fix https://github.com/ocsigen/tyxml/issues/305. --- lib/svg_types.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/svg_types.mli b/lib/svg_types.mli index a8a019ab8..cc65f4eef 100644 --- a/lib/svg_types.mli +++ b/lib/svg_types.mli @@ -1593,7 +1593,7 @@ type script_attr = | `Xlink_href ] -type animation = [ | `Animation ] +type animation = [ | `Animate ] (* star *) type animation_content = descriptive_element From fc2802ac8fa80dcaf13d4dcb802990b33c948e5e Mon Sep 17 00:00:00 2001 From: Idir Lankri Date: Tue, 12 Apr 2022 16:59:15 +0200 Subject: [PATCH 3/4] SVG: Deprecate `animation` et al. in favor of `animate` et al. To be consistent with the naming of other elements. --- lib/svg_f.ml | 4 +++- lib/svg_sigs.mli | 13 +++++++++---- lib/svg_types.mli | 20 +++++++++++++++++--- test/test_jsx.re | 6 +++--- test/test_ppx.ml | 6 +++--- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/lib/svg_f.ml b/lib/svg_f.ml index ab5a79a7b..0dfd7706d 100644 --- a/lib/svg_f.ml +++ b/lib/svg_f.ml @@ -862,7 +862,9 @@ struct let script = unary "script" - let animation = star "animate" + let animate = star "animate" + + let animation = animate let set = star "set" diff --git a/lib/svg_sigs.mli b/lib/svg_sigs.mli index df70ed08e..4c04b671c 100644 --- a/lib/svg_sigs.mli +++ b/lib/svg_sigs.mli @@ -486,13 +486,13 @@ module type T = sig val a_fill : paint wrap -> [> | `Fill ] attrib val a_animation_fill : [< | `Freeze | `Remove ] wrap -> [> | `Fill_Animation ] attrib - [@@reflect.attribute "fill" ["animation"]] + [@@reflect.attribute "fill" ["animate"]] val a_calcMode : [< | `Discrete | `Linear | `Paced | `Spline ] wrap -> [> | `CalcMode ] attrib val a_animation_values : strings wrap -> [> | `Valuesanim ] attrib - [@@reflect.attribute "values" ["animation"]] + [@@reflect.attribute "values" ["animate"]] val a_keyTimes : strings wrap -> [> | `KeyTimes ] attrib @@ -884,8 +884,8 @@ module type T = sig val script : ([< | script_attr], [< | script_content], [> | script]) unary - val animation : - ([< | animation_attr], [< | animation_content], [> | animation]) star + val animate : + ([< | animate_attr], [< | animate_content], [> | animate]) star val set : ([< | set_attr], [< | set_content], [> | set]) star @@ -963,6 +963,11 @@ module type T = sig [@@ocaml.deprecated "Use txt instead"] (** @deprecated Use txt instead *) + val animation : + ([< | animate_attr], [< | animate_content], [> | animate]) star + [@@ocaml.deprecated "Use animate instead"] + (** @deprecated Use animate instead *) + (** {2 Conversion with untyped representation} WARNING: These functions do not ensure HTML or SVG validity! You should diff --git a/lib/svg_types.mli b/lib/svg_types.mli index cc65f4eef..604f2ae60 100644 --- a/lib/svg_types.mli +++ b/lib/svg_types.mli @@ -1593,12 +1593,12 @@ type script_attr = | `Xlink_href ] -type animation = [ | `Animate ] +type animate = [ | `Animate ] (* star *) -type animation_content = descriptive_element +type animate_content = descriptive_element -type animation_attr = +type animate_attr = [ | conditional_processing_attr | core_attr @@ -2056,3 +2056,17 @@ type big_variant = | `XML | `Xor ] + +(** {2 Deprecated} *) + +type animation = animate +[@@ocaml.deprecated "Use animate instead"] +(** @deprecated Use animate instead *) + +type animation_content = animate_content +[@@ocaml.deprecated "Use animate_content instead"] +(** @deprecated Use animate_content instead *) + +type animation_attr = animate_attr +[@@ocaml.deprecated "Use animate_attr instead"] +(** @deprecated Use animate_attr instead *) diff --git a/test/test_jsx.re b/test/test_jsx.re index 769b10cd5..854f55895 100644 --- a/test/test_jsx.re +++ b/test/test_jsx.re @@ -269,10 +269,10 @@ let svg = ( [feMorphology(~a=[a_feMorphology_operator(`Erode)], [])], ), ( - "animation fill, values", - [], + "animate fill, values", + [], [ - animation( + animate( ~a=[a_animation_fill(`Freeze), a_animation_values(["1", "2"])], [], ), diff --git a/test/test_ppx.ml b/test/test_ppx.ml index 57d5333a9..5218a23fd 100644 --- a/test/test_ppx.ml +++ b/test/test_ppx.ml @@ -370,9 +370,9 @@ let svg = "svg", SvgTests.make Svg.[ [[%svg ""]], [feMorphology ~a:[a_feMorphology_operator `Erode] []] ; - "animation fill, values", - [[%svg ""]], - [animation ~a:[a_animation_fill `Freeze; a_animation_values ["1"; "2"]] []] ; + "animate fill, values", + [[%svg ""]], + [animate ~a:[a_animation_fill `Freeze; a_animation_values ["1"; "2"]] []] ; ] From 6537b2f32fa7c8361d981d44a910244b3209ff45 Mon Sep 17 00:00:00 2001 From: Idir Lankri Date: Tue, 12 Apr 2022 17:15:08 +0200 Subject: [PATCH 4/4] Update the changelog --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 7459b20f0..d864f7468 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # NEXT +* Fix the SVG element `` (by the way, deprecate `animation` et + al. in favor of `animate` et al.) + (#306 by Idir @ilankri Lankri) + * Add support for `dialog` element and `onclose` attribute (#301 by Julien Sagot)