| 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 os | 10 import os |
| 11 from generator import * | 11 from generator import * |
| 12 from htmldartgenerator import * | 12 from htmldartgenerator import * |
| 13 | 13 |
| 14 _js_custom_members = set([ | 14 _js_custom_members = set([ |
| 15 'ArrayBuffer.slice', |
| 15 'AudioBufferSourceNode.start', | 16 'AudioBufferSourceNode.start', |
| 16 'AudioBufferSourceNode.stop', | 17 'AudioBufferSourceNode.stop', |
| 17 'AudioContext.createGain', | 18 'AudioContext.createGain', |
| 18 'AudioContext.createScriptProcessor', | 19 'AudioContext.createScriptProcessor', |
| 19 'Console.memory', | 20 'Console.memory', |
| 20 'Console.profiles', | 21 'Console.profiles', |
| 21 'Console.assertCondition', | 22 'Console.assertCondition', |
| 22 'Console.count', | 23 'Console.count', |
| 23 'Console.debug', | 24 'Console.debug', |
| 24 'Console.dir', | 25 'Console.dir', |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 'Window.indexedDB', | 61 'Window.indexedDB', |
| 61 'Window.location', | 62 'Window.location', |
| 62 'Window.open', | 63 'Window.open', |
| 63 'Window.requestAnimationFrame', | 64 'Window.requestAnimationFrame', |
| 64 'Window.webkitCancelAnimationFrame', | 65 'Window.webkitCancelAnimationFrame', |
| 65 'Window.webkitRequestAnimationFrame', | 66 'Window.webkitRequestAnimationFrame', |
| 66 'WorkerContext.indexedDB', | 67 'WorkerContext.indexedDB', |
| 67 ]) | 68 ]) |
| 68 | 69 |
| 69 js_support_checks = { | 70 js_support_checks = { |
| 71 'ArrayBuffer': "JS('bool', 'typeof window.ArrayBuffer != \"undefined\"')", |
| 70 'HTMLContentElement': "Element.isTagSupported('content')", | 72 'HTMLContentElement': "Element.isTagSupported('content')", |
| 71 'HTMLDataListElement': "Element.isTagSupported('datalist')", | 73 'HTMLDataListElement': "Element.isTagSupported('datalist')", |
| 72 'HTMLDetailsElement': "Element.isTagSupported('details')", | 74 'HTMLDetailsElement': "Element.isTagSupported('details')", |
| 73 'HTMLEmbedElement': "Element.isTagSupported('embed')", | 75 'HTMLEmbedElement': "Element.isTagSupported('embed')", |
| 74 # IE creates keygen as Block elements | 76 # IE creates keygen as Block elements |
| 75 'HTMLKeygenElement': "Element.isTagSupported('keygen') " | 77 'HTMLKeygenElement': "Element.isTagSupported('keygen') " |
| 76 "&& (new Element.tag('keygen') is KeygenElement)", | 78 "&& (new Element.tag('keygen') is KeygenElement)", |
| 77 'HTMLMarqueeElement': "Element.isTagSupported('marquee')" | 79 'HTMLMarqueeElement': "Element.isTagSupported('marquee')" |
| 78 "&& (new Element.tag('marquee') is MarqueeElement)", | 80 "&& (new Element.tag('marquee') is MarqueeElement)", |
| 79 'HTMLMeterElement': "Element.isTagSupported('meter')", | 81 'HTMLMeterElement': "Element.isTagSupported('meter')", |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 for library_name in libraries: | 1043 for library_name in libraries: |
| 1042 self._libraries[library_name] = DartLibrary( | 1044 self._libraries[library_name] = DartLibrary( |
| 1043 library_name, template_loader, library_type, output_dir) | 1045 library_name, template_loader, library_type, output_dir) |
| 1044 | 1046 |
| 1045 def AddFile(self, basename, library_name, path): | 1047 def AddFile(self, basename, library_name, path): |
| 1046 self._libraries[library_name].AddFile(path) | 1048 self._libraries[library_name].AddFile(path) |
| 1047 | 1049 |
| 1048 def Emit(self, emitter, auxiliary_dir): | 1050 def Emit(self, emitter, auxiliary_dir): |
| 1049 for lib in self._libraries.values(): | 1051 for lib in self._libraries.values(): |
| 1050 lib.Emit(emitter, auxiliary_dir) | 1052 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |