Exemple #1
0
        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);
            }
        }
Exemple #2
0
 internal DocumentRule(StylesheetParser parser)
     : base(RuleType.Document, parser)
 {
 }
Exemple #3
0
 internal PageRule(StylesheetParser parser)
     : base(RuleType.Page, parser)
 {
     AppendChild(SimpleSelector.All);
     AppendChild(new StyleDeclaration(this));
 }
Exemple #4
0
 internal CharsetRule(StylesheetParser parser)
     : base(RuleType.Charset, parser)
 {
 }
Exemple #5
0
 internal MediaList(StylesheetParser parser)
 {
     _parser = parser;
 }
Exemple #6
0
 internal NamespaceRule(StylesheetParser parser)
     : base(RuleType.Namespace, parser)
 {
 }
Exemple #7
0
 internal Stylesheet(StylesheetParser parser)
 {
     _parser = parser;
     Rules   = new RuleList(this);
 }
Exemple #8
0
 internal DeclarationRule(RuleType type, string name, StylesheetParser parser)
     : base(type, parser)
 {
     _name = name;
 }
Exemple #9
0
 internal MediaRule(StylesheetParser parser) : base(RuleType.Media, parser)
 {
     AppendChild(new MediaList(parser));
 }
Exemple #10
0
 internal SupportsRule(StylesheetParser parser)
     : base(RuleType.Supports, parser)
 {
 }
Exemple #11
0
 internal KeyframesRule(StylesheetParser parser)
     : base(RuleType.Keyframes, parser)
 {
     Rules = new RuleList(this);
 }
Exemple #12
0
 public StylesheetComposer(Lexer lexer, StylesheetParser parser)
 {
     _lexer  = lexer;
     _parser = parser;
     _nodes  = new Stack <StylesheetNode>();
 }
Exemple #13
0
 internal ImportRule(StylesheetParser parser) : base(RuleType.Import, parser)
 {
     AppendChild(new MediaList(parser));
 }
Exemple #14
0
 public UnknownRule(string name, StylesheetParser parser)
     : base(RuleType.Unknown, parser)
 {
     Name = name;
 }
Exemple #15
0
 internal KeyframeRule(StylesheetParser parser)
     : base(RuleType.Keyframe, parser)
 {
     AppendChild(new StyleDeclaration(this));
 }