[css-masking] 'clip' as shorthand for 'clip-path'?

Hi,

One unresolved issue on CSS Masking[1] is one suggestion from Tab during our weekly conf calls: Should 'clip'[2] be the shorthand property for 'clip-path'[3]?

Note, 'clip' 
* just has the following syntax at the moment rect([<length> | auto]{4}) | auto (values can be comma separated)
* just applies to absolutely positioned elements

'clip-path' has the syntax: <clip-source> | <shape> | none

<shape> specifies a basic shape form CSS Exclusions.

If 'clip' would be a shorthand, the rect() function can still just apply to absolute positioned elements (SVG has restrictions as well), while the values from the 'clip-path' apply to all elements.

The new syntax would look like this:
rect([<length> | auto]{4}) | <clip-source> | <shape> | auto | none

* 'auto' and 'none' would both do nothing.
* <clip-source> references an SVG <clipPath> element. Applies to all elements
* rect() just applies to absolute positioned elements
* <shape> applies to all elements

This way 'clip' would still be backwards compatible.

Might if authors get confused that rect(…) may not work on an element, while rectangle(…) does work? Just because of the restriction for 'rect()'?

The alternative would be to make 'clip' mandatory, but deprecated. The 'clip' property stays in the spec, needs to be implemented for legacy content, but authors should use the 'clip-path' property in the future.

The alternative is easier to specify and maybe less confusing. The first way let us reuse the property 'clip', but may take longer to get implemented. Some refactoring would be needed in implementations. And it could cause some confusions.

Any preferences?

Greetings,
Dirk

[1] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html
[2] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#clip-property
[3] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#the-clip-path

Received on Tuesday, 23 October 2012 01:18:41 UTC