Letractively / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Implement magically getting and setting className #392

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
_getClassName and _setClassName are actually not wired up or working yet;
implement them.

Original issue reported on code.google.com by bradneub...@gmail.com on 5 Nov 2009 at 11:48

GoogleCodeExporter commented 8 years ago
Issue 458 has been merged into this issue.

Original comment by bradneub...@gmail.com on 9 Apr 2010 at 2:45

GoogleCodeExporter commented 8 years ago
I started working on this and realized it's a trickier issue than I thought. 
className in SVG is an 
AnimatedString, which means you get the baseVal/animVal grossness, which we 
haven't baked in 
yet. There are serious implementation issues with IE for baseVal/animVal due to 
not having magic 
getters and setters at that level, and serious usability issues with 
baseVal/animVal. I've added unit 
tests for this in testClassName() in test_js.js, but I'm going to put 
implementing this on hold for a 
bit.

Ideally, I'd like to find a pragmatic alternative to baseVal/animVal in general 
that is easier to use 
and avoids the IE issues; this will differ from the standard but I don't think 
most folks will mind -- 
its generally acknowledged baseVal/animVal is _horrible_. I'd patch in what the 
alternative is for 
native browsers, but this will take some thinking on my part.

Original comment by bradneub...@gmail.com on 9 Apr 2010 at 8:04

GoogleCodeExporter commented 8 years ago
BTW, this means that setting the className looks like this in HTML:

myElem.className = 'foobar'

But in SVG its:

myElem.className.baseVal = 'foobar'
alert(myElem.className.baseVal);

Bad news bears.

Original comment by bradneub...@gmail.com on 9 Apr 2010 at 8:04