Exemplo n.º 1
0
        private bool ParseKeyframeText(Block token)
        {
            if (token.GrammarSegment == GrammarSegment.CurlyBraceOpen)
            {
                SetParsingContext(ParsingContext.InDeclaration);
                return(true);
            }

            if (token.GrammarSegment == GrammarSegment.CurlyBracketClose)
            {
                ParseKeyframesData(token);

                return(false);
            }

            var frame = new KeyframeRule
            {
                Value = token.ToString()
            };


            CastRuleSet <KeyframesRule>().Declarations.Add(frame);
            _activeRuleSets.Push(frame);

            return(true);
        }
Exemplo n.º 2
0
        private bool ParseKeyframeText(Block token)
        {
            if (token.GrammarSegment == GrammarSegment.CurlyBraceOpen)
            {
                _frame = null;
                SetParsingContext(ParsingContext.InDeclaration);
                return(true);
            }

            if (token.GrammarSegment == GrammarSegment.CurlyBracketClose)
            {
                ParseKeyframesData(token);
                return(false);
            }

            if (token.GrammarSegment == GrammarSegment.Comma)
            {
                return(true);
            }

            if (_frame == null)
            {
                _frame = new KeyframeRule();
                _frame.AddValue(token.ToString());

                CastRuleSet <KeyframesRule>().Declarations.Add(_frame);
                _activeRuleSets.Push(_frame);
            }
            else
            {
                _frame.AddValue(token.ToString());
            }

            return(true);
        }
Exemplo n.º 3
0
 public KeyframeRule CreateKeyframeRule(Token current)
 {
     var rule = new KeyframeRule(_parser);
     var start = current.Position;
     _nodes.Push(rule);
     ParseComments(ref current);
     rule.Key = CreateKeyframeSelector(ref current);
     var end = FillDeclarations(rule.Style);
     rule.StylesheetText = CreateView(start, end);
     _nodes.Pop();
     return rule.Key != null ? rule : null;
 }
Exemplo n.º 4
0
        private bool ParseKeyframeText(Block token)
        {
            if (token.GrammarSegment == GrammarSegment.CurlyBraceOpen)
            {
                SetParsingContext(ParsingContext.InDeclaration);
                return(true);
            }

            if (token.GrammarSegment == GrammarSegment.CurlyBracketClose)
            {
                ParseKeyframesData(token);

                return(false);
            }

            if (token.GrammarSegment == GrammarSegment.Comma)
            {
                if (_activeRuleSets.Count != 0 && _activeRuleSets.Peek() is KeyframeRule)
                {
                    FinalizeRule();
                }
                SetParsingContext(ParsingContext.KeyframesData);
                return(false);
            }

            var frame = new KeyframeRule
            {
                Value = token.ToString()
            };


            var ruleset = CastRuleSet <KeyframesRule>();

            if (ruleset != null)
            {
                ruleset.Declarations.Add(frame);
            }
            _activeRuleSets.Push(frame);

            return(true);
        }
Exemplo n.º 5
0
        private bool ParseKeyframeText(Block token)
        {
            if (token.GrammarSegment == GrammarSegment.CurlyBraceOpen)
            {
                _frame = null;
                SetParsingContext(ParsingContext.InDeclaration);
                return true;
            }

            if (token.GrammarSegment == GrammarSegment.CurlyBracketClose)
            {
                ParseKeyframesData(token);
                return false;
            }

            if (token.GrammarSegment == GrammarSegment.Comma)
            {
                return true;
            }

            if (_frame == null)
            {
                _frame = new KeyframeRule();
                _frame.AddValue(token.ToString());

                CastRuleSet<KeyframesRule>().Declarations.Add(_frame);
                _activeRuleSets.Push(_frame);
            }
            else
            {
                _frame.AddValue(token.ToString());
            }

            return true;
        }
Exemplo n.º 6
0
        private bool ParseKeyframeText(Block token)
        {
            if (token.GrammarSegment == GrammarSegment.CurlyBraceOpen)
            {
                SetParsingContext(ParsingContext.InDeclaration);
                return true;
            }

            if (token.GrammarSegment == GrammarSegment.CurlyBracketClose)
            {
                ParseKeyframesData(token);

                return false;
            }

            var frame = new KeyframeRule
            {
                Value = token.ToString()
            };

            CastRuleSet<KeyframesRule>().Declarations.Add(frame);
            _activeRuleSets.Push(frame);

            return true;
        }