| 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 to provide Dart metadata for | 6 """This module provides shared functionality to provide Dart metadata for |
| 7 DOM APIs. | 7 DOM APIs. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import copy | 10 import copy |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 'CanvasRenderingContext2D.fillStyle': [ | 49 'CanvasRenderingContext2D.fillStyle': [ |
| 50 "@Creates('String|CanvasGradient|CanvasPattern')", | 50 "@Creates('String|CanvasGradient|CanvasPattern')", |
| 51 "@Returns('String|CanvasGradient|CanvasPattern')", | 51 "@Returns('String|CanvasGradient|CanvasPattern')", |
| 52 ], | 52 ], |
| 53 | 53 |
| 54 'CanvasRenderingContext2D.strokeStyle': [ | 54 'CanvasRenderingContext2D.strokeStyle': [ |
| 55 "@Creates('String|CanvasGradient|CanvasPattern')", | 55 "@Creates('String|CanvasGradient|CanvasPattern')", |
| 56 "@Returns('String|CanvasGradient|CanvasPattern')", | 56 "@Returns('String|CanvasGradient|CanvasPattern')", |
| 57 ], | 57 ], |
| 58 | 58 |
| 59 # Normally DOMWindow is nevernull, but starting from a <template> element in | |
| 60 # JavaScript, this will be null: | |
| 61 # template.content.ownerDocument.defaultView | |
| 62 'Document.window': [ | |
| 63 "@Creates('Window|=Object|Null')", | |
| 64 "@Returns('Window|=Object|Null')", | |
| 65 ], | |
| 66 | |
| 67 # Methods returning Window can return a local window, or a cross-frame | 59 # Methods returning Window can return a local window, or a cross-frame |
| 68 # window (=Object) that needs wrapping. | 60 # window (=Object) that needs wrapping. |
| 69 'DOMWindow': [ | 61 'DOMWindow': [ |
| 70 "@Creates('Window|=Object')", | 62 "@Creates('Window|=Object')", |
| 71 "@Returns('Window|=Object')", | 63 "@Returns('Window|=Object')", |
| 72 ], | 64 ], |
| 73 | 65 |
| 74 'DOMWindow.openDatabase': [ | 66 'DOMWindow.openDatabase': [ |
| 75 "@Creates('SqlDatabase')", | 67 "@Creates('SqlDatabase')", |
| 76 ], | 68 ], |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 return | 572 return |
| 581 elif support_level == 'deprecated': | 573 elif support_level == 'deprecated': |
| 582 return '@Deprecated' | 574 return '@Deprecated' |
| 583 else: | 575 else: |
| 584 _logger.warn('Unknown support_level - %s:%s' % (interface.id, member_id)) | 576 _logger.warn('Unknown support_level - %s:%s' % (interface.id, member_id)) |
| 585 | 577 |
| 586 def Flush(self): | 578 def Flush(self): |
| 587 json_file = open(self._api_status_path, 'w+') | 579 json_file = open(self._api_status_path, 'w+') |
| 588 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) | 580 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) |
| 589 json_file.close() | 581 json_file.close() |
| OLD | NEW |