public override CssRule Create(CssToken current)
        {
            var token = _tokenizer.Get();
            var rule = new CssNamespaceRule(_parser);
            rule.Prefix = GetRuleName(ref token);

            if (token.Type == CssTokenType.Url)
                rule.NamespaceUri = token.Data;

            _tokenizer.JumpToNextSemicolon();
            return rule;
        }
Пример #2
0
        public CssRule CreateNamespace(CssToken current)
        {
            var rule = new CssNamespaceRule(_parser);
            var start = current.Position;
            var token = NextToken();
            _nodes.Push(rule);
            CollectTrivia(ref token);
            rule.Prefix = GetRuleName(ref token);
            CollectTrivia(ref token);

            if (token.Type == CssTokenType.Url)
            {
                rule.NamespaceUri = token.Data;
            }

            JumpToEnd(ref token);
            rule.SourceCode = CreateView(start, token.Position);
            _nodes.Pop();
            return rule;
        }