- From: Felix Pahl <fpahl@web.de>
- Date: Mon, 09 Feb 2004 16:05:44 +0100
- To: www-svg@w3.org
The spec does not seem to define the behavior of an empty filter tag, i.e. a filter tag containing no filter primitives. Batik and the Adobe SVG viewer display different behavior, neither of which is the behavior I would have expected. Batik treats the empty filter tag as a no-op and renders the filtered element as if it didn't have a filter property. It doesn't even clip the element to the filter effects region. The Adobe Viewer treats the empty filter as resulting in a transparent canvas, i.e. it doesn't render the filtered element at all. What I would have expected, since it seems to be the most natural extension of the behavior to this special case, is that the element is rendered unfiltered, but clipped to the filter effects region. By default (i.e. if no "in" attributes are specified), each filter primitive takes an image and produces a new image, with the original image being the source graphics and the last image being the overall result of the filter. (By the way, the first part (that the first image is the source graphics) is explicitly stated in the spec, but I couldn't find the second part (that the last image is the overall result) -- this is of course sort of obvious, but should be stated explicitly nonetheless.) It seems natural to assume that if there is no filter primitive to operate on it, the original image, i.e. the source graphics, is also the last image, i.e. the result of the filter. Certainly no fully transparent "initial image" ever appears in the process (as it does when the elements of a group are composited). (Item 2 in the description of the example in Section 15.6 says "that the offscreen for the filter is initialized to transparent black", but I believe this is just a misleading way of expressing what is better expressed in the last paragraph of Section 15.1, which is a statement about filter *primitives*, not about the filter as a whole. If I am wrong on this and the sentence in Item 2 is right as it stands, it needs to be put in a far more prominent place.) Regarding clipping to the filter effects region: Section 15.5 is slightly unclear on this -- it says: "A 'filter' element can define a region on the canvas to which a given filter effect applies". This could mean either that the result of the filter effect is clipped to the filter effects region, or it could mean that the filter applies only inside the region, whereas the filtered element is passed through unchanged elsewhere. However, Section 3.7 (though it refers twice to Chapter 15 where I believe the first reference is meant to be to Section 15.5) is a bit clearer in implying that the parts of the unfiltered element lying outside the filter effects region are clipped. Batik and the Adobe Viewer in general seem to agree on this, but in the case of an empty filter tag, Batik doesn't clip the unfiltered element to the filter effects region. felix.
Received on Monday, 9 February 2004 10:33:09 UTC