| 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/CSSCustomPropertyDeclaration.h" | 7 #include "core/css/CSSCustomPropertyDeclaration.h" |
| 8 #include "core/css/CSSKeyframesRule.h" | 8 #include "core/css/CSSKeyframesRule.h" |
| 9 #include "core/css/CSSStyleSheet.h" | 9 #include "core/css/CSSStyleSheet.h" |
| 10 #include "core/css/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 } | 685 } |
| 686 } | 686 } |
| 687 | 687 |
| 688 void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Typ
e ruleType) | 688 void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule::Typ
e ruleType) |
| 689 { | 689 { |
| 690 CSSParserTokenRange rangeCopy = range; // For inspector callbacks | 690 CSSParserTokenRange rangeCopy = range; // For inspector callbacks |
| 691 | 691 |
| 692 ASSERT(range.peek().type() == IdentToken); | 692 ASSERT(range.peek().type() == IdentToken); |
| 693 const CSSParserToken& token = range.consumeIncludingWhitespace(); | 693 const CSSParserToken& token = range.consumeIncludingWhitespace(); |
| 694 CSSPropertyID unresolvedProperty = token.parseAsUnresolvedCSSPropertyID(); | 694 CSSPropertyID unresolvedProperty = token.parseAsUnresolvedCSSPropertyID(); |
| 695 if (m_styleSheet && m_styleSheet->singleOwnerDocument()) |
| 696 UseCounter::countDeprecation(m_styleSheet->singleOwnerDocument()->frame(
), unresolvedProperty); |
| 695 if (range.consume().type() != ColonToken) | 697 if (range.consume().type() != ColonToken) |
| 696 return; // Parse error | 698 return; // Parse error |
| 697 | 699 |
| 698 bool important = false; | 700 bool important = false; |
| 699 const CSSParserToken* declarationValueEnd = range.end(); | 701 const CSSParserToken* declarationValueEnd = range.end(); |
| 700 const CSSParserToken* last = range.end() - 1; | 702 const CSSParserToken* last = range.end() - 1; |
| 701 while (last->type() == WhitespaceToken) | 703 while (last->type() == WhitespaceToken) |
| 702 --last; | 704 --last; |
| 703 if (last->type() == IdentToken && last->valueEqualsIgnoringCase("important")
) { | 705 if (last->type() == IdentToken && last->valueEqualsIgnoringCase("important")
) { |
| 704 --last; | 706 --last; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 else | 757 else |
| 756 return nullptr; // Parser error, invalid value in keyframe selector | 758 return nullptr; // Parser error, invalid value in keyframe selector |
| 757 if (range.atEnd()) | 759 if (range.atEnd()) |
| 758 return result.release(); | 760 return result.release(); |
| 759 if (range.consume().type() != CommaToken) | 761 if (range.consume().type() != CommaToken) |
| 760 return nullptr; // Parser error | 762 return nullptr; // Parser error |
| 761 } | 763 } |
| 762 } | 764 } |
| 763 | 765 |
| 764 } // namespace blink | 766 } // namespace blink |
| OLD | NEW |