| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 // DO NOT EDIT | |
| 6 // Auto-generated dart:html library. | |
| 7 | |
| 8 #library("html"); | |
| 9 | |
| 10 #import('dart:dom', prefix:'dom'); | |
| 11 | |
| 12 $!GENERATED_DART_FILES | |
| 13 | |
| 14 #source('../../dom/src/EventListener.dart'); | |
| 15 #source('../../dom/src/KeyLocation.dart'); | |
| 16 #source('../../dom/src/KeyName.dart'); | |
| 17 #source('../../dom/src/ReadyState.dart'); | |
| 18 #source('../../dom/src/TimeoutHandler.dart'); | |
| 19 #source('../../dom/src/_Collections.dart'); | |
| 20 #source('../../dom/src/_XMLHttpRequestUtils.dart'); | |
| 21 #source('../../html/src/shared_FactoryProviders.dart'); | |
| 22 #source('../../html/src/dartium_FactoryProviders.dart'); | |
| 23 #source('../../html/src/Measurement.dart'); | |
| 24 #source('../../html/src/Device.dart'); | |
| 25 #source('../../html/src/_Testing.dart'); | |
| 26 #source('../../html/src/_DOMTypeBase.dart'); | |
| 27 #source('../../dom/src/_ListIterators.dart'); | |
| 28 #source('../../dom/src/_Lists.dart'); | |
| 29 | |
| 30 _WindowImpl __window; | |
| 31 _DocumentImpl __document; | |
| 32 | |
| 33 void _initialize() { | |
| 34 __window = _wrap(dom.window); | |
| 35 __document = _wrap(dom.document.documentElement); | |
| 36 } | |
| 37 | |
| 38 Window get window() { | |
| 39 if (__window == null) { | |
| 40 _initialize(); | |
| 41 } | |
| 42 return __window; | |
| 43 } | |
| 44 | |
| 45 Document get document() { | |
| 46 if (__document == null) { | |
| 47 _initialize(); | |
| 48 } | |
| 49 return __document; | |
| 50 } | |
| 51 | |
| 52 _WindowImpl get _window() { | |
| 53 if (__window == null) { | |
| 54 _initialize(); | |
| 55 } | |
| 56 return __window; | |
| 57 } | |
| 58 | |
| 59 _DocumentImpl get _document() { | |
| 60 if (__document == null) { | |
| 61 _initialize(); | |
| 62 } | |
| 63 return __document; | |
| 64 } | |
| 65 | |
| 66 _unwrap(raw) { | |
| 67 return raw is _DOMTypeBase ? raw._ptr : raw; | |
| 68 } | |
| 69 | |
| 70 // Warning: does not attempt wrap event listeners. | |
| 71 _wrap(raw) { | |
| 72 if (raw is! dom.DOMType) return raw; | |
| 73 dom.DOMType domObject = raw; | |
| 74 if (domObject.dartObjectLocalStorage != null) | |
| 75 return domObject.dartObjectLocalStorage; | |
| 76 switch(domObject.typeName) { | |
| 77 case 'HTMLDocument': | |
| 78 throw 'A document should never be wrapped directly. TODO(jacobr) XXX'; | |
| 79 case 'HTMLHtmlElement': | |
| 80 return new _DocumentImpl._wrap(domObject); | |
| 81 case 'HTMLElement': | |
| 82 return new _UnknownElementImpl._wrap(domObject); | |
| 83 $WRAPCASES | |
| 84 default: | |
| 85 throw 'Unrecognized object $domObject. Name=${domObject.typeName}'; | |
| 86 } | |
| 87 } | |
| OLD | NEW |