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

Re: Event handling in clipping conditions

From: Ken Stacey <ken@svgmaker.com>
Date: Thu, 11 Dec 2008 13:40:09 +1000
Message-ID: <49408B99.3010600@svgmaker.com>
To: www-svg@w3.org

On 5/12/2008 01:43, Doug Schepers wrote:
> The SVG WG has resolved on an erratum [1] which we believe will clarify
> this issue:
> 
> [[
> 14.3.6 Clipping paths and geometry
> 
> A clipping path is conceptually equivalent to a custom viewport for the
> referencing element. Thus, it affects the rendering of an element, but
> not the element's inherent geometry. The bounding box of a clipped
> element (that is, an element which references a 'clipPath' element via a
> 'clip-path' property) must remain the same as if it were not clipped.
> 
> With regards to pointer-events, while the visible parts of a clipped
> element receive pointer events normally, parts of a clipped element
> which are outside the extent of the clipping path must be treated as if
> they have a 'visibility' property value of 'hidden'. Therefore, an
> element which has 'pointer-events' property values which depend upon the
> visibility of the element (i.e. 'visiblePainted', 'visibleFill',
> 'visibleStroke', 'visible') will not receive pointer events for the
> occluded parts of the element. For example, a circle with a radius of 10
> which is clipped to a circle with a radius of 5 will not receive 'click'
> events outside the smaller radius if it has the default 'pointer-events'
> property value of 'visiblePainted', but will if has the property value
> of 'all'.
> ]]

To summarize - the clipping path only affects the pointer-events which 
depend upon visibility.  Those pointer-events which do not depend on 
visibility are not clipped.

The missing piece for me is that I see no mechanism for clipping all 
events - treating parts of a clipped element which are outside the 
extent of the clipping path as if they have a 'pointer-events' property 
value of 'none'.

This relates to Thomas' concerns with the scroll window example and 
existing/legacy content being "broken" by the defined behavior.

Perhaps a simplified version of Thomas' event-clip can be used. An 
attribute which controls event behavior in regions outside the clipping 
path.

overflow-events = none, auto
(or clipped-events,...)

'none' meaning pointer-events='none' outside the clipping path, and 
'auto' applying 14.3.6 above.

 From some quick tests it would appear that Firefox, Opera and ASV3 
"default" to 'none'.  Safari and Batik to 'auto'.

Ken
Received on Thursday, 11 December 2008 03:40:53 GMT

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