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

Unified Diff: third_party/WebKit/Source/build/scripts/make_css_value_keywords.py

Issue 2041363002: Move isColorKeyword out of CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: V2 Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/build/scripts/make_css_value_keywords.py
diff --git a/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py b/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py
index 99041b2e28cec411d5b853788adb712284c97f66..7c6602dbefbe979ec9da4a98ea9153cf352e5f03 100755
--- a/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py
+++ b/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py
@@ -1,13 +1,9 @@
#!/usr/bin/env python
-import os.path
-import re
import subprocess
import sys
-from in_file import InFile
from name_utilities import enum_for_css_keyword
-from name_utilities import upper_first_letter
import in_generator
import license
@@ -32,6 +28,7 @@ const size_t maxCSSValueKeywordLength = %(max_value_keyword_length)d;
const char* getValueName(CSSValueID);
bool isValueAllowedInMode(unsigned short id, CSSParserMode mode);
+bool isColorKeyword(CSSValueID);
} // namespace blink
@@ -102,6 +99,35 @@ bool isValueAllowedInMode(unsigned short id, CSSParserMode mode)
}
}
+bool isColorKeyword(CSSValueID id)
+{
+ // Named colors and color keywords:
+ //
+ // <named-color>
+ // 'aqua', 'black', 'blue', ..., 'yellow' (CSS3: "basic color keywords")
+ // 'aliceblue', ..., 'yellowgreen' (CSS3: "extended color keywords")
+ // 'transparent'
+ //
+ // 'currentcolor'
+ //
+ // <deprecated-system-color>
+ // 'ActiveBorder', ..., 'WindowText'
+ //
+ // WebKit proprietary/internal:
+ // '-webkit-link'
+ // '-webkit-activelink'
+ // '-internal-active-list-box-selection'
+ // '-internal-active-list-box-selection-text'
+ // '-internal-inactive-list-box-selection'
+ // '-internal-inactive-list-box-selection-text'
+ // '-webkit-focus-ring-color'
+ // '-internal-quirk-inherit'
+ //
+ return (id >= CSSValueAqua && id <= CSSValueInternalQuirkInherit)
+ || (id >= CSSValueAliceblue && id <= CSSValueYellowgreen)
+ || id == CSSValueMenu;
+}
+
} // namespace blink
"""

Powered by Google App Engine
This is Rietveld 408576698