CSS Object Model Api

The stylesheet seen as an in memory tree.
The CSSOM api allows the application to parse the stylesheet and build an in-memory representation (aka object model) of the stylesheet. That in-memory representation is actually a tree.

What does the tree looks like ?
Basically, a CSS stylesheet is a list of statements. So the CSSOM tree is actually a list of statment nodes. A statement can be of several types:

So, a statement node (remember, we are in a tree) of type ruleset, for example, will have children nodes. One child node for the selector list of the rulesets and another one for the list of property declarations...

At this point, the best thing to do to see what the nodes in the CSSOM tree look like is to have a look at the api documentation automatically extracted from the source code comments.

Some code examples