public static Rule CreateRule(this StylesheetParser parser, RuleType type) { switch (type) { case RuleType.Charset: return(new CharsetRule(parser)); case RuleType.Document: return(new DocumentRule(parser)); case RuleType.FontFace: return(new FontFaceRule(parser)); case RuleType.Import: return(new ImportRule(parser)); case RuleType.Keyframe: return(new KeyframeRule(parser)); case RuleType.Keyframes: return(new KeyframesRule(parser)); case RuleType.Media: return(new MediaRule(parser)); case RuleType.Namespace: return(new NamespaceRule(parser)); case RuleType.Page: return(new PageRule(parser)); case RuleType.Style: return(new StyleRule(parser)); case RuleType.Supports: return(new SupportsRule(parser)); case RuleType.Viewport: return(new ViewportRule(parser)); case RuleType.Unknown: case RuleType.RegionStyle: case RuleType.FontFeatureValues: case RuleType.CounterStyle: default: return(null); } }
internal DocumentRule(StylesheetParser parser) : base(RuleType.Document, parser) { }
internal PageRule(StylesheetParser parser) : base(RuleType.Page, parser) { AppendChild(SimpleSelector.All); AppendChild(new StyleDeclaration(this)); }
internal CharsetRule(StylesheetParser parser) : base(RuleType.Charset, parser) { }
internal MediaList(StylesheetParser parser) { _parser = parser; }
internal NamespaceRule(StylesheetParser parser) : base(RuleType.Namespace, parser) { }
internal Stylesheet(StylesheetParser parser) { _parser = parser; Rules = new RuleList(this); }
internal DeclarationRule(RuleType type, string name, StylesheetParser parser) : base(type, parser) { _name = name; }
internal MediaRule(StylesheetParser parser) : base(RuleType.Media, parser) { AppendChild(new MediaList(parser)); }
internal SupportsRule(StylesheetParser parser) : base(RuleType.Supports, parser) { }
internal KeyframesRule(StylesheetParser parser) : base(RuleType.Keyframes, parser) { Rules = new RuleList(this); }
public StylesheetComposer(Lexer lexer, StylesheetParser parser) { _lexer = lexer; _parser = parser; _nodes = new Stack <StylesheetNode>(); }
internal ImportRule(StylesheetParser parser) : base(RuleType.Import, parser) { AppendChild(new MediaList(parser)); }
public UnknownRule(string name, StylesheetParser parser) : base(RuleType.Unknown, parser) { Name = name; }
internal KeyframeRule(StylesheetParser parser) : base(RuleType.Keyframe, parser) { AppendChild(new StyleDeclaration(this)); }