Re: [cssom] CSS Value API

On Wed, 07 Apr 2010 01:30:16 +0200, Chris Marrin <cmarrin@apple.com> wrote:
> How do you see transforms and CSSMatrix fitting into this? Currently you  
> define a transform property like this:
>
>  transform:translate(20px, 50%) rotate(45deg) scale(0.5) translateZ(5px);
>
> In WebKit, a transform is a CSSValueList. Each element of the list is  
> one transform function (4 in the above example) and is of type  
> CSSTransformValue. This inherits from CSSValueList and adds a enum which  
> is the type of the function (e.g., TRANSLATE or ROTATE). Each element of  
> the CSSTransformValue represents a param of the transform function and  
> is always a primitive value. So here we're using a list not to represent  
> separate items for a property as in background, but to represent  
> separate components of a single item.
>
> Does this fit in your model?

Yeah. my idea was to introduce a generic function type that inherits (or  
more likely also implements) from the conceptual CSSList and exposes the  
type of function and its arguments. This could then be used for  
transformations, but also, shape() and attr().

And if for some functions we want to introduce a dedicated interface, e.g.  
for matrix(), but certainly also url(), we can do that too.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Wednesday, 7 April 2010 09:15:26 UTC