W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: [css2][css3-exclusions] 'clip' with more shapes and all elements

From: Dirk Schulze <dschulze@adobe.com>
Date: Mon, 20 Aug 2012 06:08:32 -0700
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Message-ID: <213024C0-E256-4943-8A73-5FCC9B7C76F8@adobe.com>

On Aug 20, 2012, at 5:06 AM, "Robert O'Callahan" <robert@ocallahan.org<mailto:robert@ocallahan.org>> wrote:

On Mon, Aug 20, 2012 at 8:13 AM, Tab Atkins Jr. <jackalmage@gmail.com<mailto:jackalmage@gmail.com>> wrote:
On Sun, Aug 19, 2012 at 9:42 AM, Dirk Schulze <dschulze@adobe.com<mailto:dschulze@adobe.com>> wrote:
> I wonder if it is possible to extend the 'clip' property to apply to all elements (instead of just absolute positioned elements) [1]? FF applies 'clip-path'[2] to all elements already. What are the concerns to do so on 'clip'?
>
> Can we extend 'clip' to use more shapes then just 'rect'? If we get rid of these limitations, the 'clip' property would be a lot more useful (or maybe useful for the first time? ;) ). The basic shapes 'circle', 'ellipse' and 'polygon' (but also 'rectangle') from the exclusion spec [3] seem to be good candidates.

Yes, we can and we should (imo). I'm not sure why 'clip' is restricted
just to abspos per spec; I assume it's to avoid possible confusion
because it doesn't change the geometry of the object.

I don't have a good reason to make 'clip' more generally applicable, but it's possible that copy-paste Web content applies 'clip' to non-abs-pos content and breaks if you make that work. (For the same reason I'm wary of making z-index apply to non-positioned elements, even though I'd really like to.)
That all sounds very reasonable to me :(. But it looks like 'clip' should be marked as deprecated (but still supported of course) in the long term.

Greetings
Dirk


> 'clip-path' could still be used for referencing SVG 'clipPath' elements or could shadow 'clip' and 'clip' supports a <FuncIRI> as well.

We've finally stumbled on a decent way to handle aliasing -
'clip-path' can be treated as a shorthand for 'clip', and we can add
url()/select() to 'clip' in addition to the shape functions.

We made clip-path induce a stacking context on the element. As usual, this made implementation a lot easier.

Making 'clip' handle arbitrary shapes, while not inducing a stacking context, would be a real pain to implement (although we could do it). Making 'clip' induce a stacking context would pose its own Web compatibility hazard.

If some browser vendors wants to do those Web compatibility experiments, please go ahead. I'm a bit fatigued by break-the-Web experiments at the moment :-).

Rob
--
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’ But I tell you, love your enemies and pray for those who persecute you, that you may be children of your Father in heaven. ... If you love those who love you, what reward will you get? Are not even the tax collectors doing that? And if you greet only your own people, what are you doing more than others?" [Matthew 5:43-47]

Received on Monday, 20 August 2012 13:07:46 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT