W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2012

Parse new SVG Transform presentation attributes with "SVG parsing rules"

From: Dirk Schulze <dschulze@adobe.com>
Date: Tue, 27 Mar 2012 10:36:28 -0700
To: "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <B3217D08-9A6C-4753-9D4B-8A9FBE8DD8CA@adobe.com>

I wrote tests for the SVG 'transform-origin' presentation attribute and realized that I left out units on length values. I wonder if strict CSS parsing rules for presentation attributes could confuse other SVG folks as well.

I suggest, that all new introduced presentation attributes from the CSS Transforms [1] spec use the parsing rules of corresponding SVG data types for <length>[2] and <number>[3].

Following presentation attributes are affected[4]:

* 'perspective'
* 'perspective-origin'
* 'transform-origin'
We already resolved that 'transform' needs to be backwards compatible and therefore supports the SVG parsing rules for transforms.

Changes of the parsing in detail:

* <number>
  - support scientific notation as described in [3] (e.g -100e-2).
* <length>
  - allow unit less length values (the value gets interpreted as 'user unit' as described in [5])
  - support all units as described in CSS Values and Units [6]
* Values with multiple arguments must still be separated as described in CSS Values and Units [6]. There is no common way in SVG anyway (see [7], [8] and [9] for comparison).

Possible issues:

The issue was raised that functions like 'calc()' might not be able to support unit less values. As example: calc(20 40px)
Can calc resolve that this should be 60 pixels? I'll investigate how WebKit deals with it. It would be great to hear comments about other implementations.


[1] http://dev.w3.org/csswg/css3-transforms/
[2] http://www.w3.org/TR/SVG/types.html#DataTypeLength
[3] http://www.w3.org/TR/SVG/types.html#DataTypeNumber
[4] http://dev.w3.org/csswg/css3-transforms/#property-index
[5] http://www.w3.org/TR/SVG/intro.html#TermUserUnits
[6] http://www.w3.org/TR/css3-values/
[7] http://www.w3.org/TR/SVG/types.html#DataTypeListOfFamilyNames
[8] http://www.w3.org/TR/SVG/types.html#DataTypeListOfStrings
[9] http://www.w3.org/TR/SVG/types.html#DataTypeList
Received on Tuesday, 27 March 2012 17:37:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 22 June 2015 03:33:47 UTC