Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / css / parser / CSSGrammar.y
index 788bda8..04b9f25 100644 (file)
@@ -467,14 +467,24 @@ semi_or_eof:
   | TOKEN_EOF
   ;
 
+before_charset_rule:
+  /* empty */ {
+      parser->startRule();
+      parser->startRuleHeader(CSSRuleSourceData::CHARSET_RULE);
+  }
+
 maybe_charset:
     /* empty */
-  | CHARSET_SYM maybe_space STRING maybe_space semi_or_eof {
+  | before_charset_rule CHARSET_SYM maybe_space STRING maybe_space semi_or_eof {
        if (parser->m_styleSheet)
-           parser->m_styleSheet->parserSetEncodingFromCharsetRule($3);
-       parser->startEndUnknownRule();
+           parser->m_styleSheet->parserSetEncodingFromCharsetRule($4);
+       parser->endRuleHeader();
+       parser->startRuleBody();
+       parser->endRule(true);
     }
-  | CHARSET_SYM at_rule_recovery
+  | before_charset_rule CHARSET_SYM at_rule_recovery {
+       parser->endRule(false);
+  }
   ;
 
 rule_list: