| 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 monitored |
| 10 import os | 11 import os |
| 11 from generator import * | 12 from generator import * |
| 12 from htmldartgenerator import * | 13 from htmldartgenerator import * |
| 13 | 14 |
| 14 _js_custom_members = set([ | 15 _js_custom_members = monitored.Set('systemhtml._js_custom_members', [ |
| 15 'ArrayBuffer.slice', | 16 'ArrayBuffer.slice', |
| 16 'AudioBufferSourceNode.start', | 17 'AudioBufferSourceNode.start', |
| 17 'AudioBufferSourceNode.stop', | 18 'AudioBufferSourceNode.stop', |
| 18 'AudioContext.createGain', | 19 'AudioContext.createGain', |
| 19 'AudioContext.createScriptProcessor', | 20 'AudioContext.createScriptProcessor', |
| 20 'CanvasRenderingContext2D.lineDashOffset', | 21 'CanvasRenderingContext2D.lineDashOffset', |
| 21 'Console.memory', | 22 'Console.memory', |
| 22 'Console.profiles', | 23 'Console.profiles', |
| 23 'Console.assertCondition', | 24 'Console.assertCondition', |
| 24 'Console.count', | 25 'Console.count', |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 'URL.revokeObjectURL', | 60 'URL.revokeObjectURL', |
| 60 'WheelEvent.wheelDeltaX', | 61 'WheelEvent.wheelDeltaX', |
| 61 'WheelEvent.wheelDeltaY', | 62 'WheelEvent.wheelDeltaY', |
| 62 'Window.cancelAnimationFrame', | 63 'Window.cancelAnimationFrame', |
| 63 'Window.console', | 64 'Window.console', |
| 64 'Window.document', | 65 'Window.document', |
| 65 'Window.indexedDB', | 66 'Window.indexedDB', |
| 66 'Window.location', | 67 'Window.location', |
| 67 'Window.open', | 68 'Window.open', |
| 68 'Window.requestAnimationFrame', | 69 'Window.requestAnimationFrame', |
| 69 'Window.webkitCancelAnimationFrame', | |
| 70 'Window.webkitRequestAnimationFrame', | |
| 71 'WorkerContext.indexedDB', | 70 'WorkerContext.indexedDB', |
| 72 ]) | 71 ]) |
| 73 | 72 |
| 74 _js_custom_constructors = set([ | 73 _js_custom_constructors = monitored.Set('systemhtml._js_custom_constructors', [ |
| 75 'AudioContext', | 74 'AudioContext', |
| 76 'Blob', | 75 'Blob', |
| 77 'MutationObserver', | 76 'MutationObserver', |
| 78 'Notification', | 77 'Notification', |
| 79 'RTCIceCandidate', | 78 'RTCIceCandidate', |
| 80 'RTCPeerConnection', | 79 'RTCPeerConnection', |
| 81 'RTCSessionDescription', | 80 'RTCSessionDescription', |
| 82 'SpeechRecognition', | 81 'SpeechRecognition', |
| 83 ]) | 82 ]) |
| 84 | 83 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 111 info.constructor_name = self.name | 110 info.constructor_name = self.name |
| 112 info.js_name = None | 111 info.js_name = None |
| 113 info.type_name = interface_name | 112 info.type_name = interface_name |
| 114 info.param_infos = map(lambda tXn: ParamInfo(tXn[1], tXn[0], True), | 113 info.param_infos = map(lambda tXn: ParamInfo(tXn[1], tXn[0], True), |
| 115 self.opt_params) | 114 self.opt_params) |
| 116 info.requires_named_arguments = True | 115 info.requires_named_arguments = True |
| 117 info.factory_parameters = ['"%s"' % self.tag] | 116 info.factory_parameters = ['"%s"' % self.tag] |
| 118 info.pure_dart_constructor = True | 117 info.pure_dart_constructor = True |
| 119 return info | 118 return info |
| 120 | 119 |
| 121 _html_element_constructors = { | 120 _html_element_constructors = monitored.Dict( |
| 121 'systemhtml._html_element_constructors', { |
| 122 'HTMLAnchorElement' : | 122 'HTMLAnchorElement' : |
| 123 ElementConstructorInfo(tag='a', opt_params=[('DOMString', 'href')]), | 123 ElementConstructorInfo(tag='a', opt_params=[('DOMString', 'href')]), |
| 124 'HTMLAreaElement': 'area', | 124 'HTMLAreaElement': 'area', |
| 125 'HTMLButtonElement': 'button', | 125 'HTMLButtonElement': 'button', |
| 126 'HTMLBRElement': 'br', | 126 'HTMLBRElement': 'br', |
| 127 'HTMLBaseElement': 'base', | 127 'HTMLBaseElement': 'base', |
| 128 'HTMLBodyElement': 'body', | 128 'HTMLBodyElement': 'body', |
| 129 'HTMLButtonElement': 'button', | 129 'HTMLButtonElement': 'button', |
| 130 'HTMLCanvasElement': | 130 'HTMLCanvasElement': |
| 131 ElementConstructorInfo(tag='canvas', | 131 ElementConstructorInfo(tag='canvas', |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 'HTMLTableCellElement': 'td', | 177 'HTMLTableCellElement': 'td', |
| 178 'HTMLTableColElement': 'col', | 178 'HTMLTableColElement': 'col', |
| 179 'HTMLTableElement': 'table', | 179 'HTMLTableElement': 'table', |
| 180 'HTMLTableRowElement': 'tr', | 180 'HTMLTableRowElement': 'tr', |
| 181 #'HTMLTableSectionElement' <thead> <tbody> <tfoot> | 181 #'HTMLTableSectionElement' <thead> <tbody> <tfoot> |
| 182 'HTMLTextAreaElement': 'textarea', | 182 'HTMLTextAreaElement': 'textarea', |
| 183 'HTMLTitleElement': 'title', | 183 'HTMLTitleElement': 'title', |
| 184 'HTMLTrackElement': 'track', | 184 'HTMLTrackElement': 'track', |
| 185 'HTMLUListElement': 'ul', | 185 'HTMLUListElement': 'ul', |
| 186 'HTMLVideoElement': 'video' | 186 'HTMLVideoElement': 'video' |
| 187 } | 187 }) |
| 188 | 188 |
| 189 _svg_element_constructors = { | 189 _svg_element_constructors = monitored.Dict( |
| 190 'systemhtml._svg_element_constructors', { |
| 190 'SVGAElement': 'a', | 191 'SVGAElement': 'a', |
| 191 'SVGAltGlyphElement': 'altGlyph', | 192 'SVGAltGlyphElement': 'altGlyph', |
| 192 'SVGAnimateElement': 'animate', | 193 'SVGAnimateElement': 'animate', |
| 193 'SVGAnimateMotionElement': 'animateMotion', | 194 'SVGAnimateMotionElement': 'animateMotion', |
| 194 'SVGAnimateTransformElement': 'animateTransform', | 195 'SVGAnimateTransformElement': 'animateTransform', |
| 195 'SVGAnimationElement': 'animation', | 196 'SVGAnimationElement': 'animation', |
| 196 'SVGCircleElement': 'circle', | 197 'SVGCircleElement': 'circle', |
| 197 'SVGClipPathElement': 'clipPath', | 198 'SVGClipPathElement': 'clipPath', |
| 198 'SVGCursorElement': 'cursor', | 199 'SVGCursorElement': 'cursor', |
| 199 'SVGDefsElement': 'defs', | 200 'SVGDefsElement': 'defs', |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 'SVGStyleElement': 'style', | 246 'SVGStyleElement': 'style', |
| 246 'SVGSwitchElement': 'switch', | 247 'SVGSwitchElement': 'switch', |
| 247 'SVGSymbolElement': 'symbol', | 248 'SVGSymbolElement': 'symbol', |
| 248 'SVGTextElement': 'text', | 249 'SVGTextElement': 'text', |
| 249 'SVGTitleElement': 'title', | 250 'SVGTitleElement': 'title', |
| 250 'SVGTRefElement': 'tref', | 251 'SVGTRefElement': 'tref', |
| 251 'SVGTSpanElement': 'tspan', | 252 'SVGTSpanElement': 'tspan', |
| 252 'SVGUseElement': 'use', | 253 'SVGUseElement': 'use', |
| 253 'SVGViewElement': 'view', | 254 'SVGViewElement': 'view', |
| 254 'SVGVKernElement': 'vkern', | 255 'SVGVKernElement': 'vkern', |
| 255 } | 256 }) |
| 256 | 257 |
| 257 _element_constructors = { | 258 _element_constructors = { |
| 258 'html': _html_element_constructors, | 259 'html': _html_element_constructors, |
| 259 'indexed_db': {}, | 260 'indexed_db': {}, |
| 260 'svg': _svg_element_constructors, | 261 'svg': _svg_element_constructors, |
| 261 'web_audio': {}, | 262 'web_audio': {}, |
| 262 } | 263 } |
| 263 | 264 |
| 264 _factory_ctr_strings = { | 265 _factory_ctr_strings = { |
| 265 'html': { | 266 'html': { |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 for library_name in libraries: | 1109 for library_name in libraries: |
| 1109 self._libraries[library_name] = DartLibrary( | 1110 self._libraries[library_name] = DartLibrary( |
| 1110 library_name, template_loader, library_type, output_dir) | 1111 library_name, template_loader, library_type, output_dir) |
| 1111 | 1112 |
| 1112 def AddFile(self, basename, library_name, path): | 1113 def AddFile(self, basename, library_name, path): |
| 1113 self._libraries[library_name].AddFile(path) | 1114 self._libraries[library_name].AddFile(path) |
| 1114 | 1115 |
| 1115 def Emit(self, emitter, auxiliary_dir): | 1116 def Emit(self, emitter, auxiliary_dir): |
| 1116 for lib in self._libraries.values(): | 1117 for lib in self._libraries.values(): |
| 1117 lib.Emit(emitter, auxiliary_dir) | 1118 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |