getComputedStyle object contains methods?

Dutsnattisuck

New Member
I have set up a demo here:http://jsbin.com/evifeb/This is more of me thinking out loud than a proper question but..Why do browsers insert style rules directly into the computed styles object along side methods and reserved words? It just makes it difficult to parse.. For example, you may notice in my demo that I'm filtering out everything but strings and numbers.. this is to weed out the functions that are in the same scope. Although, that is not 100% accurate because the length property value is a number.. Why not have a prototype function like "getAllStyles" that returns an object of styles without the nonsense? OKAY so I am aware of "getPropertyValue" but that is only useful if you want a specified style rule.. So I guess what I'm trying to say is: A) Is there a proper method of returning such an object that is cross browser safe? and B) If not, are there any other properties (not in the css spec) besides length that need weeding out? Thanks so much for the help. I'm ready to pull out my teeth.
 
Top