Some of that functionality is built into DOM Inspector, but you can look at the parts that Firebug does itself.
In lib.js there is a list of properties ("inheritedStyleNames") that can be automatically inherited, so for a given element it looks for such properties in the rules being applied to each ancestor. (That list doesn't include the special print or aural properties.)
The table here (http://www.w3.org/TR/CSS2
"updateCascadeView" in css.js will also be of interest.
Via http://code.google.com/p/f
branches/firebug1.2/conten
branches/firebug1.2/conten
Main Topics
Browse All Topics





by: cwolvesPosted on 2008-05-04 at 11:06:08ID: 21496397
It's done with internal firefox debugging classes that aren't exposed to the client. There is no simple way to emulate this, but if you -really- want to here's what it involves doing:
hash); }
function showStyles(obj, hash)
if(!hash){ hash = {}; }
// read obj.style, push each attribute into a hash, removing existing ones as being "overwritten"
// read all classes from all stylesheets and check the xpath of each one against obj
// for any matched classes, push each attribute into a hash, removing existing ones as being "overwritten"
if(obj.parentNode){ showStyles(obj.parentNode,
return hash;
}
it's fairly complicated and slow, I wouldn't recommend trying it :-)