Re: [css-transforms] default transform-origin for SVG elements


> On Jun 11, 2015, at 10:52 AM, Cameron McCormack <cam@mcc.id.au> wrote:
> 
> [I mentioned this in a public-fx email but I’m repeating it here for
> more visibility.]
> 
> The CSS Transforms spec currently says:
> 
>  The initial used value for SVG elements without associated CSS layout
>  box is 0 0.
> 
> I think the concept of an “initial used value” doesn’t make sense.
> A used value can be defined based on the computed value of the property
> plus some other conditions (other property values, perhaps what element
> it’s on).  But I don’t think it’s possible to say that the used value
> becomes 0 0 if the computed value came from the initial value (which is
> 50% 50%), unless you wanted all occurrences of 50% 50% – even explicit
> ones – to be treated as 0 0 on these SVG elements.
> 
> So I think we should define this using a UA style sheet rule.  At least
> Firefox and WebKit both already do implement this using a UA style sheet
> rule.  In Firefox we have:
> 
>  @namespace url(http://www.w3.org/2000/svg);
> 
>  *:not(svg),
>  *:not(foreignObject) > svg {
>    transform-origin: 0 0;
>  }
> 
> which should capture all non-outer <svg> elements.

WebKit and Blink have a similar UA stylesheet entry in svg.css. The one above looks better though. I would be willing to add this to the spec if the WG agrees.

Greetings,
Dirk


> 
> -- 
> Cameron McCormack ≝ http://mcc.id.au/

> 

Received on Thursday, 11 June 2015 22:01:25 UTC