Skip to content

Filter primitive subregion interpretation #1047

@matthiasclasen

Description

@matthiasclasen

The spec (both SVG 1.1 and the 2.0 draft) contain this half-sentence when talking about the filter primitive subregion:

the default subregion is 0%,0%,100%,100%, where as a special-case the percentages are relative to the dimensions of the [filter region] 
(https://www.w3.org/TR/SVG11/filters.html#FilterEffectsRegion), thus making the the default [filter primitive subregion](https://www.w3.org/TR/SVG11/filters.html#FilterPrimitiveSubRegion) equal to the [filter region](https://www.w3.org/TR/SVG11/filters.html#FilterEffectsRegion).

It isn't entirely clear (at least to me) if this this just an awkward way of saying "the default filter primitive subregion is equal to the filter region", or if it prescibes how percentage are to be interpreted in x, y, width, height set on filter primitves.

This quick experiment:

<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"> <defs> <filter id="filter"> <feFlood flood-color='pink' x='0' y='0' width='10%' height='50'/> </filter> </defs> <rect transform="scale(2)" x='20' y="100" width="100" height="100" filter="url(#filter)" /> <rect transform="scale(2)" x='20' y="100" width="100" height="100" fill='none' stroke='black' stroke-width='1px' /> </svg>

shows that browsers and inkscape interpret the 10% relative to the viewport, not relative to the filter region.

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