Open jwmcglynn opened 6 months ago
Missing features:
<filter>
and filter primitive attributes, such as the bounding box and filterUnits
filter: blur(5in)
filter
presentation attribute is defined to take <filter-function>
| <url>
]+So the CSS property needs to contain a vector of FilterEffect variants, and each FilterEffect could potentially be a ref which resolves to a vector of FilterEffects. During resolution the refs will need to be resolved before we reach the renderer.
To represent this:
Filter effects can also contain multiple trees, as shown by Example 4 here:
<filter id="filter">
<-- The first filter primitive tree. Ignored for filter process. -->
<feColorMatrix type="hueRotate" values="45"/>
<feOffset dx="10" dy="10"/>
<feGaussianBlur stdDeviation="3"/>
<-- The primary filter primitive tree. -->
<feFlood flood-color="green" result="flood"/>
<feComposite operator="in" in="SourceAlpha" in2="flood"/>
</filter>
In this case <feFlood>
takes no inputs, so it discards the prior part of the tree. The final FilterEffect chain for this should only contain [feFlood, feComposite]
.
For SVG DOM elements, there are no units:
<feGaussianBlur stdDeviation="3"/>
However for the filter presentation attributes, there are:
filter: blur(5in)
These need to be resolved before rendering.
Filter effects have bounded boxes both from the <filter>
property, and on filter primitives. These need to be considered during the filtering process.
Implement filter support, based on the spec here: https://www.w3.org/TR/filter-effects/
Stage 1: MVP
<filter>
element<feGaussianBlur>
, with minimal functionalityfilter
presentation attribute https://www.w3.org/TR/filter-effects/#FilterPropertyThis should be validated by rendering the donner splash logo
Stage 2: Full implementation
<filter>
and<feGaussianBlur>
features