[svgwg] Trying to understand the 'enable-background' property (#733)

RazrFalcon has just created a new issue for https://github.com/w3c/svgwg:

== Trying to understand the 'enable-background' property ==
https://www.w3.org/TR/SVG11/filters.html#AccessingBackgroundImage

I'm confused about the way opacity, masking and filters should be applied during a background buffer rendering. From the spec:

> For each Ai (from i=n to 1), initialize BUFi to transparent black. Render all children of Ai up to but not including Ai-1 into BUFi. The children are painted, then filtered, clipped, masked and composited using the various painting, filtering, clipping, masking and object opacity settings on the given child. Any filter effects, masking and group opacity that might be set on Ai do not apply when rendering the children of Ai into BUFi.

First it says that we should apply filters, etc. And in the next sentence it states the opposite.

After doing some test, it looks like that only the parent group/container of the element with a `filter` attribute should be ignored.

So in this case we should apply the opacity:

```xml
<g enable-background="new" opacity="0.5">
    <rect x="20" y="20" width="60" height="60" fill="green"/>
    <rect x="30" y="30" width="60" height="60" fill="blue"/>
    <g filter="url(#filter1)"/>
</g>
```

but in this one we shouldn't:

```xml
<g enable-background="new">
    <rect x="20" y="20" width="60" height="60" fill="green"/>
    <g opacity="0.5">
        <rect x="30" y="30" width="60" height="60" fill="blue"/>
        <g filter="url(#filter1)"/>
    </g>
</g>
```

Is there are a more clear explanation?

PS: I know that `enable-background` was deprecated in SVG 2.

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/733 using your GitHub account

Received on Monday, 16 September 2019 17:34:48 UTC