I keep encountering many references to style protochain in the documentation about css in flex. I tried to look it up but I couldn’t find any relevant information. Can anyone tell me what does the class StyleProtochain do?
In its source code, there is the following comment.
/**
* @private
* This is an all-static class with methods for building the protochains
* that Flex uses to look up CSS style properties.
*/
Cool, it tells me that there are a couple of methods for building the protochains, now I am supposed to know what it does, but I have no idea what a protochain is.
CSS styles are inherited. This means that when you create a new object and place it as a child of another in the DOM, this new object will have to inherit all the “inheritable” styles from the parent. Then it will override these styles through its stylename or inline styles.
The StyleProtoChain class is responsible for building this style list of any object ( which can have a style ) that is created. It is named thus because this class has to go up the DOMtree ( like going up the prototype chain … perhaps a misnomer!) and construct the list of styles for this object. The order in which this goes up is specified by this comment.
Hope this helps. If anyone wants further reference, you can find a link to the source here