| 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 provides shared functionality for the systems to generate | 6 """This module provides shared functionality for the systems to generate |
| 7 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 arguments.extend(['scriptArguments', 'scriptCallStack']) | 455 arguments.extend(['scriptArguments', 'scriptCallStack']) |
| 456 return True | 456 return True |
| 457 | 457 |
| 458 return False | 458 return False |
| 459 | 459 |
| 460 def AddAttribute(self, getter, setter): | 460 def AddAttribute(self, getter, setter): |
| 461 if 'CheckSecurityForNode' in (getter or setter).ext_attrs: | 461 if 'CheckSecurityForNode' in (getter or setter).ext_attrs: |
| 462 # FIXME: exclude from interface as well. | 462 # FIXME: exclude from interface as well. |
| 463 return | 463 return |
| 464 | 464 |
| 465 # FIXME: these should go away. | |
| 466 classes_with_unsupported_custom_getters = [ | |
| 467 'Coordinates', | |
| 468 'HTMLOutputElement', | |
| 469 'ScriptProfileNode', | |
| 470 'WebKitAnimation' ] | |
| 471 if (self._interface.id in classes_with_unsupported_custom_getters and | |
| 472 getter and set(['Custom', 'CustomGetter']) & set(getter.ext_attrs)): | |
| 473 return | |
| 474 | |
| 475 if getter: | 465 if getter: |
| 476 self._AddGetter(getter) | 466 self._AddGetter(getter) |
| 477 if setter: | 467 if setter: |
| 478 self._AddSetter(setter) | 468 self._AddSetter(setter) |
| 479 | 469 |
| 480 def _AddGetter(self, attr): | 470 def _AddGetter(self, attr): |
| 481 type_info = GetIDLTypeInfo(attr.type.id) | 471 type_info = GetIDLTypeInfo(attr.type.id) |
| 482 dart_declaration = '%s get %s()' % ( | 472 dart_declaration = '%s get %s()' % ( |
| 483 type_info.dart_type(), DartDomNameOfAttribute(attr)) | 473 type_info.dart_type(), DartDomNameOfAttribute(attr)) |
| 484 is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs | 474 is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 def _InstanceOfNode(database, interface): | 836 def _InstanceOfNode(database, interface): |
| 847 if interface.id == 'Node': | 837 if interface.id == 'Node': |
| 848 return True | 838 return True |
| 849 for parent in interface.parents: | 839 for parent in interface.parents: |
| 850 if not database.HasInterface(parent.type.id): | 840 if not database.HasInterface(parent.type.id): |
| 851 continue | 841 continue |
| 852 parent_interface = database.GetInterface(parent.type.id) | 842 parent_interface = database.GetInterface(parent.type.id) |
| 853 if _InstanceOfNode(database, parent_interface): | 843 if _InstanceOfNode(database, parent_interface): |
| 854 return True | 844 return True |
| 855 return False | 845 return False |
| OLD | NEW |