Groups in clipPaths?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Groups in clipPaths?

Paul LeBeau
Hi all

Just wondering if anyone can remember why groups are not allowed in clipPaths?

Paul

Reply | Threaded
Open this post in threaded view
|

Re: Groups in clipPaths?

Amelia Bellamy-Royds
It was *probably* an XML DTD validation issue, that an element is only able to constrain its immediate children and not all descendents.  If you allow a `<g>`, then you allow anything that is a valid child of a `<g>`, which would include things like `<image>` that don't make sense in a clipPath.  

But the spec is much less tied to DTD validation these days, so that's not a good justification anymore.  Furthermore, the clipPath can contain a `<use>`, and the `<use>` can create a copy of an image, so the argument fails on that point.  

I'd personally prefer to handle the question on the rendering side, anyway, allowing arbitrary containers and just skipping over any embedded content that can't be converted to a vector outline.

Have you tested it? What do browsers currently do?  Do they ignore the entire group or use the shapes inside it?

When you get some data, the correct place to file an issue is the FXTF repo, https://github.com/w3c/fxtf-drafts/issues/
Be sure to start the issue subject with [css-masking].

~ABR

On 2 August 2016 at 10:26, Paul LeBeau <[hidden email]> wrote:
Hi all

Just wondering if anyone can remember why groups are not allowed in clipPaths?

Paul


Reply | Threaded
Open this post in threaded view
|

Re: Groups in clipPaths?

Paul LeBeau
Thanks Amelia.

I've only experimented with Chrome. But I will test properly and file a bug to suggest considering adding them to the allowed list.

Paul


On 3 August 2016 at 06:20, Amelia Bellamy-Royds <[hidden email]> wrote:
It was *probably* an XML DTD validation issue, that an element is only able to constrain its immediate children and not all descendents.  If you allow a `<g>`, then you allow anything that is a valid child of a `<g>`, which would include things like `<image>` that don't make sense in a clipPath.  

But the spec is much less tied to DTD validation these days, so that's not a good justification anymore.  Furthermore, the clipPath can contain a `<use>`, and the `<use>` can create a copy of an image, so the argument fails on that point.  

I'd personally prefer to handle the question on the rendering side, anyway, allowing arbitrary containers and just skipping over any embedded content that can't be converted to a vector outline.

Have you tested it? What do browsers currently do?  Do they ignore the entire group or use the shapes inside it?

When you get some data, the correct place to file an issue is the FXTF repo, https://github.com/w3c/fxtf-drafts/issues/
Be sure to start the issue subject with [css-masking].

~ABR

On 2 August 2016 at 10:26, Paul LeBeau <[hidden email]> wrote:
Hi all

Just wondering if anyone can remember why groups are not allowed in clipPaths?

Paul



Reply | Threaded
Open this post in threaded view
|

Re: Groups in clipPaths?

Robert Longson
In reply to this post by Paul LeBeau
Firefox used to support groups a long time ago (i.e. Firefox 2). We removed support solely to be spec compliant. https://bugzilla.mozilla.org/show_bug.cgi?id=547062 We'd be happy to reinstate support if the specification changed.

Robert.
Reply | Threaded
Open this post in threaded view
|

Re: Groups in clipPaths?

Jelle Mulder-2
Hello All,

Please allow <g> elements in clip. I've been using it a lot and was  
surprised to hear it is actually not allowed. Otherwise we end up with the  
workaround of having to <use> a group in order to clip it. That is not  
intuitive and leads to author confusion as I am now demonstrating ;-)

Cheers,

Jelle


On Wed, 03 Aug 2016 05:16:40 +0800, Robert Longson <[hidden email]>  
wrote:

> Firefox used to support groups a long time ago (i.e. Firefox 2). We  
> removed
> support solely to be spec compliant.
> https://bugzilla.mozilla.org/show_bug.cgi?id=547062 We'd be happy to
> reinstate support if the specification changed.
>
> Robert.

Reply | Threaded
Open this post in threaded view
|

Re: Groups in clipPaths?

Paul LeBeau

On 3 August 2016 at 13:26, jelle <[hidden email]> wrote:
Hello All,

Please allow <g> elements in clip. I've been using it a lot and was surprised to hear it is actually not allowed. Otherwise we end up with the workaround of having to <use> a group in order to clip it. That is not intuitive and leads to author confusion as I am now demonstrating ;-)

Cheers,

Jelle



On Wed, 03 Aug 2016 05:16:40 +0800, Robert Longson <[hidden email]> wrote:

Firefox used to support groups a long time ago (i.e. Firefox 2). We removed
support solely to be spec compliant.
https://bugzilla.mozilla.org/show_bug.cgi?id=547062 We'd be happy to
reinstate support if the specification changed.

Robert.