Skip to content

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

@Mbodin

Description

@Mbodin

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions