| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 context, tokenizer.takeEscapedStrings(), string, parser.m_styleSheet); | 238 context, tokenizer.takeEscapedStrings(), string, parser.m_styleSheet); |
| 239 } | 239 } |
| 240 bool firstRuleValid = | 240 bool firstRuleValid = |
| 241 parser.consumeRuleList(tokenizer.tokenRange(), TopLevelRuleList, | 241 parser.consumeRuleList(tokenizer.tokenRange(), TopLevelRuleList, |
| 242 [&styleSheet](StyleRuleBase* rule) { | 242 [&styleSheet](StyleRuleBase* rule) { |
| 243 if (rule->isCharsetRule()) | 243 if (rule->isCharsetRule()) |
| 244 return; | 244 return; |
| 245 styleSheet->parserAppendRule(rule); | 245 styleSheet->parserAppendRule(rule); |
| 246 }); | 246 }); |
| 247 styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid); | 247 styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid); |
| 248 if (parser.m_lazyState) |
| 249 parser.m_lazyState->finishInitialParsing(); |
| 248 TRACE_EVENT_END0("blink,blink_style", "CSSParserImpl::parseStyleSheet.parse"); | 250 TRACE_EVENT_END0("blink,blink_style", "CSSParserImpl::parseStyleSheet.parse"); |
| 249 | 251 |
| 250 TRACE_EVENT_END2("blink,blink_style", "CSSParserImpl::parseStyleSheet", | 252 TRACE_EVENT_END2("blink,blink_style", "CSSParserImpl::parseStyleSheet", |
| 251 "tokenCount", tokenizer.tokenCount(), "length", | 253 "tokenCount", tokenizer.tokenCount(), "length", |
| 252 string.length()); | 254 string.length()); |
| 253 } | 255 } |
| 254 | 256 |
| 255 CSSSelectorList CSSParserImpl::parsePageSelector( | 257 CSSSelectorList CSSParserImpl::parsePageSelector( |
| 256 CSSParserTokenRange range, | 258 CSSParserTokenRange range, |
| 257 StyleSheetContents* styleSheet) { | 259 StyleSheetContents* styleSheet) { |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 else | 981 else |
| 980 return nullptr; // Parser error, invalid value in keyframe selector | 982 return nullptr; // Parser error, invalid value in keyframe selector |
| 981 if (range.atEnd()) | 983 if (range.atEnd()) |
| 982 return result; | 984 return result; |
| 983 if (range.consume().type() != CommaToken) | 985 if (range.consume().type() != CommaToken) |
| 984 return nullptr; // Parser error | 986 return nullptr; // Parser error |
| 985 } | 987 } |
| 986 } | 988 } |
| 987 | 989 |
| 988 } // namespace blink | 990 } // namespace blink |
| OLD | NEW |