Skip to content

Support multiple filters in css filter property

John Ledbetter requested to merge johnl/librsvg:jl/filter-prop into master

This is a first pass at #615 (closed).

The Filter property now accepts either none or a list of filter URIs to apply to an element. FilterValue and FilterValueList are introduced to store these filters.

FilterValueList::is_applicable is introduced to check if all the URIs in the list are valid (that is, they point to an element and that element is a <filter>); the entire list is applied only if every item in it is valid.

In the future, FilterValue can grow a new option to handle filter functions like blur, etc. For now, we only parse filter URIs so providing a function will cause parsing to fail; the corresponding branch in is_applicable for functions is unreachable!().

Finally, we now iterate over each filter in the list, applying it to the output of the previous when rendering.

Edited by John Ledbetter

Merge request reports