Re: CSS Transforms : computed value

On Jan 13, 2009, at 8:53 AM, Daniel Glazman wrote:

> We're currently implementing CSS Transforms [1] in BlueGriffon, our  
> new
> Gecko-based editor, and we have a hard life dealing with
> the matrix used as computed value of the (-moz-/-webkit-)transform
> property. We find it beautiful from an intellectual point of view
> but horrible from a practical one. As usual, it's perfect for browsers
> but awful for editors. We do understand the need/wish to
> be coherent with the SVG 1.1 spec, but this clearly makes the life of
> editing environments (very) painful, and the computed value of
> 'transform' almost useless from our point of view since we can't from
> a single matrix get all the individual and ordered transformation
> matrices that result in that one when multiplied together.
>
> I strongly recommend keeping the computed value of 'transform' more
> humanly readable, in the form of a series of individual  
> transformations
> rather than a single matrix. I do understand that means the layout
> engine has to store more information than just a single transformation
> matrix. But if you want real-life wysiwyg editors to implement this -
> and it seems web designers want it too - then it's almost a necessary
> cost, at least from out POV.

So you'd like the computed style to keep the same list of transform  
operations, but have computed the values for units?

Maybe it is easier to ask: what type of computed value do you expect  
to see from an input of
transform: translate(2em, 3ex) scale(1.2) translate(3em) rotate(1grad) ?

FWIW, the specification does go into detail about decomposing matrices  
into components.  Obviously you won't always be able to recreate the  
input (especially if the property has a list with multiple copies of  
the same transform function), but it might allow an editing  
application to take a matrix value and enable editing of translation,  
rotation and scale parameters (or even more when you get into 3d).

Also, I have a question. Why are you using the computed value in your  
editor?

Dean

>
> [1] http://webkit.org/specs/CSSVisualEffects/CSSTransforms.html

Received on Tuesday, 13 January 2009 20:00:09 UTC