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

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

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Generate strings with make_names 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 | « no previous file | Source/core/Init.cpp » ('j') | Source/core/core_generated.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/make_media_feature_names.py
diff --git a/Source/build/scripts/make_media_feature_names.py b/Source/build/scripts/make_media_feature_names.py
new file mode 100755
index 0000000000000000000000000000000000000000..ee9ff737cab21d0e659f600c401adf6167a997e3
--- /dev/null
+++ b/Source/build/scripts/make_media_feature_names.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+# 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.
+
+import sys
+import in_generator
+import make_names
+
+
+def mediaFeatureSymbol(entry):
+ 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 + "MediaFeature"
+ return newName
+
+
+class MakeMediaFeatureNamesWriter(make_names.MakeNamesWriter):
+ pass
+
+MakeMediaFeatureNamesWriter.filters['symbol'] = mediaFeatureSymbol
+
+if __name__ == "__main__":
+ in_generator.Maker(MakeMediaFeatureNamesWriter).main(sys.argv)
« no previous file with comments | « no previous file | Source/core/Init.cpp » ('j') | Source/core/core_generated.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698