| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 or name == 'MutationEvent' | 85 or name == 'MutationEvent' |
| 86 or name == 'MutationEvents' | 86 or name == 'MutationEvents' |
| 87 or name == 'PageTransitionEvent' | 87 or name == 'PageTransitionEvent' |
| 88 or name == 'PopStateEvent' | 88 or name == 'PopStateEvent' |
| 89 or name == 'StorageEvent' | 89 or name == 'StorageEvent' |
| 90 or name == 'SVGEvents' | 90 or name == 'SVGEvents' |
| 91 or name == 'TextEvent' | 91 or name == 'TextEvent' |
| 92 or name == 'TrackEvent' | 92 or name == 'TrackEvent' |
| 93 or name == 'TransitionEvent' | 93 or name == 'TransitionEvent' |
| 94 or name == 'WebGLContextEvent' | 94 or name == 'WebGLContextEvent' |
| 95 or name == 'WebKitTransitionEvent' | |
| 96 or name == 'WheelEvent') | 95 or name == 'WheelEvent') |
| 97 | 96 |
| 98 | 97 |
| 99 def measure_name(name): | 98 def measure_name(name): |
| 100 return 'DocumentCreateEvent' + name | 99 return 'DocumentCreateEvent' + name |
| 101 | 100 |
| 102 | 101 |
| 103 class EventFactoryWriter(json5_generator.Writer): | 102 class EventFactoryWriter(json5_generator.Writer): |
| 104 default_parameters = { | 103 default_parameters = { |
| 105 'ImplementedAs': None, | 104 'ImplementedAs': None, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 def generate_implementation(self): | 174 def generate_implementation(self): |
| 176 return { | 175 return { |
| 177 'namespace': self.namespace, | 176 'namespace': self.namespace, |
| 178 'suffix': self.suffix, | 177 'suffix': self.suffix, |
| 179 'events': self.json5_file.name_dictionaries, | 178 'events': self.json5_file.name_dictionaries, |
| 180 } | 179 } |
| 181 | 180 |
| 182 | 181 |
| 183 if __name__ == "__main__": | 182 if __name__ == "__main__": |
| 184 json5_generator.Maker(EventFactoryWriter).main() | 183 json5_generator.Maker(EventFactoryWriter).main() |
| OLD | NEW |