FilterValueList should not store a list of IRI
This surfaced in !368 (merged). We have this:
pub enum IRI {
None,
Resource(Fragment),
}
pub enum FilterValue {
URL(IRI),
}
pub struct FilterValueList(pub Vec<FilterValue>);
IRI
is like that in order to support SVG1.1's properties of type none | <funciri>
. Note that it doesn't store an arbitrary URL in the Resource
variant; it stores a Fragment
to indicate that it requires an explicit fragment identifier, a la url("utils.svg#some_element")
.
This is adequate for SVG1.1's filter
property, which is of type none | <funciri> | inherit
. However, in SVG2 it is different:
filter = none | <filter-value-list>
<filter-value-list> = [ <filter-function> | <url> ]+
I.e. none
cannot appear in the middle of a <filter-value-list>
with multiple items. Right now the code panics when it encounters this condition.
I think it would be better to have something like
pub enum Filter {
None,
List(FilterValueList)
}
pub struct FilterValueList(Vec<FilterValue>);
pub enum FilterValue {
URL(Fragment),
// expand with FilterFunction in the future
}