diff --git a/CHANGES.md b/CHANGES.md index bb71b71c5..8f2859210 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,10 @@ * Expand options for `autocomplete` attribute on `` elements (#302 by Aron @aronerben Erben) +* 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) 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 3a6a13ff5..96273f239 100644 --- a/lib/svg_f.ml +++ b/lib/svg_f.ml @@ -544,11 +544,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