public Rule CreateStyle(Token current)
 {
     var rule = new StyleRule(_parser);
     var start = current.Position;
     _nodes.Push(rule);
     ParseComments(ref current);
     rule.Selector = CreateSelector(ref current);
     var end = FillDeclarations(rule.Style);
     rule.StylesheetText = CreateView(start, end);
     _nodes.Pop();
     return rule.Selector != null ? rule : null;
 }
Example #2
0
        public override bool Equals(object obj)
        {
            //Check for null and compare run-time types.
            if ((obj == null) || !this.GetType().Equals(obj.GetType()))
            {
                return(false);
            }
            else
            {
                StyleRule p = (StyleRule)obj;

                var declaresMatch = (Declarations == p.Declarations);

                // Limited comparison - should we delve depper?
                return((Value == p.Value) &&
                       (Selector == p.Selector) &&
                       (Declarations == p.Declarations) &&
                       (RuleType == p.RuleType));
            }
        }
Example #3
0
 void ObfuscateSelectors(StyleRule rule)
 {
     rule.Selector = ObfuscateSelectors(rule.Selector);
 }