W3C home > Mailing lists > Public > public-fx@w3.org > April to June 2013

[filter-effects] allow "viewBox" as a value for primitiveUnits

From: Benjamin Lord <ben@abmcd.com>
Date: Wed, 3 Apr 2013 12:29:26 -0700
Message-Id: <E9CBF9BD-C4E6-447E-9658-211E42C2F74D@abmcd.com>
To: "public-fx@w3.org" <public-fx@w3.org>
In responsive design patterns, there are many cases in which content resizes to an SVG viewBox using preserveAspectRatio. But if I'm not mistaken, there is currently no easy way to scale the positioning of certain filters (for example a light source) relative to the viewBox. The only two options are the unscaled user space (userSpaceOnUse) and the filtered object's bounding box (objectBoundingBox).

If we imagine try to responsively code a spot-lit visual stage, with objects moving around on it, in and out of the spotlight, it's clear that scaling multiple light sources to the bounding boxes of the individual elements moving around on the stage doesn't work. Even if we were to create a redundant empty wrapper element, and call the filter once on that element, such a wrapper element still doesn't offer the power and flexibility of preserveAspectRatio. What I want as an author is to able to delegate the scaling of SVG filters to the viewBox, and use percentage lengths for filter positions, to preserve scalability.

To put this a bit more extremely, I doubt that there has *ever* been a case when an author truly needed to specify filter scaling and positioning in unscaled global units regardless of the viewBox, in a case in which a viewBox has been specified.  In retrospect, maybe a viewBox should have been checked for from the start? But since it's presumably baked hard into the spec now (???), I would like to suggest that the best way to address this use case is to add "viewBox" as another possible value for primitiveUnits.

Note that implementations are just now catching up with these uses :) 

Received on Wednesday, 3 April 2013 19:31:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:45 UTC