| 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 system to generate | 6 """This module provides shared functionality for the system to generate |
| 7 Dart:html APIs from the IDL database.""" | 7 Dart:html APIs from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import logging | 10 import logging |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 'ConsoleBase.timeStamp', | 51 'ConsoleBase.timeStamp', |
| 52 'ConsoleBase.trace', | 52 'ConsoleBase.trace', |
| 53 'ConsoleBase.warn', | 53 'ConsoleBase.warn', |
| 54 'WebKitCSSKeyframesRule.insertRule', | 54 'WebKitCSSKeyframesRule.insertRule', |
| 55 'CSSStyleDeclaration.setProperty', | 55 'CSSStyleDeclaration.setProperty', |
| 56 'CSSStyleDeclaration.__propertyQuery__', | 56 'CSSStyleDeclaration.__propertyQuery__', |
| 57 'Document.createNodeIterator', | 57 'Document.createNodeIterator', |
| 58 'Document.createTreeWalker', | 58 'Document.createTreeWalker', |
| 59 'DOMException.name', | 59 'DOMException.name', |
| 60 'DOMException.toString', | 60 'DOMException.toString', |
| 61 # ListMixin already provides this method although the implementation |
| 62 # is slower. As this class is obsolete anyway, we ignore the slowdown in |
| 63 # DOMStringList performance. |
| 64 'DOMStringList.contains', |
| 61 'Element.animate', | 65 'Element.animate', |
| 62 'Element.createShadowRoot', | 66 'Element.createShadowRoot', |
| 63 'Element.insertAdjacentElement', | 67 'Element.insertAdjacentElement', |
| 64 'Element.insertAdjacentHTML', | 68 'Element.insertAdjacentHTML', |
| 65 'Element.insertAdjacentText', | 69 'Element.insertAdjacentText', |
| 66 'Element.remove', | 70 'Element.remove', |
| 67 'Element.shadowRoot', | 71 'Element.shadowRoot', |
| 68 'Element.matches', | 72 'Element.matches', |
| 69 'ElementEvents.mouseWheel', | 73 'ElementEvents.mouseWheel', |
| 70 'ElementEvents.transitionEnd', | 74 'ElementEvents.transitionEnd', |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 return | 910 return |
| 907 self._members_emitter.Emit('\n // Shadowing definition.') | 911 self._members_emitter.Emit('\n // Shadowing definition.') |
| 908 self._AddAttributeUsingProperties(attribute, html_name, read_only) | 912 self._AddAttributeUsingProperties(attribute, html_name, read_only) |
| 909 return | 913 return |
| 910 | 914 |
| 911 # If the attribute is shadowed incompatibly in a subclass then we also | 915 # If the attribute is shadowed incompatibly in a subclass then we also |
| 912 # can't just generate it as a field. In particular, this happens with | 916 # can't just generate it as a field. In particular, this happens with |
| 913 # DomMatrixReadOnly and its subclass DomMatrix. Force the superclass | 917 # DomMatrixReadOnly and its subclass DomMatrix. Force the superclass |
| 914 # to generate getters. Hardcoding the known problem classes for now. | 918 # to generate getters. Hardcoding the known problem classes for now. |
| 915 # TODO(alanknight): Fix this more generally. | 919 # TODO(alanknight): Fix this more generally. |
| 916 if (self._interface.id == 'DOMMatrixReadOnly' or self._interface.id == 'DOMP
ointReadOnly'): | 920 if (self._interface.id == 'DOMMatrixReadOnly' or self._interface.id == 'DOMP
ointReadOnly' |
| 921 or self._interface.id == 'DOMRectReadOnly'): |
| 917 self._AddAttributeUsingProperties(attribute, html_name, read_only) | 922 self._AddAttributeUsingProperties(attribute, html_name, read_only) |
| 918 return | 923 return |
| 919 | 924 |
| 920 # If the type has a conversion we need a getter or setter to contain the | 925 # If the type has a conversion we need a getter or setter to contain the |
| 921 # conversion code. | 926 # conversion code. |
| 922 if (self._OutputConversion(attribute.type.id, attribute.id) or | 927 if (self._OutputConversion(attribute.type.id, attribute.id) or |
| 923 self._InputConversion(attribute.type.id, attribute.id)): | 928 self._InputConversion(attribute.type.id, attribute.id)): |
| 924 self._AddAttributeUsingProperties(attribute, html_name, read_only) | 929 self._AddAttributeUsingProperties(attribute, html_name, read_only) |
| 925 return | 930 return |
| 926 | 931 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 | 1313 |
| 1309 def AddFile(self, basename, library_name, path): | 1314 def AddFile(self, basename, library_name, path): |
| 1310 self._libraries[library_name].AddFile(path) | 1315 self._libraries[library_name].AddFile(path) |
| 1311 | 1316 |
| 1312 def AddTypeEntry(self, library_name, idl_name, dart_name): | 1317 def AddTypeEntry(self, library_name, idl_name, dart_name): |
| 1313 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) | 1318 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) |
| 1314 | 1319 |
| 1315 def Emit(self, emitter, auxiliary_dir): | 1320 def Emit(self, emitter, auxiliary_dir): |
| 1316 for lib in self._libraries.values(): | 1321 for lib in self._libraries.values(): |
| 1317 lib.Emit(emitter, auxiliary_dir) | 1322 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |