| 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 systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import copy | 9 import copy |
| 10 import json | 10 import json |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 "@Returns('String|CanvasGradient|CanvasPattern')", | 572 "@Returns('String|CanvasGradient|CanvasPattern')", |
| 573 ], | 573 ], |
| 574 | 574 |
| 575 # Methods returning Window can return a local window, or a cross-frame | 575 # Methods returning Window can return a local window, or a cross-frame |
| 576 # window (=Object) that needs wrapping. | 576 # window (=Object) that needs wrapping. |
| 577 'DOMWindow': [ | 577 'DOMWindow': [ |
| 578 "@Creates('Window|=Object')", | 578 "@Creates('Window|=Object')", |
| 579 "@Returns('Window|=Object')", | 579 "@Returns('Window|=Object')", |
| 580 ], | 580 ], |
| 581 | 581 |
| 582 # Starting from a <template> element in JavaScript, this is null: |
| 583 # template.content.ownerDocument.defaultView |
| 584 'Document.window': [ |
| 585 "@Creates('Window|=Object|Null')", |
| 586 "@Returns('Window|=Object|Null')", |
| 587 ], |
| 588 |
| 582 'DOMWindow.openDatabase': [ | 589 'DOMWindow.openDatabase': [ |
| 583 "@Creates('SqlDatabase')", | 590 "@Creates('SqlDatabase')", |
| 584 ], | 591 ], |
| 585 | 592 |
| 586 # To be in callback with the browser-created Event, we had to have called | 593 # To be in callback with the browser-created Event, we had to have called |
| 587 # addEventListener on the target, so we avoid | 594 # addEventListener on the target, so we avoid |
| 588 'Event.currentTarget': [ | 595 'Event.currentTarget': [ |
| 589 "@Creates('Null')", | 596 "@Creates('Null')", |
| 590 "@Returns('EventTarget|=Object')", | 597 "@Returns('EventTarget|=Object')", |
| 591 ], | 598 ], |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 type_name, type_data, dart_interface_name, self) | 1579 type_name, type_data, dart_interface_name, self) |
| 1573 | 1580 |
| 1574 if type_data.clazz == 'BasicTypedList': | 1581 if type_data.clazz == 'BasicTypedList': |
| 1575 dart_interface_name = self._renamer.RenameInterface( | 1582 dart_interface_name = self._renamer.RenameInterface( |
| 1576 self._database.GetInterface(type_name)) | 1583 self._database.GetInterface(type_name)) |
| 1577 return BasicTypedListIDLTypeInfo( | 1584 return BasicTypedListIDLTypeInfo( |
| 1578 type_name, type_data, dart_interface_name, self) | 1585 type_name, type_data, dart_interface_name, self) |
| 1579 | 1586 |
| 1580 class_name = '%sIDLTypeInfo' % type_data.clazz | 1587 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1581 return globals()[class_name](type_name, type_data) | 1588 return globals()[class_name](type_name, type_data) |
| OLD | NEW |