diff --git a/CHANGES.md b/CHANGES.md index b77ca3fc1..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) @@ -20,7 +24,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 +32,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_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 5219b1ac0..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,7 +963,12 @@ module type T = sig [@@ocaml.deprecated "Use txt instead"] (** @deprecated Use txt instead *) - (** {2 Conversion with untyped representation} + 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 always explicitly given an appropriate type to the output. diff --git a/lib/svg_types.mli b/lib/svg_types.mli index a8a019ab8..604f2ae60 100644 --- a/lib/svg_types.mli +++ b/lib/svg_types.mli @@ -1593,12 +1593,12 @@ type script_attr = | `Xlink_href ] -type animation = [ | `Animation ] +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 41fef377b..854f55895 100644 --- a/test/test_jsx.re +++ b/test/test_jsx.re @@ -81,7 +81,7 @@ let basics = ( }, ], [p([a([])])], - ) + ) ], ), ); @@ -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 cbdec1c89..5218a23fd 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")]) ()]; @@ -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"]] []] ; ]