예제 #1
0
        public CssRule CreateViewport(CssToken current)
        {
            var token = _tokenizer.Get();
            var rule = new CssViewportRule(_parser);

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

            FillDeclarations(rule, Factory.Properties.CreateViewport);
            return rule;
        }
예제 #2
0
        public CssRule CreateViewport(CssToken current)
        {
            var rule = new CssViewportRule(_parser);
            var start = current.Position;
            var token = NextToken();
            _nodes.Push(rule);
            CollectTrivia(ref token);

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

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