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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp

Issue 1648593002: Revert of Add deprecation message for -webkit-background-composite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
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"
11 #include "core/css/StyleRuleImport.h" 11 #include "core/css/StyleRuleImport.h"
12 #include "core/css/StyleRuleKeyframe.h" 12 #include "core/css/StyleRuleKeyframe.h"
13 #include "core/css/StyleRuleNamespace.h" 13 #include "core/css/StyleRuleNamespace.h"
14 #include "core/css/StyleSheetContents.h" 14 #include "core/css/StyleSheetContents.h"
15 #include "core/css/parser/CSSAtRuleID.h" 15 #include "core/css/parser/CSSAtRuleID.h"
16 #include "core/css/parser/CSSParserObserver.h" 16 #include "core/css/parser/CSSParserObserver.h"
17 #include "core/css/parser/CSSParserObserverWrapper.h" 17 #include "core/css/parser/CSSParserObserverWrapper.h"
18 #include "core/css/parser/CSSParserSelector.h" 18 #include "core/css/parser/CSSParserSelector.h"
19 #include "core/css/parser/CSSPropertyParser.h" 19 #include "core/css/parser/CSSPropertyParser.h"
20 #include "core/css/parser/CSSSelectorParser.h" 20 #include "core/css/parser/CSSSelectorParser.h"
21 #include "core/css/parser/CSSSupportsParser.h" 21 #include "core/css/parser/CSSSupportsParser.h"
22 #include "core/css/parser/CSSTokenizer.h" 22 #include "core/css/parser/CSSTokenizer.h"
23 #include "core/css/parser/CSSVariableParser.h" 23 #include "core/css/parser/CSSVariableParser.h"
24 #include "core/css/parser/MediaQueryParser.h" 24 #include "core/css/parser/MediaQueryParser.h"
25 #include "core/dom/Document.h" 25 #include "core/dom/Document.h"
26 #include "core/dom/Element.h" 26 #include "core/dom/Element.h"
27 #include "core/frame/Deprecation.h"
28 #include "core/frame/UseCounter.h" 27 #include "core/frame/UseCounter.h"
29 #include "platform/TraceEvent.h" 28 #include "platform/TraceEvent.h"
30 #include "wtf/BitArray.h" 29 #include "wtf/BitArray.h"
31 30
32 namespace blink { 31 namespace blink {
33 32
34 CSSParserImpl::CSSParserImpl(const CSSParserContext& context, StyleSheetContents * styleSheet) 33 CSSParserImpl::CSSParserImpl(const CSSParserContext& context, StyleSheetContents * styleSheet)
35 : m_context(context) 34 : m_context(context)
36 , m_styleSheet(styleSheet) 35 , m_styleSheet(styleSheet)
37 , m_observerWrapper(nullptr) 36 , m_observerWrapper(nullptr)
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 712
714 size_t propertiesCount = m_parsedProperties.size(); 713 size_t propertiesCount = m_parsedProperties.size();
715 if (RuntimeEnabledFeatures::cssVariablesEnabled() && unresolvedProperty == C SSPropertyInvalid && CSSVariableParser::isValidVariableName(token)) { 714 if (RuntimeEnabledFeatures::cssVariablesEnabled() && unresolvedProperty == C SSPropertyInvalid && CSSVariableParser::isValidVariableName(token)) {
716 AtomicString variableName = token.value(); 715 AtomicString variableName = token.value();
717 consumeVariableValue(range.makeSubRange(&range.peek(), declarationValueE nd), variableName, important); 716 consumeVariableValue(range.makeSubRange(&range.peek(), declarationValueE nd), variableName, important);
718 } 717 }
719 718
720 if (important && (ruleType == StyleRule::FontFace || ruleType == StyleRule:: Keyframe)) 719 if (important && (ruleType == StyleRule::FontFace || ruleType == StyleRule:: Keyframe))
721 return; 720 return;
722 721
723 if (unresolvedProperty != CSSPropertyInvalid) { 722 if (unresolvedProperty != CSSPropertyInvalid)
724 if (m_styleSheet && m_styleSheet->singleOwnerDocument())
725 Deprecation::warnOnDeprecatedProperties(m_styleSheet->singleOwnerDoc ument()->frame(), unresolvedProperty);
726 consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationVal ueEnd), unresolvedProperty, important, ruleType); 723 consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationVal ueEnd), unresolvedProperty, important, ruleType);
727 }
728 724
729 if (m_observerWrapper && (ruleType == StyleRule::Style || ruleType == StyleR ule::Keyframe)) { 725 if (m_observerWrapper && (ruleType == StyleRule::Style || ruleType == StyleR ule::Keyframe)) {
730 m_observerWrapper->observer().observeProperty( 726 m_observerWrapper->observer().observeProperty(
731 m_observerWrapper->startOffset(rangeCopy), m_observerWrapper->endOff set(rangeCopy), 727 m_observerWrapper->startOffset(rangeCopy), m_observerWrapper->endOff set(rangeCopy),
732 important, m_parsedProperties.size() != propertiesCount); 728 important, m_parsedProperties.size() != propertiesCount);
733 } 729 }
734 } 730 }
735 731
736 void CSSParserImpl::consumeVariableValue(CSSParserTokenRange range, const Atomic String& variableName, bool important) 732 void CSSParserImpl::consumeVariableValue(CSSParserTokenRange range, const Atomic String& variableName, bool important)
737 { 733 {
(...skipping 21 matching lines...) Expand all
759 else 755 else
760 return nullptr; // Parser error, invalid value in keyframe selector 756 return nullptr; // Parser error, invalid value in keyframe selector
761 if (range.atEnd()) 757 if (range.atEnd())
762 return result.release(); 758 return result.release();
763 if (range.consume().type() != CommaToken) 759 if (range.consume().type() != CommaToken)
764 return nullptr; // Parser error 760 return nullptr; // Parser error
765 } 761 }
766 } 762 }
767 763
768 } // namespace blink 764 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/frame/Deprecation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698