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