W3C home > Mailing lists > Public > www-svg@w3.org > June 2008

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

From: Anthony Grasso <anthony.grasso@cisra.canon.com.au>
Date: Thu, 05 Jun 2008 17:39:26 +1000
Message-ID: <4847982E.3090407@cisra.canon.com.au>
To: robert@ocallahan.org
CC: www-svg <www-svg@w3.org>

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 <robert@ocallahan.org 
> <mailto:robert@ocallahan.org>> wrote:
> 
>     Context: http://www.w3.org/TR/SVG/filters.html#AccessingBackgroundImage
> 
>     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"
>   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
> <svg xmlns="http://www.w3.org/2000/svg" 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 
black.

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
AUSTRALIA

Phone: +61 2 8873 8821
Email: anthony.grasso@cisra.canon.com.au

--

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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:39 GMT