CSS applying

After the document parsing, main nodes contains their CSS properties specified in the document CSS rules. The problem is that nodes have not all their CSS properties (DOM Hierarchy is not applied). Normaly, node properties are its properties and its parents ones. Before applying styles, the application have to load all styles for a node from its parents. Here the simplified algoritm:
HtmlDOMNode>>loadStyles
parent:= self parent.
(self styles isEmpty)
   ifTrue:[self styles:=parent styles] 
   ifFalse:[
     (parent styles properties) 
        do:[:prop|
	  (self haveAlreadyRuleNamed: prop name) 
	    ifFalse:[self styles addPropertie: prop]]].
This method is runned for all the DOM Tree, before the beginning of the visual rendering process.

Subsections

Jerome Chauveau 2007-06-21