Clip-group produces invalid svg (clip-path contains clone of group)

Migrated from: https://bugs.launchpad.net/inkscape/+bug/1441152 and also duplicate of https://bugs.launchpad.net/inkscape/+bug/1019159

Steps to reproduce:

  • Open Inkscape
  • Create an object
  • Create Clip Group with the object
  • Now the clip-path (see the defs) has a use element that points to a group

What happened?

  • The clipping-group (see the defs) has a use element that points to a group

What should have happened?

https://www.w3.org/TR/SVG11/masking.html#EstablishingANewClippingPath

A ‘clipPath’ element can contain ‘path’ elements, ‘text’ elements, basic shapes (such as ‘circle’) or a ‘use’ element. If a ‘use’ element is a child of a ‘clipPath’ element, it must directly reference ‘path’, ‘text’ or basic shape elements. Indirect references are an error (see Error processing).

For SVG2, https://www.w3.org/TR/SVG/render.html#ClippingAndMasking which references https://www.w3.org/TR/css-masking-1/#elementdef-clippath, which says the same thing (see the description)

This disallows groups or use elements that reference groups

In comments, importance of High was determined based on discussion in IRC. Dunno what the discussion was, but it implies agreement that this is incorrect behavior

Inkscape Version and Operating System:

  • Inkscape 1.1-dev (ce96f98111, 2020-04-08) Linux Mint 19.1
  • Inkscape trunk rev. 14044
Edited by Nathan Lee
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information