OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of _js_helper; | 5 part of _js_helper; |
6 | 6 |
7 String typeNameInChrome(obj) { | 7 String typeNameInChrome(obj) { |
8 String name = JS('String', "#.constructor.name", obj); | 8 String name = JS('String', "#.constructor.name", obj); |
9 return typeNameInWebKitCommon(name); | 9 return typeNameInWebKitCommon(name); |
10 } | 10 } |
(...skipping 23 matching lines...) Expand all Loading... |
34 String typeNameInOpera(obj) { | 34 String typeNameInOpera(obj) { |
35 String name = JS('String', '#', constructorNameFallback(obj)); | 35 String name = JS('String', '#', constructorNameFallback(obj)); |
36 if (name == 'Window') return 'DOMWindow'; | 36 if (name == 'Window') return 'DOMWindow'; |
37 if (name == 'ApplicationCache') return 'DOMApplicationCache'; | 37 if (name == 'ApplicationCache') return 'DOMApplicationCache'; |
38 return name; | 38 return name; |
39 } | 39 } |
40 | 40 |
41 String typeNameInFirefox(obj) { | 41 String typeNameInFirefox(obj) { |
42 String name = JS('String', '#', constructorNameFallback(obj)); | 42 String name = JS('String', '#', constructorNameFallback(obj)); |
43 if (name == 'Window') return 'DOMWindow'; | 43 if (name == 'Window') return 'DOMWindow'; |
| 44 if (name == 'BeforeUnloadEvent') return 'Event'; |
44 if (name == 'CSS2Properties') return 'CSSStyleDeclaration'; | 45 if (name == 'CSS2Properties') return 'CSSStyleDeclaration'; |
45 if (name == 'DataTransfer') return 'Clipboard'; | 46 if (name == 'DataTransfer') return 'Clipboard'; |
46 if (name == 'DragEvent') return 'MouseEvent'; | 47 if (name == 'DragEvent') return 'MouseEvent'; |
47 if (name == 'GeoGeolocation') return 'Geolocation'; | 48 if (name == 'GeoGeolocation') return 'Geolocation'; |
48 if (name == 'MouseScrollEvent') return 'WheelEvent'; | 49 if (name == 'MouseScrollEvent') return 'WheelEvent'; |
49 if (name == 'OfflineResourceList') return 'DOMApplicationCache'; | 50 if (name == 'OfflineResourceList') return 'DOMApplicationCache'; |
50 if (name == 'WorkerMessageEvent') return 'MessageEvent'; | 51 if (name == 'WorkerMessageEvent') return 'MessageEvent'; |
51 if (name == 'XMLDocument') return 'Document'; | 52 if (name == 'XMLDocument') return 'Document'; |
52 return name; | 53 return name; |
53 } | 54 } |
54 | 55 |
55 String typeNameInIE(obj) { | 56 String typeNameInIE(obj) { |
56 String name = JS('String', '#', constructorNameFallback(obj)); | 57 String name = JS('String', '#', constructorNameFallback(obj)); |
57 if (name == 'Window') return 'DOMWindow'; | 58 if (name == 'Window') return 'DOMWindow'; |
58 if (name == 'Document') { | 59 if (name == 'Document') { |
59 // IE calls both HTML and XML documents 'Document', so we check for the | 60 // IE calls both HTML and XML documents 'Document', so we check for the |
60 // xmlVersion property, which is the empty string on HTML documents. | 61 // xmlVersion property, which is the empty string on HTML documents. |
61 if (JS('bool', '!!#.xmlVersion', obj)) return 'Document'; | 62 if (JS('bool', '!!#.xmlVersion', obj)) return 'Document'; |
62 return 'HTMLDocument'; | 63 return 'HTMLDocument'; |
63 } | 64 } |
64 if (name == 'ApplicationCache') return 'DOMApplicationCache'; | 65 if (name == 'ApplicationCache') return 'DOMApplicationCache'; |
| 66 if (name == 'BeforeUnloadEvent') return 'Event'; |
65 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; | 67 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; |
66 if (name == 'DataTransfer') return 'Clipboard'; | 68 if (name == 'DataTransfer') return 'Clipboard'; |
67 if (name == 'DragEvent') return 'MouseEvent'; | 69 if (name == 'DragEvent') return 'MouseEvent'; |
68 if (name == 'HTMLDDElement') return 'HTMLElement'; | 70 if (name == 'HTMLDDElement') return 'HTMLElement'; |
69 if (name == 'HTMLDTElement') return 'HTMLElement'; | 71 if (name == 'HTMLDTElement') return 'HTMLElement'; |
70 if (name == 'HTMLTableDataCellElement') return 'HTMLTableCellElement'; | 72 if (name == 'HTMLTableDataCellElement') return 'HTMLTableCellElement'; |
71 if (name == 'HTMLTableHeaderCellElement') return 'HTMLTableCellElement'; | 73 if (name == 'HTMLTableHeaderCellElement') return 'HTMLTableCellElement'; |
72 if (name == 'HTMLPhraseElement') return 'HTMLElement'; | 74 if (name == 'HTMLPhraseElement') return 'HTMLElement'; |
73 if (name == 'MSStyleCSSProperties') return 'CSSStyleDeclaration'; | 75 if (name == 'MSStyleCSSProperties') return 'CSSStyleDeclaration'; |
74 if (name == 'MouseWheelEvent') return 'WheelEvent'; | 76 if (name == 'MouseWheelEvent') return 'WheelEvent'; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 424 } |
423 return result; | 425 return result; |
424 } | 426 } |
425 | 427 |
426 /** | 428 /** |
427 * Called by the compiler to setup [_dynamicMetadata]. | 429 * Called by the compiler to setup [_dynamicMetadata]. |
428 */ | 430 */ |
429 void dynamicSetMetadata(List<List<String>> inputTable) { | 431 void dynamicSetMetadata(List<List<String>> inputTable) { |
430 _dynamicMetadata = buildDynamicMetadata(inputTable); | 432 _dynamicMetadata = buildDynamicMetadata(inputTable); |
431 } | 433 } |
OLD | NEW |