| 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 |
| 59 # Methods returning Window can return a local window, or a cross-frame | 67 # Methods returning Window can return a local window, or a cross-frame |
| 60 # window (=Object) that needs wrapping. | 68 # window (=Object) that needs wrapping. |
| 61 'DOMWindow': [ | 69 'DOMWindow': [ |
| 62 "@Creates('Window|=Object')", | 70 "@Creates('Window|=Object')", |
| 63 "@Returns('Window|=Object')", | 71 "@Returns('Window|=Object')", |
| 64 ], | 72 ], |
| 65 | 73 |
| 66 'DOMWindow.openDatabase': [ | 74 'DOMWindow.openDatabase': [ |
| 67 "@Creates('SqlDatabase')", | 75 "@Creates('SqlDatabase')", |
| 68 ], | 76 ], |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 return | 580 return |
| 573 elif support_level == 'deprecated': | 581 elif support_level == 'deprecated': |
| 574 return '@Deprecated' | 582 return '@Deprecated' |
| 575 else: | 583 else: |
| 576 _logger.warn('Unknown support_level - %s:%s' % (interface.id, member_id)) | 584 _logger.warn('Unknown support_level - %s:%s' % (interface.id, member_id)) |
| 577 | 585 |
| 578 def Flush(self): | 586 def Flush(self): |
| 579 json_file = open(self._api_status_path, 'w+') | 587 json_file = open(self._api_status_path, 'w+') |
| 580 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) | 588 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) |
| 581 json_file.close() | 589 json_file.close() |
| OLD | NEW |