Re: ordering of effects with enable-background:new and filter on the same element

Hi Robert,

The enable-background property is an interesting one. I do agree that it 
is some parts of about its usage are confusing. It is something I will 
raise for discussion with the working group in at the next telcon. For 
now I will attempt to clarify things here.

A few things to keep in mind when using enable-background in SVG.

  - The property is designed to affect container elements only (i.e. 
<svg>, <g>, <defs> etc). This means that in the example below 
enable-background="new" has no effect on the background or surround 
graphical elements.

  - The property is designed to start a new background buffer (initially 
transparent black) for child elements of the container element.

Robert O'Callahan wrote:
> On Thu, Jun 5, 2008 at 2:45 PM, Robert O'Callahan < 
> <>> wrote:
>     Context:
>     The text says "Find the element Ai with the smallest subscript i
>     (including A0=E) for which the 'enable-background' property has the
>     value new." So that seems to mean that the search for the nearest
>     enclosing element with enable-background:new starts with the current
>     element. So if an element has enable-background:new and a 'filter',
>     then usage of "BackgroundImage" within the filter will get a
>     transparent black background. Is this intentional? It seems less
>     useful, and less in the spirit of the rest of the section, 
> The testcase below draws green on Opera, so it looks like Opera is 
> starting the enable-background:new search from the parent. So please 
> change the spec to clearly identify that as the correct behaviour.
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>   "">
> <svg xmlns="" style="enable-background:new;">
>   <defs>
>     <filter id="f1" filterUnits="objectBoundingBox" x="0" y="0" 
> width="100%" height="100%">
>       <feFlood flood-color="black" result="black"/>
>       <feComposite in="BackgroundImage" operator="over"/>
>     </filter>
>   </defs>
>   <rect x="100" y="100" width="100" height="100" fill="lime"/>
>   <rect x="100" y="100" width="100" height="100" filter="url(#f1)" 
> style="enable-background:new;"/>
> </svg>

In the above example the "BackgroundImage" for the feCompositing filter 
is what was previously composited onto the Canvas, i.e. the "lime" 
filled <rect>. I suspect that Opera is ignoring enable-background in 
this case. Hence, the resulting compositing operation is an over 
operation where the source is opaque lime and the destination is opaque 

I hope this helps to clear things up for now.

Kind Regards


Anthony Grasso

Software Engineer

Canon Information Systems Research Australia
1 Thomas Holt Drive, North Ryde, NSW 2113

Phone: +61 2 8873 8821


The information contained in this email message and any attachments may 
be confidential and may also be subject to legal professional privilege. 
If you are not the intended recipient, any use, interference with, 
disclosure or copying of this material is unauthorised and prohibited.

If you have received this email in error, please immediately advise the 
sender by return email and delete the information from your system.

Received on Thursday, 5 June 2008 07:40:11 UTC