Re: DOM APIs - Accessing The viewBox Attribute

On 1/21/10, Doug Schepers <schepers@w3.org> wrote:
> Hi, Francis-
>
> Francis Hemsher wrote (on 1/21/10 12:50 PM):
>>
>> Well, I've got a list of goodies that I think could be valid new APIs
>> for the DOM.
>> Would it be OK to start a  new thread where we could all input our wish
>> lists?
>
> Sure, we can continue here.  What have you got?
>
>
> Regards-
> -Doug Schepers
> W3C Team Contact, SVG and WebApps WGs
>

Hi Doug,
This is such a wonderous thread with a lofty subject.  I think we
could each  include our  enchancement request(s) after "DOM APIs" in
the Subject, so it's easy to track our requests.  I'll try it this way
on a suggestion, and see how it pans out.


Accessing the viewBox Attribute:
The further along I move in dynamic SVG, I find myself continually
accessing and changing the viewBox attribute value, for not only the
top SVG element, but also for symbol elements. It seems so non-elegant
to create and parse the viewBox attribute string = "x y width height".
I have to parse on "space" and reassemble with the needed spaces.

Therefore the following would be useful:

var myViewBox=mySVG.getCVB() //----get current viewBox---
var vbX=myViewBox.x
var vbY=myViewBox.y
var vbWidth=myViewBox.width
var vbHeight=myViewBox.height
//---and then also setting new values---
myViewBox.x=myNewVbX
myViewBox.y=myNewVbY
myViewBox.width=myNewVbWidth
myViewBox.height=myNewVbHeight

I'm suggestion we include a new method, called getCVB(), that will
work on elements that have the viewBox attribute, and operate on it as
shown above.

Regards,
Francis

Received on Friday, 22 January 2010 02:38:40 UTC