code: public StyleMap evaluateDOM(Document doc, MediaSpec media, final boolean inherit) {
  
  		DeclarationMap declarations = assingDeclarationsToDOM(doc, media, inherit);
  
  		StyleMap nodes = new StyleMap(declarations.size());
  
  		Traversal<StyleMap> traversal = new Traversal<StyleMap>(
  				doc, (Object) declarations, NodeFilter.SHOW_ELEMENT) {
  			
  			@Override
  			protected void processNode(StyleMap result, Node current, Object source) {
  
  			    NodeData main = CSSFactory.createNodeData();
  			    
  				// for all declarations available in the main list (pseudo=null)
  				List<Declaration> declarations = ((DeclarationMap) source).get((Element) current, null);
  				if (declarations != null) 
  				{
  					for (Declaration d : declarations) {
  						main.push(d);
  					}
  					if (inherit)
  						main.inheritFrom(result.get((Element) walker.parentNode(), null));
  				}
  				// concretize values and store them
  				result.put((Element) current, null, main.concretize());
  				
  				//repeat for the pseudo classes (if any)
  				for (PseudoElementType pseudo : ((DeclarationMap) source).pseudoSet((Element) current))
  				{
  				    NodeData pdata = CSSFactory.createNodeData();
  	                declarations = ((DeclarationMap) source).get((Element) current, pseudo);
  	                if (declarations != null) 
  	                {
  	                    for (Declaration d : declarations) {
  	                        pdata.push(d);
  	                    }
                          pdata.inheritFrom(main); //always inherit from the main element style
  	                }
  	                // concretize values and store them
  	                result.put((Element) current, pseudo, pdata.concretize());
  				}
  				
  			}
  		};
  
  		traversal.levelTraversal(nodes);
  
  		return nodes;
  	}
docs: Evaluates CSS properties of DOM tree
  
  @param doc
  Document tree
  @param media
  Media
  @param inherit
  Use inheritance
  @return Map where each element contains its CSS properties