| 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 | 10 |
| 11 from systemfrog import * | 11 from systemfrog import * |
| 12 from systeminterface import * | 12 from systeminterface import * |
| 13 | 13 |
| 14 _html_strip_webkit_prefix_classes = [ | 14 _html_strip_webkit_prefix_classes = [ |
| 15 'Animation', | 15 'Animation', |
| 16 'AnimationEvent', | 16 'AnimationEvent', |
| 17 'AnimationList', | 17 'AnimationList', |
| 18 'BlobBuilder', | 18 'BlobBuilder', |
| 19 'CSSKeyframeRule', | 19 'CSSKeyframeRule', |
| 20 'CSSKeyframesRule', | 20 'CSSKeyframesRule', |
| 21 'CSSMatrix', | 21 'CSSMatrix', |
| 22 'CSSTransformValue', | 22 'CSSTransformValue', |
| 23 'Flags', | 23 'Flags', |
| 24 'LoseContext', | 24 'LoseContext', |
| 25 'MutationObserver', |
| 25 'Point', | 26 'Point', |
| 26 'TransitionEvent'] | 27 'TransitionEvent'] |
| 27 | 28 |
| 28 # Members from the standard dom that should not be exposed publicly in dart:html | 29 # Members from the standard dom that should not be exposed publicly in dart:html |
| 29 # but need to be exposed internally to implement dart:html on top of a standard | 30 # but need to be exposed internally to implement dart:html on top of a standard |
| 30 # browser. | 31 # browser. |
| 31 _private_html_members = set([ | 32 _private_html_members = set([ |
| 32 'Document.createElement', | 33 'Document.createElement', |
| 33 'Document.createElementNS', | 34 'Document.createElementNS', |
| 34 'Document.createEvent', | 35 'Document.createEvent', |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 "Node.set:nodeValue", | 266 "Node.set:nodeValue", |
| 266 "Node.get:CDATA_SECTION_NODE", | 267 "Node.get:CDATA_SECTION_NODE", |
| 267 "Node.get:nodeName", | 268 "Node.get:nodeName", |
| 268 "Node.lookupPrefix", | 269 "Node.lookupPrefix", |
| 269 "Node.get:PROCESSING_INSTRUCTION_NODE", | 270 "Node.get:PROCESSING_INSTRUCTION_NODE", |
| 270 "IFrameElement.get:contentDocument", | 271 "IFrameElement.get:contentDocument", |
| 271 "Window.get:frameElement", | 272 "Window.get:frameElement", |
| 272 ]) | 273 ]) |
| 273 | 274 |
| 274 _js_custom_members = set([ | 275 _js_custom_members = set([ |
| 276 'IDBDatabase.transaction', |
| 275 'IFrameElement.contentWindow', | 277 'IFrameElement.contentWindow', |
| 276 'Window.document', | 278 'Window.document', |
| 277 'Window.top', | 279 'Window.top', |
| 278 'Window.location', | 280 'Window.location', |
| 279 'Window.open', | 281 'Window.open', |
| 280 'IDBDatabase.transaction', | |
| 281 ]) | 282 ]) |
| 282 | 283 |
| 283 # This map controls merging of interfaces in dart:html library. | 284 # This map controls merging of interfaces in dart:html library. |
| 284 # All constants, attributes, and operations of merged interface (key) are | 285 # All constants, attributes, and operations of merged interface (key) are |
| 285 # added to target interface (value). All references to the merged interface | 286 # added to target interface (value). All references to the merged interface |
| 286 # (e.g. parameter types, return types, parent interfaces) are replaced with | 287 # (e.g. parameter types, return types, parent interfaces) are replaced with |
| 287 # target interface. There are two important restrictions: | 288 # target interface. There are two important restrictions: |
| 288 # 1) Merged and target interfaces shouldn't have common members, otherwise there | 289 # 1) Merged and target interfaces shouldn't have common members, otherwise there |
| 289 # would be duplicated declarations in generated Dart code. | 290 # would be duplicated declarations in generated Dart code. |
| 290 # 2) Merged interface should be direct child of target interface, so the | 291 # 2) Merged interface should be direct child of target interface, so the |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 Collect(database.GetInterface(parent.type.id), | 1391 Collect(database.GetInterface(parent.type.id), |
| 1391 seen, collected) | 1392 seen, collected) |
| 1392 | 1393 |
| 1393 inheritance_closure = {} | 1394 inheritance_closure = {} |
| 1394 for interface in database.GetInterfaces(): | 1395 for interface in database.GetInterfaces(): |
| 1395 seen = set() | 1396 seen = set() |
| 1396 collected = [] | 1397 collected = [] |
| 1397 Collect(interface, seen, collected) | 1398 Collect(interface, seen, collected) |
| 1398 inheritance_closure[interface.id] = collected | 1399 inheritance_closure[interface.id] = collected |
| 1399 return inheritance_closure | 1400 return inheritance_closure |
| OLD | NEW |