OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/parser/CSSParserImpl.h" | 5 #include "core/css/parser/CSSParserImpl.h" |
6 | 6 |
7 #include "core/css/CSSCustomIdentValue.h" | 7 #include "core/css/CSSCustomIdentValue.h" |
8 #include "core/css/CSSCustomPropertyDeclaration.h" | 8 #include "core/css/CSSCustomPropertyDeclaration.h" |
9 #include "core/css/CSSKeyframesRule.h" | 9 #include "core/css/CSSKeyframesRule.h" |
10 #include "core/css/CSSStyleSheet.h" | 10 #include "core/css/CSSStyleSheet.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 if (range.AtEnd() || range.Peek().GetType() == kSemicolonToken) { | 460 if (range.AtEnd() || range.Peek().GetType() == kSemicolonToken) { |
461 range.Consume(); | 461 range.Consume(); |
462 if (allowed_rules == kAllowCharsetRules && id == kCSSAtRuleCharset) | 462 if (allowed_rules == kAllowCharsetRules && id == kCSSAtRuleCharset) |
463 return ConsumeCharsetRule(prelude); | 463 return ConsumeCharsetRule(prelude); |
464 if (allowed_rules <= kAllowImportRules && id == kCSSAtRuleImport) | 464 if (allowed_rules <= kAllowImportRules && id == kCSSAtRuleImport) |
465 return ConsumeImportRule(prelude); | 465 return ConsumeImportRule(prelude); |
466 if (allowed_rules <= kAllowNamespaceRules && id == kCSSAtRuleNamespace) | 466 if (allowed_rules <= kAllowNamespaceRules && id == kCSSAtRuleNamespace) |
467 return ConsumeNamespaceRule(prelude); | 467 return ConsumeNamespaceRule(prelude); |
468 if (allowed_rules == kApplyRules && id == kCSSAtRuleApply) { | 468 if (allowed_rules == kApplyRules && id == kCSSAtRuleApply) { |
469 ConsumeApplyRule(prelude); | 469 ConsumeApplyRule(prelude); |
470 return nullptr; // consumeApplyRule just updates m_parsedProperties | 470 return nullptr; // ConsumeApplyRule just updates parsed_properties_ |
471 } | 471 } |
472 return nullptr; // Parse error, unrecognised at-rule without block | 472 return nullptr; // Parse error, unrecognised at-rule without block |
473 } | 473 } |
474 | 474 |
475 CSSParserTokenRange block = range.ConsumeBlock(); | 475 CSSParserTokenRange block = range.ConsumeBlock(); |
476 if (allowed_rules == kKeyframeRules) | 476 if (allowed_rules == kKeyframeRules) |
477 return nullptr; // Parse error, no at-rules supported inside @keyframes | 477 return nullptr; // Parse error, no at-rules supported inside @keyframes |
478 if (allowed_rules == kNoRules || allowed_rules == kApplyRules) | 478 if (allowed_rules == kNoRules || allowed_rules == kApplyRules) |
479 return nullptr; // Parse error, no at-rules with blocks supported inside | 479 return nullptr; // Parse error, no at-rules with blocks supported inside |
480 // declaration lists | 480 // declaration lists |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 else | 984 else |
985 return nullptr; // Parser error, invalid value in keyframe selector | 985 return nullptr; // Parser error, invalid value in keyframe selector |
986 if (range.AtEnd()) | 986 if (range.AtEnd()) |
987 return result; | 987 return result; |
988 if (range.Consume().GetType() != kCommaToken) | 988 if (range.Consume().GetType() != kCommaToken) |
989 return nullptr; // Parser error | 989 return nullptr; // Parser error |
990 } | 990 } |
991 } | 991 } |
992 | 992 |
993 } // namespace blink | 993 } // namespace blink |
OLD | NEW |