OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/CSSPropertyParser.h" | 5 #include "core/css/parser/CSSPropertyParser.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/css/CSSBasicShapeValues.h" | 8 #include "core/css/CSSBasicShapeValues.h" |
9 #include "core/css/CSSBorderImage.h" | 9 #include "core/css/CSSBorderImage.h" |
10 #include "core/css/CSSContentDistributionValue.h" | 10 #include "core/css/CSSContentDistributionValue.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::cont
ainsValidVariableReferences(originalRange)) { | 173 if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::cont
ainsValidVariableReferences(originalRange)) { |
174 // We don't expand the shorthand here because crazypants. | 174 // We don't expand the shorthand here because crazypants. |
175 CSSVariableReferenceValue* variable = CSSVariableReferenceValue::create(
CSSVariableData::create(originalRange)); | 175 CSSVariableReferenceValue* variable = CSSVariableReferenceValue::create(
CSSVariableData::create(originalRange)); |
176 addProperty(propertyId, CSSPropertyInvalid, variable, important); | 176 addProperty(propertyId, CSSPropertyInvalid, variable, important); |
177 return true; | 177 return true; |
178 } | 178 } |
179 | 179 |
180 return false; | 180 return false; |
181 } | 181 } |
182 | 182 |
183 bool CSSPropertyParser::isColorKeyword(CSSValueID id) | |
184 { | |
185 // Named colors and color keywords: | |
186 // | |
187 // <named-color> | |
188 // 'aqua', 'black', 'blue', ..., 'yellow' (CSS3: "basic color keywords") | |
189 // 'aliceblue', ..., 'yellowgreen' (CSS3: "extended color keywords"
) | |
190 // 'transparent' | |
191 // | |
192 // 'currentcolor' | |
193 // | |
194 // <deprecated-system-color> | |
195 // 'ActiveBorder', ..., 'WindowText' | |
196 // | |
197 // WebKit proprietary/internal: | |
198 // '-webkit-link' | |
199 // '-webkit-activelink' | |
200 // '-internal-active-list-box-selection' | |
201 // '-internal-active-list-box-selection-text' | |
202 // '-internal-inactive-list-box-selection' | |
203 // '-internal-inactive-list-box-selection-text' | |
204 // '-webkit-focus-ring-color' | |
205 // '-internal-quirk-inherit' | |
206 // | |
207 return (id >= CSSValueAqua && id <= CSSValueInternalQuirkInherit) | |
208 || (id >= CSSValueAliceblue && id <= CSSValueYellowgreen) | |
209 || id == CSSValueMenu; | |
210 } | |
211 | |
212 bool CSSPropertyParser::isSystemColor(CSSValueID id) | 183 bool CSSPropertyParser::isSystemColor(CSSValueID id) |
213 { | 184 { |
214 return (id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSS
ValueMenu; | 185 return (id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSS
ValueMenu; |
215 } | 186 } |
216 | 187 |
217 template <typename CharacterType> | 188 template <typename CharacterType> |
218 static CSSPropertyID unresolvedCSSPropertyID(const CharacterType* propertyName,
unsigned length) | 189 static CSSPropertyID unresolvedCSSPropertyID(const CharacterType* propertyName,
unsigned length) |
219 { | 190 { |
220 char buffer[maxCSSPropertyNameLength + 1]; // 1 for null character | 191 char buffer[maxCSSPropertyNameLength + 1]; // 1 for null character |
221 | 192 |
(...skipping 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5191 case CSSPropertyGridTemplate: | 5162 case CSSPropertyGridTemplate: |
5192 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 5163 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
5193 case CSSPropertyGrid: | 5164 case CSSPropertyGrid: |
5194 return consumeGridShorthand(important); | 5165 return consumeGridShorthand(important); |
5195 default: | 5166 default: |
5196 return false; | 5167 return false; |
5197 } | 5168 } |
5198 } | 5169 } |
5199 | 5170 |
5200 } // namespace blink | 5171 } // namespace blink |
OLD | NEW |