Re: A few comments on http://dev.w3.org/SVG/proposals/improving-svg-dom/

On Jun 24, 2014, at 5:01 AM, Robert O'Callahan <robert@ocallahan.org> wrote:

> Are <switch>, hasExtension, systemLanguage, requiredFeatures and requiredExtensions worth keeping? I think this kind of feature selection is widely considerd an anti-pattern at this point. Have these actually been used in good ways? If so, I haven't seen it.

<switch> and requiredFeatures have been used in the past. Mostly to check if filters are supported IIRC. In practice they probably return true already today and removing would not hurt if we would ignore <switch>. But SVG doesn’t “ignore” elements. An unknown element causes an error. We had discussions about interpreting unknown elements as <g>, personally I think this is a nightmare to support. The other APIs are under consideration for removal already.

In Chrome the usage of <switch> is 0.027%[1], no data for the other attributes.

> 
> Seems to me that getCTM, getScreenCTM and getTransformToElement should all be replaced by a new GeometryUtils method, say getTransform(optional TransformOptions options), with TransformOptions { GeometryNode to; }.

The interface from CSSOM View definitely applies to SVG as well[2].

There is nothing comparable to getCTM, getScreenCTM yet. Note that Canvas has a currentTransform attribute that some browser vendors would like to replaced with a non-live getter. This could be an opportunity to unify the API across SVG, CSS/HTML and Canvas. However, at this point I would say that the support for getCTM is mandatory. A lot of content uses it today already.

Greetings,
Dirk

[1] http://www.chromestatus.com/metrics/feature/popularity#SVGSwitchElement
[2] http://dev.w3.org/csswg/cssom-view/#geometry

Received on Tuesday, 24 June 2014 04:31:53 UTC