W3C home > Mailing lists > Public > www-style@w3.org > February 2012

[css3-transforms] Extending CSSOM interface

From: Dirk Schulze <dschulze@adobe.com>
Date: Thu, 16 Feb 2012 09:57:09 -0800
To: www-style list <www-style@w3.org>
Message-ID: <9A1A7677-C477-4AAD-8115-0B79BF407AC0@adobe.com>
Hi www-style,

I would like to see some changes to the current interfaces of CSS Transforms. This is also described in the Wiki "Merged Transforms"[0]. Currently CSS Transforms specifies 'CSSMatrix' and 'CSSTransformValue'.

* I would like to see 'CSSTransformValue' extended by the following setters:

    void setMatrix(in CSSMatrix matrix);
    void setTranslate(in double tx, in double ty);
    void setScale(in double sx, in double sy);
    void setRotate(in double angle, in double cx, in double cy);
    void setSkew(in double angle-horizontal, in double angle-vertical);

The arguments ty, sy, cx, cy, angle-vertical are optional and get set to 0 or 1 according to their definitions on "Transformation Functions". cx, cy may get removed depending on the solution of [1]. Calling one of these functions would change the 'operationType' of the affected transformation function as well as the values of the member 'CSSMatrix'. The individual function description would be similar to SVGTransform[1].

* Rename 'CSSTransformValue' to 'CSSTransform'. This would just be an esthetic change to match what we already have in SVG: 'SVGTransform'.

* Add 'CSSTransformList'. The current spec already speaks about a transform list for the property but doesn't define it. I would like to add an interface that gives wide control of transform handling to the web author. The interface could look like this:

interface CSSTransformList {
    readonly attribute unsigned long numberOfItems;

    void clear() raises(DOMException);
    CSSTransform initialize(in CSSTransform newItem) raises(DOMException);
    CSSTransform getItem(in unsigned long index) raises(DOMException);
    CSSTransform insertItemBefore(in CSSTransform newItem, in unsigned long index) raises(DOMException);
    CSSTransform replaceItem(in CSSTransform newItem, in unsigned long index) raises(DOMException);
    CSSTransform removeItem(in unsigned long index) raises(DOMException);
    CSSTransform appendItem(in CSSTransform newItem) raises(DOMException);
    CSSTransform createCSSTransformFromMatrix(in CSSMatrix matrix);
    CSSTransform consolidate() raises(DOMException);
}

The function descriptions are similar to SVGTransformList [3].

* Define 'CSSMatrix', 'CSSTransform(Value)' and 'CSSTransformList' as "live". Changes on 'CSSTransformValue' would influence the member 'CSSMatrix'. 'getMatrix()' on 'CSSMatrix', 'getItem()' on 'CSSTransformList' return references to the objects, not copies.

Greetings,
Dirk

[0] http://www.w3.org/Graphics/fx/wiki/Merged_Transforms#CSSOM_issues

[1] http://lists.w3.org/Archives/Public/www-style/2012Feb/0692.html
[2] http://www.w3.org/TR/SVG/coords.html#InterfaceSVGTransform
[3] http://www.w3.org/TR/SVG/coords.html#InterfaceSVGTransformList
Received on Thursday, 16 February 2012 17:57:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT