enable-background and filters

Resending the question below for lack of reaction. And let me stress
that this is a real world problem, Inkscape has had several bug reports
related to using background images, and we'd love to fix them, but to do
that properly we do need to know what we're supposed to do.

In its description of what enable-background does, the specification says:

1. Find the element Ai with the smallest subscript i (including A0=E)
for which the ‘enable-background’ property has the value new.

I assume that this smallest subscript is then considered to be "n", and
the spec continues:

2. 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.

Okay, fine, can do. Now it says:

"Any filter effects, masking and group opacity that might be set on Ai
do not apply when rendering the children of Ai into BUFi."

Then it goes on to say:

3. Then, for each Ai (from i=1 to n-1), composite BUFi into BUFi+1.
4. The accumulated result (i.e., BUFn) represents the background image
available to E.

If I understand correctly this means that after step 2, BUFi contains
essentially A(i-2)...A1, all rendered in the usual way (and NO other
descendants of Ai, in particular no siblings of any of those elements).
This seems a bit weird, both the i-2 part (it says up to but not
including A(i-1)) and the part that ONLY ancestors of the "current"
element (E) are drawn.

However, it gets weirder still. Now that we have those BUFi, we all
composite them and serve up the sum total as background image. So
effectively A1 gets composited into the background n-2 times or so, A2
n-3, etc., An and A(n-1) are simply out of luck, they are in none of the
BUFi images.

Someone please tell me that this is NOT what the spec intends. (And
preferably also what the spec DOES intend.)

Received on Thursday, 28 July 2011 08:31:21 UTC