private void ApplyStyle(CSSelector nextSelector, Specificity specificity, HtmlNode node, List<HtmlStyle> htmlStyles)
        {
            if (node.Next != null)
            {
            	if (nextSelector.IsValidNode(node.GetNext()))
                {
                    nextSelector.AddSpecificity(specificity);
            		nextSelector.Parse(node.GetNext(), htmlStyles);
                }

                ApplyStyle(nextSelector, specificity, node.GetNext(), htmlStyles);
            }
        }
        private void ApplyStyle(CSSelector nextSelector, Specificity specificity, HtmlNode node, List<HtmlStyle> htmlStyles)
		{
			if (nextSelector.IsValidNode(node))
			{
                nextSelector.AddSpecificity(specificity);
				nextSelector.Parse(node, htmlStyles);
			}

			foreach (HtmlNode child in node.GetChildren())
			{
                ApplyStyle(nextSelector.Clone(), specificity, child, htmlStyles);
			}
		}
        public bool ParseSelector(string selectorText, out CSSelector selector)
        {
            selector = null;

            foreach (CSSelector item in selectors)
            {
                if (item.Prepare(selectorText))
                {
                    selector = item.Clone();

                    return true;
                }
            }

            return false;
        }