| 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 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
| 6 | 6 |
| 7 part of $LIBRARYNAME; | 7 part of $LIBRARYNAME; |
| 8 | 8 |
| 9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 10 $!MEMBERS | 10 $!MEMBERS |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 @Experimental() | 167 @Experimental() |
| 168 $if DART2JS | 168 $if DART2JS |
| 169 String get visibilityState => JS('String', | 169 String get visibilityState => JS('String', |
| 170 '(#.visibilityState || #.mozVisibilityState || #.msVisibilityState ||' | 170 '(#.visibilityState || #.mozVisibilityState || #.msVisibilityState ||' |
| 171 '#.webkitVisibilityState)', this, this, this, this); | 171 '#.webkitVisibilityState)', this, this, this, this); |
| 172 $else | 172 $else |
| 173 String get visibilityState => _webkitVisibilityState; | 173 String get visibilityState => _webkitVisibilityState; |
| 174 $endif | 174 $endif |
| 175 | 175 |
| 176 @Experimental | 176 @Experimental |
| 177 /** |
| 178 * Register a custom subclass of Element to be instantiatable by the DOM. |
| 179 * |
| 180 * This is necessary to allow the construction of any custom elements. |
| 181 * |
| 182 * The class being registered must either subclass HtmlElement or SvgElement. |
| 183 * If they subclass these directly then they can be used as: |
| 184 * |
| 185 * class FooElement extends HtmlElement{ |
| 186 * void created() { |
| 187 * print('FooElement created!'); |
| 188 * } |
| 189 * } |
| 190 * |
| 191 * main() { |
| 192 * document.register('x-foo', FooElement); |
| 193 * var myFoo = new Element.tag('x-foo'); |
| 194 * // prints 'FooElement created!' to the console. |
| 195 * } |
| 196 * |
| 197 * The custom element can also be instantiated via HTML using the syntax |
| 198 * `<x-foo></x-foo>` |
| 199 * |
| 200 * Other elements can be subclassed as well: |
| 201 * |
| 202 * class BarElement extends InputElement{ |
| 203 * void created() { |
| 204 * print('BarElement created!'); |
| 205 * } |
| 206 * } |
| 207 * |
| 208 * main() { |
| 209 * document.register('x-bar', BarElement); |
| 210 * var myBar = new Element.tag('input', 'x-bar'); |
| 211 * // prints 'BarElement created!' to the console. |
| 212 * } |
| 213 * |
| 214 * This custom element can also be instantiated via HTML using the syntax |
| 215 * `<input is="x-bar"></input>` |
| 216 * |
| 217 * The [nativeTagName] parameter is needed by platforms without native support |
| 218 * when subclassing a native type other than: |
| 219 * |
| 220 * * HtmlElement |
| 221 * * SvgElement |
| 222 * * AnchorElement |
| 223 * * AudioElement |
| 224 * * ButtonElement |
| 225 * * CanvasElement |
| 226 * * DivElement |
| 227 * * ImageElement |
| 228 * * InputElement |
| 229 * * LIElement |
| 230 * * LabelElement |
| 231 * * MenuElement |
| 232 * * MeterElement |
| 233 * * OListElement |
| 234 * * OptionElement |
| 235 * * OutputElement |
| 236 * * ParagraphElement |
| 237 * * PreElement |
| 238 * * ProgressElement |
| 239 * * SelectElement |
| 240 * * SpanElement |
| 241 * * UListElement |
| 242 * * VideoElement |
| 243 */ |
| 177 $if DART2JS | 244 $if DART2JS |
| 178 void register(String tag, Type customElementClass) { | 245 void register(String tag, Type customElementClass, {String nativeTagName}) { |
| 179 _registerCustomElement(JS('', 'window'), this, tag, customElementClass); | 246 _registerCustomElement(JS('', 'window'), this, tag, customElementClass, |
| 247 nativeTagName); |
| 180 } | 248 } |
| 181 $else | 249 $else |
| 182 void register(String tag, Type custom) { | 250 void register(String tag, Type customElementClass, {String nativeTagName}) { |
| 183 _Utils.register(tag, custom); | 251 _Utils.register(tag, customElementClass); |
| 184 } | 252 } |
| 185 $endif | 253 $endif |
| 186 | 254 |
| 187 $if DART2JS | 255 $if DART2JS |
| 188 @Creates('Null') // Set from Dart code; does not instantiate a native type. | 256 @Creates('Null') // Set from Dart code; does not instantiate a native type. |
| 189 $endif | 257 $endif |
| 190 // Note: used to polyfill <template> | 258 // Note: used to polyfill <template> |
| 191 Document _templateContentsOwner; | 259 Document _templateContentsOwner; |
| 192 | 260 |
| 193 @DomName('Document.visibilityChange') | 261 @DomName('Document.visibilityChange') |
| (...skipping 23 matching lines...) Expand all Loading... |
| 217 $endif | 285 $endif |
| 218 } | 286 } |
| 219 | 287 |
| 220 @SupportedBrowser(SupportedBrowser.CHROME) | 288 @SupportedBrowser(SupportedBrowser.CHROME) |
| 221 @SupportedBrowser(SupportedBrowser.FIREFOX) | 289 @SupportedBrowser(SupportedBrowser.FIREFOX) |
| 222 @SupportedBrowser(SupportedBrowser.IE, '10') | 290 @SupportedBrowser(SupportedBrowser.IE, '10') |
| 223 @Experimental() | 291 @Experimental() |
| 224 Stream<Event> get onVisibilityChange => | 292 Stream<Event> get onVisibilityChange => |
| 225 visibilityChangeEvent.forTarget(this); | 293 visibilityChangeEvent.forTarget(this); |
| 226 } | 294 } |
| OLD | NEW |