Beispiel #1
0
        public static StyledNode StyleTree(Dom.Node root, Css.Stylesheet stylesheet)
        {
            var specifiedValues = new Dictionary <string, Css.Value>();

            switch (root.NodeType)
            {
            case Dom.ElementData elem:
                specifiedValues = GetSpecifiedValues(elem, stylesheet);
                break;
            }

            var children = root.Children.Select(child => StyleTree(child, stylesheet)).ToList();

            return(new StyledNode(root, specifiedValues, children));
        }
Beispiel #2
0
 public StyledNode(Dom.Node node, Dictionary <string, Css.Value> specifiedValues, List <StyledNode> children)
 {
     Node            = node;
     SpecifiedValues = specifiedValues;
     Children        = children;
 }
Beispiel #3
0
 public StyledNode()
 {
     Node            = new Dom.Node();
     SpecifiedValues = new Dictionary <string, Css.Value>();
     Children        = new List <StyledNode>();
 }