Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: Source/core/css/parser/CSSGrammar.y

Issue 951213004: Make CSSRuleSourceData use the CSSRule Type enum (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use StyleRule::Type Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 %{ 1 %{
2 2
3 /* 3 /*
4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 App le Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2012 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012 Intel Corporation. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 parser->endRule(!!$$); 545 parser->endRule(!!$$);
546 } 546 }
547 | before_rule invalid_rule { 547 | before_rule invalid_rule {
548 $$ = 0; 548 $$ = 0;
549 parser->endRule(false); 549 parser->endRule(false);
550 } 550 }
551 ; 551 ;
552 552
553 before_import_rule: 553 before_import_rule:
554 /* empty */ { 554 /* empty */ {
555 parser->startRuleHeader(CSSRuleSourceData::IMPORT_RULE); 555 parser->startRuleHeader(StyleRule::Import);
556 } 556 }
557 ; 557 ;
558 558
559 import_rule_start: 559 import_rule_start:
560 before_import_rule IMPORT_SYM maybe_space { 560 before_import_rule IMPORT_SYM maybe_space {
561 parser->endRuleHeader(); 561 parser->endRuleHeader();
562 parser->startRuleBody(); 562 parser->startRuleBody();
563 } 563 }
564 ; 564 ;
565 565
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 ; 711 ;
712 712
713 at_rule_body_start: 713 at_rule_body_start:
714 /* empty */ { 714 /* empty */ {
715 parser->startRuleBody(); 715 parser->startRuleBody();
716 } 716 }
717 ; 717 ;
718 718
719 before_media_rule: 719 before_media_rule:
720 /* empty */ { 720 /* empty */ {
721 parser->startRuleHeader(CSSRuleSourceData::MEDIA_RULE); 721 parser->startRuleHeader(StyleRule::Media);
722 } 722 }
723 ; 723 ;
724 724
725 at_rule_header_end_maybe_space: 725 at_rule_header_end_maybe_space:
726 maybe_space { 726 maybe_space {
727 parser->endRuleHeader(); 727 parser->endRuleHeader();
728 } 728 }
729 ; 729 ;
730 730
731 media_rule_start: 731 media_rule_start:
(...skipping 10 matching lines...) Expand all
742 ; 742 ;
743 743
744 supports: 744 supports:
745 before_supports_rule SUPPORTS_SYM maybe_space supports_condition at_supports _rule_header_end '{' at_rule_body_start maybe_space block_rule_body closing_brac e { 745 before_supports_rule SUPPORTS_SYM maybe_space supports_condition at_supports _rule_header_end '{' at_rule_body_start maybe_space block_rule_body closing_brac e {
746 $$ = parser->createSupportsRule($4, $9); 746 $$ = parser->createSupportsRule($4, $9);
747 } 747 }
748 ; 748 ;
749 749
750 before_supports_rule: 750 before_supports_rule:
751 /* empty */ { 751 /* empty */ {
752 parser->startRuleHeader(CSSRuleSourceData::SUPPORTS_RULE); 752 parser->startRuleHeader(StyleRule::Supports);
753 parser->markSupportsRuleHeaderStart(); 753 parser->markSupportsRuleHeaderStart();
754 } 754 }
755 ; 755 ;
756 756
757 at_supports_rule_header_end: 757 at_supports_rule_header_end:
758 /* empty */ { 758 /* empty */ {
759 parser->endRuleHeader(); 759 parser->endRuleHeader();
760 parser->markSupportsRuleHeaderEnd(); 760 parser->markSupportsRuleHeaderEnd();
761 } 761 }
762 ; 762 ;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 parser->endProperty($8, false); 819 parser->endProperty($8, false);
820 } 820 }
821 | '(' maybe_space IDENT maybe_space ':' maybe_space error error_recovery clo sing_parenthesis maybe_space { 821 | '(' maybe_space IDENT maybe_space ':' maybe_space error error_recovery clo sing_parenthesis maybe_space {
822 $$ = false; 822 $$ = false;
823 parser->endProperty(false, false, GeneralCSSError); 823 parser->endProperty(false, false, GeneralCSSError);
824 } 824 }
825 ; 825 ;
826 826
827 before_keyframes_rule: 827 before_keyframes_rule:
828 /* empty */ { 828 /* empty */ {
829 parser->startRuleHeader(CSSRuleSourceData::KEYFRAMES_RULE); 829 parser->startRuleHeader(StyleRule::Keyframes);
830 } 830 }
831 ; 831 ;
832 832
833 keyframes_rule_start: 833 keyframes_rule_start:
834 before_keyframes_rule KEYFRAMES_SYM maybe_space 834 before_keyframes_rule KEYFRAMES_SYM maybe_space
835 ; 835 ;
836 836
837 webkit_keyframes_rule_start: 837 webkit_keyframes_rule_start:
838 before_keyframes_rule WEBKIT_KEYFRAMES_SYM maybe_space 838 before_keyframes_rule WEBKIT_KEYFRAMES_SYM maybe_space
839 ; 839 ;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 ; 911 ;
912 912
913 keyframes_error_recovery: 913 keyframes_error_recovery:
914 error rule_error_recovery { 914 error rule_error_recovery {
915 parser->reportError(parser->lastLocationLabel(), InvalidKeyframeSelector CSSError); 915 parser->reportError(parser->lastLocationLabel(), InvalidKeyframeSelector CSSError);
916 } 916 }
917 ; 917 ;
918 918
919 before_page_rule: 919 before_page_rule:
920 /* empty */ { 920 /* empty */ {
921 parser->startRuleHeader(CSSRuleSourceData::PAGE_RULE); 921 parser->startRuleHeader(StyleRule::Page);
922 } 922 }
923 ; 923 ;
924 924
925 page: 925 page:
926 before_page_rule PAGE_SYM maybe_space page_selector at_rule_header_end 926 before_page_rule PAGE_SYM maybe_space page_selector at_rule_header_end
927 '{' at_rule_body_start maybe_space_before_declaration declarations_and_margi ns closing_brace { 927 '{' at_rule_body_start maybe_space_before_declaration declarations_and_margi ns closing_brace {
928 if ($4) 928 if ($4)
929 $$ = parser->createPageRule(parser->sinkFloatingSelector($4)); 929 $$ = parser->createPageRule(parser->sinkFloatingSelector($4));
930 else { 930 else {
931 // Clear properties in the invalid @page rule. 931 // Clear properties in the invalid @page rule.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 | RIGHTMIDDLE_SYM { 1015 | RIGHTMIDDLE_SYM {
1016 $$ = CSSSelector::RightMiddleMarginBox; 1016 $$ = CSSSelector::RightMiddleMarginBox;
1017 } 1017 }
1018 | RIGHTBOTTOM_SYM { 1018 | RIGHTBOTTOM_SYM {
1019 $$ = CSSSelector::RightBottomMarginBox; 1019 $$ = CSSSelector::RightBottomMarginBox;
1020 } 1020 }
1021 ; 1021 ;
1022 1022
1023 before_font_face_rule: 1023 before_font_face_rule:
1024 /* empty */ { 1024 /* empty */ {
1025 parser->startRuleHeader(CSSRuleSourceData::FONT_FACE_RULE); 1025 parser->startRuleHeader(StyleRule::FontFace);
1026 } 1026 }
1027 ; 1027 ;
1028 1028
1029 font_face: 1029 font_face:
1030 before_font_face_rule FONT_FACE_SYM at_rule_header_end_maybe_space 1030 before_font_face_rule FONT_FACE_SYM at_rule_header_end_maybe_space
1031 '{' at_rule_body_start maybe_space_before_declaration declaration_list closi ng_brace { 1031 '{' at_rule_body_start maybe_space_before_declaration declaration_list closi ng_brace {
1032 $$ = parser->createFontFaceRule(); 1032 $$ = parser->createFontFaceRule();
1033 } 1033 }
1034 ; 1034 ;
1035 1035
1036 before_viewport_rule: 1036 before_viewport_rule:
1037 /* empty */ { 1037 /* empty */ {
1038 parser->markViewportRuleBodyStart(); 1038 parser->markViewportRuleBodyStart();
1039 parser->startRuleHeader(CSSRuleSourceData::VIEWPORT_RULE); 1039 parser->startRuleHeader(StyleRule::Viewport);
1040 } 1040 }
1041 ; 1041 ;
1042 1042
1043 viewport: 1043 viewport:
1044 before_viewport_rule VIEWPORT_RULE_SYM at_rule_header_end_maybe_space 1044 before_viewport_rule VIEWPORT_RULE_SYM at_rule_header_end_maybe_space
1045 '{' at_rule_body_start maybe_space_before_declaration declaration_list closi ng_brace { 1045 '{' at_rule_body_start maybe_space_before_declaration declaration_list closi ng_brace {
1046 $$ = parser->createViewportRule(); 1046 $$ = parser->createViewportRule();
1047 parser->markViewportRuleBodyEnd(); 1047 parser->markViewportRuleBodyEnd();
1048 } 1048 }
1049 ; 1049 ;
(...skipping 21 matching lines...) Expand all
1071 ; 1071 ;
1072 1072
1073 maybe_space_before_declaration: 1073 maybe_space_before_declaration:
1074 maybe_space { 1074 maybe_space {
1075 parser->startProperty(); 1075 parser->startProperty();
1076 } 1076 }
1077 ; 1077 ;
1078 1078
1079 before_selector_list: 1079 before_selector_list:
1080 /* empty */ { 1080 /* empty */ {
1081 parser->startRuleHeader(CSSRuleSourceData::STYLE_RULE); 1081 parser->startRuleHeader(StyleRule::Style);
1082 parser->startSelector(); 1082 parser->startSelector();
1083 } 1083 }
1084 ; 1084 ;
1085 1085
1086 at_rule_header_end: 1086 at_rule_header_end:
1087 /* empty */ { 1087 /* empty */ {
1088 parser->endRuleHeader(); 1088 parser->endRuleHeader();
1089 } 1089 }
1090 ; 1090 ;
1091 1091
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 ; 1857 ;
1858 1858
1859 rule_error_recovery: 1859 rule_error_recovery:
1860 /* empty */ 1860 /* empty */
1861 | rule_error_recovery error 1861 | rule_error_recovery error
1862 | rule_error_recovery invalid_square_brackets_block 1862 | rule_error_recovery invalid_square_brackets_block
1863 | rule_error_recovery invalid_parentheses_block 1863 | rule_error_recovery invalid_parentheses_block
1864 ; 1864 ;
1865 1865
1866 %% 1866 %%
OLDNEW
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/css/parser/CSSParserImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698