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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl

Issue 1957163002: Rename KeywordValue to CSSKeywordValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/cssom/CSSOMKeywords.h" 5 #include "core/css/cssom/CSSOMKeywords.h"
6 6
7 #include "core/css/cssom/KeywordValue.h" 7 #include "core/css/cssom/CSSKeywordValue.h"
8 #include "wtf/HashMap.h" 8 #include "wtf/HashMap.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 namespace { 12 namespace {
13 13
14 using KeywordTable = HashMap<CSSPropertyID, Vector<CSSValueID>>; 14 using KeywordTable = HashMap<CSSPropertyID, Vector<CSSValueID>>;
15 15
16 KeywordTable createKeywordTable() 16 KeywordTable createKeywordTable()
17 { 17 {
(...skipping 12 matching lines...) Expand all
30 } 30 }
31 31
32 KeywordTable& keywordTable() 32 KeywordTable& keywordTable()
33 { 33 {
34 DEFINE_STATIC_LOCAL(KeywordTable, keywordTable, (createKeywordTable())); 34 DEFINE_STATIC_LOCAL(KeywordTable, keywordTable, (createKeywordTable()));
35 return keywordTable; 35 return keywordTable;
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 bool CSSOMKeywords::validKeywordForProperty(CSSPropertyID id, const KeywordValue & keyword) 40 bool CSSOMKeywords::validKeywordForProperty(CSSPropertyID id, const CSSKeywordVa lue& keyword)
41 { 41 {
42 CSSValueID valueID = keyword.keywordValueID(); 42 CSSValueID valueID = keyword.keywordValueID();
43 if (valueID == CSSValueInvalid) { 43 if (valueID == CSSValueInvalid) {
44 return false; 44 return false;
45 } 45 }
46 46
47 if (valueID == CSSValueInherit || valueID == CSSValueInitial || valueID == C SSValueUnset) { 47 if (valueID == CSSValueInherit || valueID == CSSValueInitial || valueID == C SSValueUnset) {
48 // These are css-wide keywords that are valid for all properties. 48 // These are css-wide keywords that are valid for all properties.
49 return true; 49 return true;
50 } 50 }
51 51
52 const KeywordTable::iterator tableIterator = keywordTable().find(id); 52 const KeywordTable::iterator tableIterator = keywordTable().find(id);
53 if (tableIterator == keywordTable().end()) { 53 if (tableIterator == keywordTable().end()) {
54 return false; 54 return false;
55 } 55 }
56 56
57 return tableIterator->value.contains(valueID); 57 return tableIterator->value.contains(valueID);
58 } 58 }
59 59
60 } // namespace blink 60 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698