From b815be4c54e2e70094c7bc2b1e8a40290d64ab83 Mon Sep 17 00:00:00 2001 From: rand00 Date: Fri, 17 Jun 2022 23:43:56 +0200 Subject: [PATCH 1/3] Fixed `Animation to be `Animate --- 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 961ffe8468de871bba4b399c945140fc9a036275 Mon Sep 17 00:00:00 2001 From: rand00 Date: Sun, 19 Jun 2022 22:10:32 +0200 Subject: [PATCH 2/3] Fixed that Svg animation lists need to be separated by semicolons --- implem/tyxml_xml.ml | 3 ++- lib/svg_f.ml | 6 +++--- lib/xml_iter.ml | 2 ++ lib/xml_print.ml | 2 ++ lib/xml_sigs.mli | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/implem/tyxml_xml.ml b/implem/tyxml_xml.ml index 15c1029a8..26af8ab9a 100644 --- a/implem/tyxml_xml.ml +++ b/implem/tyxml_xml.ml @@ -31,7 +31,7 @@ module M = struct let uri_of_string s = s let string_of_uri s = s - type separator = Space | Comma + type separator = Space | Comma | Semicolon (** Attributes *) @@ -56,6 +56,7 @@ module M = struct let string_attrib name value = name, AStr value let space_sep_attrib name values = name, AStrL (Space, values) let comma_sep_attrib name values = name, AStrL (Comma, values) + let semicolon_sep_attrib name values = name, AStrL (Semicolon, values) let event_handler_attrib name value = name, AStr value let mouse_event_handler_attrib name value = name, AStr value let keyboard_event_handler_attrib name value = name, AStr value diff --git a/lib/svg_f.ml b/lib/svg_f.ml index ab5a79a7b..71cd58e41 100644 --- a/lib/svg_f.ml +++ b/lib/svg_f.ml @@ -538,11 +538,11 @@ struct let a_calcMode x = user_attrib C.string_of_big_variant "calcMode" x - let a_animation_values = Xml.comma_sep_attrib "values" + let a_animation_values = Xml.semicolon_sep_attrib "values" - let a_keyTimes = Xml.comma_sep_attrib "keyTimes" + let a_keyTimes = Xml.semicolon_sep_attrib "keyTimes" - let a_keySplines = Xml.comma_sep_attrib "keySplines" + let a_keySplines = Xml.semicolon_sep_attrib "keySplines" let a_from = string_attrib "from" diff --git a/lib/xml_iter.ml b/lib/xml_iter.ml index eefcf3981..44ee19c06 100644 --- a/lib/xml_iter.ml +++ b/lib/xml_iter.ml @@ -109,6 +109,7 @@ module Make(Xml : Xml_sigs.Iterable) = struct match sep with | Space -> space_sep_attrib (aname head) values' :: tail | Comma -> comma_sep_attrib (aname head) values' :: tail + | Semicolon -> semicolon_sep_attrib (aname head) values' :: tail end | _ -> head :: rm_attrib_from_list is_attrib is_value tail @@ -118,6 +119,7 @@ module Make(Xml : Xml_sigs.Iterable) = struct begin match sep with | Comma -> comma_sep_attrib (aname head) (List.map f values) | Space -> space_sep_attrib (aname head) (List.map f values) + | Semicolon -> semicolon_sep_attrib (aname head) (List.map f values) end | _ -> head in List.map aux l diff --git a/lib/xml_print.ml b/lib/xml_print.ml index 4ca20aca0..3640e16cc 100644 --- a/lib/xml_print.ml +++ b/lib/xml_print.ml @@ -233,6 +233,7 @@ struct let pp_sep indent = function | Space -> fun fmt () -> sp indent fmt | Comma -> fun fmt () -> Format.fprintf fmt ",%t" (sp indent) + | Semicolon -> fun fmt () -> Format.fprintf fmt ";%t" (sp indent) let pp_attrib_value encode indent fmt a = match acontent a with | AFloat f -> Format.fprintf fmt "\"%a\"" pp_number f @@ -363,6 +364,7 @@ struct let separator_to_string = function | Space -> " " | Comma -> ", " + | Semicolon -> "; " let attrib_value_to_string encode a = match acontent a with | AFloat f -> Printf.sprintf "\"%s\"" (string_of_number f) diff --git a/lib/xml_sigs.mli b/lib/xml_sigs.mli index ba0de523b..55f492ad8 100644 --- a/lib/xml_sigs.mli +++ b/lib/xml_sigs.mli @@ -44,6 +44,7 @@ module type T = sig val string_attrib : aname -> string wrap -> attrib val space_sep_attrib : aname -> string list wrap -> attrib val comma_sep_attrib : aname -> string list wrap -> attrib + val semicolon_sep_attrib : aname -> string list wrap -> attrib val event_handler_attrib : aname -> event_handler -> attrib val mouse_event_handler_attrib : aname -> mouse_event_handler -> attrib val keyboard_event_handler_attrib : aname -> keyboard_event_handler -> attrib @@ -75,7 +76,7 @@ module type Iterable = sig include NoWrap - type separator = Space | Comma + type separator = Space | Comma | Semicolon val aname : attrib -> aname From 90558cd2321b9a0a0e3a5939b18d07b2c2a9cd4d Mon Sep 17 00:00:00 2001 From: rand00 Date: Tue, 21 Jun 2022 11:44:12 +0200 Subject: [PATCH 3/3] CHANGES.md: (missing PR #) --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d864f7468..51542f7d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # NEXT +* Fix the SVG animation attributes `a_animation_values`, `a_keyTimes` and `a_keySplines` + to contain semicolon separated values. + (#?? by @rand00) + * Fix the SVG element `` (by the way, deprecate `animation` et al. in favor of `animate` et al.) (#306 by Idir @ilankri Lankri)