W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2017

Re: [csswg-drafts] [css-transforms-1] Define basis for percentage transform on patterns, gradients, clipPath

From: Amelia Bellamy-Royds via GitHub <sysbot+gh@w3.org>
Date: Thu, 20 Apr 2017 04:24:47 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-295576412-1492662286-sysbot+gh@w3.org>
I'm not sure what "no change" is supposed to mean.  There is no guidance on this question in either the transform spec or the SVG spec.

SVG 1.1 didn't have transformations on clipPath or mask, but it did have `patternTransform` and `gradientTransform`.  I would expect a transformation on a clip-path or mask to work the same way: as a transformation of the infinite canvas on which the effect is defined, after scaling it according to the size of the shape's bounding box or userSpace, but prior to compositing it with the shape.

However, that doesn't answer the question about percentages.  The SVG 1.1 syntax did not have percentages in transforms, and therefore they didn't need a reference *box*.  However, they did need a reference *origin*.

All the graphical effects do have a reference box (the box used for defining the scale of the effect, whether that was `objectBoundingBox` or `userSpaceOnUse`), albeit one that doesn't fit with `transform-box`.  

For gradients, we even have consistent implementations that *use* that reference box to define the transform origin for scales and rotations.  So if it's a userSpace gradient, the rotation is around the user-space origin.  If it's a bounding-box gradient, the rotation is around the top-left corner of the bounding box (after adjusting for any non-uniform scale transformation created by scaling the effect coordinate space to the bounding box).

For patterns, implementations aren't currently consistent with each other or the spec.  SVG spec bug discussion is here: https://github.com/w3c/svgwg/issues/293
I have a demo/test case here: https://codepen.io/AmeliaBR/details/woKBYp/


All of this is in addition to the long-standing issue that we still do not have clear definitions of what `objectBoundingBox` and `userSpaceOnUse` mean when applied to a non-SVG element, or how they interact with reference boxes defined in the mask/clip/fill/stroke properties on the target elements.

GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/892#issuecomment-295576412 using your GitHub account
Received on Thursday, 20 April 2017 04:24:59 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:11 UTC