Пример #1
0
        private static bool TryParseCompoundSelector(CssStringStreamReader reader, out CssCompoundSelector selector)
        {
            var simpleSelectors = new List <CssSimpleSelector>();

            reader.SkipWhitespaceAndComments();
            while (!reader.IsEndOfStream)
            {
                if (!TryParseSimpleSelector(reader, out var simpleSelector))
                {
                    break;
                }
                simpleSelectors.Add(simpleSelector);
                if (IsCombinatorChar(reader.CurrentChar))
                {
                    break;
                }
            }
            if (simpleSelectors.Count == 0)
            {
                selector = null;
                return(false);
            }
            selector = new CssCompoundSelector(simpleSelectors.ToArray());
            return(true);
        }
 public CssComplexSelectorItem(CssCompoundSelector selector, CssCombinatorType?combinator)
 {
     Selector   = selector ?? throw new ArgumentNullException(nameof(selector));
     Combinator = combinator;
 }
Пример #3
0
 public virtual void VisitCompoundSelector(CssCompoundSelector selector)
 => DefaultVisit(selector);