OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 """This module generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
7 | 7 |
8 import emitter | 8 import emitter |
9 import idlnode | 9 import idlnode |
10 import logging | 10 import logging |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 | 392 |
393 attributes = [attr for attr in interface.attributes | 393 attributes = [attr for attr in interface.attributes |
394 if not self._IsEventAttribute(interface, attr)] | 394 if not self._IsEventAttribute(interface, attr)] |
395 for (getter, setter) in _PairUpAttributes(attributes): | 395 for (getter, setter) in _PairUpAttributes(attributes): |
396 for generator in generators: | 396 for generator in generators: |
397 generator.AddAttribute(getter, setter) | 397 generator.AddAttribute(getter, setter) |
398 | 398 |
399 events = set([attr for attr in interface.attributes | 399 events = set([attr for attr in interface.attributes |
400 if self._IsEventAttribute(interface, attr)]) | 400 if self._IsEventAttribute(interface, attr)]) |
401 | 401 |
402 if events: | 402 # Hack to generate no-op Element events for DocumentFragment. |
Jacob
2012/03/06 05:09:00
Hacks like this should not go here. Place the hac
nweiz
2012/03/06 20:10:47
I'm not sure how to put this in systemhtml.py, sin
Jacob
2012/03/06 22:41:59
AddEventAttributes is really dart:html specific.
nweiz
2012/03/08 23:02:49
Done.
| |
403 if events or interface.id == 'DocumentFragment': | |
403 for generator in generators: | 404 for generator in generators: |
404 generator.AddEventAttributes(events) | 405 generator.AddEventAttributes(events) |
405 | 406 |
406 # The implementation should define an indexer if the interface directly | 407 # The implementation should define an indexer if the interface directly |
407 # extends List. | 408 # extends List. |
408 element_type = MaybeListElementType(interface) | 409 element_type = MaybeListElementType(interface) |
409 if element_type: | 410 if element_type: |
410 for generator in generators: | 411 for generator in generators: |
411 generator.AddIndexer(element_type) | 412 generator.AddIndexer(element_type) |
412 # Group overloaded operations by id | 413 # Group overloaded operations by id |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
667 pass | 668 pass |
668 | 669 |
669 def AddTypedArrayConstructors(self, element_type): | 670 def AddTypedArrayConstructors(self, element_type): |
670 pass | 671 pass |
671 | 672 |
672 def AddOperation(self, info): | 673 def AddOperation(self, info): |
673 pass | 674 pass |
674 | 675 |
675 def AddEventAttributes(self, event_attrs): | 676 def AddEventAttributes(self, event_attrs): |
676 pass | 677 pass |
OLD | NEW |