OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 import sys |
| 8 import in_generator |
| 9 import make_names |
| 10 |
| 11 |
| 12 def mediaFeatureSymbol(entry): |
| 13 name = entry['name'] |
| 14 if name.startswith('-webkit-'): |
| 15 name = name[8:] |
| 16 |
| 17 foundDash = False |
| 18 newName = "" |
| 19 for chr in name: |
| 20 if chr == '-': |
| 21 foundDash = True |
| 22 continue |
| 23 if foundDash: |
| 24 chr = chr.upper() |
| 25 foundDash = False |
| 26 newName = newName + chr |
| 27 newName = newName + "MediaFeature" |
| 28 return newName |
| 29 |
| 30 |
| 31 class MakeMediaFeatureNamesWriter(make_names.MakeNamesWriter): |
| 32 pass |
| 33 |
| 34 MakeMediaFeatureNamesWriter.filters['symbol'] = mediaFeatureSymbol |
| 35 |
| 36 if __name__ == "__main__": |
| 37 in_generator.Maker(MakeMediaFeatureNamesWriter).main(sys.argv) |
OLD | NEW |