public override CssRule Create(CssToken current)
        {
            var token = _tokenizer.Get();
            var rule = new CssSupportsRule(_parser);
            rule.Condition = CreateCondition(ref token);

            if (token.Type != CssTokenType.CurlyBracketOpen)
                return SkipDeclarations(token);

            FillRules(rule);
            return rule;
        }
Ejemplo n.º 2
0
        public CssRule CreateSupports(CssToken current)
        {
            var rule = new CssSupportsRule(_parser);
            var start = current.Position;
            var token = NextToken();
            _nodes.Push(rule);
            CollectTrivia(ref token);
            rule.Condition = AggregateCondition(ref token);
            CollectTrivia(ref token);

            if (token.Type == CssTokenType.CurlyBracketOpen)
            {
                var end = FillRules(rule);
                rule.SourceCode = CreateView(start, end);
                _nodes.Pop();
                return rule;
            }

            _nodes.Pop();
            return SkipDeclarations(token);
        }