Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The link to the SVG spec in the comments points to SVG 2, but the types are based on SVG 1.1 #327

Open
Mbodin opened this issue Dec 1, 2023 · 1 comment

Comments

@Mbodin
Copy link
Contributor

Mbodin commented Dec 1, 2023

The SVG types are said ( https://github.com/ocsigen/tyxml/blob/master/lib/svg_types.mli#L26 ) to be based on http://www.w3.org/TR/SVG/ I guess that this URL used to point to the specification of SVG 1.1, but it now points to SVG 2.

In the case of the definition of paint, the difference is large.

Here is what it appears in SVG 2 ( https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint )

<paint> := none | <color> | <url> [none | <color>? | context-fill | context-stroke

And in SVG 1.1 ( https://www.w3.org/TR/SVG11/painting.html#SpecifyingPaint )

<paint> := none | currentColor | <color> [<icccolor>] | <funciri> [ none | currentColor | <color> [<icccolor>] ] | inherit

Here is what it appears in https://github.com/ocsigen/tyxml/blob/master/lib/svg_types.mli#L287

type color = string
type icccolor = string

type paint_whitout_icc =
  [ `None | `CurrentColor
  | `Color of (color * icccolor option)
  ]

type paint =
  [ paint_whitout_icc
  | `Icc of (iri * paint_whitout_icc option) ]

This implementation is close to the one of SVG 1.1, but it differs a lot from the SVG 2. This confused me as I tried to compare to make it match to SVG 2's concepts. I still feel that I'm missing the url(#gradient) value, but I'm not used to ICC so I might just have misunderstand.

It's completely fine to stay with SVG 1.1, but maybe it would be nice to help the reader accustomed to SVG 2:

@Drup
Copy link
Member

Drup commented Dec 1, 2023

I would be quite in favour of a path moving to SVG2, but in absence of that, you are right, we should fix the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants