[css3-ui] Comments on css3-ui 'pointer-events'

On Tue, 28 Sep 2010 03:06:57 +0200, Tantek Çelik <tantek@cs.stanford.edu>  
wrote:

> On Mon, Sep 27, 2010 at 5:51 PM, fantasai  
> <fantasai.lists@inkedblade.net> wrote:
>> On 09/27/2010 02:02 PM, Erik Dahlstrom wrote:
>>>
>>> doug: i don't think it belongs in the SVG Integration spec. it
>>> belongs somewhere else
>>> ... i'm interested in speccing this out
>>>
>>> <scribe> ACTION: doug to draw up a pointer-events spec [recorded in
>>> [22]http://www.w3.org/2010/09/27-fx-minutes.html#action04]
>>
>> Tantek was already actioned to work on this spec, using existing
>> work by WebKit and Opera. Perhaps you should talk to him first.
>
> As agreed at the August Oslo CSS WG f2f, I wrote up pointer-events,
> looking at the specs from Mozilla, Apple, and Opera, and have
> integrated it into an editor's draft of CSS3-UI since we already have
> interop.
>
> http://dev.w3.org/csswg/css3-ui/#pointer-events
>
> Tantek

Good to see that the proposal has been moved into a specification.

Here are some comments on the CSS3 ui spec (for pointer-events in  
particular):

* If the computed value of 'pointer-events' is the specified value, and  
the initial value has been changed to be 'auto' then you cannot conform to  
both the SVG spec (where the intial value is 'visiblePainted') and css3 ui.

Example:
<svg xmlns="http://www.w3.org/2000/svg">
   <script>alert(window.getComputedStyle(document.documentElement,  
null).getPropertyValue("pointer-events"))</script>
</svg>

It's possible that there's no way around this, but it should be explicitly  
stated in the spec in that case. A quick test shows that IE9 and Opera  
return 'visiblePainted', while webkit and firefox return 'auto'.

* In SVG 1.1 the 'pointer-events' property only applies to 'graphics  
elements', but in css3-ui it applies to all elements. Why? I don't think  
it makes any sense to have it apply to svg's container elements for  
example.

* If the property is to be defined in the css3-ui specification, then it  
would be nice with links back to the SVG 1.1 specification for the 'fill'  
and 'stroke' property definitions.

* The definition of 'all' (and other pointer-event values) is unclear for  
SVG content in particular.
[[ The element may be the target element for pointer events whenever the  
pointer is over the contents, background, or border of the element (or in  
SVG, over either the interior (i.e., fill) or the perimeter (i.e., stroke)  
of the element). Outlines, shadows, and reflections are excluded. The  
value of the ‘visibility’ property does not effect event processing. ]]

You can make outlines, shadows and reflections in many different ways in  
svg, and they may or may not be part of the element's geometry and so are  
not always excluded. Also the note about how 'fill' and 'stroke' don't  
affect the result for 'all' is missing (compare with the SVG 1.1  
pointer-events definition[1]). Maybe it would be better to state how 'all'  
is applied in svg separately from how it's applied otherwise. The same  
also applies to all the other pointer-event values, where svg is mentioned  
in parenthesis.

* The pointer-events definition in css3 ui[2] lacks many of the details  
 from the SVG 1.1 specification[1], e.g how 'clip-path' and 'mask' affects  
pointer-events, how text elements are handled etc. Is this intentional?  
Please consider simply linking to the svg specification for all the "SVG  
only" definitions instead of repeating them here - unless they are given  
some special new meaning in css3 ui.

* How opacity (and other forms of alpha, e.g rgba, fill-opacity,  
stroke-opacity etc) affects 'pointer-events' is undefined.

* How 'clip-path', 'mask' and 'filter' affect 'pointer-events' is  
undefined.

Cheers
/Erik

[1] http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty
[2] http://dev.w3.org/csswg/css3-ui/#pointer-events

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Tuesday, 28 September 2010 08:12:36 UTC