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

Unified Diff: Source/build/scripts/media_feature_symbol.py

Issue 185533012: Auto generate MediaFeatureNames, its macros and MediaTypeNames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed comment from RuntimeEnabled Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/build/scripts/make_media_features.py ('k') | Source/build/scripts/templates/MediaFeatures.h.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/media_feature_symbol.py
diff --git a/Source/build/scripts/media_feature_symbol.py b/Source/build/scripts/media_feature_symbol.py
new file mode 100644
index 0000000000000000000000000000000000000000..0077ccbf900bdb1ad99ee92c7cebc5080692625d
--- /dev/null
+++ b/Source/build/scripts/media_feature_symbol.py
@@ -0,0 +1,28 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+def mediaFeatureSymbol(entry, suffix):
+ name = entry['name']
+ if name.startswith('-webkit-'):
+ name = name[8:]
+
+ foundDash = False
+ newName = ""
+ for chr in name:
+ if chr == '-':
+ foundDash = True
+ continue
+ if foundDash:
+ chr = chr.upper()
+ foundDash = False
+ newName = newName + chr
+ newName = newName + suffix
+ return newName
+
+
+def getMediaFeatureSymbolWithSuffix(suffix):
+ def returnedFunction(entry):
+ return mediaFeatureSymbol(entry, suffix)
+ return returnedFunction
« no previous file with comments | « Source/build/scripts/make_media_features.py ('k') | Source/build/scripts/templates/MediaFeatures.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698