blob: bc5488430bf741e2ca0d509b5959eac0c88eaf52 [file] [log] [blame]
/**
* HTML elements and other resources for web-based applications that need to
* interact with the browser and the DOM (Document Object Model).
*
* This library includes DOM element types, CSS styling, local storage,
* media, speech, events, and more.
* To get started,
* check out the [Element] class, the base class for many of the HTML
* DOM types.
*
* ## Other resources
*
* * If you've never written a web app before, try our
* tutorials—[A Game of Darts](http://dartlang.org/docs/tutorials).
*
* * To see some web-based Dart apps in action and to play with the code,
* download
* [Dart Editor](http://www.dartlang.org/#get-started)
* and run its built-in examples.
*
* * For even more examples, see
* [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples)
* on Github.
*/
library dart.dom.html;
import 'dart:async';
import 'dart:collection';
import 'dart:_collection-dev' hide Symbol, deprecated;
import 'dart:html_common';
import 'dart:indexed_db';
import 'dart:isolate';
import "dart:convert";
import 'dart:math';
import 'dart:mirrors';
import 'dart:nativewrappers';
import 'dart:typed_data';
import 'dart:web_gl' as gl;
import 'dart:web_sql';
import 'dart:svg' as svg;
import 'dart:web_audio' as web_audio;
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// DO NOT EDIT
// Auto-generated dart:html library.
// TODO(vsm): Remove this when we can do the proper checking in
// native code for custom elements.
// Not actually used, but imported since dart:html can generate these objects.
Window _window;
/**
* Top-level container for a web page, which is usually a browser tab or window.
*
* Each web page loaded in the browser has its own [Window], which is a
* container for the web page.
*
* If the web page has any `<iframe>` elements, then each `<iframe>` has its own
* [Window] object, which is accessible only to that `<iframe>`.
*
* See also:
*
* * [Window](https://developer.mozilla.org/en-US/docs/Web/API/window) from MDN.
*/
Window get window {
if (_window != null) {
return _window;
}
_window = _Utils.window();
return _window;
}
HtmlDocument _document;
/**
* Root node for all content in a web page.
*/
HtmlDocument get document {
if (_document != null) {
return _document;
}
_document = window.document;
return _document;
}
Element query(String selector) => document.query(selector);
ElementList queryAll(String selector) => document.queryAll(selector);
int _getNewIsolateId() => _Utils._getNewIsolateId();
bool _callPortInitialized = false;
var _callPortLastResult = null;
_callPortSync(num id, var message) {
if (!_callPortInitialized) {
window.on['js-result'].listen((event) {
_callPortLastResult = JSON.decode(_getPortSyncEventData(event));
});
_callPortInitialized = true;
}
assert(_callPortLastResult == null);
_dispatchEvent('js-sync-message', {'id': id, 'message': message});
var result = _callPortLastResult;
_callPortLastResult = null;
return result;
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('AbstractWorker')
class AbstractWorker extends NativeFieldWrapperClass1 implements EventTarget {
@DomName('AbstractWorker.errorEvent')
@DocsEditable()
static const EventStreamProvider<ErrorEvent> errorEvent = const EventStreamProvider<ErrorEvent>('error');
@DomName('AbstractWorker.onerror')
@DocsEditable()
Stream<ErrorEvent> get onError => errorEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('AesCbcParams')
@Experimental() // untriaged
class AesCbcParams extends Algorithm {
// To suppress missing implicit constructor warnings.
factory AesCbcParams._() { throw new UnsupportedError("Not supported"); }
@DomName('AesCbcParams.iv')
@DocsEditable()
@Experimental() // untriaged
Uint8List get iv native "AesCbcParams_iv_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('AesKeyGenParams')
@Experimental() // untriaged
class AesKeyGenParams extends Algorithm {
// To suppress missing implicit constructor warnings.
factory AesKeyGenParams._() { throw new UnsupportedError("Not supported"); }
@DomName('AesKeyGenParams.length')
@DocsEditable()
@Experimental() // untriaged
int get length native "AesKeyGenParams_length_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Algorithm')
@Experimental() // untriaged
class Algorithm extends NativeFieldWrapperClass1 {
@DomName('Algorithm.name')
@DocsEditable()
@Experimental() // untriaged
String get name native "Algorithm_name_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLAnchorElement')
class AnchorElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory AnchorElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLAnchorElement.HTMLAnchorElement')
@DocsEditable()
factory AnchorElement({String href}) {
var e = document.$dom_createElement("a");
if (href != null) e.href = href;
return e;
}
@DomName('HTMLAnchorElement.download')
@DocsEditable()
String get download native "HTMLAnchorElement_download_Getter";
@DomName('HTMLAnchorElement.download')
@DocsEditable()
void set download(String value) native "HTMLAnchorElement_download_Setter";
@DomName('HTMLAnchorElement.hash')
@DocsEditable()
String get hash native "HTMLAnchorElement_hash_Getter";
@DomName('HTMLAnchorElement.hash')
@DocsEditable()
void set hash(String value) native "HTMLAnchorElement_hash_Setter";
@DomName('HTMLAnchorElement.host')
@DocsEditable()
String get host native "HTMLAnchorElement_host_Getter";
@DomName('HTMLAnchorElement.host')
@DocsEditable()
void set host(String value) native "HTMLAnchorElement_host_Setter";
@DomName('HTMLAnchorElement.hostname')
@DocsEditable()
String get hostname native "HTMLAnchorElement_hostname_Getter";
@DomName('HTMLAnchorElement.hostname')
@DocsEditable()
void set hostname(String value) native "HTMLAnchorElement_hostname_Setter";
@DomName('HTMLAnchorElement.href')
@DocsEditable()
String get href native "HTMLAnchorElement_href_Getter";
@DomName('HTMLAnchorElement.href')
@DocsEditable()
void set href(String value) native "HTMLAnchorElement_href_Setter";
@DomName('HTMLAnchorElement.hreflang')
@DocsEditable()
String get hreflang native "HTMLAnchorElement_hreflang_Getter";
@DomName('HTMLAnchorElement.hreflang')
@DocsEditable()
void set hreflang(String value) native "HTMLAnchorElement_hreflang_Setter";
@DomName('HTMLAnchorElement.name')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLAnchorElement-partial
@deprecated // deprecated
String get name native "HTMLAnchorElement_name_Getter";
@DomName('HTMLAnchorElement.name')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLAnchorElement-partial
@deprecated // deprecated
void set name(String value) native "HTMLAnchorElement_name_Setter";
@DomName('HTMLAnchorElement.origin')
@DocsEditable()
// WebKit only
@deprecated // nonstandard
String get origin native "HTMLAnchorElement_origin_Getter";
@DomName('HTMLAnchorElement.pathname')
@DocsEditable()
String get pathname native "HTMLAnchorElement_pathname_Getter";
@DomName('HTMLAnchorElement.pathname')
@DocsEditable()
void set pathname(String value) native "HTMLAnchorElement_pathname_Setter";
@DomName('HTMLAnchorElement.ping')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-a-element
@deprecated // deprecated
String get ping native "HTMLAnchorElement_ping_Getter";
@DomName('HTMLAnchorElement.ping')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-a-element
@deprecated // deprecated
void set ping(String value) native "HTMLAnchorElement_ping_Setter";
@DomName('HTMLAnchorElement.port')
@DocsEditable()
String get port native "HTMLAnchorElement_port_Getter";
@DomName('HTMLAnchorElement.port')
@DocsEditable()
void set port(String value) native "HTMLAnchorElement_port_Setter";
@DomName('HTMLAnchorElement.protocol')
@DocsEditable()
String get protocol native "HTMLAnchorElement_protocol_Getter";
@DomName('HTMLAnchorElement.protocol')
@DocsEditable()
void set protocol(String value) native "HTMLAnchorElement_protocol_Setter";
@DomName('HTMLAnchorElement.rel')
@DocsEditable()
String get rel native "HTMLAnchorElement_rel_Getter";
@DomName('HTMLAnchorElement.rel')
@DocsEditable()
void set rel(String value) native "HTMLAnchorElement_rel_Setter";
@DomName('HTMLAnchorElement.search')
@DocsEditable()
String get search native "HTMLAnchorElement_search_Getter";
@DomName('HTMLAnchorElement.search')
@DocsEditable()
void set search(String value) native "HTMLAnchorElement_search_Setter";
@DomName('HTMLAnchorElement.target')
@DocsEditable()
String get target native "HTMLAnchorElement_target_Getter";
@DomName('HTMLAnchorElement.target')
@DocsEditable()
void set target(String value) native "HTMLAnchorElement_target_Setter";
@DomName('HTMLAnchorElement.type')
@DocsEditable()
String get type native "HTMLAnchorElement_type_Getter";
@DomName('HTMLAnchorElement.type')
@DocsEditable()
void set type(String value) native "HTMLAnchorElement_type_Setter";
@DomName('HTMLAnchorElement.toString')
@DocsEditable()
String toString() native "HTMLAnchorElement_toString_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitAnimationEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
class AnimationEvent extends Event {
// To suppress missing implicit constructor warnings.
factory AnimationEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitAnimationEvent.animationName')
@DocsEditable()
String get animationName native "WebKitAnimationEvent_animationName_Getter";
@DomName('WebKitAnimationEvent.elapsedTime')
@DocsEditable()
double get elapsedTime native "WebKitAnimationEvent_elapsedTime_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ApplicationCache')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.OPERA)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Unstable()
class ApplicationCache extends EventTarget {
// To suppress missing implicit constructor warnings.
factory ApplicationCache._() { throw new UnsupportedError("Not supported"); }
@DomName('ApplicationCache.cachedEvent')
@DocsEditable()
static const EventStreamProvider<Event> cachedEvent = const EventStreamProvider<Event>('cached');
@DomName('ApplicationCache.checkingEvent')
@DocsEditable()
static const EventStreamProvider<Event> checkingEvent = const EventStreamProvider<Event>('checking');
@DomName('ApplicationCache.downloadingEvent')
@DocsEditable()
static const EventStreamProvider<Event> downloadingEvent = const EventStreamProvider<Event>('downloading');
@DomName('ApplicationCache.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('ApplicationCache.noupdateEvent')
@DocsEditable()
static const EventStreamProvider<Event> noUpdateEvent = const EventStreamProvider<Event>('noupdate');
@DomName('ApplicationCache.obsoleteEvent')
@DocsEditable()
static const EventStreamProvider<Event> obsoleteEvent = const EventStreamProvider<Event>('obsolete');
@DomName('ApplicationCache.progressEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
@DomName('ApplicationCache.updatereadyEvent')
@DocsEditable()
static const EventStreamProvider<Event> updateReadyEvent = const EventStreamProvider<Event>('updateready');
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('ApplicationCache.CHECKING')
@DocsEditable()
static const int CHECKING = 2;
@DomName('ApplicationCache.DOWNLOADING')
@DocsEditable()
static const int DOWNLOADING = 3;
@DomName('ApplicationCache.IDLE')
@DocsEditable()
static const int IDLE = 1;
@DomName('ApplicationCache.OBSOLETE')
@DocsEditable()
static const int OBSOLETE = 5;
@DomName('ApplicationCache.UNCACHED')
@DocsEditable()
static const int UNCACHED = 0;
@DomName('ApplicationCache.UPDATEREADY')
@DocsEditable()
static const int UPDATEREADY = 4;
@DomName('ApplicationCache.status')
@DocsEditable()
int get status native "ApplicationCache_status_Getter";
@DomName('ApplicationCache.abort')
@DocsEditable()
void abort() native "ApplicationCache_abort_Callback";
@DomName('ApplicationCache.swapCache')
@DocsEditable()
void swapCache() native "ApplicationCache_swapCache_Callback";
@DomName('ApplicationCache.update')
@DocsEditable()
void update() native "ApplicationCache_update_Callback";
@DomName('ApplicationCache.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "ApplicationCache_addEventListener_Callback";
@DomName('ApplicationCache.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "ApplicationCache_dispatchEvent_Callback";
@DomName('ApplicationCache.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "ApplicationCache_removeEventListener_Callback";
@DomName('ApplicationCache.oncached')
@DocsEditable()
Stream<Event> get onCached => cachedEvent.forTarget(this);
@DomName('ApplicationCache.onchecking')
@DocsEditable()
Stream<Event> get onChecking => checkingEvent.forTarget(this);
@DomName('ApplicationCache.ondownloading')
@DocsEditable()
Stream<Event> get onDownloading => downloadingEvent.forTarget(this);
@DomName('ApplicationCache.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('ApplicationCache.onnoupdate')
@DocsEditable()
Stream<Event> get onNoUpdate => noUpdateEvent.forTarget(this);
@DomName('ApplicationCache.onobsolete')
@DocsEditable()
Stream<Event> get onObsolete => obsoleteEvent.forTarget(this);
@DomName('ApplicationCache.onprogress')
@DocsEditable()
Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
@DomName('ApplicationCache.onupdateready')
@DocsEditable()
Stream<Event> get onUpdateReady => updateReadyEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* DOM Area Element, which links regions of an image map with a hyperlink.
*
* The element can also define an uninteractive region of the map.
*
* See also:
*
* * [<area>](https://developer.mozilla.org/en-US/docs/HTML/Element/area)
* on MDN.
*/
@DomName('HTMLAreaElement')
class AreaElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory AreaElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLAreaElement.HTMLAreaElement')
@DocsEditable()
factory AreaElement() => document.$dom_createElement("area");
@DomName('HTMLAreaElement.alt')
@DocsEditable()
String get alt native "HTMLAreaElement_alt_Getter";
@DomName('HTMLAreaElement.alt')
@DocsEditable()
void set alt(String value) native "HTMLAreaElement_alt_Setter";
@DomName('HTMLAreaElement.coords')
@DocsEditable()
String get coords native "HTMLAreaElement_coords_Getter";
@DomName('HTMLAreaElement.coords')
@DocsEditable()
void set coords(String value) native "HTMLAreaElement_coords_Setter";
@DomName('HTMLAreaElement.hash')
@DocsEditable()
String get hash native "HTMLAreaElement_hash_Getter";
@DomName('HTMLAreaElement.host')
@DocsEditable()
String get host native "HTMLAreaElement_host_Getter";
@DomName('HTMLAreaElement.hostname')
@DocsEditable()
String get hostname native "HTMLAreaElement_hostname_Getter";
@DomName('HTMLAreaElement.href')
@DocsEditable()
String get href native "HTMLAreaElement_href_Getter";
@DomName('HTMLAreaElement.href')
@DocsEditable()
void set href(String value) native "HTMLAreaElement_href_Setter";
@DomName('HTMLAreaElement.pathname')
@DocsEditable()
String get pathname native "HTMLAreaElement_pathname_Getter";
@DomName('HTMLAreaElement.ping')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLAreaElement-partial
@deprecated // deprecated
String get ping native "HTMLAreaElement_ping_Getter";
@DomName('HTMLAreaElement.ping')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLAreaElement-partial
@deprecated // deprecated
void set ping(String value) native "HTMLAreaElement_ping_Setter";
@DomName('HTMLAreaElement.port')
@DocsEditable()
String get port native "HTMLAreaElement_port_Getter";
@DomName('HTMLAreaElement.protocol')
@DocsEditable()
String get protocol native "HTMLAreaElement_protocol_Getter";
@DomName('HTMLAreaElement.search')
@DocsEditable()
String get search native "HTMLAreaElement_search_Getter";
@DomName('HTMLAreaElement.shape')
@DocsEditable()
String get shape native "HTMLAreaElement_shape_Getter";
@DomName('HTMLAreaElement.shape')
@DocsEditable()
void set shape(String value) native "HTMLAreaElement_shape_Setter";
@DomName('HTMLAreaElement.target')
@DocsEditable()
String get target native "HTMLAreaElement_target_Getter";
@DomName('HTMLAreaElement.target')
@DocsEditable()
void set target(String value) native "HTMLAreaElement_target_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLAudioElement')
class AudioElement extends MediaElement {
// To suppress missing implicit constructor warnings.
factory AudioElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLAudioElement.HTMLAudioElement')
@DocsEditable()
factory AudioElement([String src]) {
return AudioElement._create_1(src);
}
@DocsEditable()
static AudioElement _create_1(src) native "HTMLAudioElement__create_1constructorCallback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('AutocompleteErrorEvent')
// http://wiki.whatwg.org/wiki/RequestAutocomplete
@Experimental()
class AutocompleteErrorEvent extends Event {
// To suppress missing implicit constructor warnings.
factory AutocompleteErrorEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('AutocompleteErrorEvent.reason')
@DocsEditable()
String get reason native "AutocompleteErrorEvent_reason_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLBRElement')
class BRElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory BRElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLBRElement.HTMLBRElement')
@DocsEditable()
factory BRElement() => document.$dom_createElement("br");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('BarProp')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#barprop
@deprecated // standard
class BarProp extends NativeFieldWrapperClass1 {
@DomName('BarProp.visible')
@DocsEditable()
bool get visible native "BarProp_visible_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLBaseElement')
class BaseElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory BaseElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLBaseElement.HTMLBaseElement')
@DocsEditable()
factory BaseElement() => document.$dom_createElement("base");
@DomName('HTMLBaseElement.href')
@DocsEditable()
String get href native "HTMLBaseElement_href_Getter";
@DomName('HTMLBaseElement.href')
@DocsEditable()
void set href(String value) native "HTMLBaseElement_href_Setter";
@DomName('HTMLBaseElement.target')
@DocsEditable()
String get target native "HTMLBaseElement_target_Getter";
@DomName('HTMLBaseElement.target')
@DocsEditable()
void set target(String value) native "HTMLBaseElement_target_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('BeforeLoadEvent')
@Experimental()
class BeforeLoadEvent extends Event {
// To suppress missing implicit constructor warnings.
factory BeforeLoadEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('BeforeLoadEvent.url')
@DocsEditable()
String get url native "BeforeLoadEvent_url_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('Blob')
class Blob extends NativeFieldWrapperClass1 {
@DomName('Blob.Blob')
@DocsEditable()
factory Blob(List blobParts, [String type, String endings]) => _create(blobParts, type, endings);
@DocsEditable()
static Blob _create(blobParts, type, endings) native "Blob_constructorCallback";
@DomName('Blob.size')
@DocsEditable()
int get size native "Blob_size_Getter";
@DomName('Blob.type')
@DocsEditable()
String get type native "Blob_type_Getter";
Blob slice([int start, int end, String contentType]) {
if (contentType != null) {
return _slice_1(start, end, contentType);
}
if (end != null) {
return _slice_2(start, end);
}
if (start != null) {
return _slice_3(start);
}
return _slice_4();
}
Blob _slice_1(start, end, contentType) native "Blob__slice_1_Callback";
Blob _slice_2(start, end) native "Blob__slice_2_Callback";
Blob _slice_3(start) native "Blob__slice_3_Callback";
Blob _slice_4() native "Blob__slice_4_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLBodyElement')
class BodyElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory BodyElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLBodyElement.blurEvent')
@DocsEditable()
static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
@DomName('HTMLBodyElement.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('HTMLBodyElement.focusEvent')
@DocsEditable()
static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
@DomName('HTMLBodyElement.hashchangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> hashChangeEvent = const EventStreamProvider<Event>('hashchange');
@DomName('HTMLBodyElement.loadEvent')
@DocsEditable()
static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
@DomName('HTMLBodyElement.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('HTMLBodyElement.offlineEvent')
@DocsEditable()
static const EventStreamProvider<Event> offlineEvent = const EventStreamProvider<Event>('offline');
@DomName('HTMLBodyElement.onlineEvent')
@DocsEditable()
static const EventStreamProvider<Event> onlineEvent = const EventStreamProvider<Event>('online');
@DomName('HTMLBodyElement.popstateEvent')
@DocsEditable()
static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStreamProvider<PopStateEvent>('popstate');
@DomName('HTMLBodyElement.resizeEvent')
@DocsEditable()
static const EventStreamProvider<Event> resizeEvent = const EventStreamProvider<Event>('resize');
@DomName('HTMLBodyElement.storageEvent')
@DocsEditable()
static const EventStreamProvider<StorageEvent> storageEvent = const EventStreamProvider<StorageEvent>('storage');
@DomName('HTMLBodyElement.unloadEvent')
@DocsEditable()
static const EventStreamProvider<Event> unloadEvent = const EventStreamProvider<Event>('unload');
@DomName('HTMLBodyElement.HTMLBodyElement')
@DocsEditable()
factory BodyElement() => document.$dom_createElement("body");
@DomName('HTMLBodyElement.onblur')
@DocsEditable()
ElementStream<Event> get onBlur => blurEvent.forElement(this);
@DomName('HTMLBodyElement.onerror')
@DocsEditable()
ElementStream<Event> get onError => errorEvent.forElement(this);
@DomName('HTMLBodyElement.onfocus')
@DocsEditable()
ElementStream<Event> get onFocus => focusEvent.forElement(this);
@DomName('HTMLBodyElement.onhashchange')
@DocsEditable()
ElementStream<Event> get onHashChange => hashChangeEvent.forElement(this);
@DomName('HTMLBodyElement.onload')
@DocsEditable()
ElementStream<Event> get onLoad => loadEvent.forElement(this);
@DomName('HTMLBodyElement.onmessage')
@DocsEditable()
ElementStream<MessageEvent> get onMessage => messageEvent.forElement(this);
@DomName('HTMLBodyElement.onoffline')
@DocsEditable()
ElementStream<Event> get onOffline => offlineEvent.forElement(this);
@DomName('HTMLBodyElement.ononline')
@DocsEditable()
ElementStream<Event> get onOnline => onlineEvent.forElement(this);
@DomName('HTMLBodyElement.onpopstate')
@DocsEditable()
ElementStream<PopStateEvent> get onPopState => popStateEvent.forElement(this);
@DomName('HTMLBodyElement.onresize')
@DocsEditable()
ElementStream<Event> get onResize => resizeEvent.forElement(this);
@DomName('HTMLBodyElement.onstorage')
@DocsEditable()
ElementStream<StorageEvent> get onStorage => storageEvent.forElement(this);
@DomName('HTMLBodyElement.onunload')
@DocsEditable()
ElementStream<Event> get onUnload => unloadEvent.forElement(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLButtonElement')
class ButtonElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ButtonElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLButtonElement.HTMLButtonElement')
@DocsEditable()
factory ButtonElement() => document.$dom_createElement("button");
@DomName('HTMLButtonElement.autofocus')
@DocsEditable()
bool get autofocus native "HTMLButtonElement_autofocus_Getter";
@DomName('HTMLButtonElement.autofocus')
@DocsEditable()
void set autofocus(bool value) native "HTMLButtonElement_autofocus_Setter";
@DomName('HTMLButtonElement.disabled')
@DocsEditable()
bool get disabled native "HTMLButtonElement_disabled_Getter";
@DomName('HTMLButtonElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLButtonElement_disabled_Setter";
@DomName('HTMLButtonElement.form')
@DocsEditable()
FormElement get form native "HTMLButtonElement_form_Getter";
@DomName('HTMLButtonElement.formAction')
@DocsEditable()
String get formAction native "HTMLButtonElement_formAction_Getter";
@DomName('HTMLButtonElement.formAction')
@DocsEditable()
void set formAction(String value) native "HTMLButtonElement_formAction_Setter";
@DomName('HTMLButtonElement.formEnctype')
@DocsEditable()
String get formEnctype native "HTMLButtonElement_formEnctype_Getter";
@DomName('HTMLButtonElement.formEnctype')
@DocsEditable()
void set formEnctype(String value) native "HTMLButtonElement_formEnctype_Setter";
@DomName('HTMLButtonElement.formMethod')
@DocsEditable()
String get formMethod native "HTMLButtonElement_formMethod_Getter";
@DomName('HTMLButtonElement.formMethod')
@DocsEditable()
void set formMethod(String value) native "HTMLButtonElement_formMethod_Setter";
@DomName('HTMLButtonElement.formNoValidate')
@DocsEditable()
bool get formNoValidate native "HTMLButtonElement_formNoValidate_Getter";
@DomName('HTMLButtonElement.formNoValidate')
@DocsEditable()
void set formNoValidate(bool value) native "HTMLButtonElement_formNoValidate_Setter";
@DomName('HTMLButtonElement.formTarget')
@DocsEditable()
String get formTarget native "HTMLButtonElement_formTarget_Getter";
@DomName('HTMLButtonElement.formTarget')
@DocsEditable()
void set formTarget(String value) native "HTMLButtonElement_formTarget_Setter";
@DomName('HTMLButtonElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLButtonElement_labels_Getter";
@DomName('HTMLButtonElement.name')
@DocsEditable()
String get name native "HTMLButtonElement_name_Getter";
@DomName('HTMLButtonElement.name')
@DocsEditable()
void set name(String value) native "HTMLButtonElement_name_Setter";
@DomName('HTMLButtonElement.type')
@DocsEditable()
String get type native "HTMLButtonElement_type_Getter";
@DomName('HTMLButtonElement.type')
@DocsEditable()
void set type(String value) native "HTMLButtonElement_type_Setter";
@DomName('HTMLButtonElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLButtonElement_validationMessage_Getter";
@DomName('HTMLButtonElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLButtonElement_validity_Getter";
@DomName('HTMLButtonElement.value')
@DocsEditable()
String get value native "HTMLButtonElement_value_Getter";
@DomName('HTMLButtonElement.value')
@DocsEditable()
void set value(String value) native "HTMLButtonElement_value_Setter";
@DomName('HTMLButtonElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLButtonElement_willValidate_Getter";
@DomName('HTMLButtonElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLButtonElement_checkValidity_Callback";
@DomName('HTMLButtonElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLButtonElement_setCustomValidity_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CDATASection')
// http://dom.spec.whatwg.org/#cdatasection
@deprecated // deprecated
class CDataSection extends Text {
// To suppress missing implicit constructor warnings.
factory CDataSection._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Canvas2DContextAttributes')
// http://wiki.whatwg.org/wiki/CanvasOpaque#Suggested_IDL
@Experimental()
class Canvas2DContextAttributes extends NativeFieldWrapperClass1 {
@DomName('Canvas2DContextAttributes.alpha')
@DocsEditable()
bool get alpha native "Canvas2DContextAttributes_alpha_Getter";
@DomName('Canvas2DContextAttributes.alpha')
@DocsEditable()
void set alpha(bool value) native "Canvas2DContextAttributes_alpha_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('HTMLCanvasElement')
class CanvasElement extends HtmlElement implements CanvasImageSource {
// To suppress missing implicit constructor warnings.
factory CanvasElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLCanvasElement.webglcontextlostEvent')
@DocsEditable()
static const EventStreamProvider<gl.ContextEvent> webGlContextLostEvent = const EventStreamProvider<gl.ContextEvent>('webglcontextlost');
@DomName('HTMLCanvasElement.webglcontextrestoredEvent')
@DocsEditable()
static const EventStreamProvider<gl.ContextEvent> webGlContextRestoredEvent = const EventStreamProvider<gl.ContextEvent>('webglcontextrestored');
@DomName('HTMLCanvasElement.HTMLCanvasElement')
@DocsEditable()
factory CanvasElement({int width, int height}) {
var e = document.$dom_createElement("canvas");
if (width != null) e.width = width;
if (height != null) e.height = height;
return e;
}
/// The height of this canvas element in CSS pixels.
@DomName('HTMLCanvasElement.height')
@DocsEditable()
int get height native "HTMLCanvasElement_height_Getter";
/// The height of this canvas element in CSS pixels.
@DomName('HTMLCanvasElement.height')
@DocsEditable()
void set height(int value) native "HTMLCanvasElement_height_Setter";
/// The width of this canvas element in CSS pixels.
@DomName('HTMLCanvasElement.width')
@DocsEditable()
int get width native "HTMLCanvasElement_width_Getter";
/// The width of this canvas element in CSS pixels.
@DomName('HTMLCanvasElement.width')
@DocsEditable()
void set width(int value) native "HTMLCanvasElement_width_Setter";
@DomName('HTMLCanvasElement.getContext')
@DocsEditable()
CanvasRenderingContext getContext(String contextId, [Map attrs]) native "HTMLCanvasElement_getContext_Callback";
@DomName('HTMLCanvasElement.toDataURL')
@DocsEditable()
String _toDataUrl(String type, [num quality]) native "HTMLCanvasElement_toDataURL_Callback";
@DomName('HTMLCanvasElement.onwebglcontextlost')
@DocsEditable()
ElementStream<gl.ContextEvent> get onWebGlContextLost => webGlContextLostEvent.forElement(this);
@DomName('HTMLCanvasElement.onwebglcontextrestored')
@DocsEditable()
ElementStream<gl.ContextEvent> get onWebGlContextRestored => webGlContextRestoredEvent.forElement(this);
/** An API for drawing on this canvas. */
CanvasRenderingContext2D get context2D => getContext('2d');
@deprecated
CanvasRenderingContext2D get context2d => this.context2D;
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@Experimental()
gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false,
antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) {
var options = {
'alpha': alpha,
'depth': depth,
'stencil': stencil,
'antialias': antialias,
'premultipliedAlpha': premultipliedAlpha,
'preserveDrawingBuffer': preserveDrawingBuffer,
};
var context = getContext('webgl', options);
if (context == null) {
context = getContext('experimental-webgl', options);
}
return context;
}
/**
* Returns a data URI containing a representation of the image in the
* format specified by type (defaults to 'image/png').
*
* Data Uri format is as follow
* `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
*
* Optional parameter [quality] in the range of 0.0 and 1.0 can be used when
* requesting [type] 'image/jpeg' or 'image/webp'. If [quality] is not passed
* the default value is used. Note: the default value varies by browser.
*
* If the height or width of this canvas element is 0, then 'data:' is
* returned, representing no data.
*
* If the type requested is not 'image/png', and the returned value is
* 'data:image/png', then the requested type is not supported.
*
* Example usage:
*
* CanvasElement canvas = new CanvasElement();
* var ctx = canvas.context2D
* ..fillStyle = "rgb(200,0,0)"
* ..fillRect(10, 10, 55, 50);
* var dataUrl = canvas.toDataUrl("image/jpeg", 0.95);
* // The Data Uri would look similar to
* // 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
* // AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
* // 9TXL0Y4OHwAAAABJRU5ErkJggg=='
* //Create a new image element from the data URI.
* var img = new ImageElement();
* img.src = dataUrl;
* document.body.children.add(img);
*
* See also:
*
* * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wikipedia.
*
* * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanvasElement) from MDN.
*
* * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canvas-todataurl) from W3C.
*/
String toDataUrl([String type = 'image/png', num quality]) =>
_toDataUrl(type, quality);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* An opaque canvas object representing a gradient.
*
* Created by calling [createLinearGradient] or [createRadialGradient] on a
* [CanvasRenderingContext2D] object.
*
* Example usage:
*
* var canvas = new CanvasElement(width: 600, height: 600);
* var ctx = canvas.context2D;
* ctx.clearRect(0, 0, 600, 600);
* ctx.save();
* // Create radial gradient.
* CanvasGradient gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, 600);
* gradient.addColorStop(0, '#000');
* gradient.addColorStop(1, 'rgb(255, 255, 255)');
* // Assign gradients to fill.
* ctx.fillStyle = gradient;
* // Draw a rectangle with a gradient fill.
* ctx.fillRect(0, 0, 600, 600);
* ctx.save();
* document.body.children.add(canvas);
*
* See also:
*
* * [CanvasGradient](https://developer.mozilla.org/en-US/docs/DOM/CanvasGradient) from MDN.
* * [CanvasGradient](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasgradient) from whatwg.
* * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgradient) from W3C.
*/
@DomName('CanvasGradient')
class CanvasGradient extends NativeFieldWrapperClass1 {
/**
* Adds a color stop to this gradient at the offset.
*
* The [offset] can range between 0.0 and 1.0.
*
* See also:
*
* * [Multiple Color Stops](https://developer.mozilla.org/en-US/docs/CSS/linear-gradient#Gradient_with_multiple_color_stops) from MDN.
*/
@DomName('CanvasGradient.addColorStop')
@DocsEditable()
void addColorStop(num offset, String color) native "CanvasGradient_addColorStop_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* An opaque object representing a pattern of image, canvas, or video.
*
* Created by calling [createPattern] on a [CanvasRenderingContext2D] object.
*
* Example usage:
*
* var canvas = new CanvasElement(width: 600, height: 600);
* var ctx = canvas.context2D;
* var img = new ImageElement();
* // Image src needs to be loaded before pattern is applied.
* img.onLoad.listen((event) {
* // When the image is loaded, create a pattern
* // from the ImageElement.
* CanvasPattern pattern = ctx.createPattern(img, 'repeat');
* ctx.rect(0, 0, canvas.width, canvas.height);
* ctx.fillStyle = pattern;
* ctx.fill();
* });
* img.src = "images/foo.jpg";
* document.body.children.add(canvas);
*
* See also:
* * [CanvasPattern](https://developer.mozilla.org/en-US/docs/DOM/CanvasPattern) from MDN.
* * [CanvasPattern](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvaspattern) from whatwg.
* * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspattern) from W3C.
*/
@DomName('CanvasPattern')
class CanvasPattern extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* A rendering context for a canvas element.
*
* This context is extended by [CanvasRenderingContext2D] and
* [WebGLRenderingContext].
*/
@DomName('CanvasRenderingContext')
class CanvasRenderingContext extends NativeFieldWrapperClass1 {
/// Reference to the canvas element to which this context belongs.
@DomName('CanvasRenderingContext.canvas')
@DocsEditable()
CanvasElement get canvas native "CanvasRenderingContext_canvas_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('CanvasRenderingContext2D')
class CanvasRenderingContext2D extends CanvasRenderingContext {
// To suppress missing implicit constructor warnings.
factory CanvasRenderingContext2D._() { throw new UnsupportedError("Not supported"); }
@DomName('CanvasRenderingContext2D.currentPath')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
@Experimental()
Path get currentPath native "CanvasRenderingContext2D_currentPath_Getter";
@DomName('CanvasRenderingContext2D.currentPath')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
@Experimental()
void set currentPath(Path value) native "CanvasRenderingContext2D_currentPath_Setter";
@DomName('CanvasRenderingContext2D.fillStyle')
@DocsEditable()
dynamic get fillStyle native "CanvasRenderingContext2D_fillStyle_Getter";
@DomName('CanvasRenderingContext2D.fillStyle')
@DocsEditable()
void set fillStyle(dynamic value) native "CanvasRenderingContext2D_fillStyle_Setter";
@DomName('CanvasRenderingContext2D.font')
@DocsEditable()
String get font native "CanvasRenderingContext2D_font_Getter";
@DomName('CanvasRenderingContext2D.font')
@DocsEditable()
void set font(String value) native "CanvasRenderingContext2D_font_Setter";
@DomName('CanvasRenderingContext2D.globalAlpha')
@DocsEditable()
num get globalAlpha native "CanvasRenderingContext2D_globalAlpha_Getter";
@DomName('CanvasRenderingContext2D.globalAlpha')
@DocsEditable()
void set globalAlpha(num value) native "CanvasRenderingContext2D_globalAlpha_Setter";
@DomName('CanvasRenderingContext2D.globalCompositeOperation')
@DocsEditable()
String get globalCompositeOperation native "CanvasRenderingContext2D_globalCompositeOperation_Getter";
@DomName('CanvasRenderingContext2D.globalCompositeOperation')
@DocsEditable()
void set globalCompositeOperation(String value) native "CanvasRenderingContext2D_globalCompositeOperation_Setter";
@DomName('CanvasRenderingContext2D.imageSmoothingEnabled')
@DocsEditable()
@Experimental() // untriaged
bool get imageSmoothingEnabled native "CanvasRenderingContext2D_imageSmoothingEnabled_Getter";
@DomName('CanvasRenderingContext2D.imageSmoothingEnabled')
@DocsEditable()
@Experimental() // untriaged
void set imageSmoothingEnabled(bool value) native "CanvasRenderingContext2D_imageSmoothingEnabled_Setter";
@DomName('CanvasRenderingContext2D.lineCap')
@DocsEditable()
String get lineCap native "CanvasRenderingContext2D_lineCap_Getter";
@DomName('CanvasRenderingContext2D.lineCap')
@DocsEditable()
void set lineCap(String value) native "CanvasRenderingContext2D_lineCap_Setter";
@DomName('CanvasRenderingContext2D.lineDashOffset')
@DocsEditable()
num get lineDashOffset native "CanvasRenderingContext2D_lineDashOffset_Getter";
@DomName('CanvasRenderingContext2D.lineDashOffset')
@DocsEditable()
void set lineDashOffset(num value) native "CanvasRenderingContext2D_lineDashOffset_Setter";
@DomName('CanvasRenderingContext2D.lineJoin')
@DocsEditable()
String get lineJoin native "CanvasRenderingContext2D_lineJoin_Getter";
@DomName('CanvasRenderingContext2D.lineJoin')
@DocsEditable()
void set lineJoin(String value) native "CanvasRenderingContext2D_lineJoin_Setter";
@DomName('CanvasRenderingContext2D.lineWidth')
@DocsEditable()
num get lineWidth native "CanvasRenderingContext2D_lineWidth_Getter";
@DomName('CanvasRenderingContext2D.lineWidth')
@DocsEditable()
void set lineWidth(num value) native "CanvasRenderingContext2D_lineWidth_Setter";
@DomName('CanvasRenderingContext2D.miterLimit')
@DocsEditable()
num get miterLimit native "CanvasRenderingContext2D_miterLimit_Getter";
@DomName('CanvasRenderingContext2D.miterLimit')
@DocsEditable()
void set miterLimit(num value) native "CanvasRenderingContext2D_miterLimit_Setter";
@DomName('CanvasRenderingContext2D.shadowBlur')
@DocsEditable()
num get shadowBlur native "CanvasRenderingContext2D_shadowBlur_Getter";
@DomName('CanvasRenderingContext2D.shadowBlur')
@DocsEditable()
void set shadowBlur(num value) native "CanvasRenderingContext2D_shadowBlur_Setter";
@DomName('CanvasRenderingContext2D.shadowColor')
@DocsEditable()
String get shadowColor native "CanvasRenderingContext2D_shadowColor_Getter";
@DomName('CanvasRenderingContext2D.shadowColor')
@DocsEditable()
void set shadowColor(String value) native "CanvasRenderingContext2D_shadowColor_Setter";
@DomName('CanvasRenderingContext2D.shadowOffsetX')
@DocsEditable()
num get shadowOffsetX native "CanvasRenderingContext2D_shadowOffsetX_Getter";
@DomName('CanvasRenderingContext2D.shadowOffsetX')
@DocsEditable()
void set shadowOffsetX(num value) native "CanvasRenderingContext2D_shadowOffsetX_Setter";
@DomName('CanvasRenderingContext2D.shadowOffsetY')
@DocsEditable()
num get shadowOffsetY native "CanvasRenderingContext2D_shadowOffsetY_Getter";
@DomName('CanvasRenderingContext2D.shadowOffsetY')
@DocsEditable()
void set shadowOffsetY(num value) native "CanvasRenderingContext2D_shadowOffsetY_Setter";
@DomName('CanvasRenderingContext2D.strokeStyle')
@DocsEditable()
dynamic get strokeStyle native "CanvasRenderingContext2D_strokeStyle_Getter";
@DomName('CanvasRenderingContext2D.strokeStyle')
@DocsEditable()
void set strokeStyle(dynamic value) native "CanvasRenderingContext2D_strokeStyle_Setter";
@DomName('CanvasRenderingContext2D.textAlign')
@DocsEditable()
String get textAlign native "CanvasRenderingContext2D_textAlign_Getter";
@DomName('CanvasRenderingContext2D.textAlign')
@DocsEditable()
void set textAlign(String value) native "CanvasRenderingContext2D_textAlign_Setter";
@DomName('CanvasRenderingContext2D.textBaseline')
@DocsEditable()
String get textBaseline native "CanvasRenderingContext2D_textBaseline_Getter";
@DomName('CanvasRenderingContext2D.textBaseline')
@DocsEditable()
void set textBaseline(String value) native "CanvasRenderingContext2D_textBaseline_Setter";
@DomName('CanvasRenderingContext2D.webkitBackingStorePixelRatio')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
double get backingStorePixelRatio native "CanvasRenderingContext2D_webkitBackingStorePixelRatio_Getter";
@DomName('CanvasRenderingContext2D.arc')
@DocsEditable()
void _arc(num x, num y, num radius, num startAngle, num endAngle, bool anticlockwise) native "CanvasRenderingContext2D_arc_Callback";
@DomName('CanvasRenderingContext2D.arcTo')
@DocsEditable()
void arcTo(num x1, num y1, num x2, num y2, num radius) native "CanvasRenderingContext2D_arcTo_Callback";
@DomName('CanvasRenderingContext2D.beginPath')
@DocsEditable()
void beginPath() native "CanvasRenderingContext2D_beginPath_Callback";
@DomName('CanvasRenderingContext2D.bezierCurveTo')
@DocsEditable()
void bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y) native "CanvasRenderingContext2D_bezierCurveTo_Callback";
@DomName('CanvasRenderingContext2D.clearRect')
@DocsEditable()
void clearRect(num x, num y, num width, num height) native "CanvasRenderingContext2D_clearRect_Callback";
void clip([String winding]) {
if (winding != null) {
_clip_1(winding);
return;
}
_clip_2();
return;
}
void _clip_1(winding) native "CanvasRenderingContext2D__clip_1_Callback";
void _clip_2() native "CanvasRenderingContext2D__clip_2_Callback";
@DomName('CanvasRenderingContext2D.closePath')
@DocsEditable()
void closePath() native "CanvasRenderingContext2D_closePath_Callback";
@DomName('CanvasRenderingContext2D.createImageData')
@DocsEditable()
ImageData createImageData(num sw, num sh) native "CanvasRenderingContext2D_createImageData_Callback";
@DomName('CanvasRenderingContext2D.createImageDataFromImageData')
@DocsEditable()
ImageData createImageDataFromImageData(ImageData imagedata) native "CanvasRenderingContext2D_createImageDataFromImageData_Callback";
@DomName('CanvasRenderingContext2D.createLinearGradient')
@DocsEditable()
CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native "CanvasRenderingContext2D_createLinearGradient_Callback";
@DomName('CanvasRenderingContext2D.createPattern')
@DocsEditable()
CanvasPattern createPattern(CanvasElement canvas, String repetitionType) native "CanvasRenderingContext2D_createPattern_Callback";
@DomName('CanvasRenderingContext2D.createPatternFromImage')
@DocsEditable()
CanvasPattern createPatternFromImage(ImageElement image, String repetitionType) native "CanvasRenderingContext2D_createPatternFromImage_Callback";
@DomName('CanvasRenderingContext2D.createRadialGradient')
@DocsEditable()
CanvasGradient createRadialGradient(num x0, num y0, num r0, num x1, num y1, num r1) native "CanvasRenderingContext2D_createRadialGradient_Callback";
@DomName('CanvasRenderingContext2D.drawCustomFocusRing')
@DocsEditable()
@Experimental() // untriaged
bool drawCustomFocusRing(Element element) native "CanvasRenderingContext2D_drawCustomFocusRing_Callback";
void _drawImage(canvas_OR_image_OR_imageBitmap_OR_video, num sx_OR_x, num sy_OR_y, [num sw_OR_width, num height_OR_sh, num dx, num dy, num dw, num dh]) {
if ((sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is ImageElement || canvas_OR_image_OR_imageBitmap_OR_video == null) && sw_OR_width == null && height_OR_sh == null && dx == null && dy == null && dw == null && dh == null) {
_drawImage_1(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y);
return;
}
if ((height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is ImageElement || canvas_OR_image_OR_imageBitmap_OR_video == null) && dx == null && dy == null && dw == null && dh == null) {
_drawImage_2(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh);
return;
}
if ((dh is num || dh == null) && (dw is num || dw == null) && (dy is num || dy == null) && (dx is num || dx == null) && (height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is ImageElement || canvas_OR_image_OR_imageBitmap_OR_video == null)) {
_drawImage_3(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh);
return;
}
if ((sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is CanvasElement || canvas_OR_image_OR_imageBitmap_OR_video == null) && sw_OR_width == null && height_OR_sh == null && dx == null && dy == null && dw == null && dh == null) {
_drawImage_4(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y);
return;
}
if ((height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is CanvasElement || canvas_OR_image_OR_imageBitmap_OR_video == null) && dx == null && dy == null && dw == null && dh == null) {
_drawImage_5(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh);
return;
}
if ((dh is num || dh == null) && (dw is num || dw == null) && (dy is num || dy == null) && (dx is num || dx == null) && (height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is CanvasElement || canvas_OR_image_OR_imageBitmap_OR_video == null)) {
_drawImage_6(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh);
return;
}
if ((sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is VideoElement || canvas_OR_image_OR_imageBitmap_OR_video == null) && sw_OR_width == null && height_OR_sh == null && dx == null && dy == null && dw == null && dh == null) {
_drawImage_7(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y);
return;
}
if ((height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is VideoElement || canvas_OR_image_OR_imageBitmap_OR_video == null) && dx == null && dy == null && dw == null && dh == null) {
_drawImage_8(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh);
return;
}
if ((dh is num || dh == null) && (dw is num || dw == null) && (dy is num || dy == null) && (dx is num || dx == null) && (height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is VideoElement || canvas_OR_image_OR_imageBitmap_OR_video == null)) {
_drawImage_9(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh);
return;
}
if ((sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is ImageBitmap || canvas_OR_image_OR_imageBitmap_OR_video == null) && sw_OR_width == null && height_OR_sh == null && dx == null && dy == null && dw == null && dh == null) {
_drawImage_10(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y);
return;
}
if ((height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is ImageBitmap || canvas_OR_image_OR_imageBitmap_OR_video == null) && dx == null && dy == null && dw == null && dh == null) {
_drawImage_11(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh);
return;
}
if ((dh is num || dh == null) && (dw is num || dw == null) && (dy is num || dy == null) && (dx is num || dx == null) && (height_OR_sh is num || height_OR_sh == null) && (sw_OR_width is num || sw_OR_width == null) && (sy_OR_y is num || sy_OR_y == null) && (sx_OR_x is num || sx_OR_x == null) && (canvas_OR_image_OR_imageBitmap_OR_video is ImageBitmap || canvas_OR_image_OR_imageBitmap_OR_video == null)) {
_drawImage_12(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void _drawImage_1(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y) native "CanvasRenderingContext2D__drawImage_1_Callback";
void _drawImage_2(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh) native "CanvasRenderingContext2D__drawImage_2_Callback";
void _drawImage_3(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh) native "CanvasRenderingContext2D__drawImage_3_Callback";
void _drawImage_4(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y) native "CanvasRenderingContext2D__drawImage_4_Callback";
void _drawImage_5(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh) native "CanvasRenderingContext2D__drawImage_5_Callback";
void _drawImage_6(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh) native "CanvasRenderingContext2D__drawImage_6_Callback";
void _drawImage_7(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y) native "CanvasRenderingContext2D__drawImage_7_Callback";
void _drawImage_8(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh) native "CanvasRenderingContext2D__drawImage_8_Callback";
void _drawImage_9(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh) native "CanvasRenderingContext2D__drawImage_9_Callback";
void _drawImage_10(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y) native "CanvasRenderingContext2D__drawImage_10_Callback";
void _drawImage_11(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh) native "CanvasRenderingContext2D__drawImage_11_Callback";
void _drawImage_12(canvas_OR_image_OR_imageBitmap_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh) native "CanvasRenderingContext2D__drawImage_12_Callback";
@DomName('CanvasRenderingContext2D.drawSystemFocusRing')
@DocsEditable()
@Experimental() // untriaged
void drawSystemFocusRing(Element element) native "CanvasRenderingContext2D_drawSystemFocusRing_Callback";
void fill([String winding]) {
if (winding != null) {
_fill_1(winding);
return;
}
_fill_2();
return;
}
void _fill_1(winding) native "CanvasRenderingContext2D__fill_1_Callback";
void _fill_2() native "CanvasRenderingContext2D__fill_2_Callback";
@DomName('CanvasRenderingContext2D.fillRect')
@DocsEditable()
void fillRect(num x, num y, num width, num height) native "CanvasRenderingContext2D_fillRect_Callback";
void fillText(String text, num x, num y, [num maxWidth]) {
if (maxWidth != null) {
_fillText_1(text, x, y, maxWidth);
return;
}
_fillText_2(text, x, y);
return;
}
void _fillText_1(text, x, y, maxWidth) native "CanvasRenderingContext2D__fillText_1_Callback";
void _fillText_2(text, x, y) native "CanvasRenderingContext2D__fillText_2_Callback";
@DomName('CanvasRenderingContext2D.getContextAttributes')
@DocsEditable()
// http://wiki.whatwg.org/wiki/CanvasOpaque#Suggested_IDL
@Experimental()
Canvas2DContextAttributes getContextAttributes() native "CanvasRenderingContext2D_getContextAttributes_Callback";
@DomName('CanvasRenderingContext2D.getImageData')
@DocsEditable()
ImageData getImageData(num sx, num sy, num sw, num sh) native "CanvasRenderingContext2D_getImageData_Callback";
@DomName('CanvasRenderingContext2D.getLineDash')
@DocsEditable()
List<num> getLineDash() native "CanvasRenderingContext2D_getLineDash_Callback";
bool isPointInPath(num x, num y, [String winding]) {
if (winding != null) {
return _isPointInPath_1(x, y, winding);
}
return _isPointInPath_2(x, y);
}
bool _isPointInPath_1(x, y, winding) native "CanvasRenderingContext2D__isPointInPath_1_Callback";
bool _isPointInPath_2(x, y) native "CanvasRenderingContext2D__isPointInPath_2_Callback";
@DomName('CanvasRenderingContext2D.isPointInStroke')
@DocsEditable()
bool isPointInStroke(num x, num y) native "CanvasRenderingContext2D_isPointInStroke_Callback";
@DomName('CanvasRenderingContext2D.lineTo')
@DocsEditable()
void lineTo(num x, num y) native "CanvasRenderingContext2D_lineTo_Callback";
@DomName('CanvasRenderingContext2D.measureText')
@DocsEditable()
TextMetrics measureText(String text) native "CanvasRenderingContext2D_measureText_Callback";
@DomName('CanvasRenderingContext2D.moveTo')
@DocsEditable()
void moveTo(num x, num y) native "CanvasRenderingContext2D_moveTo_Callback";
void putImageData(ImageData imagedata, num dx, num dy, [num dirtyX, num dirtyY, num dirtyWidth, num dirtyHeight]) {
if ((dy is num || dy == null) && (dx is num || dx == null) && (imagedata is ImageData || imagedata == null) && dirtyX == null && dirtyY == null && dirtyWidth == null && dirtyHeight == null) {
_putImageData_1(imagedata, dx, dy);
return;
}
if ((dirtyHeight is num || dirtyHeight == null) && (dirtyWidth is num || dirtyWidth == null) && (dirtyY is num || dirtyY == null) && (dirtyX is num || dirtyX == null) && (dy is num || dy == null) && (dx is num || dx == null) && (imagedata is ImageData || imagedata == null)) {
_putImageData_2(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void _putImageData_1(imagedata, dx, dy) native "CanvasRenderingContext2D__putImageData_1_Callback";
void _putImageData_2(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) native "CanvasRenderingContext2D__putImageData_2_Callback";
@DomName('CanvasRenderingContext2D.quadraticCurveTo')
@DocsEditable()
void quadraticCurveTo(num cpx, num cpy, num x, num y) native "CanvasRenderingContext2D_quadraticCurveTo_Callback";
@DomName('CanvasRenderingContext2D.rect')
@DocsEditable()
void rect(num x, num y, num width, num height) native "CanvasRenderingContext2D_rect_Callback";
@DomName('CanvasRenderingContext2D.restore')
@DocsEditable()
void restore() native "CanvasRenderingContext2D_restore_Callback";
@DomName('CanvasRenderingContext2D.rotate')
@DocsEditable()
void rotate(num angle) native "CanvasRenderingContext2D_rotate_Callback";
@DomName('CanvasRenderingContext2D.save')
@DocsEditable()
void save() native "CanvasRenderingContext2D_save_Callback";
@DomName('CanvasRenderingContext2D.scale')
@DocsEditable()
void scale(num sx, num sy) native "CanvasRenderingContext2D_scale_Callback";
@DomName('CanvasRenderingContext2D.setLineDash')
@DocsEditable()
void setLineDash(List<num> dash) native "CanvasRenderingContext2D_setLineDash_Callback";
@DomName('CanvasRenderingContext2D.setTransform')
@DocsEditable()
void setTransform(num m11, num m12, num m21, num m22, num dx, num dy) native "CanvasRenderingContext2D_setTransform_Callback";
@DomName('CanvasRenderingContext2D.stroke')
@DocsEditable()
void stroke() native "CanvasRenderingContext2D_stroke_Callback";
@DomName('CanvasRenderingContext2D.strokeRect')
@DocsEditable()
void strokeRect(num x, num y, num width, num height) native "CanvasRenderingContext2D_strokeRect_Callback";
void strokeText(String text, num x, num y, [num maxWidth]) {
if (maxWidth != null) {
_strokeText_1(text, x, y, maxWidth);
return;
}
_strokeText_2(text, x, y);
return;
}
void _strokeText_1(text, x, y, maxWidth) native "CanvasRenderingContext2D__strokeText_1_Callback";
void _strokeText_2(text, x, y) native "CanvasRenderingContext2D__strokeText_2_Callback";
@DomName('CanvasRenderingContext2D.transform')
@DocsEditable()
void transform(num m11, num m12, num m21, num m22, num dx, num dy) native "CanvasRenderingContext2D_transform_Callback";
@DomName('CanvasRenderingContext2D.translate')
@DocsEditable()
void translate(num tx, num ty) native "CanvasRenderingContext2D_translate_Callback";
@DomName('CanvasRenderingContext2D.webkitGetImageDataHD')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
ImageData getImageDataHD(num sx, num sy, num sw, num sh) native "CanvasRenderingContext2D_webkitGetImageDataHD_Callback";
void putImageDataHD(ImageData imagedata, num dx, num dy, [num dirtyX, num dirtyY, num dirtyWidth, num dirtyHeight]) {
if ((dy is num || dy == null) && (dx is num || dx == null) && (imagedata is ImageData || imagedata == null) && dirtyX == null && dirtyY == null && dirtyWidth == null && dirtyHeight == null) {
_webkitPutImageDataHD_1(imagedata, dx, dy);
return;
}
if ((dirtyHeight is num || dirtyHeight == null) && (dirtyWidth is num || dirtyWidth == null) && (dirtyY is num || dirtyY == null) && (dirtyX is num || dirtyX == null) && (dy is num || dy == null) && (dx is num || dx == null) && (imagedata is ImageData || imagedata == null)) {
_webkitPutImageDataHD_2(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void _webkitPutImageDataHD_1(imagedata, dx, dy) native "CanvasRenderingContext2D__webkitPutImageDataHD_1_Callback";
void _webkitPutImageDataHD_2(imagedata, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight) native "CanvasRenderingContext2D__webkitPutImageDataHD_2_Callback";
/**
* Sets the color used inside shapes.
* [r], [g], [b] are 0-255, [a] is 0-1.
*/
void setFillColorRgb(int r, int g, int b, [num a = 1]) {
this.fillStyle = 'rgba($r, $g, $b, $a)';
}
/**
* Sets the color used inside shapes.
* [h] is in degrees, 0-360.
* [s], [l] are in percent, 0-100.
* [a] is 0-1.
*/
void setFillColorHsl(int h, num s, num l, [num a = 1]) {
this.fillStyle = 'hsla($h, $s%, $l%, $a)';
}
/**
* Sets the color used for stroking shapes.
* [r], [g], [b] are 0-255, [a] is 0-1.
*/
void setStrokeColorRgb(int r, int g, int b, [num a = 1]) {
this.strokeStyle = 'rgba($r, $g, $b, $a)';
}
/**
* Sets the color used for stroking shapes.
* [h] is in degrees, 0-360.
* [s], [l] are in percent, 0-100.
* [a] is 0-1.
*/
void setStrokeColorHsl(int h, num s, num l, [num a = 1]) {
this.strokeStyle = 'hsla($h, $s%, $l%, $a)';
}
@DomName('CanvasRenderingContext2D.arc')
void arc(num x, num y, num radius, num startAngle, num endAngle,
[bool anticlockwise = false]) {
_arc(x, y, radius, startAngle, endAngle, anticlockwise);
}
/**
* Draws an image from a CanvasImageSource to an area of this canvas.
*
* The image will be drawn to an area of this canvas defined by
* [destRect]. [sourceRect] defines the region of the source image that is
* drawn.
* If [sourceRect] is not provided, then
* the entire rectangular image from [source] will be drawn to this context.
*
* If the image is larger than canvas
* will allow, the image will be clipped to fit the available space.
*
* CanvasElement canvas = new CanvasElement(width: 600, height: 600);
* CanvasRenderingContext2D ctx = canvas.context2D;
* ImageElement img = document.query('img');
* img.width = 100;
* img.height = 100;
*
* // Scale the image to 20x20.
* ctx.drawImageToRect(img, new Rect(50, 50, 20, 20));
*
* VideoElement video = document.query('video');
* video.width = 100;
* video.height = 100;
* // Take the middle 20x20 pixels from the video and stretch them.
* ctx.drawImageToRect(video, new Rect(50, 50, 100, 100),
* sourceRect: new Rect(40, 40, 20, 20));
*
* // Draw the top 100x20 pixels from the otherCanvas.
* CanvasElement otherCanvas = document.query('canvas');
* ctx.drawImageToRect(otherCanvas, new Rect(0, 0, 100, 20),
* sourceRect: new Rect(0, 0, 100, 20));
*
* See also:
*
* * [CanvasImageSource] for more information on what data is retrieved
* from [source].
* * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
* from the WHATWG.
*/
@DomName('CanvasRenderingContext2D.drawImage')
void drawImageToRect(CanvasImageSource source, Rect destRect,
{Rect sourceRect}) {
if (sourceRect == null) {
_drawImage(source,
destRect.left,
destRect.top,
destRect.width,
destRect.height);
} else {
_drawImage(source,
sourceRect.left,
sourceRect.top,
sourceRect.width,
sourceRect.height,
destRect.left,
destRect.top,
destRect.width,
destRect.height);
}
}
/**
* Draws an image from a CanvasImageSource to this canvas.
*
* The entire image from [source] will be drawn to this context with its top
* left corner at the point ([destX], [destY]). If the image is
* larger than canvas will allow, the image will be clipped to fit the
* available space.
*
* CanvasElement canvas = new CanvasElement(width: 600, height: 600);
* CanvasRenderingContext2D ctx = canvas.context2D;
* ImageElement img = document.query('img');
*
* ctx.drawImage(img, 100, 100);
*
* VideoElement video = document.query('video');
* ctx.drawImage(video, 0, 0);
*
* CanvasElement otherCanvas = document.query('canvas');
* otherCanvas.width = 100;
* otherCanvas.height = 100;
* ctx.drawImage(otherCanvas, 590, 590); // will get clipped
*
* See also:
*
* * [CanvasImageSource] for more information on what data is retrieved
* from [source].
* * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
* from the WHATWG.
*/
@DomName('CanvasRenderingContext2D.drawImage')
void drawImage(CanvasImageSource source, num destX, num destY) {
_drawImage(source, destX, destY);
}
/**
* Draws an image from a CanvasImageSource to an area of this canvas.
*
* The image will be drawn to this context with its top left corner at the
* point ([destX], [destY]) and will be scaled to be [destWidth] wide and
* [destHeight] tall.
*
* If the image is larger than canvas
* will allow, the image will be clipped to fit the available space.
*
* CanvasElement canvas = new CanvasElement(width: 600, height: 600);
* CanvasRenderingContext2D ctx = canvas.context2D;
* ImageElement img = document.query('img');
* img.width = 100;
* img.height = 100;
*
* // Scale the image to 300x50 at the point (20, 20)
* ctx.drawImageScaled(img, 20, 20, 300, 50);
*
* See also:
*
* * [CanvasImageSource] for more information on what data is retrieved
* from [source].
* * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
* from the WHATWG.
*/
@DomName('CanvasRenderingContext2D.drawImage')
void drawImageScaled(CanvasImageSource source,
num destX, num destY, num destWidth, num destHeight) {
_drawImage(source, destX, destY, destWidth, destHeight);
}
/**
* Draws an image from a CanvasImageSource to an area of this canvas.
*
* The image is a region of [source] that is [sourceWidth] wide and
* [destHeight] tall with top left corner at ([sourceX], [sourceY]).
* The image will be drawn to this context with its top left corner at the
* point ([destX], [destY]) and will be scaled to be [destWidth] wide and
* [destHeight] tall.
*
* If the image is larger than canvas
* will allow, the image will be clipped to fit the available space.
*
* VideoElement video = document.query('video');
* video.width = 100;
* video.height = 100;
* // Take the middle 20x20 pixels from the video and stretch them.
* ctx.drawImageScaledFromSource(video, 40, 40, 20, 20, 50, 50, 100, 100);
*
* // Draw the top 100x20 pixels from the otherCanvas to this one.
* CanvasElement otherCanvas = document.query('canvas');
* ctx.drawImageScaledFromSource(otherCanvas, 0, 0, 100, 20, 0, 0, 100, 20);
*
* See also:
*
* * [CanvasImageSource] for more information on what data is retrieved
* from [source].
* * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
* from the WHATWG.
*/
@DomName('CanvasRenderingContext2D.drawImage')
void drawImageScaledFromSource(CanvasImageSource source,
num sourceX, num sourceY, num sourceWidth, num sourceHeight,
num destX, num destY, num destWidth, num destHeight) {
_drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight,
destX, destY, destWidth, destHeight);
}
// TODO(amouravski): Add Dartium native methods for drawImage once we figure
// out how to not break native bindings.
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CharacterData')
class CharacterData extends Node implements ChildNode {
// To suppress missing implicit constructor warnings.
factory CharacterData._() { throw new UnsupportedError("Not supported"); }
@DomName('CharacterData.data')
@DocsEditable()
String get data native "CharacterData_data_Getter";
@DomName('CharacterData.data')
@DocsEditable()
void set data(String value) native "CharacterData_data_Setter";
@DomName('CharacterData.length')
@DocsEditable()
int get length native "CharacterData_length_Getter";
@DomName('CharacterData.appendData')
@DocsEditable()
void appendData(String data) native "CharacterData_appendData_Callback";
@DomName('CharacterData.deleteData')
@DocsEditable()
void deleteData(int offset, int length) native "CharacterData_deleteData_Callback";
@DomName('CharacterData.insertData')
@DocsEditable()
void insertData(int offset, String data) native "CharacterData_insertData_Callback";
@DomName('CharacterData.replaceData')
@DocsEditable()
void replaceData(int offset, int length, String data) native "CharacterData_replaceData_Callback";
@DomName('CharacterData.substringData')
@DocsEditable()
String substringData(int offset, int length) native "CharacterData_substringData_Callback";
@DomName('CharacterData.nextElementSibling')
@DocsEditable()
Element get nextElementSibling native "CharacterData_nextElementSibling_Getter";
@DomName('CharacterData.previousElementSibling')
@DocsEditable()
Element get previousElementSibling native "CharacterData_previousElementSibling_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ChildNode')
@Experimental() // untriaged
abstract class ChildNode extends NativeFieldWrapperClass1 {
@DomName('ChildNode.nextElementSibling')
@DocsEditable()
@Experimental() // untriaged
Element get nextElementSibling native "ChildNode_nextElementSibling_Getter";
@DomName('ChildNode.previousElementSibling')
@DocsEditable()
@Experimental() // untriaged
Element get previousElementSibling native "ChildNode_previousElementSibling_Getter";
@DomName('ChildNode.remove')
@DocsEditable()
@Experimental() // untriaged
void remove() native "ChildNode_remove_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CloseEvent')
class CloseEvent extends Event {
// To suppress missing implicit constructor warnings.
factory CloseEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('CloseEvent.code')
@DocsEditable()
int get code native "CloseEvent_code_Getter";
@DomName('CloseEvent.reason')
@DocsEditable()
String get reason native "CloseEvent_reason_Getter";
@DomName('CloseEvent.wasClean')
@DocsEditable()
bool get wasClean native "CloseEvent_wasClean_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Comment')
class Comment extends CharacterData {
// To suppress missing implicit constructor warnings.
factory Comment._() { throw new UnsupportedError("Not supported"); }
@DomName('Comment.Comment')
@DocsEditable()
factory Comment([String data]) {
return Comment._create_1(data);
}
@DocsEditable()
static Comment _create_1(data) native "Comment__create_1constructorCallback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Composition')
// http://www.w3.org/TR/ime-api/#idl-def-Composition
@Experimental()
class Composition extends NativeFieldWrapperClass1 {
@DomName('Composition.selectionEnd')
@DocsEditable()
@Experimental() // untriaged
int get selectionEnd native "Composition_selectionEnd_Getter";
@DomName('Composition.selectionStart')
@DocsEditable()
@Experimental() // untriaged
int get selectionStart native "Composition_selectionStart_Getter";
@DomName('Composition.text')
@DocsEditable()
String get text native "Composition_text_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('CompositionEvent')
class CompositionEvent extends UIEvent {
factory CompositionEvent(String type,
{bool canBubble: false, bool cancelable: false, Window view,
String data}) {
if (view == null) {
view = window;
}
var e = document._createEvent("CompositionEvent");
e._initCompositionEvent(type, canBubble, cancelable, view, data);
return e;
}
// To suppress missing implicit constructor warnings.
factory CompositionEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('CompositionEvent.data')
@DocsEditable()
String get data native "CompositionEvent_data_Getter";
@DomName('CompositionEvent.initCompositionEvent')
@DocsEditable()
void _initCompositionEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Window viewArg, String dataArg) native "CompositionEvent_initCompositionEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Console')
class Console extends ConsoleBase {
// To suppress missing implicit constructor warnings.
factory Console._() { throw new UnsupportedError("Not supported"); }
@DomName('Console.memory')
@DocsEditable()
@Experimental()
MemoryInfo get memory native "Console_memory_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ConsoleBase')
@Experimental() // untriaged
class ConsoleBase extends NativeFieldWrapperClass1 {
@DomName('ConsoleBase.assertCondition')
@DocsEditable()
@Experimental() // untriaged
void assertCondition(bool condition, Object arg) native "ConsoleBase_assertCondition_Callback";
@DomName('ConsoleBase.clear')
@DocsEditable()
@Experimental() // untriaged
void clear(Object arg) native "ConsoleBase_clear_Callback";
@DomName('ConsoleBase.count')
@DocsEditable()
@Experimental() // untriaged
void count(Object arg) native "ConsoleBase_count_Callback";
@DomName('ConsoleBase.debug')
@DocsEditable()
@Experimental() // untriaged
void debug(Object arg) native "ConsoleBase_debug_Callback";
@DomName('ConsoleBase.dir')
@DocsEditable()
@Experimental() // untriaged
void dir(Object arg) native "ConsoleBase_dir_Callback";
@DomName('ConsoleBase.dirxml')
@DocsEditable()
@Experimental() // untriaged
void dirxml(Object arg) native "ConsoleBase_dirxml_Callback";
@DomName('ConsoleBase.error')
@DocsEditable()
@Experimental() // untriaged
void error(Object arg) native "ConsoleBase_error_Callback";
@DomName('ConsoleBase.group')
@DocsEditable()
@Experimental() // untriaged
void group(Object arg) native "ConsoleBase_group_Callback";
@DomName('ConsoleBase.groupCollapsed')
@DocsEditable()
@Experimental() // untriaged
void groupCollapsed(Object arg) native "ConsoleBase_groupCollapsed_Callback";
@DomName('ConsoleBase.groupEnd')
@DocsEditable()
@Experimental() // untriaged
void groupEnd() native "ConsoleBase_groupEnd_Callback";
@DomName('ConsoleBase.info')
@DocsEditable()
@Experimental() // untriaged
void info(Object arg) native "ConsoleBase_info_Callback";
@DomName('ConsoleBase.log')
@DocsEditable()
@Experimental() // untriaged
void log(Object arg) native "ConsoleBase_log_Callback";
@DomName('ConsoleBase.markTimeline')
@DocsEditable()
@Experimental() // untriaged
void markTimeline(Object arg) native "ConsoleBase_markTimeline_Callback";
@DomName('ConsoleBase.profile')
@DocsEditable()
@Experimental() // untriaged
void profile(String title) native "ConsoleBase_profile_Callback";
@DomName('ConsoleBase.profileEnd')
@DocsEditable()
@Experimental() // untriaged
void profileEnd(String title) native "ConsoleBase_profileEnd_Callback";
@DomName('ConsoleBase.table')
@DocsEditable()
@Experimental() // untriaged
void table(Object arg) native "ConsoleBase_table_Callback";
@DomName('ConsoleBase.time')
@DocsEditable()
@Experimental() // untriaged
void time(String title) native "ConsoleBase_time_Callback";
@DomName('ConsoleBase.timeEnd')
@DocsEditable()
@Experimental() // untriaged
void timeEnd(String title) native "ConsoleBase_timeEnd_Callback";
@DomName('ConsoleBase.timeStamp')
@DocsEditable()
@Experimental() // untriaged
void timeStamp(Object arg) native "ConsoleBase_timeStamp_Callback";
@DomName('ConsoleBase.trace')
@DocsEditable()
@Experimental() // untriaged
void trace(Object arg) native "ConsoleBase_trace_Callback";
@DomName('ConsoleBase.warn')
@DocsEditable()
@Experimental() // untriaged
void warn(Object arg) native "ConsoleBase_warn_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLContentElement')
@SupportedBrowser(SupportedBrowser.CHROME, '26')
@Experimental()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#content-element
class ContentElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ContentElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLContentElement.HTMLContentElement')
@DocsEditable()
factory ContentElement() => document.$dom_createElement("content");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLContentElement.resetStyleInheritance')
@DocsEditable()
bool get resetStyleInheritance native "HTMLContentElement_resetStyleInheritance_Getter";
@DomName('HTMLContentElement.resetStyleInheritance')
@DocsEditable()
void set resetStyleInheritance(bool value) native "HTMLContentElement_resetStyleInheritance_Setter";
@DomName('HTMLContentElement.select')
@DocsEditable()
String get select native "HTMLContentElement_select_Getter";
@DomName('HTMLContentElement.select')
@DocsEditable()
void set select(String value) native "HTMLContentElement_select_Setter";
@DomName('HTMLContentElement.getDistributedNodes')
@DocsEditable()
List<Node> getDistributedNodes() native "HTMLContentElement_getDistributedNodes_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Coordinates')
class Coordinates extends NativeFieldWrapperClass1 {
@DomName('Coordinates.accuracy')
@DocsEditable()
double get accuracy native "Coordinates_accuracy_Getter";
@DomName('Coordinates.altitude')
@DocsEditable()
double get altitude native "Coordinates_altitude_Getter";
@DomName('Coordinates.altitudeAccuracy')
@DocsEditable()
double get altitudeAccuracy native "Coordinates_altitudeAccuracy_Getter";
@DomName('Coordinates.heading')
@DocsEditable()
double get heading native "Coordinates_heading_Getter";
@DomName('Coordinates.latitude')
@DocsEditable()
double get latitude native "Coordinates_latitude_Getter";
@DomName('Coordinates.longitude')
@DocsEditable()
double get longitude native "Coordinates_longitude_Getter";
@DomName('Coordinates.speed')
@DocsEditable()
double get speed native "Coordinates_speed_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Crypto')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/WebCryptoAPI/
class Crypto extends NativeFieldWrapperClass1 {
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('Crypto.subtle')
@DocsEditable()
@Experimental() // untriaged
SubtleCrypto get subtle native "Crypto_subtle_Getter";
@DomName('Crypto.getRandomValues')
@DocsEditable()
TypedData getRandomValues(TypedData array) native "Crypto_getRandomValues_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Key')
@Experimental() // untriaged
class CryptoKey extends NativeFieldWrapperClass1 {
@DomName('Key.algorithm')
@DocsEditable()
@Experimental() // untriaged
Algorithm get algorithm native "Key_algorithm_Getter";
@DomName('Key.extractable')
@DocsEditable()
@Experimental() // untriaged
bool get extractable native "Key_extractable_Getter";
@DomName('Key.type')
@DocsEditable()
@Experimental() // untriaged
String get type native "Key_type_Getter";
@DomName('Key.usages')
@DocsEditable()
@Experimental() // untriaged
List<String> get usages native "Key_usages_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSS')
// http://www.w3.org/TR/css3-conditional/#the-css-interface
@Experimental() // None
class Css extends NativeFieldWrapperClass1 {
@DomName('CSS.supports')
@DocsEditable()
bool supports(String property, String value) native "CSS_supports_Callback";
@DomName('CSS.supportsCondition')
@DocsEditable()
bool supportsCondition(String conditionText) native "CSS_supportsCondition_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSCharsetRule')
// http://dev.w3.org/csswg/cssom/#the-csscharsetrule-interface
@Experimental()
class CssCharsetRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssCharsetRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSCharsetRule.encoding')
@DocsEditable()
String get encoding native "CSSCharsetRule_encoding_Getter";
@DomName('CSSCharsetRule.encoding')
@DocsEditable()
void set encoding(String value) native "CSSCharsetRule_encoding_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitCSSFilterRule')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/filter-effects/
class CssFilterRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssFilterRule._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitCSSFilterRule.style')
@DocsEditable()
CssStyleDeclaration get style native "WebKitCSSFilterRule_style_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitCSSFilterValue')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
class CssFilterValue extends _CssValueList {
// To suppress missing implicit constructor warnings.
factory CssFilterValue._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitCSSFilterValue.CSS_FILTER_BLUR')
@DocsEditable()
static const int CSS_FILTER_BLUR = 10;
@DomName('WebKitCSSFilterValue.CSS_FILTER_BRIGHTNESS')
@DocsEditable()
static const int CSS_FILTER_BRIGHTNESS = 8;
@DomName('WebKitCSSFilterValue.CSS_FILTER_CONTRAST')
@DocsEditable()
static const int CSS_FILTER_CONTRAST = 9;
@DomName('WebKitCSSFilterValue.CSS_FILTER_CUSTOM')
@DocsEditable()
static const int CSS_FILTER_CUSTOM = 12;
@DomName('WebKitCSSFilterValue.CSS_FILTER_DROP_SHADOW')
@DocsEditable()
static const int CSS_FILTER_DROP_SHADOW = 11;
@DomName('WebKitCSSFilterValue.CSS_FILTER_GRAYSCALE')
@DocsEditable()
static const int CSS_FILTER_GRAYSCALE = 2;
@DomName('WebKitCSSFilterValue.CSS_FILTER_HUE_ROTATE')
@DocsEditable()
static const int CSS_FILTER_HUE_ROTATE = 5;
@DomName('WebKitCSSFilterValue.CSS_FILTER_INVERT')
@DocsEditable()
static const int CSS_FILTER_INVERT = 6;
@DomName('WebKitCSSFilterValue.CSS_FILTER_OPACITY')
@DocsEditable()
static const int CSS_FILTER_OPACITY = 7;
@DomName('WebKitCSSFilterValue.CSS_FILTER_REFERENCE')
@DocsEditable()
static const int CSS_FILTER_REFERENCE = 1;
@DomName('WebKitCSSFilterValue.CSS_FILTER_SATURATE')
@DocsEditable()
static const int CSS_FILTER_SATURATE = 4;
@DomName('WebKitCSSFilterValue.CSS_FILTER_SEPIA')
@DocsEditable()
static const int CSS_FILTER_SEPIA = 3;
@DomName('WebKitCSSFilterValue.operationType')
@DocsEditable()
int get operationType native "WebKitCSSFilterValue_operationType_Getter";
@DomName('WebKitCSSFilterValue.__getter__')
@DocsEditable()
_CSSValue __getter__(int index) native "WebKitCSSFilterValue___getter___Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSFontFaceLoadEvent')
// http://www.w3.org/TR/css3-fonts/
@Experimental()
class CssFontFaceLoadEvent extends Event {
// To suppress missing implicit constructor warnings.
factory CssFontFaceLoadEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSFontFaceLoadEvent.error')
@DocsEditable()
DomError get error native "CSSFontFaceLoadEvent_error_Getter";
@DomName('CSSFontFaceLoadEvent.fontface')
@DocsEditable()
CssFontFaceRule get fontface native "CSSFontFaceLoadEvent_fontface_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSFontFaceRule')
class CssFontFaceRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssFontFaceRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSFontFaceRule.style')
@DocsEditable()
CssStyleDeclaration get style native "CSSFontFaceRule_style_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSHostRule')
@SupportedBrowser(SupportedBrowser.CHROME, '26')
@Experimental()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#css-host-rule-interface
class CssHostRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssHostRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSHostRule.cssRules')
@DocsEditable()
List<CssRule> get cssRules native "CSSHostRule_cssRules_Getter";
@DomName('CSSHostRule.deleteRule')
@DocsEditable()
void deleteRule(int index) native "CSSHostRule_deleteRule_Callback";
@DomName('CSSHostRule.insertRule')
@DocsEditable()
int insertRule(String rule, int index) native "CSSHostRule_insertRule_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSImportRule')
class CssImportRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssImportRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSImportRule.href')
@DocsEditable()
String get href native "CSSImportRule_href_Getter";
@DomName('CSSImportRule.media')
@DocsEditable()
MediaList get media native "CSSImportRule_media_Getter";
@DomName('CSSImportRule.styleSheet')
@DocsEditable()
CssStyleSheet get styleSheet native "CSSImportRule_styleSheet_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSKeyframeRule')
@Experimental() // untriaged
class CssKeyframeRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssKeyframeRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSKeyframeRule.keyText')
@DocsEditable()
@Experimental() // untriaged
String get keyText native "CSSKeyframeRule_keyText_Getter";
@DomName('CSSKeyframeRule.keyText')
@DocsEditable()
@Experimental() // untriaged
void set keyText(String value) native "CSSKeyframeRule_keyText_Setter";
@DomName('CSSKeyframeRule.style')
@DocsEditable()
@Experimental() // untriaged
CssStyleDeclaration get style native "CSSKeyframeRule_style_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSKeyframesRule')
@Experimental() // untriaged
class CssKeyframesRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssKeyframesRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSKeyframesRule.cssRules')
@DocsEditable()
@Experimental() // untriaged
List<CssRule> get cssRules native "CSSKeyframesRule_cssRules_Getter";
@DomName('CSSKeyframesRule.name')
@DocsEditable()
@Experimental() // untriaged
String get name native "CSSKeyframesRule_name_Getter";
@DomName('CSSKeyframesRule.name')
@DocsEditable()
@Experimental() // untriaged
void set name(String value) native "CSSKeyframesRule_name_Setter";
@DomName('CSSKeyframesRule.__getter__')
@DocsEditable()
@Experimental() // untriaged
CssKeyframeRule __getter__(int index) native "CSSKeyframesRule___getter___Callback";
@DomName('CSSKeyframesRule.deleteRule')
@DocsEditable()
@Experimental() // untriaged
void deleteRule(String key) native "CSSKeyframesRule_deleteRule_Callback";
@DomName('CSSKeyframesRule.findRule')
@DocsEditable()
@Experimental() // untriaged
CssKeyframeRule findRule(String key) native "CSSKeyframesRule_findRule_Callback";
@DomName('CSSKeyframesRule.insertRule')
@DocsEditable()
@Experimental() // untriaged
void insertRule(String rule) native "CSSKeyframesRule_insertRule_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitCSSMatrix')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
class CssMatrix extends NativeFieldWrapperClass1 {
@DomName('WebKitCSSMatrix.WebKitCSSMatrix')
@DocsEditable()
factory CssMatrix([String cssValue]) {
return CssMatrix._create_1(cssValue);
}
@DocsEditable()
static CssMatrix _create_1(cssValue) native "WebKitCSSMatrix__create_1constructorCallback";
@DomName('WebKitCSSMatrix.a')
@DocsEditable()
num get a native "WebKitCSSMatrix_a_Getter";
@DomName('WebKitCSSMatrix.a')
@DocsEditable()
void set a(num value) native "WebKitCSSMatrix_a_Setter";
@DomName('WebKitCSSMatrix.b')
@DocsEditable()
num get b native "WebKitCSSMatrix_b_Getter";
@DomName('WebKitCSSMatrix.b')
@DocsEditable()
void set b(num value) native "WebKitCSSMatrix_b_Setter";
@DomName('WebKitCSSMatrix.c')
@DocsEditable()
num get c native "WebKitCSSMatrix_c_Getter";
@DomName('WebKitCSSMatrix.c')
@DocsEditable()
void set c(num value) native "WebKitCSSMatrix_c_Setter";
@DomName('WebKitCSSMatrix.d')
@DocsEditable()
num get d native "WebKitCSSMatrix_d_Getter";
@DomName('WebKitCSSMatrix.d')
@DocsEditable()
void set d(num value) native "WebKitCSSMatrix_d_Setter";
@DomName('WebKitCSSMatrix.e')
@DocsEditable()
num get e native "WebKitCSSMatrix_e_Getter";
@DomName('WebKitCSSMatrix.e')
@DocsEditable()
void set e(num value) native "WebKitCSSMatrix_e_Setter";
@DomName('WebKitCSSMatrix.f')
@DocsEditable()
num get f native "WebKitCSSMatrix_f_Getter";
@DomName('WebKitCSSMatrix.f')
@DocsEditable()
void set f(num value) native "WebKitCSSMatrix_f_Setter";
@DomName('WebKitCSSMatrix.m11')
@DocsEditable()
num get m11 native "WebKitCSSMatrix_m11_Getter";
@DomName('WebKitCSSMatrix.m11')
@DocsEditable()
void set m11(num value) native "WebKitCSSMatrix_m11_Setter";
@DomName('WebKitCSSMatrix.m12')
@DocsEditable()
num get m12 native "WebKitCSSMatrix_m12_Getter";
@DomName('WebKitCSSMatrix.m12')
@DocsEditable()
void set m12(num value) native "WebKitCSSMatrix_m12_Setter";
@DomName('WebKitCSSMatrix.m13')
@DocsEditable()
num get m13 native "WebKitCSSMatrix_m13_Getter";
@DomName('WebKitCSSMatrix.m13')
@DocsEditable()
void set m13(num value) native "WebKitCSSMatrix_m13_Setter";
@DomName('WebKitCSSMatrix.m14')
@DocsEditable()
num get m14 native "WebKitCSSMatrix_m14_Getter";
@DomName('WebKitCSSMatrix.m14')
@DocsEditable()
void set m14(num value) native "WebKitCSSMatrix_m14_Setter";
@DomName('WebKitCSSMatrix.m21')
@DocsEditable()
num get m21 native "WebKitCSSMatrix_m21_Getter";
@DomName('WebKitCSSMatrix.m21')
@DocsEditable()
void set m21(num value) native "WebKitCSSMatrix_m21_Setter";
@DomName('WebKitCSSMatrix.m22')
@DocsEditable()
num get m22 native "WebKitCSSMatrix_m22_Getter";
@DomName('WebKitCSSMatrix.m22')
@DocsEditable()
void set m22(num value) native "WebKitCSSMatrix_m22_Setter";
@DomName('WebKitCSSMatrix.m23')
@DocsEditable()
num get m23 native "WebKitCSSMatrix_m23_Getter";
@DomName('WebKitCSSMatrix.m23')
@DocsEditable()
void set m23(num value) native "WebKitCSSMatrix_m23_Setter";
@DomName('WebKitCSSMatrix.m24')
@DocsEditable()
num get m24 native "WebKitCSSMatrix_m24_Getter";
@DomName('WebKitCSSMatrix.m24')
@DocsEditable()
void set m24(num value) native "WebKitCSSMatrix_m24_Setter";
@DomName('WebKitCSSMatrix.m31')
@DocsEditable()
num get m31 native "WebKitCSSMatrix_m31_Getter";
@DomName('WebKitCSSMatrix.m31')
@DocsEditable()
void set m31(num value) native "WebKitCSSMatrix_m31_Setter";
@DomName('WebKitCSSMatrix.m32')
@DocsEditable()
num get m32 native "WebKitCSSMatrix_m32_Getter";
@DomName('WebKitCSSMatrix.m32')
@DocsEditable()
void set m32(num value) native "WebKitCSSMatrix_m32_Setter";
@DomName('WebKitCSSMatrix.m33')
@DocsEditable()
num get m33 native "WebKitCSSMatrix_m33_Getter";
@DomName('WebKitCSSMatrix.m33')
@DocsEditable()
void set m33(num value) native "WebKitCSSMatrix_m33_Setter";
@DomName('WebKitCSSMatrix.m34')
@DocsEditable()
num get m34 native "WebKitCSSMatrix_m34_Getter";
@DomName('WebKitCSSMatrix.m34')
@DocsEditable()
void set m34(num value) native "WebKitCSSMatrix_m34_Setter";
@DomName('WebKitCSSMatrix.m41')
@DocsEditable()
num get m41 native "WebKitCSSMatrix_m41_Getter";
@DomName('WebKitCSSMatrix.m41')
@DocsEditable()
void set m41(num value) native "WebKitCSSMatrix_m41_Setter";
@DomName('WebKitCSSMatrix.m42')
@DocsEditable()
num get m42 native "WebKitCSSMatrix_m42_Getter";
@DomName('WebKitCSSMatrix.m42')
@DocsEditable()
void set m42(num value) native "WebKitCSSMatrix_m42_Setter";
@DomName('WebKitCSSMatrix.m43')
@DocsEditable()
num get m43 native "WebKitCSSMatrix_m43_Getter";
@DomName('WebKitCSSMatrix.m43')
@DocsEditable()
void set m43(num value) native "WebKitCSSMatrix_m43_Setter";
@DomName('WebKitCSSMatrix.m44')
@DocsEditable()
num get m44 native "WebKitCSSMatrix_m44_Getter";
@DomName('WebKitCSSMatrix.m44')
@DocsEditable()
void set m44(num value) native "WebKitCSSMatrix_m44_Setter";
@DomName('WebKitCSSMatrix.inverse')
@DocsEditable()
CssMatrix inverse() native "WebKitCSSMatrix_inverse_Callback";
@DomName('WebKitCSSMatrix.multiply')
@DocsEditable()
CssMatrix multiply(CssMatrix secondMatrix) native "WebKitCSSMatrix_multiply_Callback";
@DomName('WebKitCSSMatrix.rotate')
@DocsEditable()
CssMatrix rotate(num rotX, num rotY, num rotZ) native "WebKitCSSMatrix_rotate_Callback";
@DomName('WebKitCSSMatrix.rotateAxisAngle')
@DocsEditable()
CssMatrix rotateAxisAngle(num x, num y, num z, num angle) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
@DomName('WebKitCSSMatrix.scale')
@DocsEditable()
CssMatrix scale(num scaleX, num scaleY, num scaleZ) native "WebKitCSSMatrix_scale_Callback";
@DomName('WebKitCSSMatrix.setMatrixValue')
@DocsEditable()
void setMatrixValue(String string) native "WebKitCSSMatrix_setMatrixValue_Callback";
@DomName('WebKitCSSMatrix.skewX')
@DocsEditable()
CssMatrix skewX(num angle) native "WebKitCSSMatrix_skewX_Callback";
@DomName('WebKitCSSMatrix.skewY')
@DocsEditable()
CssMatrix skewY(num angle) native "WebKitCSSMatrix_skewY_Callback";
@DomName('WebKitCSSMatrix.toString')
@DocsEditable()
String toString() native "WebKitCSSMatrix_toString_Callback";
@DomName('WebKitCSSMatrix.translate')
@DocsEditable()
CssMatrix translate(num x, num y, num z) native "WebKitCSSMatrix_translate_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSMediaRule')
class CssMediaRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssMediaRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSMediaRule.cssRules')
@DocsEditable()
List<CssRule> get cssRules native "CSSMediaRule_cssRules_Getter";
@DomName('CSSMediaRule.media')
@DocsEditable()
MediaList get media native "CSSMediaRule_media_Getter";
@DomName('CSSMediaRule.deleteRule')
@DocsEditable()
void deleteRule(int index) native "CSSMediaRule_deleteRule_Callback";
@DomName('CSSMediaRule.insertRule')
@DocsEditable()
int insertRule(String rule, int index) native "CSSMediaRule_insertRule_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitCSSMixFunctionValue')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
class CssMixFunctionValue extends _CssValueList {
// To suppress missing implicit constructor warnings.
factory CssMixFunctionValue._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSPageRule')
class CssPageRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssPageRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSPageRule.selectorText')
@DocsEditable()
String get selectorText native "CSSPageRule_selectorText_Getter";
@DomName('CSSPageRule.selectorText')
@DocsEditable()
void set selectorText(String value) native "CSSPageRule_selectorText_Setter";
@DomName('CSSPageRule.style')
@DocsEditable()
CssStyleDeclaration get style native "CSSPageRule_style_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitCSSRegionRule')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/css-regions/#region-style-rule-interface
class CssRegionRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssRegionRule._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitCSSRegionRule.cssRules')
@DocsEditable()
List<CssRule> get cssRules native "WebKitCSSRegionRule_cssRules_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSRule')
class CssRule extends NativeFieldWrapperClass1 {
@DomName('CSSRule.CHARSET_RULE')
@DocsEditable()
static const int CHARSET_RULE = 2;
@DomName('CSSRule.FONT_FACE_RULE')
@DocsEditable()
static const int FONT_FACE_RULE = 5;
@DomName('CSSRule.HOST_RULE')
@DocsEditable()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-css-rule-host-rule
@Experimental()
static const int HOST_RULE = 1001;
@DomName('CSSRule.IMPORT_RULE')
@DocsEditable()
static const int IMPORT_RULE = 3;
@DomName('CSSRule.KEYFRAMES_RULE')
@DocsEditable()
@Experimental() // untriaged
static const int KEYFRAMES_RULE = 7;
@DomName('CSSRule.KEYFRAME_RULE')
@DocsEditable()
@Experimental() // untriaged
static const int KEYFRAME_RULE = 8;
@DomName('CSSRule.MEDIA_RULE')
@DocsEditable()
static const int MEDIA_RULE = 4;
@DomName('CSSRule.PAGE_RULE')
@DocsEditable()
static const int PAGE_RULE = 6;
@DomName('CSSRule.STYLE_RULE')
@DocsEditable()
static const int STYLE_RULE = 1;
@DomName('CSSRule.SUPPORTS_RULE')
@DocsEditable()
static const int SUPPORTS_RULE = 12;
@DomName('CSSRule.UNKNOWN_RULE')
@DocsEditable()
// http://dev.w3.org/csswg/cssom/#changes-from-dom2
@deprecated // deprecated
static const int UNKNOWN_RULE = 0;
@DomName('CSSRule.VIEWPORT_RULE')
@DocsEditable()
@Experimental() // untriaged
static const int VIEWPORT_RULE = 15;
@DomName('CSSRule.WEBKIT_FILTER_RULE')
@DocsEditable()
// http://www.w3.org/TR/filter-effects/
@Experimental()
static const int WEBKIT_FILTER_RULE = 17;
@DomName('CSSRule.WEBKIT_KEYFRAMES_RULE')
@DocsEditable()
// http://www.w3.org/TR/css3-animations/#cssrule
@Experimental()
static const int WEBKIT_KEYFRAMES_RULE = 7;
@DomName('CSSRule.WEBKIT_KEYFRAME_RULE')
@DocsEditable()
// http://www.w3.org/TR/css3-animations/#cssrule
@Experimental()
static const int WEBKIT_KEYFRAME_RULE = 8;
@DomName('CSSRule.WEBKIT_REGION_RULE')
@DocsEditable()
// http://dev.w3.org/csswg/css-regions/#region-style-rule-interface
@Experimental()
static const int WEBKIT_REGION_RULE = 16;
@DomName('CSSRule.cssText')
@DocsEditable()
String get cssText native "CSSRule_cssText_Getter";
@DomName('CSSRule.cssText')
@DocsEditable()
void set cssText(String value) native "CSSRule_cssText_Setter";
@DomName('CSSRule.parentRule')
@DocsEditable()
CssRule get parentRule native "CSSRule_parentRule_Getter";
@DomName('CSSRule.parentStyleSheet')
@DocsEditable()
CssStyleSheet get parentStyleSheet native "CSSRule_parentStyleSheet_Getter";
@DomName('CSSRule.type')
@DocsEditable()
int get type native "CSSRule_type_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('CSSStyleDeclaration')
class CssStyleDeclaration extends NativeFieldWrapperClass1 with
CssStyleDeclarationBase {
factory CssStyleDeclaration() => new CssStyleDeclaration.css('');
factory CssStyleDeclaration.css(String css) {
final style = new Element.tag('div').style;
style.cssText = css;
return style;
}
String getPropertyValue(String propertyName) {
var propValue = _getPropertyValue(propertyName);
return propValue != null ? propValue : '';
}
@DomName('CSSStyleDeclaration.setProperty')
void setProperty(String propertyName, String value, [String priority]) {
if (priority == null) {
priority = '';
}
_setProperty(propertyName, value, priority);
}
/**
* Checks to see if CSS Transitions are supported.
*/
static bool get supportsTransitions => true;
@DomName('CSSStyleDeclaration.cssText')
@DocsEditable()
String get cssText native "CSSStyleDeclaration_cssText_Getter";
@DomName('CSSStyleDeclaration.cssText')
@DocsEditable()
void set cssText(String value) native "CSSStyleDeclaration_cssText_Setter";
@DomName('CSSStyleDeclaration.length')
@DocsEditable()
int get length native "CSSStyleDeclaration_length_Getter";
@DomName('CSSStyleDeclaration.parentRule')
@DocsEditable()
CssRule get parentRule native "CSSStyleDeclaration_parentRule_Getter";
@DomName('CSSStyleDeclaration.var')
@DocsEditable()
@Experimental() // untriaged
CssVariablesMap get _var native "CSSStyleDeclaration_var_Getter";
@DomName('CSSStyleDeclaration.__setter__')
@DocsEditable()
void __setter__(String propertyName, String propertyValue) native "CSSStyleDeclaration___setter___Callback";
@DomName('CSSStyleDeclaration.getPropertyPriority')
@DocsEditable()
String getPropertyPriority(String propertyName) native "CSSStyleDeclaration_getPropertyPriority_Callback";
@DomName('CSSStyleDeclaration.getPropertyValue')
@DocsEditable()
String _getPropertyValue(String propertyName) native "CSSStyleDeclaration_getPropertyValue_Callback";
@DomName('CSSStyleDeclaration.item')
@DocsEditable()
String item(int index) native "CSSStyleDeclaration_item_Callback";
@DomName('CSSStyleDeclaration.removeProperty')
@DocsEditable()
String removeProperty(String propertyName) native "CSSStyleDeclaration_removeProperty_Callback";
@DomName('CSSStyleDeclaration.setProperty')
@DocsEditable()
void _setProperty(String propertyName, String value, String priority) native "CSSStyleDeclaration_setProperty_Callback";
}
class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
final Iterable<Element> _elementIterable;
Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
_CssStyleDeclarationSet(this._elementIterable) {
_elementCssStyleDeclarationSetIterable = new List.from(
_elementIterable).map((e) => e.style);
}
String getPropertyValue(String propertyName) =>
_elementCssStyleDeclarationSetIterable.first.getPropertyValue(
propertyName);
void setProperty(String propertyName, String value, [String priority]) {
_elementCssStyleDeclarationSetIterable.forEach((e) =>
e.setProperty(propertyName, value, priority));
}
// Important note: CssStyleDeclarationSet does NOT implement every method
// available in CssStyleDeclaration. Some of the methods don't make so much
// sense in terms of having a resonable value to return when you're
// considering a list of Elements. You will need to manually add any of the
// items in the MEMBERS set if you want that functionality.
}
abstract class CssStyleDeclarationBase {
String getPropertyValue(String propertyName);
void setProperty(String propertyName, String value, [String priority]);
// TODO(jacobr): generate this list of properties using the existing script.
/** Gets the value of "align-content" */
String get alignContent =>
getPropertyValue('${Device.cssPrefix}align-content');
/** Sets the value of "align-content" */
void set alignContent(String value) {
setProperty('${Device.cssPrefix}align-content', value, '');
}
/** Gets the value of "align-items" */
String get alignItems =>
getPropertyValue('${Device.cssPrefix}align-items');
/** Sets the value of "align-items" */
void set alignItems(String value) {
setProperty('${Device.cssPrefix}align-items', value, '');
}
/** Gets the value of "align-self" */
String get alignSelf =>
getPropertyValue('${Device.cssPrefix}align-self');
/** Sets the value of "align-self" */
void set alignSelf(String value) {
setProperty('${Device.cssPrefix}align-self', value, '');
}
/** Gets the value of "animation" */
String get animation =>
getPropertyValue('${Device.cssPrefix}animation');
/** Sets the value of "animation" */
void set animation(String value) {
setProperty('${Device.cssPrefix}animation', value, '');
}
/** Gets the value of "animation-delay" */
String get animationDelay =>
getPropertyValue('${Device.cssPrefix}animation-delay');
/** Sets the value of "animation-delay" */
void set animationDelay(String value) {
setProperty('${Device.cssPrefix}animation-delay', value, '');
}
/** Gets the value of "animation-direction" */
String get animationDirection =>
getPropertyValue('${Device.cssPrefix}animation-direction');
/** Sets the value of "animation-direction" */
void set animationDirection(String value) {
setProperty('${Device.cssPrefix}animation-direction', value, '');
}
/** Gets the value of "animation-duration" */
String get animationDuration =>
getPropertyValue('${Device.cssPrefix}animation-duration');
/** Sets the value of "animation-duration" */
void set animationDuration(String value) {
setProperty('${Device.cssPrefix}animation-duration', value, '');
}
/** Gets the value of "animation-fill-mode" */
String get animationFillMode =>
getPropertyValue('${Device.cssPrefix}animation-fill-mode');
/** Sets the value of "animation-fill-mode" */
void set animationFillMode(String value) {
setProperty('${Device.cssPrefix}animation-fill-mode', value, '');
}
/** Gets the value of "animation-iteration-count" */
String get animationIterationCount =>
getPropertyValue('${Device.cssPrefix}animation-iteration-count');
/** Sets the value of "animation-iteration-count" */
void set animationIterationCount(String value) {
setProperty('${Device.cssPrefix}animation-iteration-count', value, '');
}
/** Gets the value of "animation-name" */
String get animationName =>
getPropertyValue('${Device.cssPrefix}animation-name');
/** Sets the value of "animation-name" */
void set animationName(String value) {
setProperty('${Device.cssPrefix}animation-name', value, '');
}
/** Gets the value of "animation-play-state" */
String get animationPlayState =>
getPropertyValue('${Device.cssPrefix}animation-play-state');
/** Sets the value of "animation-play-state" */
void set animationPlayState(String value) {
setProperty('${Device.cssPrefix}animation-play-state', value, '');
}
/** Gets the value of "animation-timing-function" */
String get animationTimingFunction =>
getPropertyValue('${Device.cssPrefix}animation-timing-function');
/** Sets the value of "animation-timing-function" */
void set animationTimingFunction(String value) {
setProperty('${Device.cssPrefix}animation-timing-function', value, '');
}
/** Gets the value of "app-region" */
String get appRegion =>
getPropertyValue('${Device.cssPrefix}app-region');
/** Sets the value of "app-region" */
void set appRegion(String value) {
setProperty('${Device.cssPrefix}app-region', value, '');
}
/** Gets the value of "appearance" */
String get appearance =>
getPropertyValue('${Device.cssPrefix}appearance');
/** Sets the value of "appearance" */
void set appearance(String value) {
setProperty('${Device.cssPrefix}appearance', value, '');
}
/** Gets the value of "aspect-ratio" */
String get aspectRatio =>
getPropertyValue('${Device.cssPrefix}aspect-ratio');
/** Sets the value of "aspect-ratio" */
void set aspectRatio(String value) {
setProperty('${Device.cssPrefix}aspect-ratio', value, '');
}
/** Gets the value of "backface-visibility" */
String get backfaceVisibility =>
getPropertyValue('${Device.cssPrefix}backface-visibility');
/** Sets the value of "backface-visibility" */
void set backfaceVisibility(String value) {
setProperty('${Device.cssPrefix}backface-visibility', value, '');
}
/** Gets the value of "background" */
String get background =>
getPropertyValue('background');
/** Sets the value of "background" */
void set background(String value) {
setProperty('background', value, '');
}
/** Gets the value of "background-attachment" */
String get backgroundAttachment =>
getPropertyValue('background-attachment');
/** Sets the value of "background-attachment" */
void set backgroundAttachment(String value) {
setProperty('background-attachment', value, '');
}
/** Gets the value of "background-clip" */
String get backgroundClip =>
getPropertyValue('background-clip');
/** Sets the value of "background-clip" */
void set backgroundClip(String value) {
setProperty('background-clip', value, '');
}
/** Gets the value of "background-color" */
String get backgroundColor =>
getPropertyValue('background-color');
/** Sets the value of "background-color" */
void set backgroundColor(String value) {
setProperty('background-color', value, '');
}
/** Gets the value of "background-composite" */
String get backgroundComposite =>
getPropertyValue('${Device.cssPrefix}background-composite');
/** Sets the value of "background-composite" */
void set backgroundComposite(String value) {
setProperty('${Device.cssPrefix}background-composite', value, '');
}
/** Gets the value of "background-image" */
String get backgroundImage =>
getPropertyValue('background-image');
/** Sets the value of "background-image" */
void set backgroundImage(String value) {
setProperty('background-image', value, '');
}
/** Gets the value of "background-origin" */
String get backgroundOrigin =>
getPropertyValue('background-origin');
/** Sets the value of "background-origin" */
void set backgroundOrigin(String value) {
setProperty('background-origin', value, '');
}
/** Gets the value of "background-position" */
String get backgroundPosition =>
getPropertyValue('background-position');
/** Sets the value of "background-position" */
void set backgroundPosition(String value) {
setProperty('background-position', value, '');
}
/** Gets the value of "background-position-x" */
String get backgroundPositionX =>
getPropertyValue('background-position-x');
/** Sets the value of "background-position-x" */
void set backgroundPositionX(String value) {
setProperty('background-position-x', value, '');
}
/** Gets the value of "background-position-y" */
String get backgroundPositionY =>
getPropertyValue('background-position-y');
/** Sets the value of "background-position-y" */
void set backgroundPositionY(String value) {
setProperty('background-position-y', value, '');
}
/** Gets the value of "background-repeat" */
String get backgroundRepeat =>
getPropertyValue('background-repeat');
/** Sets the value of "background-repeat" */
void set backgroundRepeat(String value) {
setProperty('background-repeat', value, '');
}
/** Gets the value of "background-repeat-x" */
String get backgroundRepeatX =>
getPropertyValue('background-repeat-x');
/** Sets the value of "background-repeat-x" */
void set backgroundRepeatX(String value) {
setProperty('background-repeat-x', value, '');
}
/** Gets the value of "background-repeat-y" */
String get backgroundRepeatY =>
getPropertyValue('background-repeat-y');
/** Sets the value of "background-repeat-y" */
void set backgroundRepeatY(String value) {
setProperty('background-repeat-y', value, '');
}
/** Gets the value of "background-size" */
String get backgroundSize =>
getPropertyValue('background-size');
/** Sets the value of "background-size" */
void set backgroundSize(String value) {
setProperty('background-size', value, '');
}
/** Gets the value of "blend-mode" */
String get blendMode =>
getPropertyValue('${Device.cssPrefix}blend-mode');
/** Sets the value of "blend-mode" */
void set blendMode(String value) {
setProperty('${Device.cssPrefix}blend-mode', value, '');
}
/** Gets the value of "border" */
String get border =>
getPropertyValue('border');
/** Sets the value of "border" */
void set border(String value) {
setProperty('border', value, '');
}
/** Gets the value of "border-after" */
String get borderAfter =>
getPropertyValue('${Device.cssPrefix}border-after');
/** Sets the value of "border-after" */
void set borderAfter(String value) {
setProperty('${Device.cssPrefix}border-after', value, '');
}
/** Gets the value of "border-after-color" */
String get borderAfterColor =>
getPropertyValue('${Device.cssPrefix}border-after-color');
/** Sets the value of "border-after-color" */
void set borderAfterColor(String value) {
setProperty('${Device.cssPrefix}border-after-color', value, '');
}
/** Gets the value of "border-after-style" */
String get borderAfterStyle =>
getPropertyValue('${Device.cssPrefix}border-after-style');
/** Sets the value of "border-after-style" */
void set borderAfterStyle(String value) {
setProperty('${Device.cssPrefix}border-after-style', value, '');
}
/** Gets the value of "border-after-width" */
String get borderAfterWidth =>
getPropertyValue('${Device.cssPrefix}border-after-width');
/** Sets the value of "border-after-width" */
void set borderAfterWidth(String value) {
setProperty('${Device.cssPrefix}border-after-width', value, '');
}
/** Gets the value of "border-before" */
String get borderBefore =>
getPropertyValue('${Device.cssPrefix}border-before');
/** Sets the value of "border-before" */
void set borderBefore(String value) {
setProperty('${Device.cssPrefix}border-before', value, '');
}
/** Gets the value of "border-before-color" */
String get borderBeforeColor =>
getPropertyValue('${Device.cssPrefix}border-before-color');
/** Sets the value of "border-before-color" */
void set borderBeforeColor(String value) {
setProperty('${Device.cssPrefix}border-before-color', value, '');
}
/** Gets the value of "border-before-style" */
String get borderBeforeStyle =>
getPropertyValue('${Device.cssPrefix}border-before-style');
/** Sets the value of "border-before-style" */
void set borderBeforeStyle(String value) {
setProperty('${Device.cssPrefix}border-before-style', value, '');
}
/** Gets the value of "border-before-width" */
String get borderBeforeWidth =>
getPropertyValue('${Device.cssPrefix}border-before-width');
/** Sets the value of "border-before-width" */
void set borderBeforeWidth(String value) {
setProperty('${Device.cssPrefix}border-before-width', value, '');
}
/** Gets the value of "border-bottom" */
String get borderBottom =>
getPropertyValue('border-bottom');
/** Sets the value of "border-bottom" */
void set borderBottom(String value) {
setProperty('border-bottom', value, '');
}
/** Gets the value of "border-bottom-color" */
String get borderBottomColor =>
getPropertyValue('border-bottom-color');
/** Sets the value of "border-bottom-color" */
void set borderBottomColor(String value) {
setProperty('border-bottom-color', value, '');
}
/** Gets the value of "border-bottom-left-radius" */
String get borderBottomLeftRadius =>
getPropertyValue('border-bottom-left-radius');
/** Sets the value of "border-bottom-left-radius" */
void set borderBottomLeftRadius(String value) {
setProperty('border-bottom-left-radius', value, '');
}
/** Gets the value of "border-bottom-right-radius" */
String get borderBottomRightRadius =>
getPropertyValue('border-bottom-right-radius');
/** Sets the value of "border-bottom-right-radius" */
void set borderBottomRightRadius(String value) {
setProperty('border-bottom-right-radius', value, '');
}
/** Gets the value of "border-bottom-style" */
String get borderBottomStyle =>
getPropertyValue('border-bottom-style');
/** Sets the value of "border-bottom-style" */
void set borderBottomStyle(String value) {
setProperty('border-bottom-style', value, '');
}
/** Gets the value of "border-bottom-width" */
String get borderBottomWidth =>
getPropertyValue('border-bottom-width');
/** Sets the value of "border-bottom-width" */
void set borderBottomWidth(String value) {
setProperty('border-bottom-width', value, '');
}
/** Gets the value of "border-collapse" */
String get borderCollapse =>
getPropertyValue('border-collapse');
/** Sets the value of "border-collapse" */
void set borderCollapse(String value) {
setProperty('border-collapse', value, '');
}
/** Gets the value of "border-color" */
String get borderColor =>
getPropertyValue('border-color');
/** Sets the value of "border-color" */
void set borderColor(String value) {
setProperty('border-color', value, '');
}
/** Gets the value of "border-end" */
String get borderEnd =>
getPropertyValue('${Device.cssPrefix}border-end');
/** Sets the value of "border-end" */
void set borderEnd(String value) {
setProperty('${Device.cssPrefix}border-end', value, '');
}
/** Gets the value of "border-end-color" */
String get borderEndColor =>
getPropertyValue('${Device.cssPrefix}border-end-color');
/** Sets the value of "border-end-color" */
void set borderEndColor(String value) {
setProperty('${Device.cssPrefix}border-end-color', value, '');
}
/** Gets the value of "border-end-style" */
String get borderEndStyle =>
getPropertyValue('${Device.cssPrefix}border-end-style');
/** Sets the value of "border-end-style" */
void set borderEndStyle(String value) {
setProperty('${Device.cssPrefix}border-end-style', value, '');
}
/** Gets the value of "border-end-width" */
String get borderEndWidth =>
getPropertyValue('${Device.cssPrefix}border-end-width');
/** Sets the value of "border-end-width" */
void set borderEndWidth(String value) {
setProperty('${Device.cssPrefix}border-end-width', value, '');
}
/** Gets the value of "border-fit" */
String get borderFit =>
getPropertyValue('${Device.cssPrefix}border-fit');
/** Sets the value of "border-fit" */
void set borderFit(String value) {
setProperty('${Device.cssPrefix}border-fit', value, '');
}
/** Gets the value of "border-horizontal-spacing" */
String get borderHorizontalSpacing =>
getPropertyValue('${Device.cssPrefix}border-horizontal-spacing');
/** Sets the value of "border-horizontal-spacing" */
void set borderHorizontalSpacing(String value) {
setProperty('${Device.cssPrefix}border-horizontal-spacing', value, '');
}
/** Gets the value of "border-image" */
String get borderImage =>
getPropertyValue('border-image');
/** Sets the value of "border-image" */
void set borderImage(String value) {
setProperty('border-image', value, '');
}
/** Gets the value of "border-image-outset" */
String get borderImageOutset =>
getPropertyValue('border-image-outset');
/** Sets the value of "border-image-outset" */
void set borderImageOutset(String value) {
setProperty('border-image-outset', value, '');
}
/** Gets the value of "border-image-repeat" */
String get borderImageRepeat =>
getPropertyValue('border-image-repeat');
/** Sets the value of "border-image-repeat" */
void set borderImageRepeat(String value) {
setProperty('border-image-repeat', value, '');
}
/** Gets the value of "border-image-slice" */
String get borderImageSlice =>
getPropertyValue('border-image-slice');
/** Sets the value of "border-image-slice" */
void set borderImageSlice(String value) {
setProperty('border-image-slice', value, '');
}
/** Gets the value of "border-image-source" */
String get borderImageSource =>
getPropertyValue('border-image-source');
/** Sets the value of "border-image-source" */
void set borderImageSource(String value) {
setProperty('border-image-source', value, '');
}
/** Gets the value of "border-image-width" */
String get borderImageWidth =>
getPropertyValue('border-image-width');
/** Sets the value of "border-image-width" */
void set borderImageWidth(String value) {
setProperty('border-image-width', value, '');
}
/** Gets the value of "border-left" */
String get borderLeft =>
getPropertyValue('border-left');
/** Sets the value of "border-left" */
void set borderLeft(String value) {
setProperty('border-left', value, '');
}
/** Gets the value of "border-left-color" */
String get borderLeftColor =>
getPropertyValue('border-left-color');
/** Sets the value of "border-left-color" */
void set borderLeftColor(String value) {
setProperty('border-left-color', value, '');
}
/** Gets the value of "border-left-style" */
String get borderLeftStyle =>
getPropertyValue('border-left-style');
/** Sets the value of "border-left-style" */
void set borderLeftStyle(String value) {
setProperty('border-left-style', value, '');
}
/** Gets the value of "border-left-width" */
String get borderLeftWidth =>
getPropertyValue('border-left-width');
/** Sets the value of "border-left-width" */
void set borderLeftWidth(String value) {
setProperty('border-left-width', value, '');
}
/** Gets the value of "border-radius" */
String get borderRadius =>
getPropertyValue('border-radius');
/** Sets the value of "border-radius" */
void set borderRadius(String value) {
setProperty('border-radius', value, '');
}
/** Gets the value of "border-right" */
String get borderRight =>
getPropertyValue('border-right');
/** Sets the value of "border-right" */
void set borderRight(String value) {
setProperty('border-right', value, '');
}
/** Gets the value of "border-right-color" */
String get borderRightColor =>
getPropertyValue('border-right-color');
/** Sets the value of "border-right-color" */
void set borderRightColor(String value) {
setProperty('border-right-color', value, '');
}
/** Gets the value of "border-right-style" */
String get borderRightStyle =>
getPropertyValue('border-right-style');
/** Sets the value of "border-right-style" */
void set borderRightStyle(String value) {
setProperty('border-right-style', value, '');
}
/** Gets the value of "border-right-width" */
String get borderRightWidth =>
getPropertyValue('border-right-width');
/** Sets the value of "border-right-width" */
void set borderRightWidth(String value) {
setProperty('border-right-width', value, '');
}
/** Gets the value of "border-spacing" */
String get borderSpacing =>
getPropertyValue('border-spacing');
/** Sets the value of "border-spacing" */
void set borderSpacing(String value) {
setProperty('border-spacing', value, '');
}
/** Gets the value of "border-start" */
String get borderStart =>
getPropertyValue('${Device.cssPrefix}border-start');
/** Sets the value of "border-start" */
void set borderStart(String value) {
setProperty('${Device.cssPrefix}border-start', value, '');
}
/** Gets the value of "border-start-color" */
String get borderStartColor =>
getPropertyValue('${Device.cssPrefix}border-start-color');
/** Sets the value of "border-start-color" */
void set borderStartColor(String value) {
setProperty('${Device.cssPrefix}border-start-color', value, '');
}
/** Gets the value of "border-start-style" */
String get borderStartStyle =>
getPropertyValue('${Device.cssPrefix}border-start-style');
/** Sets the value of "border-start-style" */
void set borderStartStyle(String value) {
setProperty('${Device.cssPrefix}border-start-style', value, '');
}
/** Gets the value of "border-start-width" */
String get borderStartWidth =>
getPropertyValue('${Device.cssPrefix}border-start-width');
/** Sets the value of "border-start-width" */
void set borderStartWidth(String value) {
setProperty('${Device.cssPrefix}border-start-width', value, '');
}
/** Gets the value of "border-style" */
String get borderStyle =>
getPropertyValue('border-style');
/** Sets the value of "border-style" */
void set borderStyle(String value) {
setProperty('border-style', value, '');
}
/** Gets the value of "border-top" */
String get borderTop =>
getPropertyValue('border-top');
/** Sets the value of "border-top" */
void set borderTop(String value) {
setProperty('border-top', value, '');
}
/** Gets the value of "border-top-color" */
String get borderTopColor =>
getPropertyValue('border-top-color');
/** Sets the value of "border-top-color" */
void set borderTopColor(String value) {
setProperty('border-top-color', value, '');
}
/** Gets the value of "border-top-left-radius" */
String get borderTopLeftRadius =>
getPropertyValue('border-top-left-radius');
/** Sets the value of "border-top-left-radius" */
void set borderTopLeftRadius(String value) {
setProperty('border-top-left-radius', value, '');
}
/** Gets the value of "border-top-right-radius" */
String get borderTopRightRadius =>
getPropertyValue('border-top-right-radius');
/** Sets the value of "border-top-right-radius" */
void set borderTopRightRadius(String value) {
setProperty('border-top-right-radius', value, '');
}
/** Gets the value of "border-top-style" */
String get borderTopStyle =>
getPropertyValue('border-top-style');
/** Sets the value of "border-top-style" */
void set borderTopStyle(String value) {
setProperty('border-top-style', value, '');
}
/** Gets the value of "border-top-width" */
String get borderTopWidth =>
getPropertyValue('border-top-width');
/** Sets the value of "border-top-width" */
void set borderTopWidth(String value) {
setProperty('border-top-width', value, '');
}
/** Gets the value of "border-vertical-spacing" */
String get borderVerticalSpacing =>
getPropertyValue('${Device.cssPrefix}border-vertical-spacing');
/** Sets the value of "border-vertical-spacing" */
void set borderVerticalSpacing(String value) {
setProperty('${Device.cssPrefix}border-vertical-spacing', value, '');
}
/** Gets the value of "border-width" */
String get borderWidth =>
getPropertyValue('border-width');
/** Sets the value of "border-width" */
void set borderWidth(String value) {
setProperty('border-width', value, '');
}
/** Gets the value of "bottom" */
String get bottom =>
getPropertyValue('bottom');
/** Sets the value of "bottom" */
void set bottom(String value) {
setProperty('bottom', value, '');
}
/** Gets the value of "box-align" */
String get boxAlign =>
getPropertyValue('${Device.cssPrefix}box-align');
/** Sets the value of "box-align" */
void set boxAlign(String value) {
setProperty('${Device.cssPrefix}box-align', value, '');
}
/** Gets the value of "box-decoration-break" */
String get boxDecorationBreak =>
getPropertyValue('${Device.cssPrefix}box-decoration-break');
/** Sets the value of "box-decoration-break" */
void set boxDecorationBreak(String value) {
setProperty('${Device.cssPrefix}box-decoration-break', value, '');
}
/** Gets the value of "box-direction" */
String get boxDirection =>
getPropertyValue('${Device.cssPrefix}box-direction');
/** Sets the value of "box-direction" */
void set boxDirection(String value) {
setProperty('${Device.cssPrefix}box-direction', value, '');
}
/** Gets the value of "box-flex" */
String get boxFlex =>
getPropertyValue('${Device.cssPrefix}box-flex');
/** Sets the value of "box-flex" */
void set boxFlex(String value) {
setProperty('${Device.cssPrefix}box-flex', value, '');
}
/** Gets the value of "box-flex-group" */
String get boxFlexGroup =>
getPropertyValue('${Device.cssPrefix}box-flex-group');
/** Sets the value of "box-flex-group" */
void set boxFlexGroup(String value) {
setProperty('${Device.cssPrefix}box-flex-group', value, '');
}
/** Gets the value of "box-lines" */
String get boxLines =>
getPropertyValue('${Device.cssPrefix}box-lines');
/** Sets the value of "box-lines" */
void set boxLines(String value) {
setProperty('${Device.cssPrefix}box-lines', value, '');
}
/** Gets the value of "box-ordinal-group" */
String get boxOrdinalGroup =>
getPropertyValue('${Device.cssPrefix}box-ordinal-group');
/** Sets the value of "box-ordinal-group" */
void set boxOrdinalGroup(String value) {
setProperty('${Device.cssPrefix}box-ordinal-group', value, '');
}
/** Gets the value of "box-orient" */
String get boxOrient =>
getPropertyValue('${Device.cssPrefix}box-orient');
/** Sets the value of "box-orient" */
void set boxOrient(String value) {
setProperty('${Device.cssPrefix}box-orient', value, '');
}
/** Gets the value of "box-pack" */
String get boxPack =>
getPropertyValue('${Device.cssPrefix}box-pack');
/** Sets the value of "box-pack" */
void set boxPack(String value) {
setProperty('${Device.cssPrefix}box-pack', value, '');
}
/** Gets the value of "box-reflect" */
String get boxReflect =>
getPropertyValue('${Device.cssPrefix}box-reflect');
/** Sets the value of "box-reflect" */
void set boxReflect(String value) {
setProperty('${Device.cssPrefix}box-reflect', value, '');
}
/** Gets the value of "box-shadow" */
String get boxShadow =>
getPropertyValue('box-shadow');
/** Sets the value of "box-shadow" */
void set boxShadow(String value) {
setProperty('box-shadow', value, '');
}
/** Gets the value of "box-sizing" */
String get boxSizing => Device.isFirefox ?
getPropertyValue('${Device.cssPrefix}box-sizing') :
getPropertyValue('box-sizing');
/** Sets the value of "box-sizing" */
void set boxSizing(String value) {
if (Device.isFirefox) {
setProperty('${Device.cssPrefix}box-sizing', value, '');
} else {
setProperty('box-sizing', value, '');
}
}
/** Gets the value of "caption-side" */
String get captionSide =>
getPropertyValue('caption-side');
/** Sets the value of "caption-side" */
void set captionSide(String value) {
setProperty('caption-side', value, '');
}
/** Gets the value of "clear" */
String get clear =>
getPropertyValue('clear');
/** Sets the value of "clear" */
void set clear(String value) {
setProperty('clear', value, '');
}
/** Gets the value of "clip" */
String get clip =>
getPropertyValue('clip');
/** Sets the value of "clip" */
void set clip(String value) {
setProperty('clip', value, '');
}
/** Gets the value of "clip-path" */
String get clipPath =>
getPropertyValue('${Device.cssPrefix}clip-path');
/** Sets the value of "clip-path" */
void set clipPath(String value) {
setProperty('${Device.cssPrefix}clip-path', value, '');
}
/** Gets the value of "color" */
String get color =>
getPropertyValue('color');
/** Sets the value of "color" */
void set color(String value) {
setProperty('color', value, '');
}
/** Gets the value of "color-correction" */
String get colorCorrection =>
getPropertyValue('${Device.cssPrefix}color-correction');
/** Sets the value of "color-correction" */
void set colorCorrection(String value) {
setProperty('${Device.cssPrefix}color-correction', value, '');
}
/** Gets the value of "column-axis" */
String get columnAxis =>
getPropertyValue('${Device.cssPrefix}column-axis');
/** Sets the value of "column-axis" */
void set columnAxis(String value) {
setProperty('${Device.cssPrefix}column-axis', value, '');
}
/** Gets the value of "column-break-after" */
String get columnBreakAfter =>
getPropertyValue('${Device.cssPrefix}column-break-after');
/** Sets the value of "column-break-after" */
void set columnBreakAfter(String value) {
setProperty('${Device.cssPrefix}column-break-after', value, '');
}
/** Gets the value of "column-break-before" */
String get columnBreakBefore =>
getPropertyValue('${Device.cssPrefix}column-break-before');
/** Sets the value of "column-break-before" */
void set columnBreakBefore(String value) {
setProperty('${Device.cssPrefix}column-break-before', value, '');
}
/** Gets the value of "column-break-inside" */
String get columnBreakInside =>
getPropertyValue('${Device.cssPrefix}column-break-inside');
/** Sets the value of "column-break-inside" */
void set columnBreakInside(String value) {
setProperty('${Device.cssPrefix}column-break-inside', value, '');
}
/** Gets the value of "column-count" */
String get columnCount =>
getPropertyValue('${Device.cssPrefix}column-count');
/** Sets the value of "column-count" */
void set columnCount(String value) {
setProperty('${Device.cssPrefix}column-count', value, '');
}
/** Gets the value of "column-gap" */
String get columnGap =>
getPropertyValue('${Device.cssPrefix}column-gap');
/** Sets the value of "column-gap" */
void set columnGap(String value) {
setProperty('${Device.cssPrefix}column-gap', value, '');
}
/** Gets the value of "column-progression" */
String get columnProgression =>
getPropertyValue('${Device.cssPrefix}column-progression');
/** Sets the value of "column-progression" */
void set columnProgression(String value) {
setProperty('${Device.cssPrefix}column-progression', value, '');
}
/** Gets the value of "column-rule" */
String get columnRule =>
getPropertyValue('${Device.cssPrefix}column-rule');
/** Sets the value of "column-rule" */
void set columnRule(String value) {
setProperty('${Device.cssPrefix}column-rule', value, '');
}
/** Gets the value of "column-rule-color" */
String get columnRuleColor =>
getPropertyValue('${Device.cssPrefix}column-rule-color');
/** Sets the value of "column-rule-color" */
void set columnRuleColor(String value) {
setProperty('${Device.cssPrefix}column-rule-color', value, '');
}
/** Gets the value of "column-rule-style" */
String get columnRuleStyle =>
getPropertyValue('${Device.cssPrefix}column-rule-style');
/** Sets the value of "column-rule-style" */
void set columnRuleStyle(String value) {
setProperty('${Device.cssPrefix}column-rule-style', value, '');
}
/** Gets the value of "column-rule-width" */
String get columnRuleWidth =>
getPropertyValue('${Device.cssPrefix}column-rule-width');
/** Sets the value of "column-rule-width" */
void set columnRuleWidth(String value) {
setProperty('${Device.cssPrefix}column-rule-width', value, '');
}
/** Gets the value of "column-span" */
String get columnSpan =>
getPropertyValue('${Device.cssPrefix}column-span');
/** Sets the value of "column-span" */
void set columnSpan(String value) {
setProperty('${Device.cssPrefix}column-span', value, '');
}
/** Gets the value of "column-width" */
String get columnWidth =>
getPropertyValue('${Device.cssPrefix}column-width');
/** Sets the value of "column-width" */
void set columnWidth(String value) {
setProperty('${Device.cssPrefix}column-width', value, '');
}
/** Gets the value of "columns" */
String get columns =>
getPropertyValue('${Device.cssPrefix}columns');
/** Sets the value of "columns" */
void set columns(String value) {
setProperty('${Device.cssPrefix}columns', value, '');
}
/** Gets the value of "content" */
String get content =>
getPropertyValue('content');
/** Sets the value of "content" */
void set content(String value) {
setProperty('content', value, '');
}
/** Gets the value of "counter-increment" */
String get counterIncrement =>
getPropertyValue('counter-increment');
/** Sets the value of "counter-increment" */
void set counterIncrement(String value) {
setProperty('counter-increment', value, '');
}
/** Gets the value of "counter-reset" */
String get counterReset =>
getPropertyValue('counter-reset');
/** Sets the value of "counter-reset" */
void set counterReset(String value) {
setProperty('counter-reset', value, '');
}
/** Gets the value of "cursor" */
String get cursor =>
getPropertyValue('cursor');
/** Sets the value of "cursor" */
void set cursor(String value) {
setProperty('cursor', value, '');
}
/** Gets the value of "dashboard-region" */
String get dashboardRegion =>
getPropertyValue('${Device.cssPrefix}dashboard-region');
/** Sets the value of "dashboard-region" */
void set dashboardRegion(String value) {
setProperty('${Device.cssPrefix}dashboard-region', value, '');
}
/** Gets the value of "direction" */
String get direction =>
getPropertyValue('direction');
/** Sets the value of "direction" */
void set direction(String value) {
setProperty('direction', value, '');
}
/** Gets the value of "display" */
String get display =>
getPropertyValue('display');
/** Sets the value of "display" */
void set display(String value) {
setProperty('display', value, '');
}
/** Gets the value of "empty-cells" */
String get emptyCells =>
getPropertyValue('empty-cells');
/** Sets the value of "empty-cells" */
void set emptyCells(String value) {
setProperty('empty-cells', value, '');
}
/** Gets the value of "filter" */
String get filter =>
getPropertyValue('${Device.cssPrefix}filter');
/** Sets the value of "filter" */
void set filter(String value) {
setProperty('${Device.cssPrefix}filter', value, '');
}
/** Gets the value of "flex" */
String get flex =>
getPropertyValue('${Device.cssPrefix}flex');
/** Sets the value of "flex" */
void set flex(String value) {
setProperty('${Device.cssPrefix}flex', value, '');
}
/** Gets the value of "flex-basis" */
String get flexBasis =>
getPropertyValue('${Device.cssPrefix}flex-basis');
/** Sets the value of "flex-basis" */
void set flexBasis(String value) {
setProperty('${Device.cssPrefix}flex-basis', value, '');
}
/** Gets the value of "flex-direction" */
String get flexDirection =>
getPropertyValue('${Device.cssPrefix}flex-direction');
/** Sets the value of "flex-direction" */
void set flexDirection(String value) {
setProperty('${Device.cssPrefix}flex-direction', value, '');
}
/** Gets the value of "flex-flow" */
String get flexFlow =>
getPropertyValue('${Device.cssPrefix}flex-flow');
/** Sets the value of "flex-flow" */
void set flexFlow(String value) {
setProperty('${Device.cssPrefix}flex-flow', value, '');
}
/** Gets the value of "flex-grow" */
String get flexGrow =>
getPropertyValue('${Device.cssPrefix}flex-grow');
/** Sets the value of "flex-grow" */
void set flexGrow(String value) {
setProperty('${Device.cssPrefix}flex-grow', value, '');
}
/** Gets the value of "flex-shrink" */
String get flexShrink =>
getPropertyValue('${Device.cssPrefix}flex-shrink');
/** Sets the value of "flex-shrink" */
void set flexShrink(String value) {
setProperty('${Device.cssPrefix}flex-shrink', value, '');
}
/** Gets the value of "flex-wrap" */
String get flexWrap =>
getPropertyValue('${Device.cssPrefix}flex-wrap');
/** Sets the value of "flex-wrap" */
void set flexWrap(String value) {
setProperty('${Device.cssPrefix}flex-wrap', value, '');
}
/** Gets the value of "float" */
String get float =>
getPropertyValue('float');
/** Sets the value of "float" */
void set float(String value) {
setProperty('float', value, '');
}
/** Gets the value of "flow-from" */
String get flowFrom =>
getPropertyValue('${Device.cssPrefix}flow-from');
/** Sets the value of "flow-from" */
void set flowFrom(String value) {
setProperty('${Device.cssPrefix}flow-from', value, '');
}
/** Gets the value of "flow-into" */
String get flowInto =>
getPropertyValue('${Device.cssPrefix}flow-into');
/** Sets the value of "flow-into" */
void set flowInto(String value) {
setProperty('${Device.cssPrefix}flow-into', value, '');
}
/** Gets the value of "font" */
String get font =>
getPropertyValue('font');
/** Sets the value of "font" */
void set font(String value) {
setProperty('font', value, '');
}
/** Gets the value of "font-family" */
String get fontFamily =>
getPropertyValue('font-family');
/** Sets the value of "font-family" */
void set fontFamily(String value) {
setProperty('font-family', value, '');
}
/** Gets the value of "font-feature-settings" */
String get fontFeatureSettings =>
getPropertyValue('${Device.cssPrefix}font-feature-settings');
/** Sets the value of "font-feature-settings" */
void set fontFeatureSettings(String value) {
setProperty('${Device.cssPrefix}font-feature-settings', value, '');
}
/** Gets the value of "font-kerning" */
String get fontKerning =>
getPropertyValue('${Device.cssPrefix}font-kerning');
/** Sets the value of "font-kerning" */
void set fontKerning(String value) {
setProperty('${Device.cssPrefix}font-kerning', value, '');
}
/** Gets the value of "font-size" */
String get fontSize =>
getPropertyValue('font-size');
/** Sets the value of "font-size" */
void set fontSize(String value) {
setProperty('font-size', value, '');
}
/** Gets the value of "font-size-delta" */
String get fontSizeDelta =>
getPropertyValue('${Device.cssPrefix}font-size-delta');
/** Sets the value of "font-size-delta" */
void set fontSizeDelta(String value) {
setProperty('${Device.cssPrefix}font-size-delta', value, '');
}
/** Gets the value of "font-smoothing" */
String get fontSmoothing =>
getPropertyValue('${Device.cssPrefix}font-smoothing');
/** Sets the value of "font-smoothing" */
void set fontSmoothing(String value) {
setProperty('${Device.cssPrefix}font-smoothing', value, '');
}
/** Gets the value of "font-stretch" */
String get fontStretch =>
getPropertyValue('font-stretch');
/** Sets the value of "font-stretch" */
void set fontStretch(String value) {
setProperty('font-stretch', value, '');
}
/** Gets the value of "font-style" */
String get fontStyle =>
getPropertyValue('font-style');
/** Sets the value of "font-style" */
void set fontStyle(String value) {
setProperty('font-style', value, '');
}
/** Gets the value of "font-variant" */
String get fontVariant =>
getPropertyValue('font-variant');
/** Sets the value of "font-variant" */
void set fontVariant(String value) {
setProperty('font-variant', value, '');
}
/** Gets the value of "font-variant-ligatures" */
String get fontVariantLigatures =>
getPropertyValue('${Device.cssPrefix}font-variant-ligatures');
/** Sets the value of "font-variant-ligatures" */
void set fontVariantLigatures(String value) {
setProperty('${Device.cssPrefix}font-variant-ligatures', value, '');
}
/** Gets the value of "font-weight" */
String get fontWeight =>
getPropertyValue('font-weight');
/** Sets the value of "font-weight" */
void set fontWeight(String value) {
setProperty('font-weight', value, '');
}
/** Gets the value of "grid-column" */
String get gridColumn =>
getPropertyValue('${Device.cssPrefix}grid-column');
/** Sets the value of "grid-column" */
void set gridColumn(String value) {
setProperty('${Device.cssPrefix}grid-column', value, '');
}
/** Gets the value of "grid-columns" */
String get gridColumns =>
getPropertyValue('${Device.cssPrefix}grid-columns');
/** Sets the value of "grid-columns" */
void set gridColumns(String value) {
setProperty('${Device.cssPrefix}grid-columns', value, '');
}
/** Gets the value of "grid-row" */
String get gridRow =>
getPropertyValue('${Device.cssPrefix}grid-row');
/** Sets the value of "grid-row" */
void set gridRow(String value) {
setProperty('${Device.cssPrefix}grid-row', value, '');
}
/** Gets the value of "grid-rows" */
String get gridRows =>
getPropertyValue('${Device.cssPrefix}grid-rows');
/** Sets the value of "grid-rows" */
void set gridRows(String value) {
setProperty('${Device.cssPrefix}grid-rows', value, '');
}
/** Gets the value of "height" */
String get height =>
getPropertyValue('height');
/** Sets the value of "height" */
void set height(String value) {
setProperty('height', value, '');
}
/** Gets the value of "highlight" */
String get highlight =>
getPropertyValue('${Device.cssPrefix}highlight');
/** Sets the value of "highlight" */
void set highlight(String value) {
setProperty('${Device.cssPrefix}highlight', value, '');
}
/** Gets the value of "hyphenate-character" */
String get hyphenateCharacter =>
getPropertyValue('${Device.cssPrefix}hyphenate-character');
/** Sets the value of "hyphenate-character" */
void set hyphenateCharacter(String value) {
setProperty('${Device.cssPrefix}hyphenate-character', value, '');
}
/** Gets the value of "hyphenate-limit-after" */
String get hyphenateLimitAfter =>
getPropertyValue('${Device.cssPrefix}hyphenate-limit-after');
/** Sets the value of "hyphenate-limit-after" */
void set hyphenateLimitAfter(String value) {
setProperty('${Device.cssPrefix}hyphenate-limit-after', value, '');
}
/** Gets the value of "hyphenate-limit-before" */
String get hyphenateLimitBefore =>
getPropertyValue('${Device.cssPrefix}hyphenate-limit-before');
/** Sets the value of "hyphenate-limit-before" */
void set hyphenateLimitBefore(String value) {
setProperty('${Device.cssPrefix}hyphenate-limit-before', value, '');
}
/** Gets the value of "hyphenate-limit-lines" */
String get hyphenateLimitLines =>
getPropertyValue('${Device.cssPrefix}hyphenate-limit-lines');
/** Sets the value of "hyphenate-limit-lines" */
void set hyphenateLimitLines(String value) {
setProperty('${Device.cssPrefix}hyphenate-limit-lines', value, '');
}
/** Gets the value of "hyphens" */
String get hyphens =>
getPropertyValue('${Device.cssPrefix}hyphens');
/** Sets the value of "hyphens" */
void set hyphens(String value) {
setProperty('${Device.cssPrefix}hyphens', value, '');
}
/** Gets the value of "image-orientation" */
String get imageOrientation =>
getPropertyValue('image-orientation');
/** Sets the value of "image-orientation" */
void set imageOrientation(String value) {
setProperty('image-orientation', value, '');
}
/** Gets the value of "image-rendering" */
String get imageRendering =>
getPropertyValue('image-rendering');
/** Sets the value of "image-rendering" */
void set imageRendering(String value) {
setProperty('image-rendering', value, '');
}
/** Gets the value of "image-resolution" */
String get imageResolution =>
getPropertyValue('image-resolution');
/** Sets the value of "image-resolution" */
void set imageResolution(String value) {
setProperty('image-resolution', value, '');
}
/** Gets the value of "justify-content" */
String get justifyContent =>
getPropertyValue('${Device.cssPrefix}justify-content');
/** Sets the value of "justify-content" */
void set justifyContent(String value) {
setProperty('${Device.cssPrefix}justify-content', value, '');
}
/** Gets the value of "left" */
String get left =>
getPropertyValue('left');
/** Sets the value of "left" */
void set left(String value) {
setProperty('left', value, '');
}
/** Gets the value of "letter-spacing" */
String get letterSpacing =>
getPropertyValue('letter-spacing');
/** Sets the value of "letter-spacing" */
void set letterSpacing(String value) {
setProperty('letter-spacing', value, '');
}
/** Gets the value of "line-align" */
String get lineAlign =>
getPropertyValue('${Device.cssPrefix}line-align');
/** Sets the value of "line-align" */
void set lineAlign(String value) {
setProperty('${Device.cssPrefix}line-align', value, '');
}
/** Gets the value of "line-box-contain" */
String get lineBoxContain =>
getPropertyValue('${Device.cssPrefix}line-box-contain');
/** Sets the value of "line-box-contain" */
void set lineBoxContain(String value) {
setProperty('${Device.cssPrefix}line-box-contain', value, '');
}
/** Gets the value of "line-break" */
String get lineBreak =>
getPropertyValue('${Device.cssPrefix}line-break');
/** Sets the value of "line-break" */
void set lineBreak(String value) {
setProperty('${Device.cssPrefix}line-break', value, '');
}
/** Gets the value of "line-clamp" */
String get lineClamp =>
getPropertyValue('${Device.cssPrefix}line-clamp');
/** Sets the value of "line-clamp" */
void set lineClamp(String value) {
setProperty('${Device.cssPrefix}line-clamp', value, '');
}
/** Gets the value of "line-grid" */
String get lineGrid =>
getPropertyValue('${Device.cssPrefix}line-grid');
/** Sets the value of "line-grid" */
void set lineGrid(String value) {
setProperty('${Device.cssPrefix}line-grid', value, '');
}
/** Gets the value of "line-height" */
String get lineHeight =>
getPropertyValue('line-height');
/** Sets the value of "line-height" */
void set lineHeight(String value) {
setProperty('line-height', value, '');
}
/** Gets the value of "line-snap" */
String get lineSnap =>
getPropertyValue('${Device.cssPrefix}line-snap');
/** Sets the value of "line-snap" */
void set lineSnap(String value) {
setProperty('${Device.cssPrefix}line-snap', value, '');
}
/** Gets the value of "list-style" */
String get listStyle =>
getPropertyValue('list-style');
/** Sets the value of "list-style" */
void set listStyle(String value) {
setProperty('list-style', value, '');
}
/** Gets the value of "list-style-image" */
String get listStyleImage =>
getPropertyValue('list-style-image');
/** Sets the value of "list-style-image" */
void set listStyleImage(String value) {
setProperty('list-style-image', value, '');
}
/** Gets the value of "list-style-position" */
String get listStylePosition =>
getPropertyValue('list-style-position');
/** Sets the value of "list-style-position" */
void set listStylePosition(String value) {
setProperty('list-style-position', value, '');
}
/** Gets the value of "list-style-type" */
String get listStyleType =>
getPropertyValue('list-style-type');
/** Sets the value of "list-style-type" */
void set listStyleType(String value) {
setProperty('list-style-type', value, '');
}
/** Gets the value of "locale" */
String get locale =>
getPropertyValue('${Device.cssPrefix}locale');
/** Sets the value of "locale" */
void set locale(String value) {
setProperty('${Device.cssPrefix}locale', value, '');
}
/** Gets the value of "logical-height" */
String get logicalHeight =>
getPropertyValue('${Device.cssPrefix}logical-height');
/** Sets the value of "logical-height" */
void set logicalHeight(String value) {
setProperty('${Device.cssPrefix}logical-height', value, '');
}
/** Gets the value of "logical-width" */
String get logicalWidth =>
getPropertyValue('${Device.cssPrefix}logical-width');
/** Sets the value of "logical-width" */
void set logicalWidth(String value) {
setProperty('${Device.cssPrefix}logical-width', value, '');
}
/** Gets the value of "margin" */
String get margin =>
getPropertyValue('margin');
/** Sets the value of "margin" */
void set margin(String value) {
setProperty('margin', value, '');
}
/** Gets the value of "margin-after" */
String get marginAfter =>
getPropertyValue('${Device.cssPrefix}margin-after');
/** Sets the value of "margin-after" */
void set marginAfter(String value) {
setProperty('${Device.cssPrefix}margin-after', value, '');
}
/** Gets the value of "margin-after-collapse" */
String get marginAfterCollapse =>
getPropertyValue('${Device.cssPrefix}margin-after-collapse');
/** Sets the value of "margin-after-collapse" */
void set marginAfterCollapse(String value) {
setProperty('${Device.cssPrefix}margin-after-collapse', value, '');
}
/** Gets the value of "margin-before" */
String get marginBefore =>
getPropertyValue('${Device.cssPrefix}margin-before');
/** Sets the value of "margin-before" */
void set marginBefore(String value) {
setProperty('${Device.cssPrefix}margin-before', value, '');
}
/** Gets the value of "margin-before-collapse" */
String get marginBeforeCollapse =>
getPropertyValue('${Device.cssPrefix}margin-before-collapse');
/** Sets the value of "margin-before-collapse" */
void set marginBeforeCollapse(String value) {
setProperty('${Device.cssPrefix}margin-before-collapse', value, '');
}
/** Gets the value of "margin-bottom" */
String get marginBottom =>
getPropertyValue('margin-bottom');
/** Sets the value of "margin-bottom" */
void set marginBottom(String value) {
setProperty('margin-bottom', value, '');
}
/** Gets the value of "margin-bottom-collapse" */
String get marginBottomCollapse =>
getPropertyValue('${Device.cssPrefix}margin-bottom-collapse');
/** Sets the value of "margin-bottom-collapse" */
void set marginBottomCollapse(String value) {
setProperty('${Device.cssPrefix}margin-bottom-collapse', value, '');
}
/** Gets the value of "margin-collapse" */
String get marginCollapse =>
getPropertyValue('${Device.cssPrefix}margin-collapse');
/** Sets the value of "margin-collapse" */
void set marginCollapse(String value) {
setProperty('${Device.cssPrefix}margin-collapse', value, '');
}
/** Gets the value of "margin-end" */
String get marginEnd =>
getPropertyValue('${Device.cssPrefix}margin-end');
/** Sets the value of "margin-end" */
void set marginEnd(String value) {
setProperty('${Device.cssPrefix}margin-end', value, '');
}
/** Gets the value of "margin-left" */
String get marginLeft =>
getPropertyValue('margin-left');
/** Sets the value of "margin-left" */
void set marginLeft(String value) {
setProperty('margin-left', value, '');
}
/** Gets the value of "margin-right" */
String get marginRight =>
getPropertyValue('margin-right');
/** Sets the value of "margin-right" */
void set marginRight(String value) {
setProperty('margin-right', value, '');
}
/** Gets the value of "margin-start" */
String get marginStart =>
getPropertyValue('${Device.cssPrefix}margin-start');
/** Sets the value of "margin-start" */
void set marginStart(String value) {
setProperty('${Device.cssPrefix}margin-start', value, '');
}
/** Gets the value of "margin-top" */
String get marginTop =>
getPropertyValue('margin-top');
/** Sets the value of "margin-top" */
void set marginTop(String value) {
setProperty('margin-top', value, '');
}
/** Gets the value of "margin-top-collapse" */
String get marginTopCollapse =>
getPropertyValue('${Device.cssPrefix}margin-top-collapse');
/** Sets the value of "margin-top-collapse" */
void set marginTopCollapse(String value) {
setProperty('${Device.cssPrefix}margin-top-collapse', value, '');
}
/** Gets the value of "marquee" */
String get marquee =>
getPropertyValue('${Device.cssPrefix}marquee');
/** Sets the value of "marquee" */
void set marquee(String value) {
setProperty('${Device.cssPrefix}marquee', value, '');
}
/** Gets the value of "marquee-direction" */
String get marqueeDirection =>
getPropertyValue('${Device.cssPrefix}marquee-direction');
/** Sets the value of "marquee-direction" */
void set marqueeDirection(String value) {
setProperty('${Device.cssPrefix}marquee-direction', value, '');
}
/** Gets the value of "marquee-increment" */
String get marqueeIncrement =>
getPropertyValue('${Device.cssPrefix}marquee-increment');
/** Sets the value of "marquee-increment" */
void set marqueeIncrement(String value) {
setProperty('${Device.cssPrefix}marquee-increment', value, '');
}
/** Gets the value of "marquee-repetition" */
String get marqueeRepetition =>
getPropertyValue('${Device.cssPrefix}marquee-repetition');
/** Sets the value of "marquee-repetition" */
void set marqueeRepetition(String value) {
setProperty('${Device.cssPrefix}marquee-repetition', value, '');
}
/** Gets the value of "marquee-speed" */
String get marqueeSpeed =>
getPropertyValue('${Device.cssPrefix}marquee-speed');
/** Sets the value of "marquee-speed" */
void set marqueeSpeed(String value) {
setProperty('${Device.cssPrefix}marquee-speed', value, '');
}
/** Gets the value of "marquee-style" */
String get marqueeStyle =>
getPropertyValue('${Device.cssPrefix}marquee-style');
/** Sets the value of "marquee-style" */
void set marqueeStyle(String value) {
setProperty('${Device.cssPrefix}marquee-style', value, '');
}
/** Gets the value of "mask" */
String get mask =>
getPropertyValue('${Device.cssPrefix}mask');
/** Sets the value of "mask" */
void set mask(String value) {
setProperty('${Device.cssPrefix}mask', value, '');
}
/** Gets the value of "mask-attachment" */
String get maskAttachment =>
getPropertyValue('${Device.cssPrefix}mask-attachment');
/** Sets the value of "mask-attachment" */
void set maskAttachment(String value) {
setProperty('${Device.cssPrefix}mask-attachment', value, '');
}
/** Gets the value of "mask-box-image" */
String get maskBoxImage =>
getPropertyValue('${Device.cssPrefix}mask-box-image');
/** Sets the value of "mask-box-image" */
void set maskBoxImage(String value) {
setProperty('${Device.cssPrefix}mask-box-image', value, '');
}
/** Gets the value of "mask-box-image-outset" */
String get maskBoxImageOutset =>
getPropertyValue('${Device.cssPrefix}mask-box-image-outset');
/** Sets the value of "mask-box-image-outset" */
void set maskBoxImageOutset(String value) {
setProperty('${Device.cssPrefix}mask-box-image-outset', value, '');
}
/** Gets the value of "mask-box-image-repeat" */
String get maskBoxImageRepeat =>
getPropertyValue('${Device.cssPrefix}mask-box-image-repeat');
/** Sets the value of "mask-box-image-repeat" */
void set maskBoxImageRepeat(String value) {
setProperty('${Device.cssPrefix}mask-box-image-repeat', value, '');
}
/** Gets the value of "mask-box-image-slice" */
String get maskBoxImageSlice =>
getPropertyValue('${Device.cssPrefix}mask-box-image-slice');
/** Sets the value of "mask-box-image-slice" */
void set maskBoxImageSlice(String value) {
setProperty('${Device.cssPrefix}mask-box-image-slice', value, '');
}
/** Gets the value of "mask-box-image-source" */
String get maskBoxImageSource =>
getPropertyValue('${Device.cssPrefix}mask-box-image-source');
/** Sets the value of "mask-box-image-source" */
void set maskBoxImageSource(String value) {
setProperty('${Device.cssPrefix}mask-box-image-source', value, '');
}
/** Gets the value of "mask-box-image-width" */
String get maskBoxImageWidth =>
getPropertyValue('${Device.cssPrefix}mask-box-image-width');
/** Sets the value of "mask-box-image-width" */
void set maskBoxImageWidth(String value) {
setProperty('${Device.cssPrefix}mask-box-image-width', value, '');
}
/** Gets the value of "mask-clip" */
String get maskClip =>
getPropertyValue('${Device.cssPrefix}mask-clip');
/** Sets the value of "mask-clip" */
void set maskClip(String value) {
setProperty('${Device.cssPrefix}mask-clip', value, '');
}
/** Gets the value of "mask-composite" */
String get maskComposite =>
getPropertyValue('${Device.cssPrefix}mask-composite');
/** Sets the value of "mask-composite" */
void set maskComposite(String value) {
setProperty('${Device.cssPrefix}mask-composite', value, '');
}
/** Gets the value of "mask-image" */
String get maskImage =>
getPropertyValue('${Device.cssPrefix}mask-image');
/** Sets the value of "mask-image" */
void set maskImage(String value) {
setProperty('${Device.cssPrefix}mask-image', value, '');
}
/** Gets the value of "mask-origin" */
String get maskOrigin =>
getPropertyValue('${Device.cssPrefix}mask-origin');
/** Sets the value of "mask-origin" */
void set maskOrigin(String value) {
setProperty('${Device.cssPrefix}mask-origin', value, '');
}
/** Gets the value of "mask-position" */
String get maskPosition =>
getPropertyValue('${Device.cssPrefix}mask-position');
/** Sets the value of "mask-position" */
void set maskPosition(String value) {
setProperty('${Device.cssPrefix}mask-position', value, '');
}
/** Gets the value of "mask-position-x" */
String get maskPositionX =>
getPropertyValue('${Device.cssPrefix}mask-position-x');
/** Sets the value of "mask-position-x" */
void set maskPositionX(String value) {
setProperty('${Device.cssPrefix}mask-position-x', value, '');
}
/** Gets the value of "mask-position-y" */
String get maskPositionY =>
getPropertyValue('${Device.cssPrefix}mask-position-y');
/** Sets the value of "mask-position-y" */
void set maskPositionY(String value) {
setProperty('${Device.cssPrefix}mask-position-y', value, '');
}
/** Gets the value of "mask-repeat" */
String get maskRepeat =>
getPropertyValue('${Device.cssPrefix}mask-repeat');
/** Sets the value of "mask-repeat" */
void set maskRepeat(String value) {
setProperty('${Device.cssPrefix}mask-repeat', value, '');
}
/** Gets the value of "mask-repeat-x" */
String get maskRepeatX =>
getPropertyValue('${Device.cssPrefix}mask-repeat-x');
/** Sets the value of "mask-repeat-x" */
void set maskRepeatX(String value) {
setProperty('${Device.cssPrefix}mask-repeat-x', value, '');
}
/** Gets the value of "mask-repeat-y" */
String get maskRepeatY =>
getPropertyValue('${Device.cssPrefix}mask-repeat-y');
/** Sets the value of "mask-repeat-y" */
void set maskRepeatY(String value) {
setProperty('${Device.cssPrefix}mask-repeat-y', value, '');
}
/** Gets the value of "mask-size" */
String get maskSize =>
getPropertyValue('${Device.cssPrefix}mask-size');
/** Sets the value of "mask-size" */
void set maskSize(String value) {
setProperty('${Device.cssPrefix}mask-size', value, '');
}
/** Gets the value of "max-height" */
String get maxHeight =>
getPropertyValue('max-height');
/** Sets the value of "max-height" */
void set maxHeight(String value) {
setProperty('max-height', value, '');
}
/** Gets the value of "max-logical-height" */
String get maxLogicalHeight =>
getPropertyValue('${Device.cssPrefix}max-logical-height');
/** Sets the value of "max-logical-height" */
void set maxLogicalHeight(String value) {
setProperty('${Device.cssPrefix}max-logical-height', value, '');
}
/** Gets the value of "max-logical-width" */
String get maxLogicalWidth =>
getPropertyValue('${Device.cssPrefix}max-logical-width');
/** Sets the value of "max-logical-width" */
void set maxLogicalWidth(String value) {
setProperty('${Device.cssPrefix}max-logical-width', value, '');
}
/** Gets the value of "max-width" */
String get maxWidth =>
getPropertyValue('max-width');
/** Sets the value of "max-width" */
void set maxWidth(String value) {
setProperty('max-width', value, '');
}
/** Gets the value of "max-zoom" */
String get maxZoom =>
getPropertyValue('max-zoom');
/** Sets the value of "max-zoom" */
void set maxZoom(String value) {
setProperty('max-zoom', value, '');
}
/** Gets the value of "min-height" */
String get minHeight =>
getPropertyValue('min-height');
/** Sets the value of "min-height" */
void set minHeight(String value) {
setProperty('min-height', value, '');
}
/** Gets the value of "min-logical-height" */
String get minLogicalHeight =>
getPropertyValue('${Device.cssPrefix}min-logical-height');
/** Sets the value of "min-logical-height" */
void set minLogicalHeight(String value) {
setProperty('${Device.cssPrefix}min-logical-height', value, '');
}
/** Gets the value of "min-logical-width" */
String get minLogicalWidth =>
getPropertyValue('${Device.cssPrefix}min-logical-width');
/** Sets the value of "min-logical-width" */
void set minLogicalWidth(String value) {
setProperty('${Device.cssPrefix}min-logical-width', value, '');
}
/** Gets the value of "min-width" */
String get minWidth =>
getPropertyValue('min-width');
/** Sets the value of "min-width" */
void set minWidth(String value) {
setProperty('min-width', value, '');
}
/** Gets the value of "min-zoom" */
String get minZoom =>
getPropertyValue('min-zoom');
/** Sets the value of "min-zoom" */
void set minZoom(String value) {
setProperty('min-zoom', value, '');
}
/** Gets the value of "nbsp-mode" */
String get nbspMode =>
getPropertyValue('${Device.cssPrefix}nbsp-mode');
/** Sets the value of "nbsp-mode" */
void set nbspMode(String value) {
setProperty('${Device.cssPrefix}nbsp-mode', value, '');
}
/** Gets the value of "opacity" */
String get opacity =>
getPropertyValue('opacity');
/** Sets the value of "opacity" */
void set opacity(String value) {
setProperty('opacity', value, '');
}
/** Gets the value of "order" */
String get order =>
getPropertyValue('${Device.cssPrefix}order');
/** Sets the value of "order" */
void set order(String value) {
setProperty('${Device.cssPrefix}order', value, '');
}
/** Gets the value of "orientation" */
String get orientation =>
getPropertyValue('orientation');
/** Sets the value of "orientation" */
void set orientation(String value) {
setProperty('orientation', value, '');
}
/** Gets the value of "orphans" */
String get orphans =>
getPropertyValue('orphans');
/** Sets the value of "orphans" */
void set orphans(String value) {
setProperty('orphans', value, '');
}
/** Gets the value of "outline" */
String get outline =>
getPropertyValue('outline');
/** Sets the value of "outline" */
void set outline(String value) {
setProperty('outline', value, '');
}
/** Gets the value of "outline-color" */
String get outlineColor =>
getPropertyValue('outline-color');
/** Sets the value of "outline-color" */
void set outlineColor(String value) {
setProperty('outline-color', value, '');
}
/** Gets the value of "outline-offset" */
String get outlineOffset =>
getPropertyValue('outline-offset');
/** Sets the value of "outline-offset" */
void set outlineOffset(String value) {
setProperty('outline-offset', value, '');
}
/** Gets the value of "outline-style" */
String get outlineStyle =>
getPropertyValue('outline-style');
/** Sets the value of "outline-style" */
void set outlineStyle(String value) {
setProperty('outline-style', value, '');
}
/** Gets the value of "outline-width" */
String get outlineWidth =>
getPropertyValue('outline-width');
/** Sets the value of "outline-width" */
void set outlineWidth(String value) {
setProperty('outline-width', value, '');
}
/** Gets the value of "overflow" */
String get overflow =>
getPropertyValue('overflow');
/** Sets the value of "overflow" */
void set overflow(String value) {
setProperty('overflow', value, '');
}
/** Gets the value of "overflow-scrolling" */
String get overflowScrolling =>
getPropertyValue('${Device.cssPrefix}overflow-scrolling');
/** Sets the value of "overflow-scrolling" */
void set overflowScrolling(String value) {
setProperty('${Device.cssPrefix}overflow-scrolling', value, '');
}
/** Gets the value of "overflow-wrap" */
String get overflowWrap =>
getPropertyValue('overflow-wrap');
/** Sets the value of "overflow-wrap" */
void set overflowWrap(String value) {
setProperty('overflow-wrap', value, '');
}
/** Gets the value of "overflow-x" */
String get overflowX =>
getPropertyValue('overflow-x');
/** Sets the value of "overflow-x" */
void set overflowX(String value) {
setProperty('overflow-x', value, '');
}
/** Gets the value of "overflow-y" */
String get overflowY =>
getPropertyValue('overflow-y');
/** Sets the value of "overflow-y" */
void set overflowY(String value) {
setProperty('overflow-y', value, '');
}
/** Gets the value of "padding" */
String get padding =>
getPropertyValue('padding');
/** Sets the value of "padding" */
void set padding(String value) {
setProperty('padding', value, '');
}
/** Gets the value of "padding-after" */
String get paddingAfter =>
getPropertyValue('${Device.cssPrefix}padding-after');
/** Sets the value of "padding-after" */
void set paddingAfter(String value) {
setProperty('${Device.cssPrefix}padding-after', value, '');
}
/** Gets the value of "padding-before" */
String get paddingBefore =>
getPropertyValue('${Device.cssPrefix}padding-before');
/** Sets the value of "padding-before" */
void set paddingBefore(String value) {
setProperty('${Device.cssPrefix}padding-before', value, '');
}
/** Gets the value of "padding-bottom" */
String get paddingBottom =>
getPropertyValue('padding-bottom');
/** Sets the value of "padding-bottom" */
void set paddingBottom(String value) {
setProperty('padding-bottom', value, '');
}
/** Gets the value of "padding-end" */
String get paddingEnd =>
getPropertyValue('${Device.cssPrefix}padding-end');
/** Sets the value of "padding-end" */
void set paddingEnd(String value) {
setProperty('${Device.cssPrefix}padding-end', value, '');
}
/** Gets the value of "padding-left" */
String get paddingLeft =>
getPropertyValue('padding-left');
/** Sets the value of "padding-left" */
void set paddingLeft(String value) {
setProperty('padding-left', value, '');
}
/** Gets the value of "padding-right" */
String get paddingRight =>
getPropertyValue('padding-right');
/** Sets the value of "padding-right" */
void set paddingRight(String value) {
setProperty('padding-right', value, '');
}
/** Gets the value of "padding-start" */
String get paddingStart =>
getPropertyValue('${Device.cssPrefix}padding-start');
/** Sets the value of "padding-start" */
void set paddingStart(String value) {
setProperty('${Device.cssPrefix}padding-start', value, '');
}
/** Gets the value of "padding-top" */
String get paddingTop =>
getPropertyValue('padding-top');
/** Sets the value of "padding-top" */
void set paddingTop(String value) {
setProperty('padding-top', value, '');
}
/** Gets the value of "page" */
String get page =>
getPropertyValue('page');
/** Sets the value of "page" */
void set page(String value) {
setProperty('page', value, '');
}
/** Gets the value of "page-break-after" */
String get pageBreakAfter =>
getPropertyValue('page-break-after');
/** Sets the value of "page-break-after" */
void set pageBreakAfter(String value) {
setProperty('page-break-after', value, '');
}
/** Gets the value of "page-break-before" */
String get pageBreakBefore =>
getPropertyValue('page-break-before');
/** Sets the value of "page-break-before" */
void set pageBreakBefore(String value) {
setProperty('page-break-before', value, '');
}
/** Gets the value of "page-break-inside" */
String get pageBreakInside =>
getPropertyValue('page-break-inside');
/** Sets the value of "page-break-inside" */
void set pageBreakInside(String value) {
setProperty('page-break-inside', value, '');
}
/** Gets the value of "perspective" */
String get perspective =>
getPropertyValue('${Device.cssPrefix}perspective');
/** Sets the value of "perspective" */
void set perspective(String value) {
setProperty('${Device.cssPrefix}perspective', value, '');
}
/** Gets the value of "perspective-origin" */
String get perspectiveOrigin =>
getPropertyValue('${Device.cssPrefix}perspective-origin');
/** Sets the value of "perspective-origin" */
void set perspectiveOrigin(String value) {
setProperty('${Device.cssPrefix}perspective-origin', value, '');
}
/** Gets the value of "perspective-origin-x" */
String get perspectiveOriginX =>
getPropertyValue('${Device.cssPrefix}perspective-origin-x');
/** Sets the value of "perspective-origin-x" */
void set perspectiveOriginX(String value) {
setProperty('${Device.cssPrefix}perspective-origin-x', value, '');
}
/** Gets the value of "perspective-origin-y" */
String get perspectiveOriginY =>
getPropertyValue('${Device.cssPrefix}perspective-origin-y');
/** Sets the value of "perspective-origin-y" */
void set perspectiveOriginY(String value) {
setProperty('${Device.cssPrefix}perspective-origin-y', value, '');
}
/** Gets the value of "pointer-events" */
String get pointerEvents =>
getPropertyValue('pointer-events');
/** Sets the value of "pointer-events" */
void set pointerEvents(String value) {
setProperty('pointer-events', value, '');
}
/** Gets the value of "position" */
String get position =>
getPropertyValue('position');
/** Sets the value of "position" */
void set position(String value) {
setProperty('position', value, '');
}
/** Gets the value of "print-color-adjust" */
String get printColorAdjust =>
getPropertyValue('${Device.cssPrefix}print-color-adjust');
/** Sets the value of "print-color-adjust" */
void set printColorAdjust(String value) {
setProperty('${Device.cssPrefix}print-color-adjust', value, '');
}
/** Gets the value of "quotes" */
String get quotes =>
getPropertyValue('quotes');
/** Sets the value of "quotes" */
void set quotes(String value) {
setProperty('quotes', value, '');
}
/** Gets the value of "region-break-after" */
String get regionBreakAfter =>
getPropertyValue('${Device.cssPrefix}region-break-after');
/** Sets the value of "region-break-after" */
void set regionBreakAfter(String value) {
setProperty('${Device.cssPrefix}region-break-after', value, '');
}
/** Gets the value of "region-break-before" */
String get regionBreakBefore =>
getPropertyValue('${Device.cssPrefix}region-break-before');
/** Sets the value of "region-break-before" */
void set regionBreakBefore(String value) {
setProperty('${Device.cssPrefix}region-break-before', value, '');
}
/** Gets the value of "region-break-inside" */
String get regionBreakInside =>
getPropertyValue('${Device.cssPrefix}region-break-inside');
/** Sets the value of "region-break-inside" */
void set regionBreakInside(String value) {
setProperty('${Device.cssPrefix}region-break-inside', value, '');
}
/** Gets the value of "region-overflow" */
String get regionOverflow =>
getPropertyValue('${Device.cssPrefix}region-overflow');
/** Sets the value of "region-overflow" */
void set regionOverflow(String value) {
setProperty('${Device.cssPrefix}region-overflow', value, '');
}
/** Gets the value of "resize" */
String get resize =>
getPropertyValue('resize');
/** Sets the value of "resize" */
void set resize(String value) {
setProperty('resize', value, '');
}
/** Gets the value of "right" */
String get right =>
getPropertyValue('right');
/** Sets the value of "right" */
void set right(String value) {
setProperty('right', value, '');
}
/** Gets the value of "rtl-ordering" */
String get rtlOrdering =>
getPropertyValue('${Device.cssPrefix}rtl-ordering');
/** Sets the value of "rtl-ordering" */
void set rtlOrdering(String value) {
setProperty('${Device.cssPrefix}rtl-ordering', value, '');
}
/** Gets the value of "shape-inside" */
String get shapeInside =>
getPropertyValue('${Device.cssPrefix}shape-inside');
/** Sets the value of "shape-inside" */
void set shapeInside(String value) {
setProperty('${Device.cssPrefix}shape-inside', value, '');
}
/** Gets the value of "shape-margin" */
String get shapeMargin =>
getPropertyValue('${Device.cssPrefix}shape-margin');
/** Sets the value of "shape-margin" */
void set shapeMargin(String value) {
setProperty('${Device.cssPrefix}shape-margin', value, '');
}
/** Gets the value of "shape-outside" */
String get shapeOutside =>
getPropertyValue('${Device.cssPrefix}shape-outside');
/** Sets the value of "shape-outside" */
void set shapeOutside(String value) {
setProperty('${Device.cssPrefix}shape-outside', value, '');
}
/** Gets the value of "shape-padding" */
String get shapePadding =>
getPropertyValue('${Device.cssPrefix}shape-padding');
/** Sets the value of "shape-padding" */
void set shapePadding(String value) {
setProperty('${Device.cssPrefix}shape-padding', value, '');
}
/** Gets the value of "size" */
String get size =>
getPropertyValue('size');
/** Sets the value of "size" */
void set size(String value) {
setProperty('size', value, '');
}
/** Gets the value of "speak" */
String get speak =>
getPropertyValue('speak');
/** Sets the value of "speak" */
void set speak(String value) {
setProperty('speak', value, '');
}
/** Gets the value of "src" */
String get src =>
getPropertyValue('src');
/** Sets the value of "src" */
void set src(String value) {
setProperty('src', value, '');
}
/** Gets the value of "tab-size" */
String get tabSize =>
getPropertyValue('tab-size');
/** Sets the value of "tab-size" */
void set tabSize(String value) {
setProperty('tab-size', value, '');
}
/** Gets the value of "table-layout" */
String get tableLayout =>
getPropertyValue('table-layout');
/** Sets the value of "table-layout" */
void set tableLayout(String value) {
setProperty('table-layout', value, '');
}
/** Gets the value of "tap-highlight-color" */
String get tapHighlightColor =>
getPropertyValue('${Device.cssPrefix}tap-highlight-color');
/** Sets the value of "tap-highlight-color" */
void set tapHighlightColor(String value) {
setProperty('${Device.cssPrefix}tap-highlight-color', value, '');
}
/** Gets the value of "text-align" */
String get textAlign =>
getPropertyValue('text-align');
/** Sets the value of "text-align" */
void set textAlign(String value) {
setProperty('text-align', value, '');
}
/** Gets the value of "text-align-last" */
String get textAlignLast =>
getPropertyValue('${Device.cssPrefix}text-align-last');
/** Sets the value of "text-align-last" */
void set textAlignLast(String value) {
setProperty('${Device.cssPrefix}text-align-last', value, '');
}
/** Gets the value of "text-combine" */
String get textCombine =>
getPropertyValue('${Device.cssPrefix}text-combine');
/** Sets the value of "text-combine" */
void set textCombine(String value) {
setProperty('${Device.cssPrefix}text-combine', value, '');
}
/** Gets the value of "text-decoration" */
String get textDecoration =>
getPropertyValue('text-decoration');
/** Sets the value of "text-decoration" */
void set textDecoration(String value) {
setProperty('text-decoration', value, '');
}
/** Gets the value of "text-decoration-line" */
String get textDecorationLine =>
getPropertyValue('${Device.cssPrefix}text-decoration-line');
/** Sets the value of "text-decoration-line" */
void set textDecorationLine(String value) {
setProperty('${Device.cssPrefix}text-decoration-line', value, '');
}
/** Gets the value of "text-decoration-style" */
String get textDecorationStyle =>
getPropertyValue('${Device.cssPrefix}text-decoration-style');
/** Sets the value of "text-decoration-style" */
void set textDecorationStyle(String value) {
setProperty('${Device.cssPrefix}text-decoration-style', value, '');
}
/** Gets the value of "text-decorations-in-effect" */
String get textDecorationsInEffect =>
getPropertyValue('${Device.cssPrefix}text-decorations-in-effect');
/** Sets the value of "text-decorations-in-effect" */
void set textDecorationsInEffect(String value) {
setProperty('${Device.cssPrefix}text-decorations-in-effect', value, '');
}
/** Gets the value of "text-emphasis" */
String get textEmphasis =>
getPropertyValue('${Device.cssPrefix}text-emphasis');
/** Sets the value of "text-emphasis" */
void set textEmphasis(String value) {
setProperty('${Device.cssPrefix}text-emphasis', value, '');
}
/** Gets the value of "text-emphasis-color" */
String get textEmphasisColor =>
getPropertyValue('${Device.cssPrefix}text-emphasis-color');
/** Sets the value of "text-emphasis-color" */
void set textEmphasisColor(String value) {
setProperty('${Device.cssPrefix}text-emphasis-color', value, '');
}
/** Gets the value of "text-emphasis-position" */
String get textEmphasisPosition =>
getPropertyValue('${Device.cssPrefix}text-emphasis-position');
/** Sets the value of "text-emphasis-position" */
void set textEmphasisPosition(String value) {
setProperty('${Device.cssPrefix}text-emphasis-position', value, '');
}
/** Gets the value of "text-emphasis-style" */
String get textEmphasisStyle =>
getPropertyValue('${Device.cssPrefix}text-emphasis-style');
/** Sets the value of "text-emphasis-style" */
void set textEmphasisStyle(String value) {
setProperty('${Device.cssPrefix}text-emphasis-style', value, '');
}
/** Gets the value of "text-fill-color" */
String get textFillColor =>
getPropertyValue('${Device.cssPrefix}text-fill-color');
/** Sets the value of "text-fill-color" */
void set textFillColor(String value) {
setProperty('${Device.cssPrefix}text-fill-color', value, '');
}
/** Gets the value of "text-indent" */
String get textIndent =>
getPropertyValue('text-indent');
/** Sets the value of "text-indent" */
void set textIndent(String value) {
setProperty('text-indent', value, '');
}
/** Gets the value of "text-line-through" */
String get textLineThrough =>
getPropertyValue('text-line-through');
/** Sets the value of "text-line-through" */
void set textLineThrough(String value) {
setProperty('text-line-through', value, '');
}
/** Gets the value of "text-line-through-color" */
String get textLineThroughColor =>
getPropertyValue('text-line-through-color');
/** Sets the value of "text-line-through-color" */
void set textLineThroughColor(String value) {
setProperty('text-line-through-color', value, '');
}
/** Gets the value of "text-line-through-mode" */
String get textLineThroughMode =>
getPropertyValue('text-line-through-mode');
/** Sets the value of "text-line-through-mode" */
void set textLineThroughMode(String value) {
setProperty('text-line-through-mode', value, '');
}
/** Gets the value of "text-line-through-style" */
String get textLineThroughStyle =>
getPropertyValue('text-line-through-style');
/** Sets the value of "text-line-through-style" */
void set textLineThroughStyle(String value) {
setProperty('text-line-through-style', value, '');
}
/** Gets the value of "text-line-through-width" */
String get textLineThroughWidth =>
getPropertyValue('text-line-through-width');
/** Sets the value of "text-line-through-width" */
void set textLineThroughWidth(String value) {
setProperty('text-line-through-width', value, '');
}
/** Gets the value of "text-orientation" */
String get textOrientation =>
getPropertyValue('${Device.cssPrefix}text-orientation');
/** Sets the value of "text-orientation" */
void set textOrientation(String value) {
setProperty('${Device.cssPrefix}text-orientation', value, '');
}
/** Gets the value of "text-overflow" */
String get textOverflow =>
getPropertyValue('text-overflow');
/** Sets the value of "text-overflow" */
void set textOverflow(String value) {
setProperty('text-overflow', value, '');
}
/** Gets the value of "text-overline" */
String get textOverline =>
getPropertyValue('text-overline');
/** Sets the value of "text-overline" */
void set textOverline(String value) {
setProperty('text-overline', value, '');
}
/** Gets the value of "text-overline-color" */
String get textOverlineColor =>
getPropertyValue('text-overline-color');
/** Sets the value of "text-overline-color" */
void set textOverlineColor(String value) {
setProperty('text-overline-color', value, '');
}
/** Gets the value of "text-overline-mode" */
String get textOverlineMode =>
getPropertyValue('text-overline-mode');
/** Sets the value of "text-overline-mode" */
void set textOverlineMode(String value) {
setProperty('text-overline-mode', value, '');
}
/** Gets the value of "text-overline-style" */
String get textOverlineStyle =>
getPropertyValue('text-overline-style');
/** Sets the value of "text-overline-style" */
void set textOverlineStyle(String value) {
setProperty('text-overline-style', value, '');
}
/** Gets the value of "text-overline-width" */
String get textOverlineWidth =>
getPropertyValue('text-overline-width');
/** Sets the value of "text-overline-width" */
void set textOverlineWidth(String value) {
setProperty('text-overline-width', value, '');
}
/** Gets the value of "text-rendering" */
String get textRendering =>
getPropertyValue('text-rendering');
/** Sets the value of "text-rendering" */
void set textRendering(String value) {
setProperty('text-rendering', value, '');
}
/** Gets the value of "text-security" */
String get textSecurity =>
getPropertyValue('${Device.cssPrefix}text-security');
/** Sets the value of "text-security" */
void set textSecurity(String value) {
setProperty('${Device.cssPrefix}text-security', value, '');
}
/** Gets the value of "text-shadow" */
String get textShadow =>
getPropertyValue('text-shadow');
/** Sets the value of "text-shadow" */
void set textShadow(String value) {
setProperty('text-shadow', value, '');
}
/** Gets the value of "text-size-adjust" */
String get textSizeAdjust =>
getPropertyValue('${Device.cssPrefix}text-size-adjust');
/** Sets the value of "text-size-adjust" */
void set textSizeAdjust(String value) {
setProperty('${Device.cssPrefix}text-size-adjust', value, '');
}
/** Gets the value of "text-stroke" */
String get textStroke =>
getPropertyValue('${Device.cssPrefix}text-stroke');
/** Sets the value of "text-stroke" */
void set textStroke(String value) {
setProperty('${Device.cssPrefix}text-stroke', value, '');
}
/** Gets the value of "text-stroke-color" */
String get textStrokeColor =>
getPropertyValue('${Device.cssPrefix}text-stroke-color');
/** Sets the value of "text-stroke-color" */
void set textStrokeColor(String value) {
setProperty('${Device.cssPrefix}text-stroke-color', value, '');
}
/** Gets the value of "text-stroke-width" */
String get textStrokeWidth =>
getPropertyValue('${Device.cssPrefix}text-stroke-width');
/** Sets the value of "text-stroke-width" */
void set textStrokeWidth(String value) {
setProperty('${Device.cssPrefix}text-stroke-width', value, '');
}
/** Gets the value of "text-transform" */
String get textTransform =>
getPropertyValue('text-transform');
/** Sets the value of "text-transform" */
void set textTransform(String value) {
setProperty('text-transform', value, '');
}
/** Gets the value of "text-underline" */
String get textUnderline =>
getPropertyValue('text-underline');
/** Sets the value of "text-underline" */
void set textUnderline(String value) {
setProperty('text-underline', value, '');
}
/** Gets the value of "text-underline-color" */
String get textUnderlineColor =>
getPropertyValue('text-underline-color');
/** Sets the value of "text-underline-color" */
void set textUnderlineColor(String value) {
setProperty('text-underline-color', value, '');
}
/** Gets the value of "text-underline-mode" */
String get textUnderlineMode =>
getPropertyValue('text-underline-mode');
/** Sets the value of "text-underline-mode" */
void set textUnderlineMode(String value) {
setProperty('text-underline-mode', value, '');
}
/** Gets the value of "text-underline-style" */
String get textUnderlineStyle =>
getPropertyValue('text-underline-style');
/** Sets the value of "text-underline-style" */
void set textUnderlineStyle(String value) {
setProperty('text-underline-style', value, '');
}
/** Gets the value of "text-underline-width" */
String get textUnderlineWidth =>
getPropertyValue('text-underline-width');
/** Sets the value of "text-underline-width" */
void set textUnderlineWidth(String value) {
setProperty('text-underline-width', value, '');
}
/** Gets the value of "top" */
String get top =>
getPropertyValue('top');
/** Sets the value of "top" */
void set top(String value) {
setProperty('top', value, '');
}
/** Gets the value of "transform" */
String get transform =>
getPropertyValue('${Device.cssPrefix}transform');
/** Sets the value of "transform" */
void set transform(String value) {
setProperty('${Device.cssPrefix}transform', value, '');
}
/** Gets the value of "transform-origin" */
String get transformOrigin =>
getPropertyValue('${Device.cssPrefix}transform-origin');
/** Sets the value of "transform-origin" */
void set transformOrigin(String value) {
setProperty('${Device.cssPrefix}transform-origin', value, '');
}
/** Gets the value of "transform-origin-x" */
String get transformOriginX =>
getPropertyValue('${Device.cssPrefix}transform-origin-x');
/** Sets the value of "transform-origin-x" */
void set transformOriginX(String value) {
setProperty('${Device.cssPrefix}transform-origin-x', value, '');
}
/** Gets the value of "transform-origin-y" */
String get transformOriginY =>
getPropertyValue('${Device.cssPrefix}transform-origin-y');
/** Sets the value of "transform-origin-y" */
void set transformOriginY(String value) {
setProperty('${Device.cssPrefix}transform-origin-y', value, '');
}
/** Gets the value of "transform-origin-z" */
String get transformOriginZ =>
getPropertyValue('${Device.cssPrefix}transform-origin-z');
/** Sets the value of "transform-origin-z" */
void set transformOriginZ(String value) {
setProperty('${Device.cssPrefix}transform-origin-z', value, '');
}
/** Gets the value of "transform-style" */
String get transformStyle =>
getPropertyValue('${Device.cssPrefix}transform-style');
/** Sets the value of "transform-style" */
void set transformStyle(String value) {
setProperty('${Device.cssPrefix}transform-style', value, '');
}
/** Gets the value of "transition" */
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
String get transition =>
getPropertyValue('${Device.cssPrefix}transition');
/** Sets the value of "transition" */
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
void set transition(String value) {
setProperty('${Device.cssPrefix}transition', value, '');
}
/** Gets the value of "transition-delay" */
String get transitionDelay =>
getPropertyValue('${Device.cssPrefix}transition-delay');
/** Sets the value of "transition-delay" */
void set transitionDelay(String value) {
setProperty('${Device.cssPrefix}transition-delay', value, '');
}
/** Gets the value of "transition-duration" */
String get transitionDuration =>
getPropertyValue('${Device.cssPrefix}transition-duration');
/** Sets the value of "transition-duration" */
void set transitionDuration(String value) {
setProperty('${Device.cssPrefix}transition-duration', value, '');
}
/** Gets the value of "transition-property" */
String get transitionProperty =>
getPropertyValue('${Device.cssPrefix}transition-property');
/** Sets the value of "transition-property" */
void set transitionProperty(String value) {
setProperty('${Device.cssPrefix}transition-property', value, '');
}
/** Gets the value of "transition-timing-function" */
String get transitionTimingFunction =>
getPropertyValue('${Device.cssPrefix}transition-timing-function');
/** Sets the value of "transition-timing-function" */
void set transitionTimingFunction(String value) {
setProperty('${Device.cssPrefix}transition-timing-function', value, '');
}
/** Gets the value of "unicode-bidi" */
String get unicodeBidi =>
getPropertyValue('unicode-bidi');
/** Sets the value of "unicode-bidi" */
void set unicodeBidi(String value) {
setProperty('unicode-bidi', value, '');
}
/** Gets the value of "unicode-range" */
String get unicodeRange =>
getPropertyValue('unicode-range');
/** Sets the value of "unicode-range" */
void set unicodeRange(String value) {
setProperty('unicode-range', value, '');
}
/** Gets the value of "user-drag" */
String get userDrag =>
getPropertyValue('${Device.cssPrefix}user-drag');
/** Sets the value of "user-drag" */
void set userDrag(String value) {
setProperty('${Device.cssPrefix}user-drag', value, '');
}
/** Gets the value of "user-modify" */
String get userModify =>
getPropertyValue('${Device.cssPrefix}user-modify');
/** Sets the value of "user-modify" */
void set userModify(String value) {
setProperty('${Device.cssPrefix}user-modify', value, '');
}
/** Gets the value of "user-select" */
String get userSelect =>
getPropertyValue('${Device.cssPrefix}user-select');
/** Sets the value of "user-select" */
void set userSelect(String value) {
setProperty('${Device.cssPrefix}user-select', value, '');
}
/** Gets the value of "user-zoom" */
String get userZoom =>
getPropertyValue('user-zoom');
/** Sets the value of "user-zoom" */
void set userZoom(String value) {
setProperty('user-zoom', value, '');
}
/** Gets the value of "vertical-align" */
String get verticalAlign =>
getPropertyValue('vertical-align');
/** Sets the value of "vertical-align" */
void set verticalAlign(String value) {
setProperty('vertical-align', value, '');
}
/** Gets the value of "visibility" */
String get visibility =>
getPropertyValue('visibility');
/** Sets the value of "visibility" */
void set visibility(String value) {
setProperty('visibility', value, '');
}
/** Gets the value of "white-space" */
String get whiteSpace =>
getPropertyValue('white-space');
/** Sets the value of "white-space" */
void set whiteSpace(String value) {
setProperty('white-space', value, '');
}
/** Gets the value of "widows" */
String get widows =>
getPropertyValue('widows');
/** Sets the value of "widows" */
void set widows(String value) {
setProperty('widows', value, '');
}
/** Gets the value of "width" */
String get width =>
getPropertyValue('width');
/** Sets the value of "width" */
void set width(String value) {
setProperty('width', value, '');
}
/** Gets the value of "word-break" */
String get wordBreak =>
getPropertyValue('word-break');
/** Sets the value of "word-break" */
void set wordBreak(String value) {
setProperty('word-break', value, '');
}
/** Gets the value of "word-spacing" */
String get wordSpacing =>
getPropertyValue('word-spacing');
/** Sets the value of "word-spacing" */
void set wordSpacing(String value) {
setProperty('word-spacing', value, '');
}
/** Gets the value of "word-wrap" */
String get wordWrap =>
getPropertyValue('word-wrap');
/** Sets the value of "word-wrap" */
void set wordWrap(String value) {
setProperty('word-wrap', value, '');
}
/** Gets the value of "wrap" */
String get wrap =>
getPropertyValue('${Device.cssPrefix}wrap');
/** Sets the value of "wrap" */
void set wrap(String value) {
setProperty('${Device.cssPrefix}wrap', value, '');
}
/** Gets the value of "wrap-flow" */
String get wrapFlow =>
getPropertyValue('${Device.cssPrefix}wrap-flow');
/** Sets the value of "wrap-flow" */
void set wrapFlow(String value) {
setProperty('${Device.cssPrefix}wrap-flow', value, '');
}
/** Gets the value of "wrap-through" */
String get wrapThrough =>
getPropertyValue('${Device.cssPrefix}wrap-through');
/** Sets the value of "wrap-through" */
void set wrapThrough(String value) {
setProperty('${Device.cssPrefix}wrap-through', value, '');
}
/** Gets the value of "writing-mode" */
String get writingMode =>
getPropertyValue('${Device.cssPrefix}writing-mode');
/** Sets the value of "writing-mode" */
void set writingMode(String value) {
setProperty('${Device.cssPrefix}writing-mode', value, '');
}
/** Gets the value of "z-index" */
String get zIndex =>
getPropertyValue('z-index');
/** Sets the value of "z-index" */
void set zIndex(String value) {
setProperty('z-index', value, '');
}
/** Gets the value of "zoom" */
String get zoom =>
getPropertyValue('zoom');
/** Sets the value of "zoom" */
void set zoom(String value) {
setProperty('zoom', value, '');
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSStyleRule')
class CssStyleRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssStyleRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSStyleRule.selectorText')
@DocsEditable()
String get selectorText native "CSSStyleRule_selectorText_Getter";
@DomName('CSSStyleRule.selectorText')
@DocsEditable()
void set selectorText(String value) native "CSSStyleRule_selectorText_Setter";
@DomName('CSSStyleRule.style')
@DocsEditable()
CssStyleDeclaration get style native "CSSStyleRule_style_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSStyleSheet')
class CssStyleSheet extends StyleSheet {
// To suppress missing implicit constructor warnings.
factory CssStyleSheet._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSStyleSheet.cssRules')
@DocsEditable()
List<CssRule> get cssRules native "CSSStyleSheet_cssRules_Getter";
@DomName('CSSStyleSheet.ownerRule')
@DocsEditable()
CssRule get ownerRule native "CSSStyleSheet_ownerRule_Getter";
@DomName('CSSStyleSheet.rules')
@DocsEditable()
@Experimental() // non-standard
List<CssRule> get rules native "CSSStyleSheet_rules_Getter";
int addRule(String selector, String style, [int index]) {
if (index != null) {
return _addRule_1(selector, style, index);
}
return _addRule_2(selector, style);
}
int _addRule_1(selector, style, index) native "CSSStyleSheet__addRule_1_Callback";
int _addRule_2(selector, style) native "CSSStyleSheet__addRule_2_Callback";
@DomName('CSSStyleSheet.deleteRule')
@DocsEditable()
void deleteRule(int index) native "CSSStyleSheet_deleteRule_Callback";
@DomName('CSSStyleSheet.insertRule')
@DocsEditable()
int insertRule(String rule, int index) native "CSSStyleSheet_insertRule_Callback";
@DomName('CSSStyleSheet.removeRule')
@DocsEditable()
@Experimental() // non-standard
void removeRule(int index) native "CSSStyleSheet_removeRule_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSSupportsRule')
class CssSupportsRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssSupportsRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSSupportsRule.conditionText')
@DocsEditable()
String get conditionText native "CSSSupportsRule_conditionText_Getter";
@DomName('CSSSupportsRule.cssRules')
@DocsEditable()
List<CssRule> get cssRules native "CSSSupportsRule_cssRules_Getter";
@DomName('CSSSupportsRule.deleteRule')
@DocsEditable()
void deleteRule(int index) native "CSSSupportsRule_deleteRule_Callback";
@DomName('CSSSupportsRule.insertRule')
@DocsEditable()
int insertRule(String rule, int index) native "CSSSupportsRule_insertRule_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitCSSTransformValue')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
class CssTransformValue extends _CssValueList {
// To suppress missing implicit constructor warnings.
factory CssTransformValue._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitCSSTransformValue.CSS_MATRIX')
@DocsEditable()
static const int CSS_MATRIX = 11;
@DomName('WebKitCSSTransformValue.CSS_MATRIX3D')
@DocsEditable()
static const int CSS_MATRIX3D = 21;
@DomName('WebKitCSSTransformValue.CSS_PERSPECTIVE')
@DocsEditable()
static const int CSS_PERSPECTIVE = 20;
@DomName('WebKitCSSTransformValue.CSS_ROTATE')
@DocsEditable()
static const int CSS_ROTATE = 4;
@DomName('WebKitCSSTransformValue.CSS_ROTATE3D')
@DocsEditable()
static const int CSS_ROTATE3D = 17;
@DomName('WebKitCSSTransformValue.CSS_ROTATEX')
@DocsEditable()
static const int CSS_ROTATEX = 14;
@DomName('WebKitCSSTransformValue.CSS_ROTATEY')
@DocsEditable()
static const int CSS_ROTATEY = 15;
@DomName('WebKitCSSTransformValue.CSS_ROTATEZ')
@DocsEditable()
static const int CSS_ROTATEZ = 16;
@DomName('WebKitCSSTransformValue.CSS_SCALE')
@DocsEditable()
static const int CSS_SCALE = 5;
@DomName('WebKitCSSTransformValue.CSS_SCALE3D')
@DocsEditable()
static const int CSS_SCALE3D = 19;
@DomName('WebKitCSSTransformValue.CSS_SCALEX')
@DocsEditable()
static const int CSS_SCALEX = 6;
@DomName('WebKitCSSTransformValue.CSS_SCALEY')
@DocsEditable()
static const int CSS_SCALEY = 7;
@DomName('WebKitCSSTransformValue.CSS_SCALEZ')
@DocsEditable()
static const int CSS_SCALEZ = 18;
@DomName('WebKitCSSTransformValue.CSS_SKEW')
@DocsEditable()
static const int CSS_SKEW = 8;
@DomName('WebKitCSSTransformValue.CSS_SKEWX')
@DocsEditable()
static const int CSS_SKEWX = 9;
@DomName('WebKitCSSTransformValue.CSS_SKEWY')
@DocsEditable()
static const int CSS_SKEWY = 10;
@DomName('WebKitCSSTransformValue.CSS_TRANSLATE')
@DocsEditable()
static const int CSS_TRANSLATE = 1;
@DomName('WebKitCSSTransformValue.CSS_TRANSLATE3D')
@DocsEditable()
static const int CSS_TRANSLATE3D = 13;
@DomName('WebKitCSSTransformValue.CSS_TRANSLATEX')
@DocsEditable()
static const int CSS_TRANSLATEX = 2;
@DomName('WebKitCSSTransformValue.CSS_TRANSLATEY')
@DocsEditable()
static const int CSS_TRANSLATEY = 3;
@DomName('WebKitCSSTransformValue.CSS_TRANSLATEZ')
@DocsEditable()
static const int CSS_TRANSLATEZ = 12;
@DomName('WebKitCSSTransformValue.operationType')
@DocsEditable()
int get operationType native "WebKitCSSTransformValue_operationType_Getter";
@DomName('WebKitCSSTransformValue.__getter__')
@DocsEditable()
_CSSValue __getter__(int index) native "WebKitCSSTransformValue___getter___Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSUnknownRule')
// http://dev.w3.org/csswg/cssom/#the-cssstylesheet-interface
@deprecated // deprecated
class CssUnknownRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssUnknownRule._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSVariablesMap')
@Experimental() // untriaged
class CssVariablesMap extends NativeFieldWrapperClass1 {
@DomName('CSSVariablesMap.size')
@DocsEditable()
@Experimental() // untriaged
int get size native "CSSVariablesMap_size_Getter";
@DomName('CSSVariablesMap.clear')
@DocsEditable()
@Experimental() // untriaged
void clear() native "CSSVariablesMap_clear_Callback";
@DomName('CSSVariablesMap.delete')
@DocsEditable()
@Experimental() // untriaged
bool delete(String name) native "CSSVariablesMap_delete_Callback";
@DomName('CSSVariablesMap.get')
@DocsEditable()
@Experimental() // untriaged
String get(String name) native "CSSVariablesMap_get_Callback";
@DomName('CSSVariablesMap.has')
@DocsEditable()
@Experimental() // untriaged
bool has(String name) native "CSSVariablesMap_has_Callback";
@DomName('CSSVariablesMap.set')
@DocsEditable()
@Experimental() // untriaged
void set(String name, String value) native "CSSVariablesMap_set_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSViewportRule')
@Experimental() // untriaged
class CssViewportRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssViewportRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSViewportRule.style')
@DocsEditable()
@Experimental() // untriaged
CssStyleDeclaration get style native "CSSViewportRule_style_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('CustomEvent')
class CustomEvent extends Event {
factory CustomEvent(String type,
{bool canBubble: true, bool cancelable: true, Object detail}) {
final CustomEvent e = document._createEvent('CustomEvent');
e._initCustomEvent(type, canBubble, cancelable, detail);
return e;
}
// To suppress missing implicit constructor warnings.
factory CustomEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('CustomEvent.detail')
@DocsEditable()
Object get detail native "CustomEvent_detail_Getter";
@DomName('CustomEvent.initCustomEvent')
@DocsEditable()
void _initCustomEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object detailArg) native "CustomEvent_initCustomEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLDListElement')
class DListElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory DListElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLDListElement.HTMLDListElement')
@DocsEditable()
factory DListElement() => document.$dom_createElement("dl");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLDataListElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
class DataListElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory DataListElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLDataListElement.HTMLDataListElement')
@DocsEditable()
factory DataListElement() => document.$dom_createElement("datalist");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLDataListElement.options')
@DocsEditable()
HtmlCollection get options native "HTMLDataListElement_options_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Clipboard')
class DataTransfer extends NativeFieldWrapperClass1 {
@DomName('Clipboard.dropEffect')
@DocsEditable()
String get dropEffect native "Clipboard_dropEffect_Getter";
@DomName('Clipboard.dropEffect')
@DocsEditable()
void set dropEffect(String value) native "Clipboard_dropEffect_Setter";
@DomName('Clipboard.effectAllowed')
@DocsEditable()
String get effectAllowed native "Clipboard_effectAllowed_Getter";
@DomName('Clipboard.effectAllowed')
@DocsEditable()
void set effectAllowed(String value) native "Clipboard_effectAllowed_Setter";
@DomName('Clipboard.files')
@DocsEditable()
List<File> get files native "Clipboard_files_Getter";
@DomName('Clipboard.items')
@DocsEditable()
DataTransferItemList get items native "Clipboard_items_Getter";
@DomName('Clipboard.types')
@DocsEditable()
List get types native "Clipboard_types_Getter";
@DomName('Clipboard.clearData')
@DocsEditable()
void clearData([String type]) native "Clipboard_clearData_Callback";
/**
* Gets the data for the specified type.
*
* The data is only available from within a drop operation (such as an
* [Element.onDrop] event) and will return `null` before the event is
* triggered.
*
* Data transfer is prohibited across domains. If a drag originates
* from content from another domain or protocol (HTTP vs HTTPS) then the
* data cannot be accessed.
*
* The [type] can have values such as:
*
* * `'Text'`
* * `'URL'`
*/
@DomName('Clipboard.getData')
@DocsEditable()
String getData(String type) native "Clipboard_getData_Callback";
@DomName('Clipboard.setData')
@DocsEditable()
bool setData(String type, String data) native "Clipboard_setData_Callback";
@DomName('Clipboard.setDragImage')
@DocsEditable()
void setDragImage(Element element, int x, int y) native "Clipboard_setDragImage_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DataTransferItem')
// http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html#the-datatransferitem-interface
@Experimental()
class DataTransferItem extends NativeFieldWrapperClass1 {
@DomName('DataTransferItem.kind')
@DocsEditable()
String get kind native "DataTransferItem_kind_Getter";
@DomName('DataTransferItem.type')
@DocsEditable()
String get type native "DataTransferItem_type_Getter";
@DomName('DataTransferItem.getAsFile')
@DocsEditable()
Blob getAsFile() native "DataTransferItem_getAsFile_Callback";
@DomName('DataTransferItem.getAsString')
@DocsEditable()
void _getAsString(_StringCallback callback) native "DataTransferItem_getAsString_Callback";
Future<String> getAsString() {
var completer = new Completer<String>();
_getAsString(
(value) { completer.complete(value); });
return completer.future;
}
@DomName('DataTransferItem.webkitGetAsEntry')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
Entry getAsEntry() native "DataTransferItem_webkitGetAsEntry_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DataTransferItemList')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitemlist-interface
@Experimental()
class DataTransferItemList extends NativeFieldWrapperClass1 {
@DomName('DataTransferItemList.length')
@DocsEditable()
int get length native "DataTransferItemList_length_Getter";
@DomName('DataTransferItemList.__getter__')
@DocsEditable()
@Experimental() // untriaged
DataTransferItem __getter__(int index) native "DataTransferItemList___getter___Callback";
DataTransferItem add(data_OR_file, [String type]) {
if ((data_OR_file is File || data_OR_file == null) && type == null) {
return _add_1(data_OR_file);
}
if ((type is String || type == null) && (data_OR_file is String || data_OR_file == null)) {
return _add_2(data_OR_file, type);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
DataTransferItem _add_1(data_OR_file) native "DataTransferItemList__add_1_Callback";
DataTransferItem _add_2(data_OR_file, type) native "DataTransferItemList__add_2_Callback";
@DomName('DataTransferItemList.addData')
@DocsEditable()
DataTransferItem addData(String data, String type) native "DataTransferItemList_addData_Callback";
@DomName('DataTransferItemList.addFile')
@DocsEditable()
DataTransferItem addFile(File file) native "DataTransferItemList_addFile_Callback";
@DomName('DataTransferItemList.clear')
@DocsEditable()
void clear() native "DataTransferItemList_clear_Callback";
@DomName('DataTransferItemList.remove')
@DocsEditable()
@Experimental() // untriaged
void remove(int index) native "DataTransferItemList_remove_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('DatabaseCallback')
// http://www.w3.org/TR/webdatabase/#databasecallback
@Experimental() // deprecated
typedef void DatabaseCallback(database);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DedicatedWorkerGlobalScope')
@Experimental() // untriaged
class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
// To suppress missing implicit constructor warnings.
factory DedicatedWorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
@DomName('DedicatedWorkerGlobalScope.messageEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('DedicatedWorkerGlobalScope.postMessage')
@DocsEditable()
@Experimental() // untriaged
void postMessage(Object message, [List messagePorts]) native "DedicatedWorkerGlobalScope_postMessage_Callback";
@DomName('DedicatedWorkerGlobalScope.onmessage')
@DocsEditable()
@Experimental() // untriaged
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLDetailsElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
class DetailsElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory DetailsElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLDetailsElement.HTMLDetailsElement')
@DocsEditable()
factory DetailsElement() => document.$dom_createElement("details");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLDetailsElement.open')
@DocsEditable()
bool get open native "HTMLDetailsElement_open_Getter";
@DomName('HTMLDetailsElement.open')
@DocsEditable()
void set open(bool value) native "HTMLDetailsElement_open_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DeviceAcceleration')
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
class DeviceAcceleration extends NativeFieldWrapperClass1 {
@DomName('DeviceAcceleration.x')
@DocsEditable()
double get x native "DeviceAcceleration_x_Getter";
@DomName('DeviceAcceleration.y')
@DocsEditable()
double get y native "DeviceAcceleration_y_Getter";
@DomName('DeviceAcceleration.z')
@DocsEditable()
double get z native "DeviceAcceleration_z_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DeviceMotionEvent')
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
class DeviceMotionEvent extends Event {
// To suppress missing implicit constructor warnings.
factory DeviceMotionEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('DeviceMotionEvent.acceleration')
@DocsEditable()
DeviceAcceleration get acceleration native "DeviceMotionEvent_acceleration_Getter";
@DomName('DeviceMotionEvent.accelerationIncludingGravity')
@DocsEditable()
DeviceAcceleration get accelerationIncludingGravity native "DeviceMotionEvent_accelerationIncludingGravity_Getter";
@DomName('DeviceMotionEvent.interval')
@DocsEditable()
double get interval native "DeviceMotionEvent_interval_Getter";
@DomName('DeviceMotionEvent.rotationRate')
@DocsEditable()
DeviceRotationRate get rotationRate native "DeviceMotionEvent_rotationRate_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('DeviceOrientationEvent')
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
class DeviceOrientationEvent extends Event {
factory DeviceOrientationEvent(String type,
{bool canBubble: true, bool cancelable: true, num alpha: 0, num beta: 0,
num gamma: 0, bool absolute: false}) {
var e = document._createEvent("DeviceOrientationEvent");
e._initDeviceOrientationEvent(type, canBubble, cancelable, alpha, beta,
gamma, absolute);
return e;
}
// To suppress missing implicit constructor warnings.
factory DeviceOrientationEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('DeviceOrientationEvent.absolute')
@DocsEditable()
bool get absolute native "DeviceOrientationEvent_absolute_Getter";
@DomName('DeviceOrientationEvent.alpha')
@DocsEditable()
double get alpha native "DeviceOrientationEvent_alpha_Getter";
@DomName('DeviceOrientationEvent.beta')
@DocsEditable()
double get beta native "DeviceOrientationEvent_beta_Getter";
@DomName('DeviceOrientationEvent.gamma')
@DocsEditable()
double get gamma native "DeviceOrientationEvent_gamma_Getter";
@DomName('DeviceOrientationEvent.initDeviceOrientationEvent')
@DocsEditable()
void _initDeviceOrientationEvent(String type, bool bubbles, bool cancelable, num alpha, num beta, num gamma, bool absolute) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DeviceRotationRate')
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
class DeviceRotationRate extends NativeFieldWrapperClass1 {
@DomName('DeviceRotationRate.alpha')
@DocsEditable()
double get alpha native "DeviceRotationRate_alpha_Getter";
@DomName('DeviceRotationRate.beta')
@DocsEditable()
double get beta native "DeviceRotationRate_beta_Getter";
@DomName('DeviceRotationRate.gamma')
@DocsEditable()
double get gamma native "DeviceRotationRate_gamma_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLDialogElement')
@Unstable()
class DialogElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory DialogElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLDialogElement.open')
@DocsEditable()
bool get open native "HTMLDialogElement_open_Getter";
@DomName('HTMLDialogElement.open')
@DocsEditable()
void set open(bool value) native "HTMLDialogElement_open_Setter";
@DomName('HTMLDialogElement.returnValue')
@DocsEditable()
@Experimental() // untriaged
String get returnValue native "HTMLDialogElement_returnValue_Getter";
@DomName('HTMLDialogElement.returnValue')
@DocsEditable()
@Experimental() // untriaged
void set returnValue(String value) native "HTMLDialogElement_returnValue_Setter";
@DomName('HTMLDialogElement.close')
@DocsEditable()
void close(String returnValue) native "HTMLDialogElement_close_Callback";
@DomName('HTMLDialogElement.show')
@DocsEditable()
void show() native "HTMLDialogElement_show_Callback";
@DomName('HTMLDialogElement.showModal')
@DocsEditable()
void showModal() native "HTMLDialogElement_showModal_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('DirectoryEntry')
// http://www.w3.org/TR/file-system-api/#the-directoryentry-interface
@Experimental()
class DirectoryEntry extends Entry {
/**
* Create a new directory with the specified `path`. If `exclusive` is true,
* the returned Future will complete with an error if a directory already
* exists with the specified `path`.
*/
Future<Entry> createDirectory(String path, {bool exclusive: false}) {
return _getDirectory(path, options:
{'create': true, 'exclusive': exclusive});
}
/**
* Retrieve an already existing directory entry. The returned future will
* result in an error if a directory at `path` does not exist or if the item
* at `path` is not a directory.
*/
Future<Entry> getDirectory(String path) {
return _getDirectory(path);
}
/**
* Create a new file with the specified `path`. If `exclusive` is true,
* the returned Future will complete with an error if a file already
* exists at the specified `path`.
*/
Future<Entry> createFile(String path, {bool exclusive: false}) {
return _getFile(path, options: {'create': true, 'exclusive': exclusive});
}
/**
* Retrieve an already existing file entry. The returned future will
* result in an error if a file at `path` does not exist or if the item at
* `path` is not a file.
*/
Future<Entry> getFile(String path) {
return _getFile(path);
}
// To suppress missing implicit constructor warnings.
factory DirectoryEntry._() { throw new UnsupportedError("Not supported"); }
@DomName('DirectoryEntry.createReader')
@DocsEditable()
DirectoryReader createReader() native "DirectoryEntry_createReader_Callback";
@DomName('DirectoryEntry.getDirectory')
@DocsEditable()
void __getDirectory(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) native "DirectoryEntry_getDirectory_Callback";
Future<Entry> _getDirectory(String path, {Map options}) {
var completer = new Completer<Entry>();
__getDirectory(path, options : options,
successCallback : (value) { completer.complete(value); },
errorCallback : (error) { completer.completeError(error); });
return completer.future;
}
@DomName('DirectoryEntry.getFile')
@DocsEditable()
void __getFile(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) native "DirectoryEntry_getFile_Callback";
Future<Entry> _getFile(String path, {Map options}) {
var completer = new Completer<Entry>();
__getFile(path, options : options,
successCallback : (value) { completer.complete(value); },
errorCallback : (error) { completer.completeError(error); });
return completer.future;
}
@DomName('DirectoryEntry.removeRecursively')
@DocsEditable()
void _removeRecursively(VoidCallback successCallback, [_ErrorCallback errorCallback]) native "DirectoryEntry_removeRecursively_Callback";
Future removeRecursively() {
var completer = new Completer();
_removeRecursively(
() { completer.complete(); },
(error) { completer.completeError(error); });
return completer.future;
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DirectoryReader')
// http://www.w3.org/TR/file-system-api/#the-directoryreader-interface
@Experimental()
class DirectoryReader extends NativeFieldWrapperClass1 {
@DomName('DirectoryReader.readEntries')
@DocsEditable()
void _readEntries(_EntriesCallback successCallback, [_ErrorCallback errorCallback]) native "DirectoryReader_readEntries_Callback";
Future<List<Entry>> readEntries() {
var completer = new Completer<List<Entry>>();
_readEntries(
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* Represents an HTML <div> element.
*
* The [DivElement] is a generic container for content and does not have any
* special significance. It is functionally similar to [SpanElement].
*
* The [DivElement] is a block-level element, as opposed to [SpanElement],
* which is an inline-level element.
*
* Example usage:
*
* DivElement div = new DivElement();
* div.text = 'Here's my new DivElem
* document.body.elements.add(elem);
*
* See also:
*
* * [HTML <div> element](http://www.w3.org/TR/html-markup/div.html) from W3C.
* * [Block-level element](http://www.w3.org/TR/CSS2/visuren.html#block-boxes) from W3C.
* * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
*/
@DomName('HTMLDivElement')
class DivElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory DivElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLDivElement.HTMLDivElement')
@DocsEditable()
factory DivElement() => document.$dom_createElement("div");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* The base class for all documents.
*
* Each web page loaded in the browser has its own [Document] object, which is
* typically an [HtmlDocument].
*
* If you aren't comfortable with DOM concepts, see the Dart tutorial
* [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connect-dart-html/).
*/
@DomName('Document')
class Document extends Node
{
// To suppress missing implicit constructor warnings.
factory Document._() { throw new UnsupportedError("Not supported"); }
@DomName('Document.readystatechangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> readyStateChangeEvent = const EventStreamProvider<Event>('readystatechange');
@DomName('Document.securitypolicyviolationEvent')
@DocsEditable()
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#widl-Document-onsecuritypolicyviolation
@Experimental()
static const EventStreamProvider<SecurityPolicyViolationEvent> securityPolicyViolationEvent = const EventStreamProvider<SecurityPolicyViolationEvent>('securitypolicyviolation');
@DomName('Document.selectionchangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> selectionChangeEvent = const EventStreamProvider<Event>('selectionchange');
@DomName('Document.webkitpointerlockchangeEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Document-onpointerlockchange
static const EventStreamProvider<Event> pointerLockChangeEvent = const EventStreamProvider<Event>('webkitpointerlockchange');
@DomName('Document.webkitpointerlockerrorEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Document-onpointerlockerror
static const EventStreamProvider<Event> pointerLockErrorEvent = const EventStreamProvider<Event>('webkitpointerlockerror');
@DomName('Document.body')
@DocsEditable()
HtmlElement get _body native "Document_body_Getter";
@DomName('Document.body')
@DocsEditable()
void set _body(HtmlElement value) native "Document_body_Setter";
@DomName('Document.charset')
@DocsEditable()
@deprecated // nonstandard
String get charset native "Document_charset_Getter";
@DomName('Document.charset')
@DocsEditable()
@deprecated // nonstandard
void set charset(String value) native "Document_charset_Setter";
@DomName('Document.cookie')
@DocsEditable()
String get cookie native "Document_cookie_Getter";
@DomName('Document.cookie')
@DocsEditable()
void set cookie(String value) native "Document_cookie_Setter";
@DomName('Document.currentScript')
@DocsEditable()
@Experimental() // untriaged
ScriptElement get currentScript native "Document_currentScript_Getter";
@DomName('Document.defaultView')
@DocsEditable()
WindowBase get window native "Document_defaultView_Getter";
@DomName('Document.documentElement')
@DocsEditable()
Element get documentElement native "Document_documentElement_Getter";
@DomName('Document.domain')
@DocsEditable()
String get domain native "Document_domain_Getter";
@DomName('Document.fontloader')
@DocsEditable()
// http://www.w3.org/TR/css3-fonts/#document-fontloader
@Experimental()
FontLoader get fontloader native "Document_fontloader_Getter";
@DomName('Document.head')
@DocsEditable()
HeadElement get _head native "Document_head_Getter";
@DomName('Document.implementation')
@DocsEditable()
DomImplementation get implementation native "Document_implementation_Getter";
@DomName('Document.lastModified')
@DocsEditable()
String get _lastModified native "Document_lastModified_Getter";
@DomName('Document.preferredStylesheetSet')
@DocsEditable()
String get _preferredStylesheetSet native "Document_preferredStylesheetSet_Getter";
@DomName('Document.readyState')
@DocsEditable()
String get readyState native "Document_readyState_Getter";
@DomName('Document.referrer')
@DocsEditable()
String get _referrer native "Document_referrer_Getter";
@DomName('Document.securityPolicy')
@DocsEditable()
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#idl-def-SecurityPolicy
@Experimental()
SecurityPolicy get securityPolicy native "Document_securityPolicy_Getter";
@DomName('Document.selectedStylesheetSet')
@DocsEditable()
String get _selectedStylesheetSet native "Document_selectedStylesheetSet_Getter";
@DomName('Document.selectedStylesheetSet')
@DocsEditable()
void set _selectedStylesheetSet(String value) native "Document_selectedStylesheetSet_Setter";
@DomName('Document.styleSheets')
@DocsEditable()
List<StyleSheet> get _styleSheets native "Document_styleSheets_Getter";
@DomName('Document.title')
@DocsEditable()
String get _title native "Document_title_Getter";
@DomName('Document.title')
@DocsEditable()
void set _title(String value) native "Document_title_Setter";
@DomName('Document.webkitFullscreenElement')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-document-fullscreenelement
Element get _webkitFullscreenElement native "Document_webkitFullscreenElement_Getter";
@DomName('Document.webkitFullscreenEnabled')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-document-fullscreenenabled
bool get _webkitFullscreenEnabled native "Document_webkitFullscreenEnabled_Getter";
@DomName('Document.webkitHidden')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#document
bool get _webkitHidden native "Document_webkitHidden_Getter";
@DomName('Document.webkitIsFullScreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@deprecated // deprecated
bool get _webkitIsFullScreen native "Document_webkitIsFullScreen_Getter";
@DomName('Document.webkitPointerLockElement')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Document-pointerLockElement
Element get _webkitPointerLockElement native "Document_webkitPointerLockElement_Getter";
@DomName('Document.webkitVisibilityState')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#dom-document-visibilitystate
String get _webkitVisibilityState native "Document_webkitVisibilityState_Getter";
@DomName('Document.adoptNode')
@DocsEditable()
Node adoptNode(Node source) native "Document_adoptNode_Callback";
@DomName('Document.caretRangeFromPoint')
@DocsEditable()
// http://www.w3.org/TR/2009/WD-cssom-view-20090804/#dom-documentview-caretrangefrompoint
@Experimental()
Range _caretRangeFromPoint(int x, int y) native "Document_caretRangeFromPoint_Callback";
@DomName('Document.createCDATASection')
@DocsEditable()
// http://dom.spec.whatwg.org/#dom-document-createcdatasection
@deprecated // deprecated
CDataSection createCDataSection(String data) native "Document_createCDATASection_Callback";
@DomName('Document.createDocumentFragment')
@DocsEditable()
DocumentFragment createDocumentFragment() native "Document_createDocumentFragment_Callback";
Element $dom_createElement(String localName_OR_tagName, [String typeExtension]) {
if ((localName_OR_tagName is String || localName_OR_tagName == null) && typeExtension == null) {
return _createElement_1(localName_OR_tagName);
}
if ((typeExtension is String || typeExtension == null) && (localName_OR_tagName is String || localName_OR_tagName == null)) {
return _createElement_2(localName_OR_tagName, typeExtension);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
Element _createElement_1(localName_OR_tagName) native "Document__createElement_1_Callback";
Element _createElement_2(localName_OR_tagName, typeExtension) native "Document__createElement_2_Callback";
Element $dom_createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) {
if ((qualifiedName is String || qualifiedName == null) && (namespaceURI is String || namespaceURI == null) && typeExtension == null) {
return _createElementNS_1(namespaceURI, qualifiedName);
}
if ((typeExtension is String || typeExtension == null) && (qualifiedName is String || qualifiedName == null) && (namespaceURI is String || namespaceURI == null)) {
return _createElementNS_2(namespaceURI, qualifiedName, typeExtension);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
Element _createElementNS_1(namespaceURI, qualifiedName) native "Document__createElementNS_1_Callback";
Element _createElementNS_2(namespaceURI, qualifiedName, typeExtension) native "Document__createElementNS_2_Callback";
@DomName('Document.createEvent')
@DocsEditable()
Event _createEvent(String eventType) native "Document_createEvent_Callback";
NodeIterator _createNodeIterator(Node root, [int whatToShow, NodeFilter filter, bool expandEntityReferences]) {
if (expandEntityReferences != null) {
return _createNodeIterator_1(root, whatToShow, filter, expandEntityReferences);
}
if (filter != null) {
return _createNodeIterator_2(root, whatToShow, filter);
}
if (whatToShow != null) {
return _createNodeIterator_3(root, whatToShow);
}
return _createNodeIterator_4(root);
}
NodeIterator _createNodeIterator_1(root, whatToShow, filter, expandEntityReferences) native "Document__createNodeIterator_1_Callback";
NodeIterator _createNodeIterator_2(root, whatToShow, filter) native "Document__createNodeIterator_2_Callback";
NodeIterator _createNodeIterator_3(root, whatToShow) native "Document__createNodeIterator_3_Callback";
NodeIterator _createNodeIterator_4(root) native "Document__createNodeIterator_4_Callback";
@DomName('Document.createRange')
@DocsEditable()
Range createRange() native "Document_createRange_Callback";
@DomName('Document.createTextNode')
@DocsEditable()
Text _createTextNode(String data) native "Document_createTextNode_Callback";
@DomName('Document.createTouch')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Touch _createTouch(Window window, EventTarget target, int identifier, int pageX, int pageY, int screenX, int screenY, int webkitRadiusX, int webkitRadiusY, num webkitRotationAngle, num webkitForce) native "Document_createTouch_Callback";
@DomName('Document.createTouchList')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
TouchList _createTouchList() native "Document_createTouchList_Callback";
TreeWalker _createTreeWalker(Node root, [int whatToShow, NodeFilter filter, bool expandEntityReferences]) {
if (expandEntityReferences != null) {
return _createTreeWalker_1(root, whatToShow, filter, expandEntityReferences);
}
if (filter != null) {
return _createTreeWalker_2(root, whatToShow, filter);
}
if (whatToShow != null) {
return _createTreeWalker_3(root, whatToShow);
}
return _createTreeWalker_4(root);
}
TreeWalker _createTreeWalker_1(root, whatToShow, filter, expandEntityReferences) native "Document__createTreeWalker_1_Callback";
TreeWalker _createTreeWalker_2(root, whatToShow, filter) native "Document__createTreeWalker_2_Callback";
TreeWalker _createTreeWalker_3(root, whatToShow) native "Document__createTreeWalker_3_Callback";
TreeWalker _createTreeWalker_4(root) native "Document__createTreeWalker_4_Callback";
@DomName('Document.elementFromPoint')
@DocsEditable()
Element _elementFromPoint(int x, int y) native "Document_elementFromPoint_Callback";
@DomName('Document.execCommand')
@DocsEditable()
bool execCommand(String command, bool userInterface, String value) native "Document_execCommand_Callback";
@DomName('Document.getCSSCanvasContext')
@DocsEditable()
// https://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html
@Experimental() // non-standard
CanvasRenderingContext _getCssCanvasContext(String contextId, String name, int width, int height) native "Document_getCSSCanvasContext_Callback";
@DomName('Document.getElementById')
@DocsEditable()
Element getElementById(String elementId) native "Document_getElementById_Callback";
@DomName('Document.getElementsByClassName')
@DocsEditable()
List<Node> getElementsByClassName(String tagname) native "Document_getElementsByClassName_Callback";
@DomName('Document.getElementsByName')
@DocsEditable()
List<Node> getElementsByName(String elementName) native "Document_getElementsByName_Callback";
@DomName('Document.getElementsByTagName')
@DocsEditable()
List<Node> getElementsByTagName(String tagname) native "Document_getElementsByTagName_Callback";
Node importNode(Node importedNode, [bool deep]) {
if (deep != null) {
return _importNode_1(importedNode, deep);
}
return _importNode_2(importedNode);
}
Node _importNode_1(importedNode, deep) native "Document__importNode_1_Callback";
Node _importNode_2(importedNode) native "Document__importNode_2_Callback";
@DomName('Document.queryCommandEnabled')
@DocsEditable()
bool queryCommandEnabled(String command) native "Document_queryCommandEnabled_Callback";
@DomName('Document.queryCommandIndeterm')
@DocsEditable()
bool queryCommandIndeterm(String command) native "Document_queryCommandIndeterm_Callback";
@DomName('Document.queryCommandState')
@DocsEditable()
bool queryCommandState(String command) native "Document_queryCommandState_Callback";
@DomName('Document.queryCommandSupported')
@DocsEditable()
bool queryCommandSupported(String command) native "Document_queryCommandSupported_Callback";
@DomName('Document.queryCommandValue')
@DocsEditable()
String queryCommandValue(String command) native "Document_queryCommandValue_Callback";
/**
* Finds the first descendant element of this document that matches the
* specified group of selectors.
*
* Unless your webpage contains multiple documents, the top-level query
* method behaves the same as this method, so you should use it instead to
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
* var element1 = document.query('.className');
* var element2 = document.query('#id');
*
* For details about CSS selector syntax, see the
* [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
@DomName('Document.querySelector')
@DocsEditable()
Element query(String selectors) native "Document_querySelector_Callback";
@DomName('Document.querySelectorAll')
@DocsEditable()
List<Node> _querySelectorAll(String selectors) native "Document_querySelectorAll_Callback";
@DomName('Document.webkitCancelFullScreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@deprecated // deprecated
void _webkitCancelFullScreen() native "Document_webkitCancelFullScreen_Callback";
@DomName('Document.webkitExitFullscreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-document-exitfullscreen
void _webkitExitFullscreen() native "Document_webkitExitFullscreen_Callback";
@DomName('Document.webkitExitPointerLock')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Document-exitPointerLock-void
void _webkitExitPointerLock() native "Document_webkitExitPointerLock_Callback";
@DomName('Document.webkitGetNamedFlows')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/css3-regions/#dom-named-flow-collection
NamedFlowCollection getNamedFlows() native "Document_webkitGetNamedFlows_Callback";
@DomName('Document.childElementCount')
@DocsEditable()
int get _childElementCount native "Document_childElementCount_Getter";
@DomName('Document.children')
@DocsEditable()
HtmlCollection get _children native "Document_children_Getter";
@DomName('Document.firstElementChild')
@DocsEditable()
Element get _firstElementChild native "Document_firstElementChild_Getter";
@DomName('Document.lastElementChild')
@DocsEditable()
Element get _lastElementChild native "Document_lastElementChild_Getter";
@DomName('Document.onabort')
@DocsEditable()
Stream<Event> get onAbort => Element.abortEvent.forTarget(this);
@DomName('Document.onbeforecopy')
@DocsEditable()
Stream<Event> get onBeforeCopy => Element.beforeCopyEvent.forTarget(this);
@DomName('Document.onbeforecut')
@DocsEditable()
Stream<Event> get onBeforeCut => Element.beforeCutEvent.forTarget(this);
@DomName('Document.onbeforepaste')
@DocsEditable()
Stream<Event> get onBeforePaste => Element.beforePasteEvent.forTarget(this);
@DomName('Document.onblur')
@DocsEditable()
Stream<Event> get onBlur => Element.blurEvent.forTarget(this);
@DomName('Document.onchange')
@DocsEditable()
Stream<Event> get onChange => Element.changeEvent.forTarget(this);
@DomName('Document.onclick')
@DocsEditable()
Stream<MouseEvent> get onClick => Element.clickEvent.forTarget(this);
@DomName('Document.oncontextmenu')
@DocsEditable()
Stream<MouseEvent> get onContextMenu => Element.contextMenuEvent.forTarget(this);
@DomName('Document.oncopy')
@DocsEditable()
Stream<Event> get onCopy => Element.copyEvent.forTarget(this);
@DomName('Document.oncut')
@DocsEditable()
Stream<Event> get onCut => Element.cutEvent.forTarget(this);
@DomName('Document.ondblclick')
@DocsEditable()
Stream<Event> get onDoubleClick => Element.doubleClickEvent.forTarget(this);
@DomName('Document.ondrag')
@DocsEditable()
Stream<MouseEvent> get onDrag => Element.dragEvent.forTarget(this);
@DomName('Document.ondragend')
@DocsEditable()
Stream<MouseEvent> get onDragEnd => Element.dragEndEvent.forTarget(this);
@DomName('Document.ondragenter')
@DocsEditable()
Stream<MouseEvent> get onDragEnter => Element.dragEnterEvent.forTarget(this);
@DomName('Document.ondragleave')
@DocsEditable()
Stream<MouseEvent> get onDragLeave => Element.dragLeaveEvent.forTarget(this);
@DomName('Document.ondragover')
@DocsEditable()
Stream<MouseEvent> get onDragOver => Element.dragOverEvent.forTarget(this);
@DomName('Document.ondragstart')
@DocsEditable()
Stream<MouseEvent> get onDragStart => Element.dragStartEvent.forTarget(this);
@DomName('Document.ondrop')
@DocsEditable()
Stream<MouseEvent> get onDrop => Element.dropEvent.forTarget(this);
@DomName('Document.onerror')
@DocsEditable()
Stream<Event> get onError => Element.errorEvent.forTarget(this);
@DomName('Document.onfocus')
@DocsEditable()
Stream<Event> get onFocus => Element.focusEvent.forTarget(this);
@DomName('Document.oninput')
@DocsEditable()
Stream<Event> get onInput => Element.inputEvent.forTarget(this);
@DomName('Document.oninvalid')
@DocsEditable()
Stream<Event> get onInvalid => Element.invalidEvent.forTarget(this);
@DomName('Document.onkeydown')
@DocsEditable()
Stream<KeyboardEvent> get onKeyDown => Element.keyDownEvent.forTarget(this);
@DomName('Document.onkeypress')
@DocsEditable()
Stream<KeyboardEvent> get onKeyPress => Element.keyPressEvent.forTarget(this);
@DomName('Document.onkeyup')
@DocsEditable()
Stream<KeyboardEvent> get onKeyUp => Element.keyUpEvent.forTarget(this);
@DomName('Document.onload')
@DocsEditable()
Stream<Event> get onLoad => Element.loadEvent.forTarget(this);
@DomName('Document.onmousedown')
@DocsEditable()
Stream<MouseEvent> get onMouseDown => Element.mouseDownEvent.forTarget(this);
@DomName('Document.onmouseenter')
@DocsEditable()
@Experimental() // untriaged
Stream<MouseEvent> get onMouseEnter => Element.mouseEnterEvent.forTarget(this);
@DomName('Document.onmouseleave')
@DocsEditable()
@Experimental() // untriaged
Stream<MouseEvent> get onMouseLeave => Element.mouseLeaveEvent.forTarget(this);
@DomName('Document.onmousemove')
@DocsEditable()
Stream<MouseEvent> get onMouseMove => Element.mouseMoveEvent.forTarget(this);
@DomName('Document.onmouseout')
@DocsEditable()
Stream<MouseEvent> get onMouseOut => Element.mouseOutEvent.forTarget(this);
@DomName('Document.onmouseover')
@DocsEditable()
Stream<MouseEvent> get onMouseOver => Element.mouseOverEvent.forTarget(this);
@DomName('Document.onmouseup')
@DocsEditable()
Stream<MouseEvent> get onMouseUp => Element.mouseUpEvent.forTarget(this);
@DomName('Document.onmousewheel')
@DocsEditable()
Stream<WheelEvent> get onMouseWheel => Element.mouseWheelEvent.forTarget(this);
@DomName('Document.onpaste')
@DocsEditable()
Stream<Event> get onPaste => Element.pasteEvent.forTarget(this);
@DomName('Document.onreadystatechange')
@DocsEditable()
Stream<Event> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
@DomName('Document.onreset')
@DocsEditable()
Stream<Event> get onReset => Element.resetEvent.forTarget(this);
@DomName('Document.onscroll')
@DocsEditable()
Stream<Event> get onScroll => Element.scrollEvent.forTarget(this);
@DomName('Document.onsearch')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
Stream<Event> get onSearch => Element.searchEvent.forTarget(this);
@DomName('Document.onsecuritypolicyviolation')
@DocsEditable()
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#widl-Document-onsecuritypolicyviolation
@Experimental()
Stream<SecurityPolicyViolationEvent> get onSecurityPolicyViolation => securityPolicyViolationEvent.forTarget(this);
@DomName('Document.onselect')
@DocsEditable()
Stream<Event> get onSelect => Element.selectEvent.forTarget(this);
@DomName('Document.onselectionchange')
@DocsEditable()
Stream<Event> get onSelectionChange => selectionChangeEvent.forTarget(this);
@DomName('Document.onselectstart')
@DocsEditable()
Stream<Event> get onSelectStart => Element.selectStartEvent.forTarget(this);
@DomName('Document.onsubmit')
@DocsEditable()
Stream<Event> get onSubmit => Element.submitEvent.forTarget(this);
@DomName('Document.ontouchcancel')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchCancel => Element.touchCancelEvent.forTarget(this);
@DomName('Document.ontouchend')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchEnd => Element.touchEndEvent.forTarget(this);
@DomName('Document.ontouchmove')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchMove => Element.touchMoveEvent.forTarget(this);
@DomName('Document.ontouchstart')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchStart => Element.touchStartEvent.forTarget(this);
@DomName('Document.onwebkitfullscreenchange')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
Stream<Event> get onFullscreenChange => Element.fullscreenChangeEvent.forTarget(this);
@DomName('Document.onwebkitfullscreenerror')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
Stream<Event> get onFullscreenError => Element.fullscreenErrorEvent.forTarget(this);
@DomName('Document.onwebkitpointerlockchange')
@DocsEditable()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Document-onpointerlockchange
@Experimental()
Stream<Event> get onPointerLockChange => pointerLockChangeEvent.forTarget(this);
@DomName('Document.onwebkitpointerlockerror')
@DocsEditable()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Document-onpointerlockerror
@Experimental()
Stream<Event> get onPointerLockError => pointerLockErrorEvent.forTarget(this);
/**
* Finds all descendant elements of this document that match the specified
* group of selectors.
*
* Unless your webpage contains multiple documents, the top-level queryAll
* method behaves the same as this method, so you should use it instead to
* save typing a few characters.
*
* [selectors] should be a string using CSS selector syntax.
* var items = document.queryAll('.itemClassName');
*
* For details about CSS selector syntax, see the
* [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
ElementList queryAll(String selectors) {
return new _FrozenElementList._wrap(_querySelectorAll(selectors));
}
/// Checks if [register] is supported on the current platform.
bool get supportsRegister {
return true;
}
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('DocumentFragment')
class DocumentFragment extends Node implements ParentNode {
factory DocumentFragment() => document.createDocumentFragment();
factory DocumentFragment.html(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
return document.body.createFragment(html,
validator: validator, treeSanitizer: treeSanitizer);
}
factory DocumentFragment.svg(String svgContent,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
return new svg.SvgSvgElement().createFragment(svgContent,
validator: validator, treeSanitizer: treeSanitizer);
}
List<Element> _children;
List<Element> get children {
if (_children == null) {
_children = new FilteredElementList(this);
}
return _children;
}
void set children(List<Element> value) {
// Copy list first since we don't want liveness during iteration.
List copy = new List.from(value);
var children = this.children;
children.clear();
children.addAll(copy);
}
Element query(String selectors) => _querySelector(selectors);
List<Element> queryAll(String selectors) =>
new _FrozenElementList._wrap(_querySelectorAll(selectors));
String get innerHtml {
final e = new Element.tag("div");
e.append(this.clone(true));
return e.innerHtml;
}
void set innerHtml(String value) {
this.setInnerHtml(value);
}
void setInnerHtml(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
this.nodes.clear();
append(document.body.createFragment(
html, validator: validator, treeSanitizer: treeSanitizer));
}
/**
* Adds the specified text as a text node after the last child of this
* document fragment.
*/
void appendText(String text) {
this.append(new Text(text));
}
/**
* Parses the specified text as HTML and adds the resulting node after the
* last child of this document fragment.
*/
void appendHtml(String text) {
this.append(new DocumentFragment.html(text));
}
// To suppress missing implicit constructor warnings.
factory DocumentFragment._() { throw new UnsupportedError("Not supported"); }
@DomName('DocumentFragment.querySelector')
@DocsEditable()
Element _querySelector(String selectors) native "DocumentFragment_querySelector_Callback";
@DomName('DocumentFragment.querySelectorAll')
@DocsEditable()
List<Node> _querySelectorAll(String selectors) native "DocumentFragment_querySelectorAll_Callback";
@DomName('DocumentFragment.childElementCount')
@DocsEditable()
int get _childElementCount native "DocumentFragment_childElementCount_Getter";
@DomName('DocumentFragment.firstElementChild')
@DocsEditable()
Element get _firstElementChild native "DocumentFragment_firstElementChild_Getter";
@DomName('DocumentFragment.lastElementChild')
@DocsEditable()
Element get _lastElementChild native "DocumentFragment_lastElementChild_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DocumentType')
// http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
@deprecated // stable
class DocumentType extends Node implements ChildNode {
// To suppress missing implicit constructor warnings.
factory DocumentType._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMError')
class DomError extends NativeFieldWrapperClass1 {
@DomName('DOMError.message')
@DocsEditable()
@Experimental() // untriaged
String get message native "DOMError_message_Getter";
@DomName('DOMError.name')
@DocsEditable()
String get name native "DOMError_name_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('DOMException')
@Unstable()
class DomException extends NativeFieldWrapperClass1 {
static const String INDEX_SIZE = 'IndexSizeError';
static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
static const String WRONG_DOCUMENT = 'WrongDocumentError';
static const String INVALID_CHARACTER = 'InvalidCharacterError';
static const String NO_MODIFICATION_ALLOWED = 'NoModificationAllowedError';
static const String NOT_FOUND = 'NotFoundError';
static const String NOT_SUPPORTED = 'NotSupportedError';
static const String INVALID_STATE = 'InvalidStateError';
static const String SYNTAX = 'SyntaxError';
static const String INVALID_MODIFICATION = 'InvalidModificationError';
static const String NAMESPACE = 'NamespaceError';
static const String INVALID_ACCESS = 'InvalidAccessError';
static const String TYPE_MISMATCH = 'TypeMismatchError';
static const String SECURITY = 'SecurityError';
static const String NETWORK = 'NetworkError';
static const String ABORT = 'AbortError';
static const String URL_MISMATCH = 'URLMismatchError';
static const String QUOTA_EXCEEDED = 'QuotaExceededError';
static const String TIMEOUT = 'TimeoutError';
static const String INVALID_NODE_TYPE = 'InvalidNodeTypeError';
static const String DATA_CLONE = 'DataCloneError';
@DomName('DOMException.message')
@DocsEditable()
String get message native "DOMException_message_Getter";
@DomName('DOMException.name')
@DocsEditable()
String get name native "DOMException_name_Getter";
@DomName('DOMException.toString')
@DocsEditable()
String toString() native "DOMException_toString_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMImplementation')
class DomImplementation extends NativeFieldWrapperClass1 {
@DomName('DOMImplementation.createCSSStyleSheet')
@DocsEditable()
@Experimental() // non-standard
CssStyleSheet createCssStyleSheet(String title, String media) native "DOMImplementation_createCSSStyleSheet_Callback";
@DomName('DOMImplementation.createDocument')
@DocsEditable()
Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) native "DOMImplementation_createDocument_Callback";
@DomName('DOMImplementation.createDocumentType')
@DocsEditable()
DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) native "DOMImplementation_createDocumentType_Callback";
@DomName('DOMImplementation.createHTMLDocument')
@DocsEditable()
HtmlDocument createHtmlDocument(String title) native "DOMImplementation_createHTMLDocument_Callback";
@DomName('DOMImplementation.hasFeature')
@DocsEditable()
bool hasFeature(String feature, String version) native "DOMImplementation_hasFeature_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMParser')
class DomParser extends NativeFieldWrapperClass1 {
@DomName('DOMParser.DOMParser')
@DocsEditable()
factory DomParser() {
return DomParser._create_1();
}
@DocsEditable()
static DomParser _create_1() native "DOMParser__create_1constructorCallback";
@DomName('DOMParser.parseFromString')
@DocsEditable()
Document parseFromString(String str, String contentType) native "DOMParser_parseFromString_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMSettableTokenList')
class DomSettableTokenList extends DomTokenList {
// To suppress missing implicit constructor warnings.
factory DomSettableTokenList._() { throw new UnsupportedError("Not supported"); }
@DomName('DOMSettableTokenList.value')
@DocsEditable()
String get value native "DOMSettableTokenList_value_Getter";
@DomName('DOMSettableTokenList.value')
@DocsEditable()
void set value(String value) native "DOMSettableTokenList_value_Setter";
@DomName('DOMSettableTokenList.__getter__')
@DocsEditable()
String __getter__(int index) native "DOMSettableTokenList___getter___Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMStringList')
class DomStringList extends NativeFieldWrapperClass1 with ListMixin<String>, ImmutableListMixin<String> implements List<String> {
@DomName('DOMStringList.length')
@DocsEditable()
int get length native "DOMStringList_length_Getter";
String operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
String _nativeIndexedGetter(int index) native "DOMStringList_item_Callback";
void operator[]=(int index, String value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<String> mixins.
// String is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
String get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
String get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
String get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
String elementAt(int index) => this[index];
// -- end List<String> mixins.
@DomName('DOMStringList.contains')
@DocsEditable()
bool contains(String string) native "DOMStringList_contains_Callback";
@DomName('DOMStringList.item')
@DocsEditable()
String item(int index) native "DOMStringList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMStringMap')
abstract class DomStringMap extends NativeFieldWrapperClass1 {
@DomName('DOMStringMap.__delete__')
@DocsEditable()
bool __delete__(String name) native "DOMStringMap___delete___Callback";
@DomName('DOMStringMap.__getter__')
@DocsEditable()
String __getter__(String name) native "DOMStringMap___getter___Callback";
@DomName('DOMStringMap.__setter__')
@DocsEditable()
void __setter__(String name, String value) native "DOMStringMap___setter___Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMTokenList')
class DomTokenList extends NativeFieldWrapperClass1 {
@DomName('DOMTokenList.length')
@DocsEditable()
int get length native "DOMTokenList_length_Getter";
@DomName('DOMTokenList.contains')
@DocsEditable()
bool contains(String token) native "DOMTokenList_contains_Callback";
@DomName('DOMTokenList.item')
@DocsEditable()
String item(int index) native "DOMTokenList_item_Callback";
@DomName('DOMTokenList.toString')
@DocsEditable()
String toString() native "DOMTokenList_toString_Callback";
bool toggle(String token, [bool force]) {
if (force != null) {
return _toggle_1(token, force);
}
return _toggle_2(token);
}
bool _toggle_1(token, force) native "DOMTokenList__toggle_1_Callback";
bool _toggle_2(token) native "DOMTokenList__toggle_2_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class _ChildrenElementList extends ListBase<Element> {
// Raw Element.
final Element _element;
final HtmlCollection _childElements;
_ChildrenElementList._wrap(Element element)
: _childElements = element._children,
_element = element;
bool contains(Object element) => _childElements.contains(element);
bool get isEmpty {
return _element._firstElementChild == null;
}
int get length {
return _childElements.length;
}
Element operator [](int index) {
return _childElements[index];
}
void operator []=(int index, Element value) {
_element._replaceChild(value, _childElements[index]);
}
void set length(int newLength) {
// TODO(jacobr): remove children when length is reduced.
throw new UnsupportedError('Cannot resize element lists');
}
Element add(Element value) {
_element.append(value);
return value;
}
Iterator<Element> get iterator => toList().iterator;
void addAll(Iterable<Element> iterable) {
if (iterable is _ChildNodeListLazy) {
iterable = new List.from(iterable);
}
for (Element element in iterable) {
_element.append(element);
}
}
void sort([int compare(Element a, Element b)]) {
throw new UnsupportedError('Cannot sort element lists');
}
void removeWhere(bool test(Element element)) {
_filter(test, false);
}
void retainWhere(bool test(Element element)) {
_filter(test, true);
}
void _filter(bool test(var element), bool retainMatching) {
var removed;
if (retainMatching) {
removed = _element.children.where((e) => !test(e));
} else {
removed = _element.children.where(test);
}
for (var e in removed) e.remove();
}
void setRange(int start, int end, Iterable<Element> iterable,
[int skipCount = 0]) {
throw new UnimplementedError();
}
void replaceRange(int start, int end, Iterable<Element> iterable) {
throw new UnimplementedError();
}
void fillRange(int start, int end, [Element fillValue]) {
throw new UnimplementedError();
}
bool remove(Object object) {
if (object is Element) {
Element element = object;
if (identical(element.parentNode, _element)) {
_element._removeChild(element);
return true;
}
}
return false;
}
void insert(int index, Element element) {
if (index < 0 || index > length) {
throw new RangeError.range(index, 0, length);
}
if (index == length) {
_element.append(element);
} else {
_element.insertBefore(element, this[index]);
}
}
void setAll(int index, Iterable<Element> iterable) {
throw new UnimplementedError();
}
void clear() {
// It is unclear if we want to keep non element nodes?
_element.text = '';
}
Element removeAt(int index) {
final result = this[index];
if (result != null) {
_element._removeChild(result);
}
return result;
}
Element removeLast() {
final result = this.last;
if (result != null) {
_element._removeChild(result);
}
return result;
}
Element get first {
Element result = _element._firstElementChild;
if (result == null) throw new StateError("No elements");
return result;
}
Element get last {
Element result = _element._lastElementChild;
if (result == null) throw new StateError("No elements");
return result;
}
Element get single {
if (length > 1) throw new StateError("More than one element");
return first;
}
}
/**
* An immutable list containing HTML elements. This list contains some
* additional methods when compared to regular lists for ease of CSS
* manipulation on a group of elements.
*/
abstract class ElementList<T extends Element> extends ListBase<T> {
/**
* The union of all CSS classes applied to the elements in this list.
*
* This set makes it easy to add, remove or toggle (add if not present, remove
* if present) the classes applied to a collection of elements.
*
* htmlList.classes.add('selected');
* htmlList.classes.toggle('isOnline');
* htmlList.classes.remove('selected');
*/
CssClassSet get classes;
/** Replace the classes with `value` for every element in this list. */
set classes(Iterable<String> value);
/**
* Access the union of all [CssStyleDeclaration]s that are associated with an
* [ElementList].
*
* Grouping the style objects all together provides easy editing of specific
* properties of a collection of elements. Setting a specific property value
* will set that property in all [Element]s in the [ElementList]. Getting a
* specific property value will return the value of the property of the first
* element in the [ElementList].
*/
CssStyleDeclarationBase get style;
/**
* Access dimensions and position of the Elements in this list.
*
* Setting the height or width properties will set the height or width
* property for all elements in the list. This returns a rectangle with the
* dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Getting the height or width returns the height or width of the
* first Element in this list.
*
* Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not.
*/
@Experimental()
CssRect get contentEdge;
/**
* Access dimensions and position of the first Element's content + padding box
* in this list.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not. This
* can be used to retrieve jQuery's `innerHeight` value for an element. This
* is also a rectangle equalling the dimensions of clientHeight and
* clientWidth.
*/
@Experimental()
CssRect get paddingEdge;
/**
* Access dimensions and position of the first Element's content + padding +
* border box in this list.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not. This
* can be used to retrieve jQuery's `outerHeight` value for an element.
*/
@Experimental()
CssRect get borderEdge;
/**
* Access dimensions and position of the first Element's content + padding +
* border + margin box in this list.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not. This
* can be used to retrieve jQuery's `outerHeight` value for an element.
*/
@Experimental()
CssRect get marginEdge;
@DomName('Element.onabort')
@DocsEditable()
ElementStream<Event> get onAbort;
@DomName('Element.onbeforecopy')
@DocsEditable()
ElementStream<Event> get onBeforeCopy;
@DomName('Element.onbeforecut')
@DocsEditable()
ElementStream<Event> get onBeforeCut;
@DomName('Element.onbeforepaste')
@DocsEditable()
ElementStream<Event> get onBeforePaste;
@DomName('Element.onblur')
@DocsEditable()
ElementStream<Event> get onBlur;
@DomName('Element.onchange')
@DocsEditable()
ElementStream<Event> get onChange;
@DomName('Element.onclick')
@DocsEditable()
ElementStream<MouseEvent> get onClick;
@DomName('Element.oncontextmenu')
@DocsEditable()
ElementStream<MouseEvent> get onContextMenu;
@DomName('Element.oncopy')
@DocsEditable()
ElementStream<Event> get onCopy;
@DomName('Element.oncut')
@DocsEditable()
ElementStream<Event> get onCut;
@DomName('Element.ondblclick')
@DocsEditable()
ElementStream<Event> get onDoubleClick;
@DomName('Element.ondrag')
@DocsEditable()
ElementStream<MouseEvent> get onDrag;
@DomName('Element.ondragend')
@DocsEditable()
ElementStream<MouseEvent> get onDragEnd;
@DomName('Element.ondragenter')
@DocsEditable()
ElementStream<MouseEvent> get onDragEnter;
@DomName('Element.ondragleave')
@DocsEditable()
ElementStream<MouseEvent> get onDragLeave;
@DomName('Element.ondragover')
@DocsEditable()
ElementStream<MouseEvent> get onDragOver;
@DomName('Element.ondragstart')
@DocsEditable()
ElementStream<MouseEvent> get onDragStart;
@DomName('Element.ondrop')
@DocsEditable()
ElementStream<MouseEvent> get onDrop;
@DomName('Element.onerror')
@DocsEditable()
ElementStream<Event> get onError;
@DomName('Element.onfocus')
@DocsEditable()
ElementStream<Event> get onFocus;
@DomName('Element.oninput')
@DocsEditable()
ElementStream<Event> get onInput;
@DomName('Element.oninvalid')
@DocsEditable()
ElementStream<Event> get onInvalid;
@DomName('Element.onkeydown')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyDown;
@DomName('Element.onkeypress')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyPress;
@DomName('Element.onkeyup')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyUp;
@DomName('Element.onload')
@DocsEditable()
ElementStream<Event> get onLoad;
@DomName('Element.onmousedown')
@DocsEditable()
ElementStream<MouseEvent> get onMouseDown;
@DomName('Element.onmouseenter')
@DocsEditable()
@Experimental() // untriaged
ElementStream<MouseEvent> get onMouseEnter;
@DomName('Element.onmouseleave')
@DocsEditable()
@Experimental() // untriaged
ElementStream<MouseEvent> get onMouseLeave;
@DomName('Element.onmousemove')
@DocsEditable()
ElementStream<MouseEvent> get onMouseMove;
@DomName('Element.onmouseout')
@DocsEditable()
ElementStream<MouseEvent> get onMouseOut;
@DomName('Element.onmouseover')
@DocsEditable()
ElementStream<MouseEvent> get onMouseOver;
@DomName('Element.onmouseup')
@DocsEditable()
ElementStream<MouseEvent> get onMouseUp;
@DomName('Element.onmousewheel')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
@Experimental() // non-standard
ElementStream<WheelEvent> get onMouseWheel;
@DomName('Element.onpaste')
@DocsEditable()
ElementStream<Event> get onPaste;
@DomName('Element.onreset')
@DocsEditable()
ElementStream<Event> get onReset;
@DomName('Element.onscroll')
@DocsEditable()
ElementStream<Event> get onScroll;
@DomName('Element.onsearch')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
ElementStream<Event> get onSearch;
@DomName('Element.onselect')
@DocsEditable()
ElementStream<Event> get onSelect;
@DomName('Element.onselectstart')
@DocsEditable()
@Experimental() // nonstandard
ElementStream<Event> get onSelectStart;
@DomName('Element.onsubmit')
@DocsEditable()
ElementStream<Event> get onSubmit;
@DomName('Element.ontouchcancel')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchCancel;
@DomName('Element.ontouchend')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchEnd;
@DomName('Element.ontouchenter')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchEnter;
@DomName('Element.ontouchleave')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchLeave;
@DomName('Element.ontouchmove')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchMove;
@DomName('Element.ontouchstart')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchStart;
@DomName('Element.ontransitionend')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
ElementStream<TransitionEvent> get onTransitionEnd;
@DomName('Element.onwebkitfullscreenchange')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
ElementStream<Event> get onFullscreenChange;
@DomName('Element.onwebkitfullscreenerror')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
ElementStream<Event> get onFullscreenError;
}
// TODO(jacobr): this is an inefficient implementation but it is hard to see
// a better option given that we cannot quite force NodeList to be an
// ElementList as there are valid cases where a NodeList JavaScript object
// contains Node objects that are not Elements.
class _FrozenElementList<T extends Element> extends ListBase<T> implements ElementList {
final List<Node> _nodeList;
// The subset of _nodeList that are Elements.
List<Element> _elementList;
_FrozenElementList._wrap(this._nodeList) {
_elementList = _nodeList.where((e) => e is Element).toList();
}
int get length => _nodeList.length;
Element operator [](int index) => _nodeList[index];
void operator []=(int index, Element value) {
throw new UnsupportedError('Cannot modify list');
}
void set length(int newLength) {
throw new UnsupportedError('Cannot modify list');
}
void sort([Comparator<Element> compare]) {
throw new UnsupportedError('Cannot sort list');
}
Element get first => _nodeList.first;
Element get last => _nodeList.last;
Element get single => _nodeList.single;
CssClassSet get classes => new _MultiElementCssClassSet(_elementList);
CssStyleDeclarationBase get style =>
new _CssStyleDeclarationSet(_elementList);
void set classes(Iterable<String> value) {
_elementList.forEach((e) => e.classes = value);
}
CssRect get contentEdge => new _ContentCssListRect(_elementList);
CssRect get paddingEdge => _elementList.first.paddingEdge;
CssRect get borderEdge => _elementList.first.borderEdge;
CssRect get marginEdge => _elementList.first.marginEdge;
@DomName('Element.onabort')
@DocsEditable()
ElementStream<Event> get onAbort => Element.abortEvent._forElementList(this);
@DomName('Element.onbeforecopy')
@DocsEditable()
ElementStream<Event> get onBeforeCopy => Element.beforeCopyEvent._forElementList(this);
@DomName('Element.onbeforecut')
@DocsEditable()
ElementStream<Event> get onBeforeCut => Element.beforeCutEvent._forElementList(this);
@DomName('Element.onbeforepaste')
@DocsEditable()
ElementStream<Event> get onBeforePaste => Element.beforePasteEvent._forElementList(this);
@DomName('Element.onblur')
@DocsEditable()
ElementStream<Event> get onBlur => Element.blurEvent._forElementList(this);
@DomName('Element.onchange')
@DocsEditable()
ElementStream<Event> get onChange => Element.changeEvent._forElementList(this);
@DomName('Element.onclick')
@DocsEditable()
ElementStream<MouseEvent> get onClick => Element.clickEvent._forElementList(this);
@DomName('Element.oncontextmenu')
@DocsEditable()
ElementStream<MouseEvent> get onContextMenu => Element.contextMenuEvent._forElementList(this);
@DomName('Element.oncopy')
@DocsEditable()
ElementStream<Event> get onCopy => Element.copyEvent._forElementList(this);
@DomName('Element.oncut')
@DocsEditable()
ElementStream<Event> get onCut => Element.cutEvent._forElementList(this);
@DomName('Element.ondblclick')
@DocsEditable()
ElementStream<Event> get onDoubleClick => Element.doubleClickEvent._forElementList(this);
@DomName('Element.ondrag')
@DocsEditable()
ElementStream<MouseEvent> get onDrag => Element.dragEvent._forElementList(this);
@DomName('Element.ondragend')
@DocsEditable()
ElementStream<MouseEvent> get onDragEnd => Element.dragEndEvent._forElementList(this);
@DomName('Element.ondragenter')
@DocsEditable()
ElementStream<MouseEvent> get onDragEnter => Element.dragEnterEvent._forElementList(this);
@DomName('Element.ondragleave')
@DocsEditable()
ElementStream<MouseEvent> get onDragLeave => Element.dragLeaveEvent._forElementList(this);
@DomName('Element.ondragover')
@DocsEditable()
ElementStream<MouseEvent> get onDragOver => Element.dragOverEvent._forElementList(this);
@DomName('Element.ondragstart')
@DocsEditable()
ElementStream<MouseEvent> get onDragStart => Element.dragStartEvent._forElementList(this);
@DomName('Element.ondrop')
@DocsEditable()
ElementStream<MouseEvent> get onDrop => Element.dropEvent._forElementList(this);
@DomName('Element.onerror')
@DocsEditable()
ElementStream<Event> get onError => Element.errorEvent._forElementList(this);
@DomName('Element.onfocus')
@DocsEditable()
ElementStream<Event> get onFocus => Element.focusEvent._forElementList(this);
@DomName('Element.oninput')
@DocsEditable()
ElementStream<Event> get onInput => Element.inputEvent._forElementList(this);
@DomName('Element.oninvalid')
@DocsEditable()
ElementStream<Event> get onInvalid => Element.invalidEvent._forElementList(this);
@DomName('Element.onkeydown')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyDown => Element.keyDownEvent._forElementList(this);
@DomName('Element.onkeypress')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyPress => Element.keyPressEvent._forElementList(this);
@DomName('Element.onkeyup')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyUp => Element.keyUpEvent._forElementList(this);
@DomName('Element.onload')
@DocsEditable()
ElementStream<Event> get onLoad => Element.loadEvent._forElementList(this);
@DomName('Element.onmousedown')
@DocsEditable()
ElementStream<MouseEvent> get onMouseDown => Element.mouseDownEvent._forElementList(this);
@DomName('Element.onmouseenter')
@DocsEditable()
@Experimental() // untriaged
ElementStream<MouseEvent> get onMouseEnter => Element.mouseEnterEvent._forElementList(this);
@DomName('Element.onmouseleave')
@DocsEditable()
@Experimental() // untriaged
ElementStream<MouseEvent> get onMouseLeave => Element.mouseLeaveEvent._forElementList(this);
@DomName('Element.onmousemove')
@DocsEditable()
ElementStream<MouseEvent> get onMouseMove => Element.mouseMoveEvent._forElementList(this);
@DomName('Element.onmouseout')
@DocsEditable()
ElementStream<MouseEvent> get onMouseOut => Element.mouseOutEvent._forElementList(this);
@DomName('Element.onmouseover')
@DocsEditable()
ElementStream<MouseEvent> get onMouseOver => Element.mouseOverEvent._forElementList(this);
@DomName('Element.onmouseup')
@DocsEditable()
ElementStream<MouseEvent> get onMouseUp => Element.mouseUpEvent._forElementList(this);
@DomName('Element.onmousewheel')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
@Experimental() // non-standard
ElementStream<WheelEvent> get onMouseWheel => Element.mouseWheelEvent._forElementList(this);
@DomName('Element.onpaste')
@DocsEditable()
ElementStream<Event> get onPaste => Element.pasteEvent._forElementList(this);
@DomName('Element.onreset')
@DocsEditable()
ElementStream<Event> get onReset => Element.resetEvent._forElementList(this);
@DomName('Element.onscroll')
@DocsEditable()
ElementStream<Event> get onScroll => Element.scrollEvent._forElementList(this);
@DomName('Element.onsearch')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
ElementStream<Event> get onSearch => Element.searchEvent._forElementList(this);
@DomName('Element.onselect')
@DocsEditable()
ElementStream<Event> get onSelect => Element.selectEvent._forElementList(this);
@DomName('Element.onselectstart')
@DocsEditable()
@Experimental() // nonstandard
ElementStream<Event> get onSelectStart => Element.selectStartEvent._forElementList(this);
@DomName('Element.onsubmit')
@DocsEditable()
ElementStream<Event> get onSubmit => Element.submitEvent._forElementList(this);
@DomName('Element.ontouchcancel')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchCancel => Element.touchCancelEvent._forElementList(this);
@DomName('Element.ontouchend')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchEnd => Element.touchEndEvent._forElementList(this);
@DomName('Element.ontouchenter')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchEnter => Element.touchEnterEvent._forElementList(this);
@DomName('Element.ontouchleave')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchLeave => Element.touchLeaveEvent._forElementList(this);
@DomName('Element.ontouchmove')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchMove => Element.touchMoveEvent._forElementList(this);
@DomName('Element.ontouchstart')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchStart => Element.touchStartEvent._forElementList(this);
@DomName('Element.ontransitionend')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
ElementStream<TransitionEvent> get onTransitionEnd => Element.transitionEndEvent._forElementList(this);
@DomName('Element.onwebkitfullscreenchange')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
ElementStream<Event> get onFullscreenChange => Element.fullscreenChangeEvent._forElementList(this);
@DomName('Element.onwebkitfullscreenerror')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
ElementStream<Event> get onFullscreenError => Element.fullscreenErrorEvent._forElementList(this);
}
/**
* An abstract class, which all HTML elements extend.
*/
@DomName('Element')
abstract class Element extends Node implements ParentNode, ChildNode {
/**
* Creates an HTML element from a valid fragment of HTML.
*
* var element = new Element.html('<div class="foo">content</div>');
*
* The HTML fragment should contain only one single root element, any
* leading or trailing text nodes will be removed.
*
* The HTML fragment is parsed as if it occurred within the context of a
* `<body>` tag, this means that special elements such as `<caption>` which
* must be parsed within the scope of a `<table>` element will be dropped. Use
* [createFragment] to parse contextual HTML fragments.
*
* Unless a validator is provided this will perform the default validation
* and remove all scriptable elements and attributes.
*
* See also:
*
* * [NodeValidator]
*
*/
factory Element.html(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
var fragment = document.body.createFragment(html, validator: validator,
treeSanitizer: treeSanitizer);
return fragment.nodes.where((e) => e is Element).single;
}
/**
* Creates the HTML element specified by the tag name.
*
* This is similar to [Document.createElement].
* [tag] should be a valid HTML tag name. If [tag] is an unknown tag then
* this will create an [UnknownElement].
*
* var divElement = new Element.tag('div');
* print(divElement is DivElement); // 'true'
* var myElement = new Element.tag('unknownTag');
* print(myElement is UnknownElement); // 'true'
*
* For standard elements it is more preferable to use the type constructors:
* var element = new DivElement();
*
* See also:
*
* * [isTagSupported]
*/
factory Element.tag(String tag) =>
_ElementFactoryProvider.createElement_tag(tag);
/// Creates a new `<a>` element.
///
/// This is identical to calling `new Element.tag('a')`.
factory Element.a() => new Element.tag('a');
/// Creates a new `<article>` element.
///
/// This is identical to calling `new Element.tag('article')`.
factory Element.article() => new Element.tag('article');
/// Creates a new `<aside>` element.
///
/// This is identical to calling `new Element.tag('aside')`.
factory Element.aside() => new Element.tag('aside');
/// Creates a new `<audio>` element.
///
/// This is identical to calling `new Element.tag('audio')`.
factory Element.audio() => new Element.tag('audio');
/// Creates a new `<br>` element.
///
/// This is identical to calling `new Element.tag('br')`.
factory Element.br() => new Element.tag('br');
/// Creates a new `<canvas>` element.
///
/// This is identical to calling `new Element.tag('canvas')`.
factory Element.canvas() => new Element.tag('canvas');
/// Creates a new `<div>` element.
///
/// This is identical to calling `new Element.tag('div')`.
factory Element.div() => new Element.tag('div');
/// Creates a new `<footer>` element.
///
/// This is identical to calling `new Element.tag('footer')`.
factory Element.footer() => new Element.tag('footer');
/// Creates a new `<header>` element.
///
/// This is identical to calling `new Element.tag('header')`.
factory Element.header() => new Element.tag('header');
/// Creates a new `<hr>` element.
///
/// This is identical to calling `new Element.tag('hr')`.
factory Element.hr() => new Element.tag('hr');
/// Creates a new `<iframe>` element.
///
/// This is identical to calling `new Element.tag('iframe')`.
factory Element.iframe() => new Element.tag('iframe');
/// Creates a new `<img>` element.
///
/// This is identical to calling `new Element.tag('img')`.
factory Element.img() => new Element.tag('img');
/// Creates a new `<li>` element.
///
/// This is identical to calling `new Element.tag('li')`.
factory Element.li() => new Element.tag('li');
/// Creates a new `<nav>` element.
///
/// This is identical to calling `new Element.tag('nav')`.
factory Element.nav() => new Element.tag('nav');
/// Creates a new `<ol>` element.
///
/// This is identical to calling `new Element.tag('ol')`.
factory Element.ol() => new Element.tag('ol');
/// Creates a new `<option>` element.
///
/// This is identical to calling `new Element.tag('option')`.
factory Element.option() => new Element.tag('option');
/// Creates a new `<p>` element.
///
/// This is identical to calling `new Element.tag('p')`.
factory Element.p() => new Element.tag('p');
/// Creates a new `<pre>` element.
///
/// This is identical to calling `new Element.tag('pre')`.
factory Element.pre() => new Element.tag('pre');
/// Creates a new `<section>` element.
///
/// This is identical to calling `new Element.tag('section')`.
factory Element.section() => new Element.tag('section');
/// Creates a new `<select>` element.
///
/// This is identical to calling `new Element.tag('select')`.
factory Element.select() => new Element.tag('select');
/// Creates a new `<span>` element.
///
/// This is identical to calling `new Element.tag('span')`.
factory Element.span() => new Element.tag('span');
/// Creates a new `<svg>` element.
///
/// This is identical to calling `new Element.tag('svg')`.
factory Element.svg() => new Element.tag('svg');
/// Creates a new `<table>` element.
///
/// This is identical to calling `new Element.tag('table')`.
factory Element.table() => new Element.tag('table');
/// Creates a new `<td>` element.
///
/// This is identical to calling `new Element.tag('td')`.
factory Element.td() => new Element.tag('td');
/// Creates a new `<textarea>` element.
///
/// This is identical to calling `new Element.tag('textarea')`.
factory Element.textarea() => new Element.tag('textarea');
/// Creates a new `<th>` element.
///
/// This is identical to calling `new Element.tag('th')`.
factory Element.th() => new Element.tag('th');
/// Creates a new `<tr>` element.
///
/// This is identical to calling `new Element.tag('tr')`.
factory Element.tr() => new Element.tag('tr');
/// Creates a new `<ul>` element.
///
/// This is identical to calling `new Element.tag('ul')`.
factory Element.ul() => new Element.tag('ul');
/// Creates a new `<video>` element.
///
/// This is identical to calling `new Element.tag('video')`.
factory Element.video() => new Element.tag('video');
/**
* All attributes on this element.
*
* Any modifications to the attribute map will automatically be applied to
* this element.
*
* This only includes attributes which are not in a namespace
* (such as 'xlink:href'), additional attributes can be accessed via
* [getNamespacedAttributes].
*/
Map<String, String> get attributes => new _ElementAttributeMap(this);
void set attributes(Map<String, String> value) {
Map<String, String> attributes = this.attributes;
attributes.clear();
for (String key in value.keys) {
attributes[key] = value[key];
}
}
/**
* List of the direct children of this element.
*
* This collection can be used to add and remove elements from the document.
*
* var item = new DivElement();
* item.text = 'Something';
* document.body.children.add(item) // Item is now displayed on the page.
* for (var element in document.body.children) {
* element.style.background = 'red'; // Turns every child of body red.
* }
*/
List<Element> get children => new _ChildrenElementList._wrap(this);
void set children(List<Element> value) {
// Copy list first since we don't want liveness during iteration.
List copy = new List.from(value);
var children = this.children;
children.clear();
children.addAll(copy);
}
/**
* Finds all descendent elements of this element that match the specified
* group of selectors.
*
* [selectors] should be a string using CSS selector syntax.
*
* var items = element.query('.itemClassName');
*/
ElementList queryAll(String selectors) =>
new _FrozenElementList._wrap(_querySelectorAll(selectors));
/**
* The set of CSS classes applied to this element.
*
* This set makes it easy to add, remove or toggle the classes applied to
* this element.
*
* element.classes.add('selected');
* element.classes.toggle('isOnline');
* element.classes.remove('selected');
*/
CssClassSet get classes => new _ElementCssClassSet(this);
void set classes(Iterable<String> value) {
CssClassSet classSet = classes;
classSet.clear();
classSet.addAll(value);
}
/**
* Allows access to all custom data attributes (data-*) set on this element.
*
* The keys for the map must follow these rules:
*
* * The name must not begin with 'xml'.
* * The name cannot contain a semi-colon (';').
* * The name cannot contain any capital letters.
*
* Any keys from markup will be converted to camel-cased keys in the map.
*
* For example, HTML specified as:
*
* <div data-my-random-value='value'></div>
*
* Would be accessed in Dart as:
*
* var value = element.dataset['myRandomValue'];
*
* See also:
*
* * [Custom data attributes](http://www.w3.org/TR/html5/global-attributes.html#custom-data-attribute)
*/
Map<String, String> get dataset =>
new _DataAttributeMap(attributes);
void set dataset(Map<String, String> value) {
final data = this.dataset;
data.clear();
for (String key in value.keys) {
data[key] = value[key];
}
}
/**
* Gets a map for manipulating the attributes of a particular namespace.
*
* This is primarily useful for SVG attributes such as xref:link.
*/
Map<String, String> getNamespacedAttributes(String namespace) {
return new _NamespacedAttributeMap(this, namespace);
}
/**
* The set of all CSS values applied to this element, including inherited
* and default values.
*
* The computedStyle contains values that are inherited from other
* sources, such as parent elements or stylesheets. This differs from the
* [style] property, which contains only the values specified directly on this
* element.
*
* PseudoElement can be values such as `::after`, `::before`, `::marker`,
* `::line-marker`.
*
* See also:
*
* * [CSS Inheritance and Cascade](http://docs.webplatform.org/wiki/tutorials/inheritance_and_cascade)
* * [Pseudo-elements](http://docs.webplatform.org/wiki/css/selectors/pseudo-elements)
*/
CssStyleDeclaration getComputedStyle([String pseudoElement]) {
if (pseudoElement == null) {
pseudoElement = '';
}
// TODO(jacobr): last param should be null, see b/5045788
return window._getComputedStyle(this, pseudoElement);
}
/**
* Gets the position of this element relative to the client area of the page.
*/
Rect get client => new Rect(clientLeft, clientTop, clientWidth, clientHeight);
/**
* Gets the offset of this element relative to its offsetParent.
*/
Rect get offset => new Rect(offsetLeft, offsetTop, offsetWidth, offsetHeight);
/**
* Adds the specified text after the last child of this element.
*/
void appendText(String text) {
this.insertAdjacentText('beforeend', text);
}
/**
* Parses the specified text as HTML and adds the resulting node after the
* last child of this element.
*/
void appendHtml(String text) {
this.insertAdjacentHtml('beforeend', text);
}
/**
* Checks to see if the tag name is supported by the current platform.
*
* The tag should be a valid HTML tag name.
*/
static bool isTagSupported(String tag) {
var e = _ElementFactoryProvider.createElement_tag(tag);
return e is Element && !(e is UnknownElement);
}
/**
* Called by the DOM when this element has been instantiated.
*/
@Experimental()
void created() {}
// Hooks to support custom WebComponents.
Element _xtag;
/**
* Experimental support for [web components][wc]. This field stores a
* reference to the component implementation. It was inspired by Mozilla's
* [x-tags][] project. Please note: in the future it may be possible to
* `extend Element` from your class, in which case this field will be
* deprecated.
*
* If xtag has not been set, it will simply return `this` [Element].
*
* [wc]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html
* [x-tags]: http://x-tags.org/
*/
// Note: return type is `dynamic` for convenience to suppress warnings when
// members of the component are used. The actual type is a subtype of Element.
get xtag => _xtag != null ? _xtag : this;
void set xtag(Element value) {
_xtag = value;
}
@DomName('Element.localName')
@DocsEditable()
String get localName => _localName;
@DomName('Element.namespaceUri')
@DocsEditable()
String get namespaceUri => _namespaceUri;
String toString() => localName;
/**
* Scrolls this element into view.
*
* Only one of of the alignment options may be specified at a time.
*
* If no options are specified then this will attempt to scroll the minimum
* amount needed to bring the element into view.
*
* Note that alignCenter is currently only supported on WebKit platforms. If
* alignCenter is specified but not supported then this will fall back to
* alignTop.
*
* See also:
*
* * [scrollIntoView](http://docs.webplatform.org/wiki/dom/methods/scrollIntoView)
* * [scrollIntoViewIfNeeded](http://docs.webplatform.org/wiki/dom/methods/scrollIntoViewIfNeeded)
*/
void scrollIntoView([ScrollAlignment alignment]) {
var hasScrollIntoViewIfNeeded = false;
if (alignment == ScrollAlignment.TOP) {
this._scrollIntoView(true);
} else if (alignment == ScrollAlignment.BOTTOM) {
this._scrollIntoView(false);
} else if (hasScrollIntoViewIfNeeded) {
if (alignment == ScrollAlignment.CENTER) {
this._scrollIntoViewIfNeeded(true);
} else {
this._scrollIntoViewIfNeeded();
}
} else {
this._scrollIntoView();
}
}
/** Checks if this element or any of its parents match the CSS selectors. */
@Experimental()
bool matchesWithAncestors(String selectors) {
var elem = this;
do {
if (elem.matches(selectors)) return true;
elem = elem.parent;
} while(elem != null);
return false;
}
Element _templateInstanceRef;
// Note: only used if `this is! TemplateElement`
DocumentFragment _templateContent;
bool _templateIsDecorated;
/**
* Gets the template this node refers to.
* This is only supported if [isTemplate] is true.
*/
@Experimental()
Element get ref {
_ensureTemplate();
Element result = null;
var refId = attributes['ref'];
if (refId != null) {
var treeScope = this;
while (treeScope.parentNode != null) {
treeScope = treeScope.parentNode;
}
// Note: JS code tests that getElementById is present. We can't do that
// easily, so instead check for the types known to implement it.
if (treeScope is Document ||
treeScope is ShadowRoot ||
treeScope is svg.SvgSvgElement) {
result = treeScope.getElementById(refId);
}
}
if (result == null) {
result = _templateInstanceRef;
if (result == null) return this;
}
var nextRef = result.ref;
return nextRef != null ? nextRef : result;
}
/**
* Gets the content of this template.
* This is only supported if [isTemplate] is true.
*/
@Experimental()
DocumentFragment get content {
_ensureTemplate();
return _templateContent;
}
/**
* Creates an instance of the template, using the provided model and optional
* binding delegate.
*
* This is only supported if [isTemplate] is true.
*/
@Experimental()
DocumentFragment createInstance(model, [BindingDelegate delegate]) {
_ensureTemplate();
return TemplateElement.mdvPackage(this).createInstance(model, delegate);
}
/**
* The data model which is inherited through the tree.
* This is only supported if [isTemplate] is true.
*/
@Experimental()
get model => TemplateElement.mdvPackage(this).model;
@Experimental()
void set model(value) {
_ensureTemplate();
TemplateElement.mdvPackage(this).model = value;
}
/**
* The binding delegate which is inherited through the tree. It can be used
* to configure custom syntax for `{{bindings}}` inside this template.
*
* This is only supported if [isTemplate] is true.
*/
@Experimental()
BindingDelegate get bindingDelegate =>
TemplateElement.mdvPackage(this).bindingDelegate;
@Experimental()
void set bindingDelegate(BindingDelegate value) {
_ensureTemplate();
TemplateElement.mdvPackage(this).bindingDelegate = value;
}
// TODO(jmesserly): const set would be better
static const _TABLE_TAGS = const {
'caption': null,
'col': null,
'colgroup': null,
'tbody': null,
'td': null,
'tfoot': null,
'th': null,
'thead': null,
'tr': null,
};
bool get _isAttributeTemplate => attributes.containsKey('template') &&
(localName == 'option' || localName == 'optgroup' ||
_TABLE_TAGS.containsKey(localName));
/**
* Returns true if this node is a template.
*
* A node is a template if [tagName] is TEMPLATE, or the node has the
* 'template' attribute and this tag supports attribute form for backwards
* compatibility with existing HTML parsers. The nodes that can use attribute
* form are table elments (THEAD, TBODY, TFOOT, TH, TR, TD, CAPTION, COLGROUP
* and COL), OPTION, and OPTGROUP.
*/
// TODO(jmesserly): this is not a public MDV API, but it seems like a useful
// place to document which tags our polyfill considers to be templates.
// Otherwise I'd be repeating it in several other places.
// See if we can replace this with a TemplateMixin.
@Experimental()
bool get isTemplate => tagName == 'TEMPLATE' || _isAttributeTemplate;
void _ensureTemplate() {
if (!isTemplate) {
throw new UnsupportedError('$this is not a template.');
}
TemplateElement.decorate(this);
}
/**
* Access this element's content position.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not.
*
* _Important_ _note_: use of this method _will_ perform CSS calculations that
* can trigger a browser reflow. Therefore, use of this property _during_ an
* animation frame is discouraged. See also:
* [Browser Reflow](https://developers.google.com/speed/articles/reflow)
*/
@Experimental()
CssRect get contentEdge => new _ContentCssRect(this);
/**
* Access the dimensions and position of this element's content + padding box.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not. This
* can be used to retrieve jQuery's
* [innerHeight](http://api.jquery.com/innerHeight/) value for an element.
* This is also a rectangle equalling the dimensions of clientHeight and
* clientWidth.
*
* _Important_ _note_: use of this method _will_ perform CSS calculations that
* can trigger a browser reflow. Therefore, use of this property _during_ an
* animation frame is discouraged. See also:
* [Browser Reflow](https://developers.google.com/speed/articles/reflow)
*/
@Experimental()
CssRect get paddingEdge => new _PaddingCssRect(this);
/**
* Access the dimensions and position of this element's content + padding +
* border box.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not. This
* can be used to retrieve jQuery's
* [outerHeight](http://api.jquery.com/outerHeight/) value for an element.
*
* _Important_ _note_: use of this method _will_ perform CSS calculations that
* can trigger a browser reflow. Therefore, use of this property _during_ an
* animation frame is discouraged. See also:
* [Browser Reflow](https://developers.google.com/speed/articles/reflow)
*/
@Experimental()
CssRect get borderEdge => new _BorderCssRect(this);
/**
* Access the dimensions and position of this element's content + padding +
* border + margin box.
*
* This returns a rectangle with the dimenions actually available for content
* in this element, in pixels, regardless of this element's box-sizing
* property. Unlike [getBoundingClientRect], the dimensions of this rectangle
* will return the same numerical height if the element is hidden or not. This
* can be used to retrieve jQuery's
* [outerHeight](http://api.jquery.com/outerHeight/) value for an element.
*
* _Important_ _note_: use of this method will perform CSS calculations that
* can trigger a browser reflow. Therefore, use of this property _during_ an
* animation frame is discouraged. See also:
* [Browser Reflow](https://developers.google.com/speed/articles/reflow)
*/
@Experimental()
CssRect get marginEdge => new _MarginCssRect(this);
/**
* Provides the coordinates of the element relative to the top of the
* document.
*
* This method is the Dart equivalent to jQuery's
* [offset](http://api.jquery.com/offset/) method.
*/
Point get documentOffset => offsetTo(document.documentElement);
/**
* Provides the offset of this element's [borderEdge] relative to the
* specified [parent].
*
* This is the Dart equivalent of jQuery's
* [position](http://api.jquery.com/position/) method. Unlike jQuery's
* position, however, [parent] can be any parent element of `this`,
* rather than only `this`'s immediate [offsetParent]. If the specified
* element is _not_ an offset parent or transitive offset parent to this
* element, an [ArgumentError] is thrown.
*/
Point offsetTo(Element parent) {
return Element._offsetToHelper(this, parent);
}
static Point _offsetToHelper(Element current, Element parent) {
// We're hopping from _offsetParent_ to offsetParent (not just parent), so
// offsetParent, "tops out" at BODY. But people could conceivably pass in
// the document.documentElement and I want it to return an absolute offset,
// so we have the special case checking for HTML.
bool foundAsParent = identical(current, parent) || parent.tagName == 'HTML';
if (current == null || identical(current, parent)) {
if (foundAsParent) return new Point(0, 0);
throw new ArgumentError("Specified element is not a transitive offset "
"parent of this element.");
}
Element parentOffset = current.offsetParent;
Point p = Element._offsetToHelper(parentOffset, parent);
return new Point(p.x + current.offsetLeft, p.y + current.offsetTop);
}
static HtmlDocument _parseDocument;
static NodeValidatorBuilder _defaultValidator;
static _ValidatingTreeSanitizer _defaultSanitizer;
/**
* Create a DocumentFragment from the HTML fragment and ensure that it follows
* the sanitization rules specified by the validator or treeSanitizer.
*
* If the default validation behavior is too restrictive then a new
* NodeValidator should be created, either extending or wrapping a default
* validator and overriding the validation APIs.
*
* The treeSanitizer is used to walk the generated node tree and sanitize it.
* A custom treeSanitizer can also be provided to perform special validation
* rules but since the API is more complex to implement this is discouraged.
*
* The returned tree is guaranteed to only contain nodes and attributes which
* are allowed by the provided validator.
*
* See also:
*
* * [NodeValidator]
* * [NodeTreeSanitizer]
*/
DocumentFragment createFragment(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
if (treeSanitizer == null) {
if (validator == null) {
if (_defaultValidator == null) {
_defaultValidator = new NodeValidatorBuilder.common();
}
validator = _defaultValidator;
}
if (_defaultSanitizer == null) {
_defaultSanitizer = new _ValidatingTreeSanitizer(validator);
} else {
_defaultSanitizer.validator = validator;
}
treeSanitizer = _defaultSanitizer;
} else if (validator != null) {
throw new ArgumentError(
'validator can only be passed if treeSanitizer is null');
}
if (_parseDocument == null) {
_parseDocument = document.implementation.createHtmlDocument('');
}
var contextElement;
if (this is BodyElement) {
contextElement = _parseDocument.body;
} else {
contextElement = _parseDocument.$dom_createElement(tagName);
_parseDocument.body.append(contextElement);
}
var fragment;
if (Range.supportsCreateContextualFragment) {
var range = _parseDocument.createRange();
range.selectNodeContents(contextElement);
fragment = range.createContextualFragment(html);
} else {
contextElement._innerHtml = html;
fragment = _parseDocument.createDocumentFragment();
while (contextElement.firstChild != null) {
fragment.append(contextElement.firstChild);
}
}
if (contextElement != _parseDocument.body) {
contextElement.remove();
}
treeSanitizer.sanitizeTree(fragment);
return fragment;
}
/**
* Parses the HTML fragment and sets it as the contents of this element.
*
* This uses the default sanitization behavior to sanitize the HTML fragment,
* use [setInnerHtml] to override the default behavior.
*/
void set innerHtml(String html) {
this.setInnerHtml(html);
}
/**
* Parses the HTML fragment and sets it as the contents of this element.
* This ensures that the generated content follows the sanitization rules
* specified by the validator or treeSanitizer.
*
* If the default validation behavior is too restrictive then a new
* NodeValidator should be created, either extending or wrapping a default
* validator and overriding the validation APIs.
*
* The treeSanitizer is used to walk the generated node tree and sanitize it.
* A custom treeSanitizer can also be provided to perform special validation
* rules but since the API is more complex to implement this is discouraged.
*
* The resulting tree is guaranteed to only contain nodes and attributes which
* are allowed by the provided validator.
*
* See also:
*
* * [NodeValidator]
* * [NodeTreeSanitizer]
*/
void setInnerHtml(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
text = null;
append(createFragment(
html, validator: validator, treeSanitizer: treeSanitizer));
}
String get innerHtml => _innerHtml;
/**
* For use while transitioning to the safe [innerHtml] or [setInnerHtml].
* Unsafe because it opens the app to cross-site scripting vulnerabilities.
*/
@deprecated
void set unsafeInnerHtml(String html) {
_innerHtml = html;
}
// To suppress missing implicit constructor warnings.
factory Element._() { throw new UnsupportedError("Not supported"); }
@DomName('Element.abortEvent')
@DocsEditable()
static const EventStreamProvider<Event> abortEvent = const EventStreamProvider<Event>('abort');
@DomName('Element.beforecopyEvent')
@DocsEditable()
static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamProvider<Event>('beforecopy');
@DomName('Element.beforecutEvent')
@DocsEditable()
static const EventStreamProvider<Event> beforeCutEvent = const EventStreamProvider<Event>('beforecut');
@DomName('Element.beforepasteEvent')
@DocsEditable()
static const EventStreamProvider<Event> beforePasteEvent = const EventStreamProvider<Event>('beforepaste');
@DomName('Element.blurEvent')
@DocsEditable()
static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
@DomName('Element.changeEvent')
@DocsEditable()
static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
@DomName('Element.clickEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamProvider<MouseEvent>('click');
@DomName('Element.contextmenuEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStreamProvider<MouseEvent>('contextmenu');
@DomName('Element.copyEvent')
@DocsEditable()
static const EventStreamProvider<Event> copyEvent = const EventStreamProvider<Event>('copy');
@DomName('Element.cutEvent')
@DocsEditable()
static const EventStreamProvider<Event> cutEvent = const EventStreamProvider<Event>('cut');
@DomName('Element.dblclickEvent')
@DocsEditable()
static const EventStreamProvider<Event> doubleClickEvent = const EventStreamProvider<Event>('dblclick');
@DomName('Element.dragEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProvider<MouseEvent>('drag');
@DomName('Element.dragendEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamProvider<MouseEvent>('dragend');
@DomName('Element.dragenterEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStreamProvider<MouseEvent>('dragenter');
@DomName('Element.dragleaveEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStreamProvider<MouseEvent>('dragleave');
@DomName('Element.dragoverEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStreamProvider<MouseEvent>('dragover');
@DomName('Element.dragstartEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStreamProvider<MouseEvent>('dragstart');
@DomName('Element.dropEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProvider<MouseEvent>('drop');
@DomName('Element.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('Element.focusEvent')
@DocsEditable()
static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
@DomName('Element.inputEvent')
@DocsEditable()
static const EventStreamProvider<Event> inputEvent = const EventStreamProvider<Event>('input');
@DomName('Element.invalidEvent')
@DocsEditable()
static const EventStreamProvider<Event> invalidEvent = const EventStreamProvider<Event>('invalid');
@DomName('Element.keydownEvent')
@DocsEditable()
static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStreamProvider<KeyboardEvent>('keydown');
@DomName('Element.keypressEvent')
@DocsEditable()
static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStreamProvider<KeyboardEvent>('keypress');
@DomName('Element.keyupEvent')
@DocsEditable()
static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStreamProvider<KeyboardEvent>('keyup');
@DomName('Element.loadEvent')
@DocsEditable()
static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
@DomName('Element.mousedownEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStreamProvider<MouseEvent>('mousedown');
@DomName('Element.mouseenterEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<MouseEvent> mouseEnterEvent = const EventStreamProvider<MouseEvent>('mouseenter');
@DomName('Element.mouseleaveEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<MouseEvent> mouseLeaveEvent = const EventStreamProvider<MouseEvent>('mouseleave');
@DomName('Element.mousemoveEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStreamProvider<MouseEvent>('mousemove');
@DomName('Element.mouseoutEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStreamProvider<MouseEvent>('mouseout');
@DomName('Element.mouseoverEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStreamProvider<MouseEvent>('mouseover');
@DomName('Element.mouseupEvent')
@DocsEditable()
static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamProvider<MouseEvent>('mouseup');
@DomName('Element.mousewheelEvent')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
@Experimental() // non-standard
static const EventStreamProvider<WheelEvent> mouseWheelEvent = const EventStreamProvider<WheelEvent>('mousewheel');
@DomName('Element.pasteEvent')
@DocsEditable()
static const EventStreamProvider<Event> pasteEvent = const EventStreamProvider<Event>('paste');
@DomName('Element.resetEvent')
@DocsEditable()
static const EventStreamProvider<Event> resetEvent = const EventStreamProvider<Event>('reset');
@DomName('Element.scrollEvent')
@DocsEditable()
static const EventStreamProvider<Event> scrollEvent = const EventStreamProvider<Event>('scroll');
@DomName('Element.searchEvent')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
static const EventStreamProvider<Event> searchEvent = const EventStreamProvider<Event>('search');
@DomName('Element.selectEvent')
@DocsEditable()
static const EventStreamProvider<Event> selectEvent = const EventStreamProvider<Event>('select');
@DomName('Element.selectstartEvent')
@DocsEditable()
@Experimental() // nonstandard
static const EventStreamProvider<Event> selectStartEvent = const EventStreamProvider<Event>('selectstart');
@DomName('Element.submitEvent')
@DocsEditable()
static const EventStreamProvider<Event> submitEvent = const EventStreamProvider<Event>('submit');
@DomName('Element.touchcancelEvent')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStreamProvider<TouchEvent>('touchcancel');
@DomName('Element.touchendEvent')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStreamProvider<TouchEvent>('touchend');
@DomName('Element.touchenterEvent')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
static const EventStreamProvider<TouchEvent> touchEnterEvent = const EventStreamProvider<TouchEvent>('touchenter');
@DomName('Element.touchleaveEvent')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
static const EventStreamProvider<TouchEvent> touchLeaveEvent = const EventStreamProvider<TouchEvent>('touchleave');
@DomName('Element.touchmoveEvent')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStreamProvider<TouchEvent>('touchmove');
@DomName('Element.touchstartEvent')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStreamProvider<TouchEvent>('touchstart');
@DomName('Element.transitionendEvent')
@DocsEditable()
static const EventStreamProvider<TransitionEvent> transitionEndEvent = const EventStreamProvider<TransitionEvent>('transitionend');
@DomName('Element.webkitfullscreenchangeEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
static const EventStreamProvider<Event> fullscreenChangeEvent = const EventStreamProvider<Event>('webkitfullscreenchange');
@DomName('Element.webkitfullscreenerrorEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
static const EventStreamProvider<Event> fullscreenErrorEvent = const EventStreamProvider<Event>('webkitfullscreenerror');
String contentEditable;
String dir;
bool draggable;
bool hidden;
String _innerHtml;
InputMethodContext get inputMethodContext;
bool get isContentEditable;
String lang;
String get outerHtml;
bool spellcheck;
int tabIndex;
String title;
bool translate;
String dropzone;
void click();
Element insertAdjacentElement(String where, Element element);
void insertAdjacentHtml(String where, String html);
void insertAdjacentText(String where, String text);
@DomName('Element.ALLOW_KEYBOARD_INPUT')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-element-requestfullscreen
@deprecated // deprecated
static const int ALLOW_KEYBOARD_INPUT = 1;
@DomName('Element.attributes')
@DocsEditable()
_NamedNodeMap get _attributes native "Element_attributes_Getter";
@DomName('Element.className')
@DocsEditable()
String get className native "Element_className_Getter";
@DomName('Element.className')
@DocsEditable()
void set className(String value) native "Element_className_Setter";
@DomName('Element.clientHeight')
@DocsEditable()
int get clientHeight native "Element_clientHeight_Getter";
@DomName('Element.clientLeft')
@DocsEditable()
int get clientLeft native "Element_clientLeft_Getter";
@DomName('Element.clientTop')
@DocsEditable()
int get clientTop native "Element_clientTop_Getter";
@DomName('Element.clientWidth')
@DocsEditable()
int get clientWidth native "Element_clientWidth_Getter";
@DomName('Element.id')
@DocsEditable()
String get id native "Element_id_Getter";
@DomName('Element.id')
@DocsEditable()
void set id(String value) native "Element_id_Setter";
@DomName('Element.localName')
@DocsEditable()
@Experimental() // untriaged
String get _localName native "Element_localName_Getter";
@DomName('Element.namespaceURI')
@DocsEditable()
@Experimental() // untriaged
String get _namespaceUri native "Element_namespaceURI_Getter";
@DomName('Element.offsetHeight')
@DocsEditable()
int get offsetHeight native "Element_offsetHeight_Getter";
@DomName('Element.offsetLeft')
@DocsEditable()
int get offsetLeft native "Element_offsetLeft_Getter";
@DomName('Element.offsetParent')
@DocsEditable()
Element get offsetParent native "Element_offsetParent_Getter";
@DomName('Element.offsetTop')
@DocsEditable()
int get offsetTop native "Element_offsetTop_Getter";
@DomName('Element.offsetWidth')
@DocsEditable()
int get offsetWidth native "Element_offsetWidth_Getter";
@DomName('Element.pseudo')
@DocsEditable()
@Experimental() // untriaged
String get pseudo native "Element_pseudo_Getter";
@DomName('Element.pseudo')
@DocsEditable()
@Experimental() // untriaged
void set pseudo(String value) native "Element_pseudo_Setter";
@DomName('Element.scrollHeight')
@DocsEditable()
int get scrollHeight native "Element_scrollHeight_Getter";
@DomName('Element.scrollLeft')
@DocsEditable()
int get scrollLeft native "Element_scrollLeft_Getter";
@DomName('Element.scrollLeft')
@DocsEditable()
void set scrollLeft(int value) native "Element_scrollLeft_Setter";
@DomName('Element.scrollTop')
@DocsEditable()
int get scrollTop native "Element_scrollTop_Getter";
@DomName('Element.scrollTop')
@DocsEditable()
void set scrollTop(int value) native "Element_scrollTop_Setter";
@DomName('Element.scrollWidth')
@DocsEditable()
int get scrollWidth native "Element_scrollWidth_Getter";
@DomName('Element.shadowRoot')
@DocsEditable()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-shadow-aware-create-shadow-root
@Experimental()
ShadowRoot get shadowRoot native "Element_shadowRoot_Getter";
@DomName('Element.style')
@DocsEditable()
CssStyleDeclaration get style native "Element_style_Getter";
@DomName('Element.tagName')
@DocsEditable()
String get tagName native "Element_tagName_Getter";
@DomName('Element.webkitRegionOverset')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/css-regions/#dom-region-regionoverset
String get regionOverset native "Element_webkitRegionOverset_Getter";
@DomName('Element.blur')
@DocsEditable()
void blur() native "Element_blur_Callback";
@DomName('Element.createShadowRoot')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-shadow-aware-create-shadow-root
ShadowRoot createShadowRoot() native "Element_createShadowRoot_Callback";
@DomName('Element.focus')
@DocsEditable()
void focus() native "Element_focus_Callback";
@DomName('Element.getAttribute')
@DocsEditable()
String _getAttribute(String name) native "Element_getAttribute_Callback";
@DomName('Element.getAttributeNS')
@DocsEditable()
String _getAttributeNS(String namespaceURI, String localName) native "Element_getAttributeNS_Callback";
@DomName('Element.getBoundingClientRect')
@DocsEditable()
Rect getBoundingClientRect() native "Element_getBoundingClientRect_Callback";
@DomName('Element.getClientRects')
@DocsEditable()
List<Rect> getClientRects() native "Element_getClientRects_Callback";
@DomName('Element.getDestinationInsertionPoints')
@DocsEditable()
@Experimental() // untriaged
List<Node> getDestinationInsertionPoints() native "Element_getDestinationInsertionPoints_Callback";
@DomName('Element.getElementsByClassName')
@DocsEditable()
List<Node> getElementsByClassName(String name) native "Element_getElementsByClassName_Callback";
@DomName('Element.getElementsByTagName')
@DocsEditable()
List<Node> _getElementsByTagName(String name) native "Element_getElementsByTagName_Callback";
@DomName('Element.hasAttribute')
@DocsEditable()
bool _hasAttribute(String name) native "Element_hasAttribute_Callback";
@DomName('Element.hasAttributeNS')
@DocsEditable()
bool _hasAttributeNS(String namespaceURI, String localName) native "Element_hasAttributeNS_Callback";
/**
* Finds the first descendant element of this element that matches the
* specified group of selectors.
*
* [selectors] should be a string using CSS selector syntax.
*
* // Gets the first descendant with the class 'classname'
* var element = element.query('.className');
* // Gets the element with id 'id'
* var element = element.query('#id');
* // Gets the first descendant [ImageElement]
* var img = element.query('img');
*
* See also:
*
* * [CSS Selectors](http://docs.webplatform.org/wiki/css/selectors)
*/
@DomName('Element.querySelector')
@DocsEditable()
Element query(String selectors) native "Element_querySelector_Callback";
@DomName('Element.querySelectorAll')
@DocsEditable()
List<Node> _querySelectorAll(String selectors) native "Element_querySelectorAll_Callback";
@DomName('Element.removeAttribute')
@DocsEditable()
void _removeAttribute(String name) native "Element_removeAttribute_Callback";
@DomName('Element.removeAttributeNS')
@DocsEditable()
void _removeAttributeNS(String namespaceURI, String localName) native "Element_removeAttributeNS_Callback";
@DomName('Element.scrollByLines')
@DocsEditable()
void scrollByLines(int lines) native "Element_scrollByLines_Callback";
@DomName('Element.scrollByPages')
@DocsEditable()
void scrollByPages(int pages) native "Element_scrollByPages_Callback";
void _scrollIntoView([bool alignWithTop]) {
if (alignWithTop != null) {
_scrollIntoView_1(alignWithTop);
return;
}
_scrollIntoView_2();
return;
}
void _scrollIntoView_1(alignWithTop) native "Element__scrollIntoView_1_Callback";
void _scrollIntoView_2() native "Element__scrollIntoView_2_Callback";
void _scrollIntoViewIfNeeded([bool centerIfNeeded]) {
if (centerIfNeeded != null) {
_scrollIntoViewIfNeeded_1(centerIfNeeded);
return;
}
_scrollIntoViewIfNeeded_2();
return;
}
void _scrollIntoViewIfNeeded_1(centerIfNeeded) native "Element__scrollIntoViewIfNeeded_1_Callback";
void _scrollIntoViewIfNeeded_2() native "Element__scrollIntoViewIfNeeded_2_Callback";
@DomName('Element.setAttribute')
@DocsEditable()
void _setAttribute(String name, String value) native "Element_setAttribute_Callback";
@DomName('Element.setAttributeNS')
@DocsEditable()
void _setAttributeNS(String namespaceURI, String qualifiedName, String value) native "Element_setAttributeNS_Callback";
@DomName('Element.webkitGetRegionFlowRanges')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/css-regions/#dom-region-getregionflowranges
List<Range> getRegionFlowRanges() native "Element_webkitGetRegionFlowRanges_Callback";
@DomName('Element.webkitMatchesSelector')
@DocsEditable()
@Experimental()
// http://dev.w3.org/2006/webapi/selectors-api2/#matches
bool matches(String selectors) native "Element_webkitMatchesSelector_Callback";
@DomName('Element.webkitRequestFullScreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-element-requestfullscreen
@deprecated // deprecated
void requestFullScreen(int flags) native "Element_webkitRequestFullScreen_Callback";
@DomName('Element.webkitRequestFullscreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-element-requestfullscreen
void requestFullscreen() native "Element_webkitRequestFullscreen_Callback";
@DomName('Element.webkitRequestPointerLock')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#widl-Element-requestPointerLock-void
void requestPointerLock() native "Element_webkitRequestPointerLock_Callback";
@DomName('Element.nextElementSibling')
@DocsEditable()
Element get nextElementSibling native "Element_nextElementSibling_Getter";
@DomName('Element.previousElementSibling')
@DocsEditable()
Element get previousElementSibling native "Element_previousElementSibling_Getter";
@DomName('Element.remove')
@DocsEditable()
void remove() native "Element_remove_Callback";
@DomName('Element.childElementCount')
@DocsEditable()
int get _childElementCount native "Element_childElementCount_Getter";
@DomName('Element.children')
@DocsEditable()
HtmlCollection get _children native "Element_children_Getter";
@DomName('Element.firstElementChild')
@DocsEditable()
Element get _firstElementChild native "Element_firstElementChild_Getter";
@DomName('Element.lastElementChild')
@DocsEditable()
Element get _lastElementChild native "Element_lastElementChild_Getter";
@DomName('Element.onabort')
@DocsEditable()
ElementStream<Event> get onAbort => abortEvent.forElement(this);
@DomName('Element.onbeforecopy')
@DocsEditable()
ElementStream<Event> get onBeforeCopy => beforeCopyEvent.forElement(this);
@DomName('Element.onbeforecut')
@DocsEditable()
ElementStream<Event> get onBeforeCut => beforeCutEvent.forElement(this);
@DomName('Element.onbeforepaste')
@DocsEditable()
ElementStream<Event> get onBeforePaste => beforePasteEvent.forElement(this);
@DomName('Element.onblur')
@DocsEditable()
ElementStream<Event> get onBlur => blurEvent.forElement(this);
@DomName('Element.onchange')
@DocsEditable()
ElementStream<Event> get onChange => changeEvent.forElement(this);
@DomName('Element.onclick')
@DocsEditable()
ElementStream<MouseEvent> get onClick => clickEvent.forElement(this);
@DomName('Element.oncontextmenu')
@DocsEditable()
ElementStream<MouseEvent> get onContextMenu => contextMenuEvent.forElement(this);
@DomName('Element.oncopy')
@DocsEditable()
ElementStream<Event> get onCopy => copyEvent.forElement(this);
@DomName('Element.oncut')
@DocsEditable()
ElementStream<Event> get onCut => cutEvent.forElement(this);
@DomName('Element.ondblclick')
@DocsEditable()
ElementStream<Event> get onDoubleClick => doubleClickEvent.forElement(this);
@DomName('Element.ondrag')
@DocsEditable()
ElementStream<MouseEvent> get onDrag => dragEvent.forElement(this);
@DomName('Element.ondragend')
@DocsEditable()
ElementStream<MouseEvent> get onDragEnd => dragEndEvent.forElement(this);
@DomName('Element.ondragenter')
@DocsEditable()
ElementStream<MouseEvent> get onDragEnter => dragEnterEvent.forElement(this);
@DomName('Element.ondragleave')
@DocsEditable()
ElementStream<MouseEvent> get onDragLeave => dragLeaveEvent.forElement(this);
@DomName('Element.ondragover')
@DocsEditable()
ElementStream<MouseEvent> get onDragOver => dragOverEvent.forElement(this);
@DomName('Element.ondragstart')
@DocsEditable()
ElementStream<MouseEvent> get onDragStart => dragStartEvent.forElement(this);
@DomName('Element.ondrop')
@DocsEditable()
ElementStream<MouseEvent> get onDrop => dropEvent.forElement(this);
@DomName('Element.onerror')
@DocsEditable()
ElementStream<Event> get onError => errorEvent.forElement(this);
@DomName('Element.onfocus')
@DocsEditable()
ElementStream<Event> get onFocus => focusEvent.forElement(this);
@DomName('Element.oninput')
@DocsEditable()
ElementStream<Event> get onInput => inputEvent.forElement(this);
@DomName('Element.oninvalid')
@DocsEditable()
ElementStream<Event> get onInvalid => invalidEvent.forElement(this);
@DomName('Element.onkeydown')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyDown => keyDownEvent.forElement(this);
@DomName('Element.onkeypress')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyPress => keyPressEvent.forElement(this);
@DomName('Element.onkeyup')
@DocsEditable()
ElementStream<KeyboardEvent> get onKeyUp => keyUpEvent.forElement(this);
@DomName('Element.onload')
@DocsEditable()
ElementStream<Event> get onLoad => loadEvent.forElement(this);
@DomName('Element.onmousedown')
@DocsEditable()
ElementStream<MouseEvent> get onMouseDown => mouseDownEvent.forElement(this);
@DomName('Element.onmouseenter')
@DocsEditable()
@Experimental() // untriaged
ElementStream<MouseEvent> get onMouseEnter => mouseEnterEvent.forElement(this);
@DomName('Element.onmouseleave')
@DocsEditable()
@Experimental() // untriaged
ElementStream<MouseEvent> get onMouseLeave => mouseLeaveEvent.forElement(this);
@DomName('Element.onmousemove')
@DocsEditable()
ElementStream<MouseEvent> get onMouseMove => mouseMoveEvent.forElement(this);
@DomName('Element.onmouseout')
@DocsEditable()
ElementStream<MouseEvent> get onMouseOut => mouseOutEvent.forElement(this);
@DomName('Element.onmouseover')
@DocsEditable()
ElementStream<MouseEvent> get onMouseOver => mouseOverEvent.forElement(this);
@DomName('Element.onmouseup')
@DocsEditable()
ElementStream<MouseEvent> get onMouseUp => mouseUpEvent.forElement(this);
@DomName('Element.onmousewheel')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
@Experimental() // non-standard
ElementStream<WheelEvent> get onMouseWheel => mouseWheelEvent.forElement(this);
@DomName('Element.onpaste')
@DocsEditable()
ElementStream<Event> get onPaste => pasteEvent.forElement(this);
@DomName('Element.onreset')
@DocsEditable()
ElementStream<Event> get onReset => resetEvent.forElement(this);
@DomName('Element.onscroll')
@DocsEditable()
ElementStream<Event> get onScroll => scrollEvent.forElement(this);
@DomName('Element.onsearch')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
ElementStream<Event> get onSearch => searchEvent.forElement(this);
@DomName('Element.onselect')
@DocsEditable()
ElementStream<Event> get onSelect => selectEvent.forElement(this);
@DomName('Element.onselectstart')
@DocsEditable()
@Experimental() // nonstandard
ElementStream<Event> get onSelectStart => selectStartEvent.forElement(this);
@DomName('Element.onsubmit')
@DocsEditable()
ElementStream<Event> get onSubmit => submitEvent.forElement(this);
@DomName('Element.ontouchcancel')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchCancel => touchCancelEvent.forElement(this);
@DomName('Element.ontouchend')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchEnd => touchEndEvent.forElement(this);
@DomName('Element.ontouchenter')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchEnter => touchEnterEvent.forElement(this);
@DomName('Element.ontouchleave')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchLeave => touchLeaveEvent.forElement(this);
@DomName('Element.ontouchmove')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchMove => touchMoveEvent.forElement(this);
@DomName('Element.ontouchstart')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
ElementStream<TouchEvent> get onTouchStart => touchStartEvent.forElement(this);
@DomName('Element.ontransitionend')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
ElementStream<TransitionEvent> get onTransitionEnd => transitionEndEvent.forElement(this);
@DomName('Element.onwebkitfullscreenchange')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
ElementStream<Event> get onFullscreenChange => fullscreenChangeEvent.forElement(this);
@DomName('Element.onwebkitfullscreenerror')
@DocsEditable()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@Experimental()
ElementStream<Event> get onFullscreenError => fullscreenErrorEvent.forElement(this);
}
class _ElementFactoryProvider {
@DomName('Document.createElement')
static Element createElement_tag(String tag) =>
document.$dom_createElement(tag);
}
/**
* Options for Element.scrollIntoView.
*/
class ScrollAlignment {
final _value;
const ScrollAlignment._internal(this._value);
toString() => 'ScrollAlignment.$_value';
/// Attempt to align the element to the top of the scrollable area.
static const TOP = const ScrollAlignment._internal('TOP');
/// Attempt to center the element in the scrollable area.
static const CENTER = const ScrollAlignment._internal('CENTER');
/// Attempt to align the element to the bottom of the scrollable area.
static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLEmbedElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.IE)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Unstable()
class EmbedElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory EmbedElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLEmbedElement.HTMLEmbedElement')
@DocsEditable()
factory EmbedElement() => document.$dom_createElement("embed");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLEmbedElement.align')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLEmbedElement-partial
@deprecated // deprecated
String get align native "HTMLEmbedElement_align_Getter";
@DomName('HTMLEmbedElement.align')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLEmbedElement-partial
@deprecated // deprecated
void set align(String value) native "HTMLEmbedElement_align_Setter";
@DomName('HTMLEmbedElement.height')
@DocsEditable()
String get height native "HTMLEmbedElement_height_Getter";
@DomName('HTMLEmbedElement.height')
@DocsEditable()
void set height(String value) native "HTMLEmbedElement_height_Setter";
@DomName('HTMLEmbedElement.name')
@DocsEditable()
String get name native "HTMLEmbedElement_name_Getter";
@DomName('HTMLEmbedElement.name')
@DocsEditable()
void set name(String value) native "HTMLEmbedElement_name_Setter";
@DomName('HTMLEmbedElement.src')
@DocsEditable()
String get src native "HTMLEmbedElement_src_Getter";
@DomName('HTMLEmbedElement.src')
@DocsEditable()
void set src(String value) native "HTMLEmbedElement_src_Setter";
@DomName('HTMLEmbedElement.type')
@DocsEditable()
String get type native "HTMLEmbedElement_type_Getter";
@DomName('HTMLEmbedElement.type')
@DocsEditable()
void set type(String value) native "HTMLEmbedElement_type_Setter";
@DomName('HTMLEmbedElement.width')
@DocsEditable()
String get width native "HTMLEmbedElement_width_Getter";
@DomName('HTMLEmbedElement.width')
@DocsEditable()
void set width(String value) native "HTMLEmbedElement_width_Setter";
@DomName('HTMLEmbedElement.__getter__')
@DocsEditable()
bool __getter__(index_OR_name) native "HTMLEmbedElement___getter___Callback";
@DomName('HTMLEmbedElement.__setter__')
@DocsEditable()
void __setter__(index_OR_name, Node value) native "HTMLEmbedElement___setter___Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('EntriesCallback')
// http://www.w3.org/TR/file-system-api/#the-entriescallback-interface
@Experimental()
typedef void _EntriesCallback(List<Entry> entries);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Entry')
// http://www.w3.org/TR/file-system-api/#the-entry-interface
@Experimental()
class Entry extends NativeFieldWrapperClass1 {
@DomName('Entry.filesystem')
@DocsEditable()
FileSystem get filesystem native "Entry_filesystem_Getter";
@DomName('Entry.fullPath')
@DocsEditable()
String get fullPath native "Entry_fullPath_Getter";
@DomName('Entry.isDirectory')
@DocsEditable()
bool get isDirectory native "Entry_isDirectory_Getter";
@DomName('Entry.isFile')
@DocsEditable()
bool get isFile native "Entry_isFile_Getter";
@DomName('Entry.name')
@DocsEditable()
String get name native "Entry_name_Getter";
void _copyTo(DirectoryEntry parent, {String name, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
if (name != null) {
_copyTo_1(parent, name, successCallback, errorCallback);
return;
}
_copyTo_2(parent);
return;
}
void _copyTo_1(parent, name, successCallback, errorCallback) native "Entry__copyTo_1_Callback";
void _copyTo_2(parent) native "Entry__copyTo_2_Callback";
Future<Entry> copyTo(DirectoryEntry parent, {String name}) {
var completer = new Completer<Entry>();
_copyTo(parent, name : name,
successCallback : (value) { completer.complete(value); },
errorCallback : (error) { completer.completeError(error); });
return completer.future;
}
@DomName('Entry.getMetadata')
@DocsEditable()
void _getMetadata(MetadataCallback successCallback, [_ErrorCallback errorCallback]) native "Entry_getMetadata_Callback";
Future<Metadata> getMetadata() {
var completer = new Completer<Metadata>();
_getMetadata(
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('Entry.getParent')
@DocsEditable()
void _getParent([_EntryCallback successCallback, _ErrorCallback errorCallback]) native "Entry_getParent_Callback";
Future<Entry> getParent() {
var completer = new Completer<Entry>();
_getParent(
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
void _moveTo(DirectoryEntry parent, {String name, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
if (name != null) {
_moveTo_1(parent, name, successCallback, errorCallback);
return;
}
_moveTo_2(parent);
return;
}
void _moveTo_1(parent, name, successCallback, errorCallback) native "Entry__moveTo_1_Callback";
void _moveTo_2(parent) native "Entry__moveTo_2_Callback";
Future<Entry> moveTo(DirectoryEntry parent, {String name}) {
var completer = new Completer<Entry>();
_moveTo(parent, name : name,
successCallback : (value) { completer.complete(value); },
errorCallback : (error) { completer.completeError(error); });
return completer.future;
}
@DomName('Entry.remove')
@DocsEditable()
void _remove(VoidCallback successCallback, [_ErrorCallback errorCallback]) native "Entry_remove_Callback";
Future remove() {
var completer = new Completer();
_remove(
() { completer.complete(); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('Entry.toURL')
@DocsEditable()
String toUrl() native "Entry_toURL_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('EntryCallback')
// http://www.w3.org/TR/file-system-api/#the-entrycallback-interface
@Experimental()
typedef void _EntryCallback(Entry entry);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('ErrorCallback')
// http://www.w3.org/TR/file-system-api/#the-errorcallback-interface
@Experimental()
typedef void _ErrorCallback(FileError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ErrorEvent')
@Unstable()
class ErrorEvent extends Event {
// To suppress missing implicit constructor warnings.
factory ErrorEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('ErrorEvent.colno')
@DocsEditable()
@Experimental() // untriaged
int get colno native "ErrorEvent_colno_Getter";
@DomName('ErrorEvent.error')
@DocsEditable()
@Experimental() // untriaged
Object get error native "ErrorEvent_error_Getter";
@DomName('ErrorEvent.filename')
@DocsEditable()
String get filename native "ErrorEvent_filename_Getter";
@DomName('ErrorEvent.lineno')
@DocsEditable()
int get lineno native "ErrorEvent_lineno_Getter";
@DomName('ErrorEvent.message')
@DocsEditable()
String get message native "ErrorEvent_message_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('Event')
class Event extends NativeFieldWrapperClass1 {
// In JS, canBubble and cancelable are technically required parameters to
// init*Event. In practice, though, if they aren't provided they simply
// default to false (since that's Boolean(undefined)).
//
// Contrary to JS, we default canBubble and cancelable to true, since that's
// what people want most of the time anyway.
factory Event(String type,
{bool canBubble: true, bool cancelable: true}) {
return new Event.eventType('Event', type, canBubble: canBubble,
cancelable: cancelable);
}
/**
* Creates a new Event object of the specified type.
*
* This is analogous to document.createEvent.
* Normally events should be created via their constructors, if available.
*
* var e = new Event.type('MouseEvent', 'mousedown', true, true);
*/
factory Event.eventType(String type, String name, {bool canBubble: true,
bool cancelable: true}) {
final Event e = document._createEvent(type);
e._initEvent(name, canBubble, cancelable);
return e;
}
@DomName('Event.AT_TARGET')
@DocsEditable()
static const int AT_TARGET = 2;
@DomName('Event.BLUR')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int BLUR = 8192;
@DomName('Event.BUBBLING_PHASE')
@DocsEditable()
static const int BUBBLING_PHASE = 3;
@DomName('Event.CAPTURING_PHASE')
@DocsEditable()
static const int CAPTURING_PHASE = 1;
@DomName('Event.CHANGE')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int CHANGE = 32768;
@DomName('Event.CLICK')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int CLICK = 64;
@DomName('Event.DBLCLICK')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int DBLCLICK = 128;
@DomName('Event.DRAGDROP')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int DRAGDROP = 2048;
@DomName('Event.FOCUS')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int FOCUS = 4096;
@DomName('Event.KEYDOWN')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int KEYDOWN = 256;
@DomName('Event.KEYPRESS')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int KEYPRESS = 1024;
@DomName('Event.KEYUP')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int KEYUP = 512;
@DomName('Event.MOUSEDOWN')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int MOUSEDOWN = 1;
@DomName('Event.MOUSEDRAG')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int MOUSEDRAG = 32;
@DomName('Event.MOUSEMOVE')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int MOUSEMOVE = 16;
@DomName('Event.MOUSEOUT')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int MOUSEOUT = 8;
@DomName('Event.MOUSEOVER')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int MOUSEOVER = 4;
@DomName('Event.MOUSEUP')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int MOUSEUP = 2;
@DomName('Event.NONE')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int NONE = 0;
@DomName('Event.SELECT')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.captureEvents
@deprecated // deprecated
static const int SELECT = 16384;
@DomName('Event.bubbles')
@DocsEditable()
bool get bubbles native "Event_bubbles_Getter";
@DomName('Event.cancelBubble')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-3-Events/#events-event-type-stopPropagation
@deprecated // deprecated
bool get cancelBubble native "Event_cancelBubble_Getter";
@DomName('Event.cancelBubble')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-3-Events/#events-event-type-stopPropagation
@deprecated // deprecated
void set cancelBubble(bool value) native "Event_cancelBubble_Setter";
@DomName('Event.cancelable')
@DocsEditable()
bool get cancelable native "Event_cancelable_Getter";
@DomName('Event.clipboardData')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// Part of copy/paste
@Experimental() // nonstandard
DataTransfer get clipboardData native "Event_clipboardData_Getter";
@DomName('Event.currentTarget')
@DocsEditable()
EventTarget get currentTarget native "Event_currentTarget_Getter";
@DomName('Event.defaultPrevented')
@DocsEditable()
bool get defaultPrevented native "Event_defaultPrevented_Getter";
@DomName('Event.eventPhase')
@DocsEditable()
int get eventPhase native "Event_eventPhase_Getter";
@DomName('Event.path')
@DocsEditable()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#extensions-to-event
@Experimental()
List<Node> get path native "Event_path_Getter";
@DomName('Event.target')
@DocsEditable()
EventTarget get target native "Event_target_Getter";
@DomName('Event.timeStamp')
@DocsEditable()
int get timeStamp native "Event_timeStamp_Getter";
@DomName('Event.type')
@DocsEditable()
String get type native "Event_type_Getter";
@DomName('Event.initEvent')
@DocsEditable()
void _initEvent(String eventTypeArg, bool canBubbleArg, bool cancelableArg) native "Event_initEvent_Callback";
@DomName('Event.preventDefault')
@DocsEditable()
void preventDefault() native "Event_preventDefault_Callback";
@DomName('Event.stopImmediatePropagation')
@DocsEditable()
void stopImmediatePropagation() native "Event_stopImmediatePropagation_Callback";
@DomName('Event.stopPropagation')
@DocsEditable()
void stopPropagation() native "Event_stopPropagation_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('EventSource')
// http://www.w3.org/TR/eventsource/#the-eventsource-interface
@Experimental() // stable
class EventSource extends EventTarget {
factory EventSource(String title, {withCredentials: false}) {
var parsedOptions = {
'withCredentials': withCredentials,
};
return EventSource._factoryEventSource(title, parsedOptions);
}
// To suppress missing implicit constructor warnings.
factory EventSource._() { throw new UnsupportedError("Not supported"); }
@DomName('EventSource.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('EventSource.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('EventSource.openEvent')
@DocsEditable()
static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
@DomName('EventSource.EventSource')
@DocsEditable()
static EventSource _factoryEventSource(String url, [Map eventSourceInit]) {
return EventSource._create_1(url, eventSourceInit);
}
@DocsEditable()
static EventSource _create_1(url, eventSourceInit) native "EventSource__create_1constructorCallback";
@DomName('EventSource.CLOSED')
@DocsEditable()
static const int CLOSED = 2;
@DomName('EventSource.CONNECTING')
@DocsEditable()
static const int CONNECTING = 0;
@DomName('EventSource.OPEN')
@DocsEditable()
static const int OPEN = 1;
@DomName('EventSource.readyState')
@DocsEditable()
int get readyState native "EventSource_readyState_Getter";
@DomName('EventSource.url')
@DocsEditable()
String get url native "EventSource_url_Getter";
@DomName('EventSource.withCredentials')
@DocsEditable()
bool get withCredentials native "EventSource_withCredentials_Getter";
@DomName('EventSource.close')
@DocsEditable()
void close() native "EventSource_close_Callback";
@DomName('EventSource.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "EventSource_addEventListener_Callback";
@DomName('EventSource.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "EventSource_dispatchEvent_Callback";
@DomName('EventSource.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "EventSource_removeEventListener_Callback";
@DomName('EventSource.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('EventSource.onmessage')
@DocsEditable()
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
@DomName('EventSource.onopen')
@DocsEditable()
Stream<Event> get onOpen => openEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Base class that supports listening for and dispatching browser events.
*
* Normally events are accessed via the Stream getter:
*
* element.onMouseOver.listen((e) => print('Mouse over!'));
*
* To access bubbling events which are declared on one element, but may bubble
* up to another element type (common for MediaElement events):
*
* MediaElement.pauseEvent.forTarget(document.body).listen(...);
*
* To useCapture on events:
*
* Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
*
* Custom events can be declared as:
*
* class DataGenerator {
* static EventStreamProvider<Event> dataEvent =
* new EventStreamProvider('data');
* }
*
* Then listeners should access the event with:
*
* DataGenerator.dataEvent.forTarget(element).listen(...);
*
* Custom events can also be accessed as:
*
* element.on['some_event'].listen(...);
*
* This approach is generally discouraged as it loses the event typing and
* some DOM events may have multiple platform-dependent event names under the
* covers. By using the standard Stream getters you will get the platform
* specific event name automatically.
*/
class Events {
/* Raw event target. */
final EventTarget _ptr;
Events(this._ptr);
Stream operator [](String type) {
return new _EventStream(_ptr, type, false);
}
}
/**
* Base class for all browser objects that support events.
*
* Use the [on] property to add, and remove events (rather than
* [$dom_addEventListener] and [$dom_removeEventListener]
* for compile-time type checks and a more concise API.
*/
@DomName('EventTarget')
class EventTarget extends NativeFieldWrapperClass1 {
/**
* This is an ease-of-use accessor for event streams which should only be
* used when an explicit accessor is not available.
*/
Events get on => new Events(this);
@DomName('EventTarget.addEventListener')
@DocsEditable()
@deprecated
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "EventTarget_addEventListener_Callback";
@DomName('EventTarget.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "EventTarget_dispatchEvent_Callback";
@DomName('EventTarget.removeEventListener')
@DocsEditable()
@deprecated
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "EventTarget_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLFieldSetElement')
@Unstable()
class FieldSetElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory FieldSetElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLFieldSetElement.HTMLFieldSetElement')
@DocsEditable()
factory FieldSetElement() => document.$dom_createElement("fieldset");
@DomName('HTMLFieldSetElement.disabled')
@DocsEditable()
bool get disabled native "HTMLFieldSetElement_disabled_Getter";
@DomName('HTMLFieldSetElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLFieldSetElement_disabled_Setter";
@DomName('HTMLFieldSetElement.elements')
@DocsEditable()
HtmlCollection get elements native "HTMLFieldSetElement_elements_Getter";
@DomName('HTMLFieldSetElement.form')
@DocsEditable()
FormElement get form native "HTMLFieldSetElement_form_Getter";
@DomName('HTMLFieldSetElement.name')
@DocsEditable()
String get name native "HTMLFieldSetElement_name_Getter";
@DomName('HTMLFieldSetElement.name')
@DocsEditable()
void set name(String value) native "HTMLFieldSetElement_name_Setter";
@DomName('HTMLFieldSetElement.type')
@DocsEditable()
String get type native "HTMLFieldSetElement_type_Getter";
@DomName('HTMLFieldSetElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLFieldSetElement_validationMessage_Getter";
@DomName('HTMLFieldSetElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLFieldSetElement_validity_Getter";
@DomName('HTMLFieldSetElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLFieldSetElement_willValidate_Getter";
@DomName('HTMLFieldSetElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLFieldSetElement_checkValidity_Callback";
@DomName('HTMLFieldSetElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLFieldSetElement_setCustomValidity_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('File')
class File extends Blob {
// To suppress missing implicit constructor warnings.
factory File._() { throw new UnsupportedError("Not supported"); }
@DomName('File.lastModifiedDate')
@DocsEditable()
DateTime get lastModifiedDate native "File_lastModifiedDate_Getter";
@DomName('File.name')
@DocsEditable()
String get name native "File_name_Getter";
@DomName('File.webkitRelativePath')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://plus.sandbox.google.com/+AddyOsmani/posts/Dk5UhZ6zfF3
String get relativePath native "File_webkitRelativePath_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('FileCallback')
// http://www.w3.org/TR/file-system-api/#the-filecallback-interface
@Experimental()
typedef void _FileCallback(File file);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileEntry')
// http://www.w3.org/TR/file-system-api/#the-fileentry-interface
@Experimental()
class FileEntry extends Entry {
// To suppress missing implicit constructor warnings.
factory FileEntry._() { throw new UnsupportedError("Not supported"); }
@DomName('FileEntry.createWriter')
@DocsEditable()
void _createWriter(_FileWriterCallback successCallback, [_ErrorCallback errorCallback]) native "FileEntry_createWriter_Callback";
Future<FileWriter> createWriter() {
var completer = new Completer<FileWriter>();
_createWriter(
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('FileEntry.file')
@DocsEditable()
void _file(_FileCallback successCallback, [_ErrorCallback errorCallback]) native "FileEntry_file_Callback";
Future<File> file() {
var completer = new Completer<File>();
_file(
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileError')
// http://dev.w3.org/2009/dap/file-system/pub/FileSystem/
@Experimental()
class FileError extends DomError {
// To suppress missing implicit constructor warnings.
factory FileError._() { throw new UnsupportedError("Not supported"); }
@DomName('FileError.ABORT_ERR')
@DocsEditable()
static const int ABORT_ERR = 3;
@DomName('FileError.ENCODING_ERR')
@DocsEditable()
static const int ENCODING_ERR = 5;
@DomName('FileError.INVALID_MODIFICATION_ERR')
@DocsEditable()
static const int INVALID_MODIFICATION_ERR = 9;
@DomName('FileError.INVALID_STATE_ERR')
@DocsEditable()
static const int INVALID_STATE_ERR = 7;
@DomName('FileError.NOT_FOUND_ERR')
@DocsEditable()
static const int NOT_FOUND_ERR = 1;
@DomName('FileError.NOT_READABLE_ERR')
@DocsEditable()
static const int NOT_READABLE_ERR = 4;
@DomName('FileError.NO_MODIFICATION_ALLOWED_ERR')
@DocsEditable()
static const int NO_MODIFICATION_ALLOWED_ERR = 6;
@DomName('FileError.PATH_EXISTS_ERR')
@DocsEditable()
static const int PATH_EXISTS_ERR = 12;
@DomName('FileError.QUOTA_EXCEEDED_ERR')
@DocsEditable()
static const int QUOTA_EXCEEDED_ERR = 10;
@DomName('FileError.SECURITY_ERR')
@DocsEditable()
static const int SECURITY_ERR = 2;
@DomName('FileError.SYNTAX_ERR')
@DocsEditable()
static const int SYNTAX_ERR = 8;
@DomName('FileError.TYPE_MISMATCH_ERR')
@DocsEditable()
static const int TYPE_MISMATCH_ERR = 11;
@DomName('FileError.code')
@DocsEditable()
int get code native "FileError_code_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileList')
class FileList extends NativeFieldWrapperClass1 with ListMixin<File>, ImmutableListMixin<File> implements List<File> {
@DomName('FileList.length')
@DocsEditable()
int get length native "FileList_length_Getter";
File operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
File _nativeIndexedGetter(int index) native "FileList_item_Callback";
void operator[]=(int index, File value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<File> mixins.
// File is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
File get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
File get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
File get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
File elementAt(int index) => this[index];
// -- end List<File> mixins.
@DomName('FileList.item')
@DocsEditable()
File item(int index) native "FileList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileReader')
class FileReader extends EventTarget {
// To suppress missing implicit constructor warnings.
factory FileReader._() { throw new UnsupportedError("Not supported"); }
@DomName('FileReader.abortEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
@DomName('FileReader.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('FileReader.loadEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
@DomName('FileReader.loadendEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
@DomName('FileReader.loadstartEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
@DomName('FileReader.progressEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
@DomName('FileReader.FileReader')
@DocsEditable()
factory FileReader() {
return FileReader._create_1();
}
@DocsEditable()
static FileReader _create_1() native "FileReader__create_1constructorCallback";
@DomName('FileReader.DONE')
@DocsEditable()
static const int DONE = 2;
@DomName('FileReader.EMPTY')
@DocsEditable()
static const int EMPTY = 0;
@DomName('FileReader.LOADING')
@DocsEditable()
static const int LOADING = 1;
@DomName('FileReader.error')
@DocsEditable()
FileError get error native "FileReader_error_Getter";
@DomName('FileReader.readyState')
@DocsEditable()
int get readyState native "FileReader_readyState_Getter";
@DomName('FileReader.result')
@DocsEditable()
Object get result native "FileReader_result_Getter";
@DomName('FileReader.abort')
@DocsEditable()
void abort() native "FileReader_abort_Callback";
@DomName('FileReader.readAsArrayBuffer')
@DocsEditable()
void readAsArrayBuffer(Blob blob) native "FileReader_readAsArrayBuffer_Callback";
@DomName('FileReader.readAsBinaryString')
@DocsEditable()
// http://blog.whatwg.org/weekly-stream-autocomplete
@deprecated // deprecated
void readAsBinaryString(Blob blob) native "FileReader_readAsBinaryString_Callback";
@DomName('FileReader.readAsDataURL')
@DocsEditable()
void readAsDataUrl(Blob blob) native "FileReader_readAsDataURL_Callback";
void readAsText(Blob blob, [String encoding]) {
if (encoding != null) {
_readAsText_1(blob, encoding);
return;
}
_readAsText_2(blob);
return;
}
void _readAsText_1(blob, encoding) native "FileReader__readAsText_1_Callback";
void _readAsText_2(blob) native "FileReader__readAsText_2_Callback";
@DomName('FileReader.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "FileReader_addEventListener_Callback";
@DomName('FileReader.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "FileReader_dispatchEvent_Callback";
@DomName('FileReader.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "FileReader_removeEventListener_Callback";
@DomName('FileReader.onabort')
@DocsEditable()
Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
@DomName('FileReader.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('FileReader.onload')
@DocsEditable()
Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
@DomName('FileReader.onloadend')
@DocsEditable()
Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
@DomName('FileReader.onloadstart')
@DocsEditable()
Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
@DomName('FileReader.onprogress')
@DocsEditable()
Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Stream')
@Experimental() // untriaged
class FileStream extends NativeFieldWrapperClass1 {
@DomName('Stream.type')
@DocsEditable()
@Experimental() // untriaged
String get type native "Stream_type_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMFileSystem')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://www.w3.org/TR/file-system-api/
class FileSystem extends NativeFieldWrapperClass1 {
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('DOMFileSystem.name')
@DocsEditable()
String get name native "DOMFileSystem_name_Getter";
@DomName('DOMFileSystem.root')
@DocsEditable()
DirectoryEntry get root native "DOMFileSystem_root_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('FileSystemCallback')
// http://www.w3.org/TR/file-system-api/#the-filesystemcallback-interface
@Experimental()
typedef void _FileSystemCallback(FileSystem fileSystem);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileWriter')
// http://www.w3.org/TR/file-writer-api/#the-filewriter-interface
@Experimental()
class FileWriter extends EventTarget {
// To suppress missing implicit constructor warnings.
factory FileWriter._() { throw new UnsupportedError("Not supported"); }
@DomName('FileWriter.abortEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
@DomName('FileWriter.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('FileWriter.progressEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
@DomName('FileWriter.writeEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> writeEvent = const EventStreamProvider<ProgressEvent>('write');
@DomName('FileWriter.writeendEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> writeEndEvent = const EventStreamProvider<ProgressEvent>('writeend');
@DomName('FileWriter.writestartEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> writeStartEvent = const EventStreamProvider<ProgressEvent>('writestart');
@DomName('FileWriter.DONE')
@DocsEditable()
static const int DONE = 2;
@DomName('FileWriter.INIT')
@DocsEditable()
static const int INIT = 0;
@DomName('FileWriter.WRITING')
@DocsEditable()
static const int WRITING = 1;
@DomName('FileWriter.error')
@DocsEditable()
FileError get error native "FileWriter_error_Getter";
@DomName('FileWriter.length')
@DocsEditable()
int get length native "FileWriter_length_Getter";
@DomName('FileWriter.position')
@DocsEditable()
int get position native "FileWriter_position_Getter";
@DomName('FileWriter.readyState')
@DocsEditable()
int get readyState native "FileWriter_readyState_Getter";
@DomName('FileWriter.abort')
@DocsEditable()
void abort() native "FileWriter_abort_Callback";
@DomName('FileWriter.seek')
@DocsEditable()
void seek(int position) native "FileWriter_seek_Callback";
@DomName('FileWriter.truncate')
@DocsEditable()
void truncate(int size) native "FileWriter_truncate_Callback";
@DomName('FileWriter.write')
@DocsEditable()
void write(Blob data) native "FileWriter_write_Callback";
@DomName('FileWriter.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "FileWriter_addEventListener_Callback";
@DomName('FileWriter.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "FileWriter_dispatchEvent_Callback";
@DomName('FileWriter.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "FileWriter_removeEventListener_Callback";
@DomName('FileWriter.onabort')
@DocsEditable()
Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
@DomName('FileWriter.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('FileWriter.onprogress')
@DocsEditable()
Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
@DomName('FileWriter.onwrite')
@DocsEditable()
Stream<ProgressEvent> get onWrite => writeEvent.forTarget(this);
@DomName('FileWriter.onwriteend')
@DocsEditable()
Stream<ProgressEvent> get onWriteEnd => writeEndEvent.forTarget(this);
@DomName('FileWriter.onwritestart')
@DocsEditable()
Stream<ProgressEvent> get onWriteStart => writeStartEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('FileWriterCallback')
// http://www.w3.org/TR/file-writer-api/#idl-def-FileWriter
@Experimental()
typedef void _FileWriterCallback(FileWriter fileWriter);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FocusEvent')
class FocusEvent extends UIEvent {
// To suppress missing implicit constructor warnings.
factory FocusEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('FocusEvent.relatedTarget')
@DocsEditable()
EventTarget get relatedTarget native "FocusEvent_relatedTarget_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FontLoader')
// http://www.w3.org/TR/css3-fonts/#document-fontloader
@Experimental()
class FontLoader extends EventTarget {
// To suppress missing implicit constructor warnings.
factory FontLoader._() { throw new UnsupportedError("Not supported"); }
@DomName('FontLoader.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('FontLoader.loadEvent')
@DocsEditable()
static const EventStreamProvider<CssFontFaceLoadEvent> loadEvent = const EventStreamProvider<CssFontFaceLoadEvent>('load');
@DomName('FontLoader.loadingEvent')
@DocsEditable()
static const EventStreamProvider<CssFontFaceLoadEvent> loadingEvent = const EventStreamProvider<CssFontFaceLoadEvent>('loading');
@DomName('FontLoader.loadingdoneEvent')
@DocsEditable()
static const EventStreamProvider<CssFontFaceLoadEvent> loadingDoneEvent = const EventStreamProvider<CssFontFaceLoadEvent>('loadingdone');
@DomName('FontLoader.loadstartEvent')
@DocsEditable()
static const EventStreamProvider<CssFontFaceLoadEvent> loadStartEvent = const EventStreamProvider<CssFontFaceLoadEvent>('loadstart');
@DomName('FontLoader.loading')
@DocsEditable()
bool get loading native "FontLoader_loading_Getter";
@DomName('FontLoader.checkFont')
@DocsEditable()
bool checkFont(String font, String text) native "FontLoader_checkFont_Callback";
@DomName('FontLoader.loadFont')
@DocsEditable()
void loadFont(Map params) native "FontLoader_loadFont_Callback";
@DomName('FontLoader.notifyWhenFontsReady')
@DocsEditable()
void notifyWhenFontsReady(VoidCallback callback) native "FontLoader_notifyWhenFontsReady_Callback";
@DomName('FontLoader.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "FontLoader_addEventListener_Callback";
@DomName('FontLoader.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "FontLoader_dispatchEvent_Callback";
@DomName('FontLoader.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "FontLoader_removeEventListener_Callback";
@DomName('FontLoader.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('FontLoader.onload')
@DocsEditable()
Stream<CssFontFaceLoadEvent> get onLoad => loadEvent.forTarget(this);
@DomName('FontLoader.onloading')
@DocsEditable()
Stream<CssFontFaceLoadEvent> get onLoading => loadingEvent.forTarget(this);
@DomName('FontLoader.onloadingdone')
@DocsEditable()
Stream<CssFontFaceLoadEvent> get onLoadingDone => loadingDoneEvent.forTarget(this);
@DomName('FontLoader.onloadstart')
@DocsEditable()
Stream<CssFontFaceLoadEvent> get onLoadStart => loadStartEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FormData')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
class FormData extends NativeFieldWrapperClass1 {
@DomName('FormData.FormData')
@DocsEditable()
factory FormData([FormElement form]) => _create(form);
@DocsEditable()
static FormData _create(form) native "FormData_constructorCallback";
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('FormData.append')
@DocsEditable()
void append(String name, String value) native "FormData_append_Callback";
@DomName('FormData.appendBlob')
@DocsEditable()
void appendBlob(String name, Blob value, [String filename]) native "FormData_appendBlob_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLFormElement')
class FormElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory FormElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLFormElement.autocompleteEvent')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
@Experimental()
static const EventStreamProvider<Event> autocompleteEvent = const EventStreamProvider<Event>('autocomplete');
@DomName('HTMLFormElement.autocompleteerrorEvent')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
@Experimental()
static const EventStreamProvider<AutocompleteErrorEvent> autocompleteErrorEvent = const EventStreamProvider<AutocompleteErrorEvent>('autocompleteerror');
@DomName('HTMLFormElement.HTMLFormElement')
@DocsEditable()
factory FormElement() => document.$dom_createElement("form");
@DomName('HTMLFormElement.acceptCharset')
@DocsEditable()
String get acceptCharset native "HTMLFormElement_acceptCharset_Getter";
@DomName('HTMLFormElement.acceptCharset')
@DocsEditable()
void set acceptCharset(String value) native "HTMLFormElement_acceptCharset_Setter";
@DomName('HTMLFormElement.action')
@DocsEditable()
String get action native "HTMLFormElement_action_Getter";
@DomName('HTMLFormElement.action')
@DocsEditable()
void set action(String value) native "HTMLFormElement_action_Setter";
@DomName('HTMLFormElement.autocomplete')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
@Experimental()
String get autocomplete native "HTMLFormElement_autocomplete_Getter";
@DomName('HTMLFormElement.autocomplete')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
@Experimental()
void set autocomplete(String value) native "HTMLFormElement_autocomplete_Setter";
@DomName('HTMLFormElement.encoding')
@DocsEditable()
String get encoding native "HTMLFormElement_encoding_Getter";
@DomName('HTMLFormElement.encoding')
@DocsEditable()
void set encoding(String value) native "HTMLFormElement_encoding_Setter";
@DomName('HTMLFormElement.enctype')
@DocsEditable()
String get enctype native "HTMLFormElement_enctype_Getter";
@DomName('HTMLFormElement.enctype')
@DocsEditable()
void set enctype(String value) native "HTMLFormElement_enctype_Setter";
@DomName('HTMLFormElement.length')
@DocsEditable()
int get length native "HTMLFormElement_length_Getter";
@DomName('HTMLFormElement.method')
@DocsEditable()
String get method native "HTMLFormElement_method_Getter";
@DomName('HTMLFormElement.method')
@DocsEditable()
void set method(String value) native "HTMLFormElement_method_Setter";
@DomName('HTMLFormElement.name')
@DocsEditable()
String get name native "HTMLFormElement_name_Getter";
@DomName('HTMLFormElement.name')
@DocsEditable()
void set name(String value) native "HTMLFormElement_name_Setter";
@DomName('HTMLFormElement.noValidate')
@DocsEditable()
bool get noValidate native "HTMLFormElement_noValidate_Getter";
@DomName('HTMLFormElement.noValidate')
@DocsEditable()
void set noValidate(bool value) native "HTMLFormElement_noValidate_Setter";
@DomName('HTMLFormElement.target')
@DocsEditable()
String get target native "HTMLFormElement_target_Getter";
@DomName('HTMLFormElement.target')
@DocsEditable()
void set target(String value) native "HTMLFormElement_target_Setter";
@DomName('HTMLFormElement.__getter__')
@DocsEditable()
Node __getter__(int index) native "HTMLFormElement___getter___Callback";
@DomName('HTMLFormElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLFormElement_checkValidity_Callback";
@DomName('HTMLFormElement.requestAutocomplete')
@DocsEditable()
// http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-October/037711.html
@Experimental()
void requestAutocomplete() native "HTMLFormElement_requestAutocomplete_Callback";
@DomName('HTMLFormElement.reset')
@DocsEditable()
void reset() native "HTMLFormElement_reset_Callback";
@DomName('HTMLFormElement.submit')
@DocsEditable()
void submit() native "HTMLFormElement_submit_Callback";
@DomName('HTMLFormElement.onautocomplete')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
@Experimental()
ElementStream<Event> get onAutocomplete => autocompleteEvent.forElement(this);
@DomName('HTMLFormElement.onautocompleteerror')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
@Experimental()
ElementStream<AutocompleteErrorEvent> get onAutocompleteError => autocompleteErrorEvent.forElement(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Gamepad')
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepad-interface
@Experimental()
class Gamepad extends NativeFieldWrapperClass1 {
@DomName('Gamepad.axes')
@DocsEditable()
List<num> get axes native "Gamepad_axes_Getter";
@DomName('Gamepad.buttons')
@DocsEditable()
List<num> get buttons native "Gamepad_buttons_Getter";
@DomName('Gamepad.id')
@DocsEditable()
String get id native "Gamepad_id_Getter";
@DomName('Gamepad.index')
@DocsEditable()
int get index native "Gamepad_index_Getter";
@DomName('Gamepad.timestamp')
@DocsEditable()
int get timestamp native "Gamepad_timestamp_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('Geolocation')
@Unstable()
class Geolocation extends NativeFieldWrapperClass1 {
@DomName('Geolocation.getCurrentPosition')
Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
Duration timeout, Duration maximumAge}) {
var options = {};
if (enableHighAccuracy != null) {
options['enableHighAccuracy'] = enableHighAccuracy;
}
if (timeout != null) {
options['timeout'] = timeout.inMilliseconds;
}
if (maximumAge != null) {
options['maximumAge'] = maximumAge.inMilliseconds;
}
var completer = new Completer<Geoposition>();
try {
_getCurrentPosition(
(position) {
completer.complete(_ensurePosition(position));
},
(error) {
completer.completeError(error);
},
options);
} catch (e, stacktrace) {
completer.completeError(e, stacktrace);
}
return completer.future;
}
@DomName('Geolocation.watchPosition')
Stream<Geoposition> watchPosition({bool enableHighAccuracy,
Duration timeout, Duration maximumAge}) {
var options = {};
if (enableHighAccuracy != null) {
options['enableHighAccuracy'] = enableHighAccuracy;
}
if (timeout != null) {
options['timeout'] = timeout.inMilliseconds;
}
if (maximumAge != null) {
options['maximumAge'] = maximumAge.inMilliseconds;
}
int watchId;
var controller;
controller = new StreamController<Geoposition>(sync: true,
onListen: () {
assert(watchId == null);
watchId = _watchPosition(
(position) {
controller.add(_ensurePosition(position));
},
(error) {
controller.addError(error);
},
options);
},
onCancel: () {
assert(watchId != null);
_clearWatch(watchId);
});
return controller.stream;
}
Geoposition _ensurePosition(domPosition) {
return domPosition;
}
@DomName('Geolocation.clearWatch')
@DocsEditable()
void _clearWatch(int watchID) native "Geolocation_clearWatch_Callback";
@DomName('Geolocation.getCurrentPosition')
@DocsEditable()
void _getCurrentPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) native "Geolocation_getCurrentPosition_Callback";
@DomName('Geolocation.watchPosition')
@DocsEditable()
int _watchPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) native "Geolocation_watchPosition_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Geoposition')
@Unstable()
class Geoposition extends NativeFieldWrapperClass1 {
@DomName('Geoposition.coords')
@DocsEditable()
Coordinates get coords native "Geoposition_coords_Getter";
@DomName('Geoposition.timestamp')
@DocsEditable()
int get timestamp native "Geoposition_timestamp_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* An `<hr>` tag.
*/
@DomName('HTMLHRElement')
class HRElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory HRElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLHRElement.HTMLHRElement')
@DocsEditable()
factory HRElement() => document.$dom_createElement("hr");
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('HashChangeEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Unstable()
class HashChangeEvent extends Event {
factory HashChangeEvent(String type,
{bool canBubble: true, bool cancelable: true, String oldUrl,
String newUrl}) {
var event = document._createEvent("HashChangeEvent");
event._initHashChangeEvent(type, canBubble, cancelable, oldUrl, newUrl);
return event;
}
// To suppress missing implicit constructor warnings.
factory HashChangeEvent._() { throw new UnsupportedError("Not supported"); }
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HashChangeEvent.newURL')
@DocsEditable()
String get newUrl native "HashChangeEvent_newURL_Getter";
@DomName('HashChangeEvent.oldURL')
@DocsEditable()
String get oldUrl native "HashChangeEvent_oldURL_Getter";
@DomName('HashChangeEvent.initHashChangeEvent')
@DocsEditable()
void _initHashChangeEvent(String type, bool canBubble, bool cancelable, String oldURL, String newURL) native "HashChangeEvent_initHashChangeEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLHeadElement')
class HeadElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory HeadElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLHeadElement.HTMLHeadElement')
@DocsEditable()
factory HeadElement() => document.$dom_createElement("head");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLHeadingElement')
class HeadingElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory HeadingElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable()
factory HeadingElement.h1() => document.$dom_createElement("h1");
@DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable()
factory HeadingElement.h2() => document.$dom_createElement("h2");
@DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable()
factory HeadingElement.h3() => document.$dom_createElement("h3");
@DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable()
factory HeadingElement.h4() => document.$dom_createElement("h4");
@DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable()
factory HeadingElement.h5() => document.$dom_createElement("h5");
@DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable()
factory HeadingElement.h6() => document.$dom_createElement("h6");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('History')
class History extends NativeFieldWrapperClass1 implements HistoryBase {
/**
* Checks if the State APIs are supported on the current platform.
*
* See also:
*
* * [pushState]
* * [replaceState]
* * [state]
*/
static bool get supportsState => true;
@DomName('History.length')
@DocsEditable()
int get length native "History_length_Getter";
@DomName('History.state')
@DocsEditable()
dynamic get state native "History_state_Getter";
@DomName('History.back')
@DocsEditable()
void back() native "History_back_Callback";
@DomName('History.forward')
@DocsEditable()
void forward() native "History_forward_Callback";
@DomName('History.go')
@DocsEditable()
void go(int distance) native "History_go_Callback";
@DomName('History.pushState')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
void pushState(Object data, String title, [String url]) native "History_pushState_Callback";
@DomName('History.replaceState')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
void replaceState(Object data, String title, [String url]) native "History_replaceState_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HmacKeyParams')
@Experimental() // untriaged
class HmacKeyParams extends Algorithm {
// To suppress missing implicit constructor warnings.
factory HmacKeyParams._() { throw new UnsupportedError("Not supported"); }
@DomName('HmacKeyParams.hash')
@DocsEditable()
@Experimental() // untriaged
Algorithm get hash native "HmacKeyParams_hash_Getter";
@DomName('HmacKeyParams.length')
@DocsEditable()
@Experimental() // untriaged
int get length native "HmacKeyParams_length_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HmacParams')
@Experimental() // untriaged
class HmacParams extends Algorithm {
// To suppress missing implicit constructor warnings.
factory HmacParams._() { throw new UnsupportedError("Not supported"); }
@DomName('HmacParams.hash')
@DocsEditable()
@Experimental() // untriaged
Algorithm get hash native "HmacParams_hash_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLAllCollection')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-all
@deprecated // deprecated
class HtmlAllCollection extends NativeFieldWrapperClass1 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
@DomName('HTMLAllCollection.length')
@DocsEditable()
int get length native "HTMLAllCollection_length_Getter";
Node operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Node _nativeIndexedGetter(int index) native "HTMLAllCollection_item_Callback";
void operator[]=(int index, Node value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Node> mixins.
// Node is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Node get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Node get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Node get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Node elementAt(int index) => this[index];
// -- end List<Node> mixins.
@DomName('HTMLAllCollection.__getter__')
@DocsEditable()
Node __getter__(int index) native "HTMLAllCollection___getter___Callback";
@DomName('HTMLAllCollection.item')
@DocsEditable()
Node item(int index) native "HTMLAllCollection_item_Callback";
@DomName('HTMLAllCollection.namedItem')
@DocsEditable()
Node namedItem(String name) native "HTMLAllCollection_namedItem_Callback";
@DomName('HTMLAllCollection.tags')
@DocsEditable()
List<Node> tags(String name) native "HTMLAllCollection_tags_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLCollection')
class HtmlCollection extends NativeFieldWrapperClass1 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
@DomName('HTMLCollection.length')
@DocsEditable()
int get length native "HTMLCollection_length_Getter";
Node operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Node _nativeIndexedGetter(int index) native "HTMLCollection_item_Callback";
void operator[]=(int index, Node value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Node> mixins.
// Node is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Node get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Node get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Node get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Node elementAt(int index) => this[index];
// -- end List<Node> mixins.
@DomName('HTMLCollection.__getter__')
@DocsEditable()
Node __getter__(String name) native "HTMLCollection___getter___Callback";
@DomName('HTMLCollection.item')
@DocsEditable()
Node item(int index) native "HTMLCollection_item_Callback";
@DomName('HTMLCollection.namedItem')
@DocsEditable()
Node namedItem(String name) native "HTMLCollection_namedItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('HTMLDocument')
class HtmlDocument extends Document {
// To suppress missing implicit constructor warnings.
factory HtmlDocument._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLDocument.activeElement')
@DocsEditable()
Element get activeElement native "HTMLDocument_activeElement_Getter";
@DomName('HTMLDocument.captureEvents')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture
@deprecated // deprecated
void captureEvents() native "HTMLDocument_captureEvents_Callback";
@DomName('HTMLDocument.releaseEvents')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture
@deprecated // deprecated
void releaseEvents() native "HTMLDocument_releaseEvents_Callback";
@DomName('Document.body')
BodyElement get body => _body;
@DomName('Document.body')
void set body(BodyElement value) {
_body = value;
}
@DomName('Document.caretRangeFromPoint')
Range caretRangeFromPoint(int x, int y) {
return _caretRangeFromPoint(x, y);
}
@DomName('Document.elementFromPoint')
Element elementFromPoint(int x, int y) {
return _elementFromPoint(x, y);
}
/**
* Checks if the getCssCanvasContext API is supported on the current platform.
*
* See also:
*
* * [getCssCanvasContext]
*/
static bool get supportsCssCanvasContext => true;
/**
* Gets a CanvasRenderingContext which can be used as the CSS background of an
* element.
*
* CSS:
*
* background: -webkit-canvas(backgroundCanvas)
*
* Generate the canvas:
*
* var context = document.getCssCanvasContext('2d', 'backgroundCanvas',
* 100, 100);
* context.fillStyle = 'red';
* context.fillRect(0, 0, 100, 100);
*
* See also:
*
* * [supportsCssCanvasContext]
* * [CanvasElement.getContext]
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@DomName('Document.getCSSCanvasContext')
CanvasRenderingContext getCssCanvasContext(String contextId, String name,
int width, int height) {
return _getCssCanvasContext(contextId, name, width, height);
}
@DomName('Document.head')
HeadElement get head => _head;
@DomName('Document.lastModified')
String get lastModified => _lastModified;
@DomName('Document.preferredStylesheetSet')
String get preferredStylesheetSet => _preferredStylesheetSet;
@DomName('Document.referrer')
String get referrer => _referrer;
@DomName('Document.selectedStylesheetSet')
String get selectedStylesheetSet => _selectedStylesheetSet;
void set selectedStylesheetSet(String value) {
_selectedStylesheetSet = value;
}
@DomName('Document.styleSheets')
List<StyleSheet> get styleSheets => _styleSheets;
@DomName('Document.title')
String get title => _title;
@DomName('Document.title')
void set title(String value) {
_title = value;
}
@DomName('Document.webkitCancelFullScreen')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
void cancelFullScreen() {
_webkitCancelFullScreen();
}
@DomName('Document.webkitExitFullscreen')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
void exitFullscreen() {
_webkitExitFullscreen();
}
@DomName('Document.webkitExitPointerLock')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
void exitPointerLock() {
_webkitExitPointerLock();
}
@DomName('Document.webkitFullscreenElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
Element get fullscreenElement => _webkitFullscreenElement;
@DomName('Document.webkitFullscreenEnabled')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
bool get fullscreenEnabled => _webkitFullscreenEnabled;
@DomName('Document.webkitHidden')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
bool get hidden => _webkitHidden;
@DomName('Document.webkitIsFullScreen')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
bool get isFullScreen => _webkitIsFullScreen;
@DomName('Document.webkitPointerLockElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
Element get pointerLockElement =>
_webkitPointerLockElement;
@DomName('Document.webkitVisibilityState')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
String get visibilityState => _webkitVisibilityState;
@Experimental
void register(String tag, Type custom) {
_Utils.register(tag, custom);
}
// Note: used to polyfill <template>
Document _templateContentsOwner;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLElement')
class HtmlElement extends Element {
// To suppress missing implicit constructor warnings.
factory HtmlElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLElement.contentEditable')
@DocsEditable()
String get contentEditable native "HTMLElement_contentEditable_Getter";
@DomName('HTMLElement.contentEditable')
@DocsEditable()
void set contentEditable(String value) native "HTMLElement_contentEditable_Setter";
@DomName('HTMLElement.dir')
@DocsEditable()
String get dir native "HTMLElement_dir_Getter";
@DomName('HTMLElement.dir')
@DocsEditable()
void set dir(String value) native "HTMLElement_dir_Setter";
@DomName('HTMLElement.draggable')
@DocsEditable()
bool get draggable native "HTMLElement_draggable_Getter";
@DomName('HTMLElement.draggable')
@DocsEditable()
void set draggable(bool value) native "HTMLElement_draggable_Setter";
@DomName('HTMLElement.hidden')
@DocsEditable()
bool get hidden native "HTMLElement_hidden_Getter";
@DomName('HTMLElement.hidden')
@DocsEditable()
void set hidden(bool value) native "HTMLElement_hidden_Setter";
@DomName('HTMLElement.innerHTML')
@DocsEditable()
String get _innerHtml native "HTMLElement_innerHTML_Getter";
@DomName('HTMLElement.innerHTML')
@DocsEditable()
void set _innerHtml(String value) native "HTMLElement_innerHTML_Setter";
@DomName('HTMLElement.inputMethodContext')
@DocsEditable()
@Experimental() // untriaged
InputMethodContext get inputMethodContext native "HTMLElement_inputMethodContext_Getter";
@DomName('HTMLElement.isContentEditable')
@DocsEditable()
bool get isContentEditable native "HTMLElement_isContentEditable_Getter";
@DomName('HTMLElement.lang')
@DocsEditable()
String get lang native "HTMLElement_lang_Getter";
@DomName('HTMLElement.lang')
@DocsEditable()
void set lang(String value) native "HTMLElement_lang_Setter";
@DomName('HTMLElement.outerHTML')
@DocsEditable()
String get outerHtml native "HTMLElement_outerHTML_Getter";
@DomName('HTMLElement.spellcheck')
@DocsEditable()
// http://blog.whatwg.org/the-road-to-html-5-spellchecking
@Experimental() // nonstandard
bool get spellcheck native "HTMLElement_spellcheck_Getter";
@DomName('HTMLElement.spellcheck')
@DocsEditable()
// http://blog.whatwg.org/the-road-to-html-5-spellchecking
@Experimental() // nonstandard
void set spellcheck(bool value) native "HTMLElement_spellcheck_Setter";
@DomName('HTMLElement.tabIndex')
@DocsEditable()
int get tabIndex native "HTMLElement_tabIndex_Getter";
@DomName('HTMLElement.tabIndex')
@DocsEditable()
void set tabIndex(int value) native "HTMLElement_tabIndex_Setter";
@DomName('HTMLElement.title')
@DocsEditable()
String get title native "HTMLElement_title_Getter";
@DomName('HTMLElement.title')
@DocsEditable()
void set title(String value) native "HTMLElement_title_Setter";
@DomName('HTMLElement.translate')
@DocsEditable()
bool get translate native "HTMLElement_translate_Getter";
@DomName('HTMLElement.translate')
@DocsEditable()
void set translate(bool value) native "HTMLElement_translate_Setter";
@DomName('HTMLElement.webkitdropzone')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute
String get dropzone native "HTMLElement_webkitdropzone_Getter";
@DomName('HTMLElement.webkitdropzone')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute
void set dropzone(String value) native "HTMLElement_webkitdropzone_Setter";
@DomName('HTMLElement.click')
@DocsEditable()
void click() native "HTMLElement_click_Callback";
@DomName('HTMLElement.insertAdjacentElement')
@DocsEditable()
@Experimental() // non-standard
Element insertAdjacentElement(String where, Element element) native "HTMLElement_insertAdjacentElement_Callback";
@DomName('HTMLElement.insertAdjacentHTML')
@DocsEditable()
void insertAdjacentHtml(String where, String html) native "HTMLElement_insertAdjacentHTML_Callback";
@DomName('HTMLElement.insertAdjacentText')
@DocsEditable()
@Experimental() // non-standard
void insertAdjacentText(String where, String text) native "HTMLElement_insertAdjacentText_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLFormControlsCollection')
class HtmlFormControlsCollection extends HtmlCollection {
// To suppress missing implicit constructor warnings.
factory HtmlFormControlsCollection._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLFormControlsCollection.__getter__')
@DocsEditable()
Node __getter__(int index) native "HTMLFormControlsCollection___getter___Callback";
@DomName('HTMLFormControlsCollection.namedItem')
@DocsEditable()
Node namedItem(String name) native "HTMLFormControlsCollection_namedItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLHtmlElement')
class HtmlHtmlElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory HtmlHtmlElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLHtmlElement.HTMLHtmlElement')
@DocsEditable()
factory HtmlHtmlElement() => document.$dom_createElement("html");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLOptionsCollection')
class HtmlOptionsCollection extends HtmlCollection {
// To suppress missing implicit constructor warnings.
factory HtmlOptionsCollection._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* A utility for retrieving data from a URL.
*
* HttpRequest can be used to obtain data from http, ftp, and file
* protocols.
*
* For example, suppose we're developing these API docs, and we
* wish to retrieve the HTML of the top-level page and print it out.
* The easiest way to do that would be:
*
* HttpRequest.getString('http://api.dartlang.org').then((response) {
* print(response);
* });
*
* **Important**: With the default behavior of this class, your
* code making the request should be served from the same origin (domain name,
* port, and application layer protocol) as the URL you are trying to access
* with HttpRequest. However, there are ways to
* [get around this restriction](http://www.dartlang.org/articles/json-web-service/#note-on-jsonp).
*
* See also:
*
* * [Dart article on using HttpRequests](http://www.dartlang.org/articles/json-web-service/#getting-data)
* * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest)
* * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
*/
@DomName('XMLHttpRequest')
class HttpRequest extends XmlHttpRequestEventTarget {
/**
* Creates a URL get request for the specified [url].
*
* The server response must be a `text/` mime type for this request to
* succeed.
*
* This is similar to [request] but specialized for HTTP GET requests which
* return text content.
*
* See also:
*
* * [request]
*/
static Future<String> getString(String url,
{bool withCredentials, void onProgress(ProgressEvent e)}) {
return request(url, withCredentials: withCredentials,
onProgress: onProgress).then((xhr) => xhr.responseText);
}
/**
* Makes a server POST request with the specified data encoded as form data.
*
* This is similar to sending a FormData object with broader browser
* support but limited to string values.
*
* See also:
*
* * [request]
*/
static Future<HttpRequest> postFormData(String url, Map<String, String> data,
{bool withCredentials, String responseType,
Map<String, String> requestHeaders,
void onProgress(ProgressEvent e)}) {
var parts = [];
data.forEach((key, value) {
parts.add('${Uri.encodeQueryComponent(key)}='
'${Uri.encodeQueryComponent(value)}');
});
var formData = parts.join('&');
if (requestHeaders == null) {
requestHeaders = <String, String>{};
}
requestHeaders.putIfAbsent('Content-Type',
() => 'application/x-www-form-urlencoded; charset=UTF-8');
return request(url, method: 'POST', withCredentials: withCredentials,
responseType: responseType,
requestHeaders: requestHeaders, sendData: formData,
onProgress: onProgress);
}
/**
* Creates a URL request for the specified [url].
*
* By default this will do an HTTP GET request, this can be overridden with
* [method].
*
* The Future is completed when the response is available.
*
* The [withCredentials] parameter specified that credentials such as a cookie
* (already) set in the header or
* [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2)
* should be specified for the request. Details to keep in mind when using
* credentials:
*
* * Using credentials is only useful for cross-origin requests.
* * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildcard (*).
* * The `Access-Control-Allow-Credentials` header of `url` must be set to true.
* * If `Access-Control-Expose-Headers` has not been set to true, only a subset of all the response headers will be returned when calling [getAllRequestHeaders].
*
* Note that requests for file:// URIs are only supported by Chrome extensions
* with appropriate permissions in their manifest. Requests to file:// URIs
* will also never fail- the Future will always complete successfully, even
* when the file cannot be found.
*
* See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
*/
static Future<HttpRequest> request(String url,
{String method, bool withCredentials, String responseType,
String mimeType, Map<String, String> requestHeaders, sendData,
void onProgress(ProgressEvent e)}) {
var completer = new Completer<HttpRequest>();
var xhr = new HttpRequest();
if (method == null) {
method = 'GET';
}
xhr.open(method, url, async: true);
if (withCredentials != null) {
xhr.withCredentials = withCredentials;
}
if (responseType != null) {
xhr.responseType = responseType;
}
if (mimeType != null) {
xhr.overrideMimeType(mimeType);
}
if (requestHeaders != null) {
requestHeaders.forEach((header, value) {
xhr.setRequestHeader(header, value);
});
}
if (onProgress != null) {
xhr.onProgress.listen(onProgress);
}
xhr.onLoad.listen((e) {
// Note: file:// URIs have status of 0.
if ((xhr.status >= 200 && xhr.status < 300) ||
xhr.status == 0 || xhr.status == 304) {
completer.complete(xhr);
} else {
completer.completeError(e);
}
});
xhr.onError.listen((e) {
completer.completeError(e);
});
if (sendData != null) {
xhr.send(sendData);
} else {
xhr.send();
}
return completer.future;
}
/**
* Checks to see if the Progress event is supported on the current platform.
*/
static bool get supportsProgressEvent {
return true;
}
/**
* Checks to see if the current platform supports making cross origin
* requests.
*
* Note that even if cross origin requests are supported, they still may fail
* if the destination server does not support CORS requests.
*/
static bool get supportsCrossOrigin {
return true;
}
/**
* Checks to see if the LoadEnd event is supported on the current platform.
*/
static bool get supportsLoadEndEvent {
return true;
}
/**
* Checks to see if the overrideMimeType method is supported on the current
* platform.
*/
static bool get supportsOverrideMimeType {
return true;
}
/**
* Makes a cross-origin request to the specified URL.
*
* This API provides a subset of [request] which works on IE9. If IE9
* cross-origin support is not required then [request] should be used instead.
*/
@Experimental()
static Future<String> requestCrossOrigin(String url,
{String method, String sendData}) {
if (supportsCrossOrigin) {
return request(url, method: method, sendData: sendData).then((xhr) {
return xhr.responseText;
});
}
}
// To suppress missing implicit constructor warnings.
factory HttpRequest._() { throw new UnsupportedError("Not supported"); }
@DomName('XMLHttpRequest.readystatechangeEvent')
@DocsEditable()
static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
/**
* General constructor for any type of request (GET, POST, etc).
*
* This call is used in conjunction with [open]:
*
* var request = new HttpRequest();
* request.open('GET', 'http://dartlang.org');
* request.onLoad.listen((event) => print(
* 'Request complete ${event.target.reponseText}'));
* request.send();
*
* is the (more verbose) equivalent of
*
* HttpRequest.getString('http://dartlang.org').then(
* (result) => print('Request complete: $result'));
*/
@DomName('XMLHttpRequest.XMLHttpRequest')
@DocsEditable()
factory HttpRequest() => _create();
@DocsEditable()
static HttpRequest _create() native "XMLHttpRequest_constructorCallback";
@DomName('XMLHttpRequest.DONE')
@DocsEditable()
static const int DONE = 4;
@DomName('XMLHttpRequest.HEADERS_RECEIVED')
@DocsEditable()
static const int HEADERS_RECEIVED = 2;
@DomName('XMLHttpRequest.LOADING')
@DocsEditable()
static const int LOADING = 3;
@DomName('XMLHttpRequest.OPENED')
@DocsEditable()
static const int OPENED = 1;
@DomName('XMLHttpRequest.UNSENT')
@DocsEditable()
static const int UNSENT = 0;
/**
* Indicator of the current state of the request:
*
* <table>
* <tr>
* <td>Value</td>
* <td>State</td>
* <td>Meaning</td>
* </tr>
* <tr>
* <td>0</td>
* <td>unsent</td>
* <td><code>open()</code> has not yet been called</td>
* </tr>
* <tr>
* <td>1</td>
* <td>opened</td>
* <td><code>send()</code> has not yet been called</td>
* </tr>
* <tr>
* <td>2</td>
* <td>headers received</td>
* <td><code>sent()</code> has been called; response headers and <code>status</code> are available</td>
* </tr>
* <tr>
* <td>3</td> <td>loading</td> <td><code>responseText</code> holds some data</td>
* </tr>
* <tr>
* <td>4</td> <td>done</td> <td>request is complete</td>
* </tr>
* </table>
*/
@DomName('XMLHttpRequest.readyState')
@DocsEditable()
int get readyState native "XMLHttpRequest_readyState_Getter";
/**
* The data received as a reponse from the request.
*
* The data could be in the
* form of a [String], [ByteBuffer], [Document], [Blob], or json (also a
* [String]). `null` indicates request failure.
*/
@DomName('XMLHttpRequest.response')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
Object get response native "XMLHttpRequest_response_Getter";
/**
* The response in string form or `null on failure.
*/
@DomName('XMLHttpRequest.responseText')
@DocsEditable()
String get responseText native "XMLHttpRequest_responseText_Getter";
/**
* [String] telling the server the desired response format.
*
* Default is `String`.
* Other options are one of 'arraybuffer', 'blob', 'document', 'json',
* 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
* `responseType` is set while performing a synchronous request.
*
* See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType)
*/
@DomName('XMLHttpRequest.responseType')
@DocsEditable()
String get responseType native "XMLHttpRequest_responseType_Getter";
/**
* [String] telling the server the desired response format.
*
* Default is `String`.
* Other options are one of 'arraybuffer', 'blob', 'document', 'json',
* 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
* `responseType` is set while performing a synchronous request.
*
* See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType)
*/
@DomName('XMLHttpRequest.responseType')
@DocsEditable()
void set responseType(String value) native "XMLHttpRequest_responseType_Setter";
/**
* The request response, or null on failure.
*
* The response is processed as
* `text/xml` stream, unless responseType = 'document' and the request is
* synchronous.
*/
@DomName('XMLHttpRequest.responseXML')
@DocsEditable()
Document get responseXml native "XMLHttpRequest_responseXML_Getter";
/**
* The http result code from the request (200, 404, etc).
* See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
*/
@DomName('XMLHttpRequest.status')
@DocsEditable()
int get status native "XMLHttpRequest_status_Getter";
/**
* The request response string (such as \"200 OK\").
* See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
*/
@DomName('XMLHttpRequest.statusText')
@DocsEditable()
String get statusText native "XMLHttpRequest_statusText_Getter";
@DomName('XMLHttpRequest.timeout')
@DocsEditable()
@Experimental() // untriaged
int get timeout native "XMLHttpRequest_timeout_Getter";
@DomName('XMLHttpRequest.timeout')
@DocsEditable()
@Experimental() // untriaged
void set timeout(int value) native "XMLHttpRequest_timeout_Setter";
/**
* [EventTarget] that can hold listeners to track the progress of the request.
* The events fired will be members of [HttpRequestUploadEvents].
*/
@DomName('XMLHttpRequest.upload')
@DocsEditable()
@Unstable()
HttpRequestUpload get upload native "XMLHttpRequest_upload_Getter";
/**
* True if cross-site requests should use credentials such as cookies
* or authorization headers; false otherwise.
*
* This value is ignored for same-site requests.
*/
@DomName('XMLHttpRequest.withCredentials')
@DocsEditable()
bool get withCredentials native "XMLHttpRequest_withCredentials_Getter";
/**
* True if cross-site requests should use credentials such as cookies
* or authorization headers; false otherwise.
*
* This value is ignored for same-site requests.
*/
@DomName('XMLHttpRequest.withCredentials')
@DocsEditable()
void set withCredentials(bool value) native "XMLHttpRequest_withCredentials_Setter";
/**
* Stop the current request.
*
* The request can only be stopped if readyState is `HEADERS_RECIEVED` or
* `LOADING`. If this method is not in the process of being sent, the method
* has no effect.
*/
@DomName('XMLHttpRequest.abort')
@DocsEditable()
void abort() native "XMLHttpRequest_abort_Callback";
/**
* Retrieve all the response headers from a request.
*
* `null` if no headers have been received. For multipart requests,
* `getAllResponseHeaders` will return the response headers for the current
* part of the request.
*
* See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
* for a list of common response headers.
*/
@DomName('XMLHttpRequest.getAllResponseHeaders')
@DocsEditable()
@Unstable()
String getAllResponseHeaders() native "XMLHttpRequest_getAllResponseHeaders_Callback";
/**
* Return the response header named `header`, or `null` if not found.
*
* See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
* for a list of common response headers.
*/
@DomName('XMLHttpRequest.getResponseHeader')
@DocsEditable()
@Unstable()
String getResponseHeader(String header) native "XMLHttpRequest_getResponseHeader_Callback";
/**
* Specify the desired `url`, and `method` to use in making the request.
*
* By default the request is done asyncronously, with no user or password
* authentication information. If `async` is false, the request will be send
* synchronously.
*
* Calling `open` again on a currently active request is equivalent to
* calling `abort`.
*/
@DomName('XMLHttpRequest.open')
@DocsEditable()
void open(String method, String url, {bool async, String user, String password}) native "XMLHttpRequest_open_Callback";
/**
* Specify a particular MIME type (such as `text/xml`) desired for the
* response.
*
* This value must be set before the request has been sent. See also the list
* of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types)
*/
@DomName('XMLHttpRequest.overrideMimeType')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
void overrideMimeType(String override) native "XMLHttpRequest_overrideMimeType_Callback";
/**
* Send the request with any given `data`.
*
* See also:
*
* * [send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send%28%29)
* from MDN.
*/
@DomName('XMLHttpRequest.send')
@DocsEditable()
void send([data]) native "XMLHttpRequest_send_Callback";
@DomName('XMLHttpRequest.setRequestHeader')
@DocsEditable()
void setRequestHeader(String header, String value) native "XMLHttpRequest_setRequestHeader_Callback";
/**
* Event listeners to be notified every time the [HttpRequest]
* object's `readyState` changes values.
*/
@DomName('XMLHttpRequest.onreadystatechange')
@DocsEditable()
Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XMLHttpRequestProgressEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
class HttpRequestProgressEvent extends ProgressEvent {
// To suppress missing implicit constructor warnings.
factory HttpRequestProgressEvent._() { throw new UnsupportedError("Not supported"); }
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('XMLHttpRequestProgressEvent.position')
@DocsEditable()
int get position native "XMLHttpRequestProgressEvent_position_Getter";
@DomName('XMLHttpRequestProgressEvent.totalSize')
@DocsEditable()
int get totalSize native "XMLHttpRequestProgressEvent_totalSize_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XMLHttpRequestUpload')
// http://xhr.spec.whatwg.org/#xmlhttprequestupload
@Experimental()
class HttpRequestUpload extends XmlHttpRequestEventTarget {
// To suppress missing implicit constructor warnings.
factory HttpRequestUpload._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLIFrameElement')
class IFrameElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory IFrameElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLIFrameElement.HTMLIFrameElement')
@DocsEditable()
factory IFrameElement() => document.$dom_createElement("iframe");
@DomName('HTMLIFrameElement.contentWindow')
@DocsEditable()
WindowBase get contentWindow native "HTMLIFrameElement_contentWindow_Getter";
@DomName('HTMLIFrameElement.height')
@DocsEditable()
String get height native "HTMLIFrameElement_height_Getter";
@DomName('HTMLIFrameElement.height')
@DocsEditable()
void set height(String value) native "HTMLIFrameElement_height_Setter";
@DomName('HTMLIFrameElement.name')
@DocsEditable()
String get name native "HTMLIFrameElement_name_Getter";
@DomName('HTMLIFrameElement.name')
@DocsEditable()
void set name(String value) native "HTMLIFrameElement_name_Setter";
@DomName('HTMLIFrameElement.sandbox')
@DocsEditable()
String get sandbox native "HTMLIFrameElement_sandbox_Getter";
@DomName('HTMLIFrameElement.sandbox')
@DocsEditable()
void set sandbox(String value) native "HTMLIFrameElement_sandbox_Setter";
@DomName('HTMLIFrameElement.seamless')
@DocsEditable()
bool get seamless native "HTMLIFrameElement_seamless_Getter";
@DomName('HTMLIFrameElement.seamless')
@DocsEditable()
void set seamless(bool value) native "HTMLIFrameElement_seamless_Setter";
@DomName('HTMLIFrameElement.src')
@DocsEditable()
String get src native "HTMLIFrameElement_src_Getter";
@DomName('HTMLIFrameElement.src')
@DocsEditable()
void set src(String value) native "HTMLIFrameElement_src_Setter";
@DomName('HTMLIFrameElement.srcdoc')
@DocsEditable()
String get srcdoc native "HTMLIFrameElement_srcdoc_Getter";
@DomName('HTMLIFrameElement.srcdoc')
@DocsEditable()
void set srcdoc(String value) native "HTMLIFrameElement_srcdoc_Setter";
@DomName('HTMLIFrameElement.width')
@DocsEditable()
String get width native "HTMLIFrameElement_width_Getter";
@DomName('HTMLIFrameElement.width')
@DocsEditable()
void set width(String value) native "HTMLIFrameElement_width_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ImageBitmap')
@Experimental() // untriaged
class ImageBitmap extends NativeFieldWrapperClass1 {
@DomName('ImageBitmap.height')
@DocsEditable()
@Experimental() // untriaged
int get height native "ImageBitmap_height_Getter";
@DomName('ImageBitmap.width')
@DocsEditable()
@Experimental() // untriaged
int get width native "ImageBitmap_width_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('ImageData')
class ImageData extends NativeFieldWrapperClass1 {
List<int> __data;
List<int> get data {
if (__data == null) {
__data = _data;
}
return __data;
}
@DomName('ImageData.data')
@DocsEditable()
List<int> get _data native "ImageData_data_Getter";
@DomName('ImageData.height')
@DocsEditable()
int get height native "ImageData_height_Getter";
@DomName('ImageData.width')
@DocsEditable()
int get width native "ImageData_width_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('HTMLImageElement')
class ImageElement extends HtmlElement implements CanvasImageSource {
// To suppress missing implicit constructor warnings.
factory ImageElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLImageElement.HTMLImageElement')
@DocsEditable()
factory ImageElement({String src, int width, int height}) {
var e = document.$dom_createElement("img");
if (src != null) e.src = src;
if (width != null) e.width = width;
if (height != null) e.height = height;
return e;
}
@DomName('HTMLImageElement.alt')
@DocsEditable()
String get alt native "HTMLImageElement_alt_Getter";
@DomName('HTMLImageElement.alt')
@DocsEditable()
void set alt(String value) native "HTMLImageElement_alt_Setter";
@DomName('HTMLImageElement.border')
@DocsEditable()
@deprecated // deprecated
String get border native "HTMLImageElement_border_Getter";
@DomName('HTMLImageElement.border')
@DocsEditable()
@deprecated // deprecated
void set border(String value) native "HTMLImageElement_border_Setter";
@DomName('HTMLImageElement.complete')
@DocsEditable()
bool get complete native "HTMLImageElement_complete_Getter";
@DomName('HTMLImageElement.crossOrigin')
@DocsEditable()
String get crossOrigin native "HTMLImageElement_crossOrigin_Getter";
@DomName('HTMLImageElement.crossOrigin')
@DocsEditable()
void set crossOrigin(String value) native "HTMLImageElement_crossOrigin_Setter";
@DomName('HTMLImageElement.height')
@DocsEditable()
int get height native "HTMLImageElement_height_Getter";
@DomName('HTMLImageElement.height')
@DocsEditable()
void set height(int value) native "HTMLImageElement_height_Setter";
@DomName('HTMLImageElement.isMap')
@DocsEditable()
bool get isMap native "HTMLImageElement_isMap_Getter";
@DomName('HTMLImageElement.isMap')
@DocsEditable()
void set isMap(bool value) native "HTMLImageElement_isMap_Setter";
@DomName('HTMLImageElement.lowsrc')
@DocsEditable()
@deprecated // deprecated
String get lowsrc native "HTMLImageElement_lowsrc_Getter";
@DomName('HTMLImageElement.lowsrc')
@DocsEditable()
@deprecated // deprecated
void set lowsrc(String value) native "HTMLImageElement_lowsrc_Setter";
@DomName('HTMLImageElement.naturalHeight')
@DocsEditable()
int get naturalHeight native "HTMLImageElement_naturalHeight_Getter";
@DomName('HTMLImageElement.naturalWidth')
@DocsEditable()
int get naturalWidth native "HTMLImageElement_naturalWidth_Getter";
@DomName('HTMLImageElement.src')
@DocsEditable()
String get src native "HTMLImageElement_src_Getter";
@DomName('HTMLImageElement.src')
@DocsEditable()
void set src(String value) native "HTMLImageElement_src_Setter";
@DomName('HTMLImageElement.useMap')
@DocsEditable()
String get useMap native "HTMLImageElement_useMap_Getter";
@DomName('HTMLImageElement.useMap')
@DocsEditable()
void set useMap(String value) native "HTMLImageElement_useMap_Setter";
@DomName('HTMLImageElement.width')
@DocsEditable()
int get width native "HTMLImageElement_width_Getter";
@DomName('HTMLImageElement.width')
@DocsEditable()
void set width(int value) native "HTMLImageElement_width_Setter";
@DomName('HTMLImageElement.x')
@DocsEditable()
@deprecated // deprecated
int get x native "HTMLImageElement_x_Getter";
@DomName('HTMLImageElement.y')
@DocsEditable()
@deprecated // deprecated
int get y native "HTMLImageElement_y_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('HTMLInputElement')
class InputElement extends HtmlElement implements
HiddenInputElement,
SearchInputElement,
TextInputElement,
UrlInputElement,
TelephoneInputElement,
EmailInputElement,
PasswordInputElement,
DateInputElement,
MonthInputElement,
WeekInputElement,
TimeInputElement,
LocalDateTimeInputElement,
NumberInputElement,
RangeInputElement,
CheckboxInputElement,
RadioButtonInputElement,
FileUploadInputElement,
SubmitButtonInputElement,
ImageButtonInputElement,
ResetButtonInputElement,
ButtonInputElement
{
factory InputElement({String type}) {
var e = document.$dom_createElement("input");
if (type != null) {
try {
// IE throws an exception for unknown types.
e.type = type;
} catch(_) {}
}
return e;
}
// To suppress missing implicit constructor warnings.
factory InputElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLInputElement.webkitSpeechChangeEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#extending_html_elements
static const EventStreamProvider<Event> speechChangeEvent = const EventStreamProvider<Event>('webkitSpeechChange');
@DomName('HTMLInputElement.accept')
@DocsEditable()
String get accept native "HTMLInputElement_accept_Getter";
@DomName('HTMLInputElement.accept')
@DocsEditable()
void set accept(String value) native "HTMLInputElement_accept_Setter";
@DomName('HTMLInputElement.alt')
@DocsEditable()
String get alt native "HTMLInputElement_alt_Getter";
@DomName('HTMLInputElement.alt')
@DocsEditable()
void set alt(String value) native "HTMLInputElement_alt_Setter";
@DomName('HTMLInputElement.autocomplete')
@DocsEditable()
String get autocomplete native "HTMLInputElement_autocomplete_Getter";
@DomName('HTMLInputElement.autocomplete')
@DocsEditable()
void set autocomplete(String value) native "HTMLInputElement_autocomplete_Setter";
@DomName('HTMLInputElement.autofocus')
@DocsEditable()
bool get autofocus native "HTMLInputElement_autofocus_Getter";
@DomName('HTMLInputElement.autofocus')
@DocsEditable()
void set autofocus(bool value) native "HTMLInputElement_autofocus_Setter";
@DomName('HTMLInputElement.checked')
@DocsEditable()
bool get checked native "HTMLInputElement_checked_Getter";
@DomName('HTMLInputElement.checked')
@DocsEditable()
void set checked(bool value) native "HTMLInputElement_checked_Setter";
@DomName('HTMLInputElement.defaultChecked')
@DocsEditable()
bool get defaultChecked native "HTMLInputElement_defaultChecked_Getter";
@DomName('HTMLInputElement.defaultChecked')
@DocsEditable()
void set defaultChecked(bool value) native "HTMLInputElement_defaultChecked_Setter";
@DomName('HTMLInputElement.defaultValue')
@DocsEditable()
String get defaultValue native "HTMLInputElement_defaultValue_Getter";
@DomName('HTMLInputElement.defaultValue')
@DocsEditable()
void set defaultValue(String value) native "HTMLInputElement_defaultValue_Setter";
@DomName('HTMLInputElement.dirName')
@DocsEditable()
String get dirName native "HTMLInputElement_dirName_Getter";
@DomName('HTMLInputElement.dirName')
@DocsEditable()
void set dirName(String value) native "HTMLInputElement_dirName_Setter";
@DomName('HTMLInputElement.disabled')
@DocsEditable()
bool get disabled native "HTMLInputElement_disabled_Getter";
@DomName('HTMLInputElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLInputElement_disabled_Setter";
@DomName('HTMLInputElement.files')
@DocsEditable()
List<File> get files native "HTMLInputElement_files_Getter";
@DomName('HTMLInputElement.files')
@DocsEditable()
void set files(List<File> value) native "HTMLInputElement_files_Setter";
@DomName('HTMLInputElement.form')
@DocsEditable()
FormElement get form native "HTMLInputElement_form_Getter";
@DomName('HTMLInputElement.formAction')
@DocsEditable()
String get formAction native "HTMLInputElement_formAction_Getter";
@DomName('HTMLInputElement.formAction')
@DocsEditable()
void set formAction(String value) native "HTMLInputElement_formAction_Setter";
@DomName('HTMLInputElement.formEnctype')
@DocsEditable()
String get formEnctype native "HTMLInputElement_formEnctype_Getter";
@DomName('HTMLInputElement.formEnctype')
@DocsEditable()
void set formEnctype(String value) native "HTMLInputElement_formEnctype_Setter";
@DomName('HTMLInputElement.formMethod')
@DocsEditable()
String get formMethod native "HTMLInputElement_formMethod_Getter";
@DomName('HTMLInputElement.formMethod')
@DocsEditable()
void set formMethod(String value) native "HTMLInputElement_formMethod_Setter";
@DomName('HTMLInputElement.formNoValidate')
@DocsEditable()
bool get formNoValidate native "HTMLInputElement_formNoValidate_Getter";
@DomName('HTMLInputElement.formNoValidate')
@DocsEditable()
void set formNoValidate(bool value) native "HTMLInputElement_formNoValidate_Setter";
@DomName('HTMLInputElement.formTarget')
@DocsEditable()
String get formTarget native "HTMLInputElement_formTarget_Getter";
@DomName('HTMLInputElement.formTarget')
@DocsEditable()
void set formTarget(String value) native "HTMLInputElement_formTarget_Setter";
@DomName('HTMLInputElement.height')
@DocsEditable()
int get height native "HTMLInputElement_height_Getter";
@DomName('HTMLInputElement.height')
@DocsEditable()
void set height(int value) native "HTMLInputElement_height_Setter";
@DomName('HTMLInputElement.incremental')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
bool get incremental native "HTMLInputElement_incremental_Getter";
@DomName('HTMLInputElement.incremental')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
void set incremental(bool value) native "HTMLInputElement_incremental_Setter";
@DomName('HTMLInputElement.indeterminate')
@DocsEditable()
bool get indeterminate native "HTMLInputElement_indeterminate_Getter";
@DomName('HTMLInputElement.indeterminate')
@DocsEditable()
void set indeterminate(bool value) native "HTMLInputElement_indeterminate_Setter";
@DomName('HTMLInputElement.inputMode')
@DocsEditable()
@Experimental() // untriaged
String get inputMode native "HTMLInputElement_inputMode_Getter";
@DomName('HTMLInputElement.inputMode')
@DocsEditable()
@Experimental() // untriaged
void set inputMode(String value) native "HTMLInputElement_inputMode_Setter";
@DomName('HTMLInputElement.labels')
@DocsEditable()
List<Node> get labels native "HTMLInputElement_labels_Getter";
@DomName('HTMLInputElement.list')
@DocsEditable()
HtmlElement get list native "HTMLInputElement_list_Getter";
@DomName('HTMLInputElement.max')
@DocsEditable()
String get max native "HTMLInputElement_max_Getter";
@DomName('HTMLInputElement.max')
@DocsEditable()
void set max(String value) native "HTMLInputElement_max_Setter";
@DomName('HTMLInputElement.maxLength')
@DocsEditable()
int get maxLength native "HTMLInputElement_maxLength_Getter";
@DomName('HTMLInputElement.maxLength')
@DocsEditable()
void set maxLength(int value) native "HTMLInputElement_maxLength_Setter";
@DomName('HTMLInputElement.min')
@DocsEditable()
String get min native "HTMLInputElement_min_Getter";
@DomName('HTMLInputElement.min')
@DocsEditable()
void set min(String value) native "HTMLInputElement_min_Setter";
@DomName('HTMLInputElement.multiple')
@DocsEditable()
bool get multiple native "HTMLInputElement_multiple_Getter";
@DomName('HTMLInputElement.multiple')
@DocsEditable()
void set multiple(bool value) native "HTMLInputElement_multiple_Setter";
@DomName('HTMLInputElement.name')
@DocsEditable()
String get name native "HTMLInputElement_name_Getter";
@DomName('HTMLInputElement.name')
@DocsEditable()
void set name(String value) native "HTMLInputElement_name_Setter";
@DomName('HTMLInputElement.pattern')
@DocsEditable()
String get pattern native "HTMLInputElement_pattern_Getter";
@DomName('HTMLInputElement.pattern')
@DocsEditable()
void set pattern(String value) native "HTMLInputElement_pattern_Setter";
@DomName('HTMLInputElement.placeholder')
@DocsEditable()
String get placeholder native "HTMLInputElement_placeholder_Getter";
@DomName('HTMLInputElement.placeholder')
@DocsEditable()
void set placeholder(String value) native "HTMLInputElement_placeholder_Setter";
@DomName('HTMLInputElement.readOnly')
@DocsEditable()
bool get readOnly native "HTMLInputElement_readOnly_Getter";
@DomName('HTMLInputElement.readOnly')
@DocsEditable()
void set readOnly(bool value) native "HTMLInputElement_readOnly_Setter";
@DomName('HTMLInputElement.required')
@DocsEditable()
bool get required native "HTMLInputElement_required_Getter";
@DomName('HTMLInputElement.required')
@DocsEditable()
void set required(bool value) native "HTMLInputElement_required_Setter";
@DomName('HTMLInputElement.selectionDirection')
@DocsEditable()
String get selectionDirection native "HTMLInputElement_selectionDirection_Getter";
@DomName('HTMLInputElement.selectionDirection')
@DocsEditable()
void set selectionDirection(String value) native "HTMLInputElement_selectionDirection_Setter";
@DomName('HTMLInputElement.selectionEnd')
@DocsEditable()
int get selectionEnd native "HTMLInputElement_selectionEnd_Getter";
@DomName('HTMLInputElement.selectionEnd')
@DocsEditable()
void set selectionEnd(int value) native "HTMLInputElement_selectionEnd_Setter";
@DomName('HTMLInputElement.selectionStart')
@DocsEditable()
int get selectionStart native "HTMLInputElement_selectionStart_Getter";
@DomName('HTMLInputElement.selectionStart')
@DocsEditable()
void set selectionStart(int value) native "HTMLInputElement_selectionStart_Setter";
@DomName('HTMLInputElement.size')
@DocsEditable()
int get size native "HTMLInputElement_size_Getter";
@DomName('HTMLInputElement.size')
@DocsEditable()
void set size(int value) native "HTMLInputElement_size_Setter";
@DomName('HTMLInputElement.src')
@DocsEditable()
String get src native "HTMLInputElement_src_Getter";
@DomName('HTMLInputElement.src')
@DocsEditable()
void set src(String value) native "HTMLInputElement_src_Setter";
@DomName('HTMLInputElement.step')
@DocsEditable()
String get step native "HTMLInputElement_step_Getter";
@DomName('HTMLInputElement.step')
@DocsEditable()
void set step(String value) native "HTMLInputElement_step_Setter";
@DomName('HTMLInputElement.type')
@DocsEditable()
String get type native "HTMLInputElement_type_Getter";
@DomName('HTMLInputElement.type')
@DocsEditable()
void set type(String value) native "HTMLInputElement_type_Setter";
@DomName('HTMLInputElement.useMap')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLInputElement-partial
@deprecated // deprecated
String get useMap native "HTMLInputElement_useMap_Getter";
@DomName('HTMLInputElement.useMap')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLInputElement-partial
@deprecated // deprecated
void set useMap(String value) native "HTMLInputElement_useMap_Setter";
@DomName('HTMLInputElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLInputElement_validationMessage_Getter";
@DomName('HTMLInputElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLInputElement_validity_Getter";
@DomName('HTMLInputElement.value')
@DocsEditable()
String get value native "HTMLInputElement_value_Getter";
@DomName('HTMLInputElement.value')
@DocsEditable()
void set value(String value) native "HTMLInputElement_value_Setter";
@DomName('HTMLInputElement.valueAsDate')
@DocsEditable()
DateTime get valueAsDate native "HTMLInputElement_valueAsDate_Getter";
@DomName('HTMLInputElement.valueAsDate')
@DocsEditable()
void set valueAsDate(DateTime value) native "HTMLInputElement_valueAsDate_Setter";
@DomName('HTMLInputElement.valueAsNumber')
@DocsEditable()
num get valueAsNumber native "HTMLInputElement_valueAsNumber_Getter";
@DomName('HTMLInputElement.valueAsNumber')
@DocsEditable()
void set valueAsNumber(num value) native "HTMLInputElement_valueAsNumber_Setter";
@DomName('HTMLInputElement.webkitEntries')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#concept-input-type-file-selected
List<Entry> get entries native "HTMLInputElement_webkitEntries_Getter";
@DomName('HTMLInputElement.webkitGrammar')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#attrib-grammar
bool get grammar native "HTMLInputElement_webkitGrammar_Getter";
@DomName('HTMLInputElement.webkitGrammar')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#attrib-grammar
void set grammar(bool value) native "HTMLInputElement_webkitGrammar_Setter";
@DomName('HTMLInputElement.webkitSpeech')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#attrib-speech
bool get speech native "HTMLInputElement_webkitSpeech_Getter";
@DomName('HTMLInputElement.webkitSpeech')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#attrib-speech
void set speech(bool value) native "HTMLInputElement_webkitSpeech_Setter";
@DomName('HTMLInputElement.webkitdirectory')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://plus.sandbox.google.com/+AddyOsmani/posts/Dk5UhZ6zfF3
bool get directory native "HTMLInputElement_webkitdirectory_Getter";
@DomName('HTMLInputElement.webkitdirectory')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://plus.sandbox.google.com/+AddyOsmani/posts/Dk5UhZ6zfF3
void set directory(bool value) native "HTMLInputElement_webkitdirectory_Setter";
@DomName('HTMLInputElement.width')
@DocsEditable()
int get width native "HTMLInputElement_width_Getter";
@DomName('HTMLInputElement.width')
@DocsEditable()
void set width(int value) native "HTMLInputElement_width_Setter";
@DomName('HTMLInputElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLInputElement_willValidate_Getter";
@DomName('HTMLInputElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLInputElement_checkValidity_Callback";
@DomName('HTMLInputElement.select')
@DocsEditable()
void select() native "HTMLInputElement_select_Callback";
@DomName('HTMLInputElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLInputElement_setCustomValidity_Callback";
void setRangeText(String replacement, {int start, int end, String selectionMode}) {
if ((replacement is String || replacement == null) && start == null && end == null && selectionMode == null) {
_setRangeText_1(replacement);
return;
}
if ((selectionMode is String || selectionMode == null) && (end is int || end == null) && (start is int || start == null) && (replacement is String || replacement == null)) {
_setRangeText_2(replacement, start, end, selectionMode);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void _setRangeText_1(replacement) native "HTMLInputElement__setRangeText_1_Callback";
void _setRangeText_2(replacement, start, end, selectionMode) native "HTMLInputElement__setRangeText_2_Callback";
void setSelectionRange(int start, int end, [String direction]) {
if (direction != null) {
_setSelectionRange_1(start, end, direction);
return;
}
_setSelectionRange_2(start, end);
return;
}
void _setSelectionRange_1(start, end, direction) native "HTMLInputElement__setSelectionRange_1_Callback";
void _setSelectionRange_2(start, end) native "HTMLInputElement__setSelectionRange_2_Callback";
void stepDown([int n]) {
if (n != null) {
_stepDown_1(n);
return;
}
_stepDown_2();
return;
}
void _stepDown_1(n) native "HTMLInputElement__stepDown_1_Callback";
void _stepDown_2() native "HTMLInputElement__stepDown_2_Callback";
void stepUp([int n]) {
if (n != null) {
_stepUp_1(n);
return;
}
_stepUp_2();
return;
}
void _stepUp_1(n) native "HTMLInputElement__stepUp_1_Callback";
void _stepUp_2() native "HTMLInputElement__stepUp_2_Callback";
@DomName('HTMLInputElement.onwebkitSpeechChange')
@DocsEditable()
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#extending_html_elements
@Experimental()
ElementStream<Event> get onSpeechChange => speechChangeEvent.forElement(this);
}
// Interfaces representing the InputElement APIs which are supported
// for the various types of InputElement. From:
// http://www.w3.org/html/wg/drafts/html/master/forms.html#the-input-element.
/**
* Exposes the functionality common between all InputElement types.
*/
abstract class InputElementBase implements Element {
@DomName('HTMLInputElement.autofocus')
bool autofocus;
@DomName('HTMLInputElement.disabled')
bool disabled;
@DomName('HTMLInputElement.incremental')
bool incremental;
@DomName('HTMLInputElement.indeterminate')
bool indeterminate;
@DomName('HTMLInputElement.labels')
List<Node> get labels;
@DomName('HTMLInputElement.name')
String name;
@DomName('HTMLInputElement.validationMessage')
String get validationMessage;
@DomName('HTMLInputElement.validity')
ValidityState get validity;
@DomName('HTMLInputElement.value')
String value;
@DomName('HTMLInputElement.willValidate')
bool get willValidate;
@DomName('HTMLInputElement.checkValidity')
bool checkValidity();
@DomName('HTMLInputElement.setCustomValidity')
void setCustomValidity(String error);
}
/**
* Hidden input which is not intended to be seen or edited by the user.
*/
abstract class HiddenInputElement implements InputElementBase {
factory HiddenInputElement() => new InputElement(type: 'hidden');
}
/**
* Base interface for all inputs which involve text editing.
*/
abstract class TextInputElementBase implements InputElementBase {
@DomName('HTMLInputElement.autocomplete')
String autocomplete;
@DomName('HTMLInputElement.maxLength')
int maxLength;
@DomName('HTMLInputElement.pattern')
String pattern;
@DomName('HTMLInputElement.placeholder')
String placeholder;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
@DomName('HTMLInputElement.size')
int size;
@DomName('HTMLInputElement.select')
void select();
@DomName('HTMLInputElement.selectionDirection')
String selectionDirection;
@DomName('HTMLInputElement.selectionEnd')
int selectionEnd;
@DomName('HTMLInputElement.selectionStart')
int selectionStart;
@DomName('HTMLInputElement.setSelectionRange')
void setSelectionRange(int start, int end, [String direction]);
}
/**
* Similar to [TextInputElement], but on platforms where search is styled
* differently this will get the search style.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
abstract class SearchInputElement implements TextInputElementBase {
factory SearchInputElement() => new InputElement(type: 'search');
@DomName('HTMLInputElement.dirName')
String dirName;
@DomName('HTMLInputElement.list')
Element get list;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'search')).type == 'search';
}
}
/**
* A basic text input editor control.
*/
abstract class TextInputElement implements TextInputElementBase {
factory TextInputElement() => new InputElement(type: 'text');
@DomName('HTMLInputElement.dirName')
String dirName;
@DomName('HTMLInputElement.list')
Element get list;
}
/**
* A control for editing an absolute URL.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
abstract class UrlInputElement implements TextInputElementBase {
factory UrlInputElement() => new InputElement(type: 'url');
@DomName('HTMLInputElement.list')
Element get list;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'url')).type == 'url';
}
}
/**
* Represents a control for editing a telephone number.
*
* This provides a single line of text with minimal formatting help since
* there is a wide variety of telephone numbers.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
abstract class TelephoneInputElement implements TextInputElementBase {
factory TelephoneInputElement() => new InputElement(type: 'tel');
@DomName('HTMLInputElement.list')
Element get list;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'tel')).type == 'tel';
}
}
/**
* An e-mail address or list of e-mail addresses.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
abstract class EmailInputElement implements TextInputElementBase {
factory EmailInputElement() => new InputElement(type: 'email');
@DomName('HTMLInputElement.autocomplete')
String autocomplete;
@DomName('HTMLInputElement.autofocus')
bool autofocus;
@DomName('HTMLInputElement.list')
Element get list;
@DomName('HTMLInputElement.maxLength')
int maxLength;
@DomName('HTMLInputElement.multiple')
bool multiple;
@DomName('HTMLInputElement.pattern')
String pattern;
@DomName('HTMLInputElement.placeholder')
String placeholder;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
@DomName('HTMLInputElement.size')
int size;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'email')).type == 'email';
}
}
/**
* Text with no line breaks (sensitive information).
*/
abstract class PasswordInputElement implements TextInputElementBase {
factory PasswordInputElement() => new InputElement(type: 'password');
}
/**
* Base interface for all input element types which involve ranges.
*/
abstract class RangeInputElementBase implements InputElementBase {
@DomName('HTMLInputElement.list')
Element get list;
@DomName('HTMLInputElement.max')
String max;
@DomName('HTMLInputElement.min')
String min;
@DomName('HTMLInputElement.step')
String step;
@DomName('HTMLInputElement.valueAsNumber')
num valueAsNumber;
@DomName('HTMLInputElement.stepDown')
void stepDown([int n]);
@DomName('HTMLInputElement.stepUp')
void stepUp([int n]);
}
/**
* A date (year, month, day) with no time zone.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
abstract class DateInputElement implements RangeInputElementBase {
factory DateInputElement() => new InputElement(type: 'date');
@DomName('HTMLInputElement.valueAsDate')
DateTime valueAsDate;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'date')).type == 'date';
}
}
/**
* A date consisting of a year and a month with no time zone.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
abstract class MonthInputElement implements RangeInputElementBase {
factory MonthInputElement() => new InputElement(type: 'month');
@DomName('HTMLInputElement.valueAsDate')
DateTime valueAsDate;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'month')).type == 'month';
}
}
/**
* A date consisting of a week-year number and a week number with no time zone.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
abstract class WeekInputElement implements RangeInputElementBase {
factory WeekInputElement() => new InputElement(type: 'week');
@DomName('HTMLInputElement.valueAsDate')
DateTime valueAsDate;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'week')).type == 'week';
}
}
/**
* A time (hour, minute, seconds, fractional seconds) with no time zone.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
abstract class TimeInputElement implements RangeInputElementBase {
factory TimeInputElement() => new InputElement(type: 'time');
@DomName('HTMLInputElement.valueAsDate')
DateTime valueAsDate;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'time')).type == 'time';
}
}
/**
* A date and time (year, month, day, hour, minute, second, fraction of a
* second) with no time zone.
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
abstract class LocalDateTimeInputElement implements RangeInputElementBase {
factory LocalDateTimeInputElement() =>
new InputElement(type: 'datetime-local');
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'datetime-local')).type == 'datetime-local';
}
}
/**
* A numeric editor control.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.IE)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
abstract class NumberInputElement implements RangeInputElementBase {
factory NumberInputElement() => new InputElement(type: 'number');
@DomName('HTMLInputElement.placeholder')
String placeholder;
@DomName('HTMLInputElement.readOnly')
bool readOnly;
@DomName('HTMLInputElement.required')
bool required;
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'number')).type == 'number';
}
}
/**
* Similar to [NumberInputElement] but the browser may provide more optimal
* styling (such as a slider control).
*
* Use [supported] to check if this is supported on the current platform.
*/
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.IE, '10')
@Experimental()
abstract class RangeInputElement implements RangeInputElementBase {
factory RangeInputElement() => new InputElement(type: 'range');
/// Returns true if this input type is supported on the current platform.
static bool get supported {
return (new InputElement(type: 'range')).type == 'range';
}
}
/**
* A boolean editor control.
*
* Note that if [indeterminate] is set then this control is in a third
* indeterminate state.
*/
abstract class CheckboxInputElement implements InputElementBase {
factory CheckboxInputElement() => new InputElement(type: 'checkbox');
@DomName('HTMLInputElement.checked')
bool checked;
@DomName('HTMLInputElement.required')
bool required;
}
/**
* A control that when used with other [ReadioButtonInputElement] controls
* forms a radio button group in which only one control can be checked at a
* time.
*
* Radio buttons are considered to be in the same radio button group if:
*
* * They are all of type 'radio'.
* * They all have either the same [FormElement] owner, or no owner.
* * Their name attributes contain the same name.
*/
abstract class RadioButtonInputElement implements InputElementBase {
factory RadioButtonInputElement() => new InputElement(type: 'radio');
@DomName('HTMLInputElement.checked')
bool checked;
@DomName('HTMLInputElement.required')
bool required;
}
/**
* A control for picking files from the user's computer.
*/
abstract class FileUploadInputElement implements InputElementBase {
factory FileUploadInputElement() => new InputElement(type: 'file');
@DomName('HTMLInputElement.accept')
String accept;
@DomName('HTMLInputElement.multiple')
bool multiple;
@DomName('HTMLInputElement.required')
bool required;
@DomName('HTMLInputElement.files')
List<File> files;
}
/**
* A button, which when clicked, submits the form.
*/
abstract class SubmitButtonInputElement implements InputElementBase {
factory SubmitButtonInputElement() => new InputElement(type: 'submit');
@DomName('HTMLInputElement.formAction')
String formAction;
@DomName('HTMLInputElement.formEnctype')
String formEnctype;
@DomName('HTMLInputElement.formMethod')
String formMethod;
@DomName('HTMLInputElement.formNoValidate')
bool formNoValidate;
@DomName('HTMLInputElement.formTarget')
String formTarget;
}
/**
* Either an image which the user can select a coordinate to or a form
* submit button.
*/
abstract class ImageButtonInputElement implements InputElementBase {
factory ImageButtonInputElement() => new InputElement(type: 'image');
@DomName('HTMLInputElement.alt')
String alt;
@DomName('HTMLInputElement.formAction')
String formAction;
@DomName('HTMLInputElement.formEnctype')
String formEnctype;
@DomName('HTMLInputElement.formMethod')
String formMethod;
@DomName('HTMLInputElement.formNoValidate')
bool formNoValidate;
@DomName('HTMLInputElement.formTarget')
String formTarget;
@DomName('HTMLInputElement.height')
int height;
@DomName('HTMLInputElement.src')
String src;
@DomName('HTMLInputElement.width')
int width;
}
/**
* A button, which when clicked, resets the form.
*/
abstract class ResetButtonInputElement implements InputElementBase {
factory ResetButtonInputElement() => new InputElement(type: 'reset');
}
/**
* A button, with no default behavior.
*/
abstract class ButtonInputElement implements InputElementBase {
factory ButtonInputElement() => new InputElement(type: 'button');
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('InputMethodContext')
// http://www.w3.org/TR/ime-api/#idl-def-InputMethodContext
@Experimental()
class InputMethodContext extends NativeFieldWrapperClass1 {
@DomName('InputMethodContext.composition')
@DocsEditable()
Composition get composition native "InputMethodContext_composition_Getter";
@DomName('InputMethodContext.locale')
@DocsEditable()
String get locale native "InputMethodContext_locale_Getter";
@DomName('InputMethodContext.target')
@DocsEditable()
@Experimental() // untriaged
HtmlElement get target native "InputMethodContext_target_Getter";
@DomName('InputMethodContext.confirmComposition')
@DocsEditable()
void confirmComposition() native "InputMethodContext_confirmComposition_Callback";
@DomName('InputMethodContext.setCaretRectangle')
@DocsEditable()
void setCaretRectangle(Node anchor, int x, int y, int w, int h) native "InputMethodContext_setCaretRectangle_Callback";
@DomName('InputMethodContext.setExclusionRectangle')
@DocsEditable()
void setExclusionRectangle(Node anchor, int x, int y, int w, int h) native "InputMethodContext_setExclusionRectangle_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('KeyboardEvent')
class KeyboardEvent extends UIEvent {
factory KeyboardEvent(String type,
{Window view, bool canBubble: true, bool cancelable: true,
int keyLocation: 1, bool ctrlKey: false,
bool altKey: false, bool shiftKey: false, bool metaKey: false,
bool altGraphKey: false}) {
if (view == null) {
view = window;
}
final e = document._createEvent("KeyboardEvent");
e._initKeyboardEvent(type, canBubble, cancelable, view, "",
keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
return e;
}
@DomName('KeyboardEvent.keyCode')
int get keyCode => _keyCode;
@DomName('KeyboardEvent.charCode')
int get charCode => _charCode;
// To suppress missing implicit constructor warnings.
factory KeyboardEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('KeyboardEvent.DOM_KEY_LOCATION_LEFT')
@DocsEditable()
@Experimental() // untriaged
static const int DOM_KEY_LOCATION_LEFT = 0x01;
@DomName('KeyboardEvent.DOM_KEY_LOCATION_NUMPAD')
@DocsEditable()
@Experimental() // untriaged
static const int DOM_KEY_LOCATION_NUMPAD = 0x03;
@DomName('KeyboardEvent.DOM_KEY_LOCATION_RIGHT')
@DocsEditable()
@Experimental() // untriaged
static const int DOM_KEY_LOCATION_RIGHT = 0x02;
@DomName('KeyboardEvent.DOM_KEY_LOCATION_STANDARD')
@DocsEditable()
@Experimental() // untriaged
static const int DOM_KEY_LOCATION_STANDARD = 0x00;
@DomName('KeyboardEvent.altGraphKey')
@DocsEditable()
@Experimental() // nonstandard
bool get altGraphKey native "KeyboardEvent_altGraphKey_Getter";
@DomName('KeyboardEvent.altKey')
@DocsEditable()
bool get altKey native "KeyboardEvent_altKey_Getter";
@DomName('KeyboardEvent.ctrlKey')
@DocsEditable()
bool get ctrlKey native "KeyboardEvent_ctrlKey_Getter";
@DomName('KeyboardEvent.keyIdentifier')
@DocsEditable()
@Experimental() // nonstandard
String get _keyIdentifier native "KeyboardEvent_keyIdentifier_Getter";
@DomName('KeyboardEvent.keyLocation')
@DocsEditable()
@Experimental() // nonstandard
int get keyLocation native "KeyboardEvent_keyLocation_Getter";
@DomName('KeyboardEvent.location')
@DocsEditable()
@Experimental() // untriaged
int get location native "KeyboardEvent_location_Getter";
@DomName('KeyboardEvent.metaKey')
@DocsEditable()
bool get metaKey native "KeyboardEvent_metaKey_Getter";
@DomName('KeyboardEvent.shiftKey')
@DocsEditable()
bool get shiftKey native "KeyboardEvent_shiftKey_Getter";
@DomName('KeyboardEvent.getModifierState')
@DocsEditable()
@Experimental() // untriaged
bool getModifierState(String keyArgument) native "KeyboardEvent_getModifierState_Callback";
@DomName('KeyboardEvent.initKeyboardEvent')
@DocsEditable()
void _initKeyboardEvent(String type, bool canBubble, bool cancelable, Window view, String keyIdentifier, int location, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) native "KeyboardEvent_initKeyboardEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLKeygenElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-keygen-element
class KeygenElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory KeygenElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLKeygenElement.HTMLKeygenElement')
@DocsEditable()
factory KeygenElement() => document.$dom_createElement("keygen");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLKeygenElement.autofocus')
@DocsEditable()
bool get autofocus native "HTMLKeygenElement_autofocus_Getter";
@DomName('HTMLKeygenElement.autofocus')
@DocsEditable()
void set autofocus(bool value) native "HTMLKeygenElement_autofocus_Setter";
@DomName('HTMLKeygenElement.challenge')
@DocsEditable()
String get challenge native "HTMLKeygenElement_challenge_Getter";
@DomName('HTMLKeygenElement.challenge')
@DocsEditable()
void set challenge(String value) native "HTMLKeygenElement_challenge_Setter";
@DomName('HTMLKeygenElement.disabled')
@DocsEditable()
bool get disabled native "HTMLKeygenElement_disabled_Getter";
@DomName('HTMLKeygenElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLKeygenElement_disabled_Setter";
@DomName('HTMLKeygenElement.form')
@DocsEditable()
FormElement get form native "HTMLKeygenElement_form_Getter";
@DomName('HTMLKeygenElement.keytype')
@DocsEditable()
String get keytype native "HTMLKeygenElement_keytype_Getter";
@DomName('HTMLKeygenElement.keytype')
@DocsEditable()
void set keytype(String value) native "HTMLKeygenElement_keytype_Setter";
@DomName('HTMLKeygenElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLKeygenElement_labels_Getter";
@DomName('HTMLKeygenElement.name')
@DocsEditable()
String get name native "HTMLKeygenElement_name_Getter";
@DomName('HTMLKeygenElement.name')
@DocsEditable()
void set name(String value) native "HTMLKeygenElement_name_Setter";
@DomName('HTMLKeygenElement.type')
@DocsEditable()
String get type native "HTMLKeygenElement_type_Getter";
@DomName('HTMLKeygenElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLKeygenElement_validationMessage_Getter";
@DomName('HTMLKeygenElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLKeygenElement_validity_Getter";
@DomName('HTMLKeygenElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLKeygenElement_willValidate_Getter";
@DomName('HTMLKeygenElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLKeygenElement_checkValidity_Callback";
@DomName('HTMLKeygenElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLKeygenElement_setCustomValidity_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLLIElement')
class LIElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory LIElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLLIElement.HTMLLIElement')
@DocsEditable()
factory LIElement() => document.$dom_createElement("li");
@DomName('HTMLLIElement.type')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLLIElement-partial
@deprecated // deprecated
String get type native "HTMLLIElement_type_Getter";
@DomName('HTMLLIElement.type')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLLIElement-partial
@deprecated // deprecated
void set type(String value) native "HTMLLIElement_type_Setter";
@DomName('HTMLLIElement.value')
@DocsEditable()
int get value native "HTMLLIElement_value_Getter";
@DomName('HTMLLIElement.value')
@DocsEditable()
void set value(int value) native "HTMLLIElement_value_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLLabelElement')
class LabelElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory LabelElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLLabelElement.HTMLLabelElement')
@DocsEditable()
factory LabelElement() => document.$dom_createElement("label");
@DomName('HTMLLabelElement.control')
@DocsEditable()
HtmlElement get control native "HTMLLabelElement_control_Getter";
@DomName('HTMLLabelElement.form')
@DocsEditable()
FormElement get form native "HTMLLabelElement_form_Getter";
@DomName('HTMLLabelElement.htmlFor')
@DocsEditable()
String get htmlFor native "HTMLLabelElement_htmlFor_Getter";
@DomName('HTMLLabelElement.htmlFor')
@DocsEditable()
void set htmlFor(String value) native "HTMLLabelElement_htmlFor_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLLegendElement')
class LegendElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory LegendElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLLegendElement.HTMLLegendElement')
@DocsEditable()
factory LegendElement() => document.$dom_createElement("legend");
@DomName('HTMLLegendElement.form')
@DocsEditable()
FormElement get form native "HTMLLegendElement_form_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLLinkElement')
class LinkElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory LinkElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLLinkElement.HTMLLinkElement')
@DocsEditable()
factory LinkElement() => document.$dom_createElement("link");
@DomName('HTMLLinkElement.disabled')
@DocsEditable()
bool get disabled native "HTMLLinkElement_disabled_Getter";
@DomName('HTMLLinkElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLLinkElement_disabled_Setter";
@DomName('HTMLLinkElement.href')
@DocsEditable()
String get href native "HTMLLinkElement_href_Getter";
@DomName('HTMLLinkElement.href')
@DocsEditable()
void set href(String value) native "HTMLLinkElement_href_Setter";
@DomName('HTMLLinkElement.hreflang')
@DocsEditable()
String get hreflang native "HTMLLinkElement_hreflang_Getter";
@DomName('HTMLLinkElement.hreflang')
@DocsEditable()
void set hreflang(String value) native "HTMLLinkElement_hreflang_Setter";
@DomName('HTMLLinkElement.import')
@DocsEditable()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#interface-import
@Experimental()
Document get import native "HTMLLinkElement_import_Getter";
@DomName('HTMLLinkElement.media')
@DocsEditable()
String get media native "HTMLLinkElement_media_Getter";
@DomName('HTMLLinkElement.media')
@DocsEditable()
void set media(String value) native "HTMLLinkElement_media_Setter";
@DomName('HTMLLinkElement.rel')
@DocsEditable()
String get rel native "HTMLLinkElement_rel_Getter";
@DomName('HTMLLinkElement.rel')
@DocsEditable()
void set rel(String value) native "HTMLLinkElement_rel_Setter";
@DomName('HTMLLinkElement.sheet')
@DocsEditable()
StyleSheet get sheet native "HTMLLinkElement_sheet_Getter";
@DomName('HTMLLinkElement.sizes')
@DocsEditable()
DomSettableTokenList get sizes native "HTMLLinkElement_sizes_Getter";
@DomName('HTMLLinkElement.sizes')
@DocsEditable()
void set sizes(DomSettableTokenList value) native "HTMLLinkElement_sizes_Setter";
@DomName('HTMLLinkElement.type')
@DocsEditable()
String get type native "HTMLLinkElement_type_Getter";
@DomName('HTMLLinkElement.type')
@DocsEditable()
void set type(String value) native "HTMLLinkElement_type_Setter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('Location')
class Location extends NativeFieldWrapperClass1 implements LocationBase {
@DomName('Location.ancestorOrigins')
@DocsEditable()
@Experimental() // nonstandard
List<String> get ancestorOrigins native "Location_ancestorOrigins_Getter";
@DomName('Location.hash')
@DocsEditable()
String get hash native "Location_hash_Getter";
@DomName('Location.hash')
@DocsEditable()
void set hash(String value) native "Location_hash_Setter";
@DomName('Location.host')
@DocsEditable()
String get host native "Location_host_Getter";
@DomName('Location.host')
@DocsEditable()
void set host(String value) native "Location_host_Setter";
@DomName('Location.hostname')
@DocsEditable()
String get hostname native "Location_hostname_Getter";
@DomName('Location.hostname')
@DocsEditable()
void set hostname(String value) native "Location_hostname_Setter";
@DomName('Location.href')
@DocsEditable()
String get href native "Location_href_Getter";
@DomName('Location.href')
@DocsEditable()
void set href(String value) native "Location_href_Setter";
@DomName('Location.origin')
@DocsEditable()
// http://url.spec.whatwg.org/#urlutils Webkit Only
@Experimental() // non-standard
String get origin native "Location_origin_Getter";
@DomName('Location.pathname')
@DocsEditable()
String get pathname native "Location_pathname_Getter";
@DomName('Location.pathname')
@DocsEditable()
void set pathname(String value) native "Location_pathname_Setter";
@DomName('Location.port')
@DocsEditable()
String get port native "Location_port_Getter";
@DomName('Location.port')
@DocsEditable()
void set port(String value) native "Location_port_Setter";
@DomName('Location.protocol')
@DocsEditable()
String get protocol native "Location_protocol_Getter";
@DomName('Location.protocol')
@DocsEditable()
void set protocol(String value) native "Location_protocol_Setter";
@DomName('Location.search')
@DocsEditable()
String get search native "Location_search_Getter";
@DomName('Location.search')
@DocsEditable()
void set search(String value) native "Location_search_Setter";
@DomName('Location.assign')
@DocsEditable()
void assign(String url) native "Location_assign_Callback";
@DomName('Location.reload')
@DocsEditable()
void reload() native "Location_reload_Callback";
@DomName('Location.replace')
@DocsEditable()
void replace(String url) native "Location_replace_Callback";
@DomName('Location.toString')
@DocsEditable()
String toString() native "Location_toString_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MIDIErrorCallback')
// http://webaudio.github.io/web-midi-api/#midierrorcallback
@Experimental()
typedef void MidiErrorCallback(DomError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MIDISuccessCallback')
@Experimental() // untriaged
typedef void MidiSuccessCallback(MidiAccess access, bool sysex);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLMapElement')
class MapElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory MapElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLMapElement.HTMLMapElement')
@DocsEditable()
factory MapElement() => document.$dom_createElement("map");
@DomName('HTMLMapElement.areas')
@DocsEditable()
HtmlCollection get areas native "HTMLMapElement_areas_Getter";
@DomName('HTMLMapElement.name')
@DocsEditable()
String get name native "HTMLMapElement_name_Getter";
@DomName('HTMLMapElement.name')
@DocsEditable()
void set name(String value) native "HTMLMapElement_name_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaController')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#mediacontroller
@Experimental()
class MediaController extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MediaController._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaController.MediaController')
@DocsEditable()
factory MediaController() {
return MediaController._create_1();
}
@DocsEditable()
static MediaController _create_1() native "MediaController__create_1constructorCallback";
@DomName('MediaController.buffered')
@DocsEditable()
TimeRanges get buffered native "MediaController_buffered_Getter";
@DomName('MediaController.currentTime')
@DocsEditable()
num get currentTime native "MediaController_currentTime_Getter";
@DomName('MediaController.currentTime')
@DocsEditable()
void set currentTime(num value) native "MediaController_currentTime_Setter";
@DomName('MediaController.defaultPlaybackRate')
@DocsEditable()
num get defaultPlaybackRate native "MediaController_defaultPlaybackRate_Getter";
@DomName('MediaController.defaultPlaybackRate')
@DocsEditable()
void set defaultPlaybackRate(num value) native "MediaController_defaultPlaybackRate_Setter";
@DomName('MediaController.duration')
@DocsEditable()
double get duration native "MediaController_duration_Getter";
@DomName('MediaController.muted')
@DocsEditable()
bool get muted native "MediaController_muted_Getter";
@DomName('MediaController.muted')
@DocsEditable()
void set muted(bool value) native "MediaController_muted_Setter";
@DomName('MediaController.paused')
@DocsEditable()
bool get paused native "MediaController_paused_Getter";
@DomName('MediaController.playbackRate')
@DocsEditable()
num get playbackRate native "MediaController_playbackRate_Getter";
@DomName('MediaController.playbackRate')
@DocsEditable()
void set playbackRate(num value) native "MediaController_playbackRate_Setter";
@DomName('MediaController.playbackState')
@DocsEditable()
String get playbackState native "MediaController_playbackState_Getter";
@DomName('MediaController.played')
@DocsEditable()
TimeRanges get played native "MediaController_played_Getter";
@DomName('MediaController.seekable')
@DocsEditable()
TimeRanges get seekable native "MediaController_seekable_Getter";
@DomName('MediaController.volume')
@DocsEditable()
num get volume native "MediaController_volume_Getter";
@DomName('MediaController.volume')
@DocsEditable()
void set volume(num value) native "MediaController_volume_Setter";
@DomName('MediaController.pause')
@DocsEditable()
void pause() native "MediaController_pause_Callback";
@DomName('MediaController.play')
@DocsEditable()
void play() native "MediaController_play_Callback";
@DomName('MediaController.unpause')
@DocsEditable()
void unpause() native "MediaController_unpause_Callback";
@DomName('MediaController.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MediaController_addEventListener_Callback";
@DomName('MediaController.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MediaController_dispatchEvent_Callback";
@DomName('MediaController.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaController_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLMediaElement')
@Unstable()
class MediaElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory MediaElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLMediaElement.canplayEvent')
@DocsEditable()
static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvider<Event>('canplay');
@DomName('HTMLMediaElement.canplaythroughEvent')
@DocsEditable()
static const EventStreamProvider<Event> canPlayThroughEvent = const EventStreamProvider<Event>('canplaythrough');
@DomName('HTMLMediaElement.durationchangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> durationChangeEvent = const EventStreamProvider<Event>('durationchange');
@DomName('HTMLMediaElement.emptiedEvent')
@DocsEditable()
static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvider<Event>('emptied');
@DomName('HTMLMediaElement.endedEvent')
@DocsEditable()
static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
@DomName('HTMLMediaElement.loadeddataEvent')
@DocsEditable()
static const EventStreamProvider<Event> loadedDataEvent = const EventStreamProvider<Event>('loadeddata');
@DomName('HTMLMediaElement.loadedmetadataEvent')
@DocsEditable()
static const EventStreamProvider<Event> loadedMetadataEvent = const EventStreamProvider<Event>('loadedmetadata');
@DomName('HTMLMediaElement.loadstartEvent')
@DocsEditable()
static const EventStreamProvider<Event> loadStartEvent = const EventStreamProvider<Event>('loadstart');
@DomName('HTMLMediaElement.pauseEvent')
@DocsEditable()
static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider<Event>('pause');
@DomName('HTMLMediaElement.playEvent')
@DocsEditable()
static const EventStreamProvider<Event> playEvent = const EventStreamProvider<Event>('play');
@DomName('HTMLMediaElement.playingEvent')
@DocsEditable()
static const EventStreamProvider<Event> playingEvent = const EventStreamProvider<Event>('playing');
@DomName('HTMLMediaElement.progressEvent')
@DocsEditable()
static const EventStreamProvider<Event> progressEvent = const EventStreamProvider<Event>('progress');
@DomName('HTMLMediaElement.ratechangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> rateChangeEvent = const EventStreamProvider<Event>('ratechange');
@DomName('HTMLMediaElement.seekedEvent')
@DocsEditable()
static const EventStreamProvider<Event> seekedEvent = const EventStreamProvider<Event>('seeked');
@DomName('HTMLMediaElement.seekingEvent')
@DocsEditable()
static const EventStreamProvider<Event> seekingEvent = const EventStreamProvider<Event>('seeking');
@DomName('HTMLMediaElement.showEvent')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#event-media-loadstart
@Experimental()
static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
@DomName('HTMLMediaElement.stalledEvent')
@DocsEditable()
static const EventStreamProvider<Event> stalledEvent = const EventStreamProvider<Event>('stalled');
@DomName('HTMLMediaElement.suspendEvent')
@DocsEditable()
static const EventStreamProvider<Event> suspendEvent = const EventStreamProvider<Event>('suspend');
@DomName('HTMLMediaElement.timeupdateEvent')
@DocsEditable()
static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamProvider<Event>('timeupdate');
@DomName('HTMLMediaElement.volumechangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamProvider<Event>('volumechange');
@DomName('HTMLMediaElement.waitingEvent')
@DocsEditable()
static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
@DomName('HTMLMediaElement.webkitkeyaddedEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
static const EventStreamProvider<MediaKeyEvent> keyAddedEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyadded');
@DomName('HTMLMediaElement.webkitkeyerrorEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
static const EventStreamProvider<MediaKeyEvent> keyErrorEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyerror');
@DomName('HTMLMediaElement.webkitkeymessageEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
static const EventStreamProvider<MediaKeyEvent> keyMessageEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeymessage');
@DomName('HTMLMediaElement.webkitneedkeyEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
static const EventStreamProvider<MediaKeyEvent> needKeyEvent = const EventStreamProvider<MediaKeyEvent>('webkitneedkey');
@DomName('HTMLMediaElement.HAVE_CURRENT_DATA')
@DocsEditable()
static const int HAVE_CURRENT_DATA = 2;
@DomName('HTMLMediaElement.HAVE_ENOUGH_DATA')
@DocsEditable()
static const int HAVE_ENOUGH_DATA = 4;
@DomName('HTMLMediaElement.HAVE_FUTURE_DATA')
@DocsEditable()
static const int HAVE_FUTURE_DATA = 3;
@DomName('HTMLMediaElement.HAVE_METADATA')
@DocsEditable()
static const int HAVE_METADATA = 1;
@DomName('HTMLMediaElement.HAVE_NOTHING')
@DocsEditable()
static const int HAVE_NOTHING = 0;
@DomName('HTMLMediaElement.NETWORK_EMPTY')
@DocsEditable()
static const int NETWORK_EMPTY = 0;
@DomName('HTMLMediaElement.NETWORK_IDLE')
@DocsEditable()
static const int NETWORK_IDLE = 1;
@DomName('HTMLMediaElement.NETWORK_LOADING')
@DocsEditable()
static const int NETWORK_LOADING = 2;
@DomName('HTMLMediaElement.NETWORK_NO_SOURCE')
@DocsEditable()
static const int NETWORK_NO_SOURCE = 3;
@DomName('HTMLMediaElement.autoplay')
@DocsEditable()
bool get autoplay native "HTMLMediaElement_autoplay_Getter";
@DomName('HTMLMediaElement.autoplay')
@DocsEditable()
void set autoplay(bool value) native "HTMLMediaElement_autoplay_Setter";
@DomName('HTMLMediaElement.buffered')
@DocsEditable()
TimeRanges get buffered native "HTMLMediaElement_buffered_Getter";
@DomName('HTMLMediaElement.controller')
@DocsEditable()
MediaController get controller native "HTMLMediaElement_controller_Getter";
@DomName('HTMLMediaElement.controller')
@DocsEditable()
void set controller(MediaController value) native "HTMLMediaElement_controller_Setter";
@DomName('HTMLMediaElement.controls')
@DocsEditable()
bool get controls native "HTMLMediaElement_controls_Getter";
@DomName('HTMLMediaElement.controls')
@DocsEditable()
void set controls(bool value) native "HTMLMediaElement_controls_Setter";
@DomName('HTMLMediaElement.currentSrc')
@DocsEditable()
String get currentSrc native "HTMLMediaElement_currentSrc_Getter";
@DomName('HTMLMediaElement.currentTime')
@DocsEditable()
num get currentTime native "HTMLMediaElement_currentTime_Getter";
@DomName('HTMLMediaElement.currentTime')
@DocsEditable()
void set currentTime(num value) native "HTMLMediaElement_currentTime_Setter";
@DomName('HTMLMediaElement.defaultMuted')
@DocsEditable()
bool get defaultMuted native "HTMLMediaElement_defaultMuted_Getter";
@DomName('HTMLMediaElement.defaultMuted')
@DocsEditable()
void set defaultMuted(bool value) native "HTMLMediaElement_defaultMuted_Setter";
@DomName('HTMLMediaElement.defaultPlaybackRate')
@DocsEditable()
num get defaultPlaybackRate native "HTMLMediaElement_defaultPlaybackRate_Getter";
@DomName('HTMLMediaElement.defaultPlaybackRate')
@DocsEditable()
void set defaultPlaybackRate(num value) native "HTMLMediaElement_defaultPlaybackRate_Setter";
@DomName('HTMLMediaElement.duration')
@DocsEditable()
double get duration native "HTMLMediaElement_duration_Getter";
@DomName('HTMLMediaElement.ended')
@DocsEditable()
bool get ended native "HTMLMediaElement_ended_Getter";
@DomName('HTMLMediaElement.error')
@DocsEditable()
MediaError get error native "HTMLMediaElement_error_Getter";
@DomName('HTMLMediaElement.initialTime')
@DocsEditable()
// http://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-media-initialtime
@Experimental()
double get initialTime native "HTMLMediaElement_initialTime_Getter";
@DomName('HTMLMediaElement.loop')
@DocsEditable()
bool get loop native "HTMLMediaElement_loop_Getter";
@DomName('HTMLMediaElement.loop')
@DocsEditable()
void set loop(bool value) native "HTMLMediaElement_loop_Setter";
@DomName('HTMLMediaElement.mediaGroup')
@DocsEditable()
String get mediaGroup native "HTMLMediaElement_mediaGroup_Getter";
@DomName('HTMLMediaElement.mediaGroup')
@DocsEditable()
void set mediaGroup(String value) native "HTMLMediaElement_mediaGroup_Setter";
@DomName('HTMLMediaElement.mediaKeys')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html
@Experimental()
MediaKeys get mediaKeys native "HTMLMediaElement_mediaKeys_Getter";
@DomName('HTMLMediaElement.mediaKeys')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html
@Experimental()
void set mediaKeys(MediaKeys value) native "HTMLMediaElement_mediaKeys_Setter";
@DomName('HTMLMediaElement.muted')
@DocsEditable()
bool get muted native "HTMLMediaElement_muted_Getter";
@DomName('HTMLMediaElement.muted')
@DocsEditable()
void set muted(bool value) native "HTMLMediaElement_muted_Setter";
@DomName('HTMLMediaElement.networkState')
@DocsEditable()
int get networkState native "HTMLMediaElement_networkState_Getter";
@DomName('HTMLMediaElement.paused')
@DocsEditable()
bool get paused native "HTMLMediaElement_paused_Getter";
@DomName('HTMLMediaElement.playbackRate')
@DocsEditable()
num get playbackRate native "HTMLMediaElement_playbackRate_Getter";
@DomName('HTMLMediaElement.playbackRate')
@DocsEditable()
void set playbackRate(num value) native "HTMLMediaElement_playbackRate_Setter";
@DomName('HTMLMediaElement.played')
@DocsEditable()
TimeRanges get played native "HTMLMediaElement_played_Getter";
@DomName('HTMLMediaElement.preload')
@DocsEditable()
String get preload native "HTMLMediaElement_preload_Getter";
@DomName('HTMLMediaElement.preload')
@DocsEditable()
void set preload(String value) native "HTMLMediaElement_preload_Setter";
@DomName('HTMLMediaElement.readyState')
@DocsEditable()
int get readyState native "HTMLMediaElement_readyState_Getter";
@DomName('HTMLMediaElement.seekable')
@DocsEditable()
TimeRanges get seekable native "HTMLMediaElement_seekable_Getter";
@DomName('HTMLMediaElement.seeking')
@DocsEditable()
bool get seeking native "HTMLMediaElement_seeking_Getter";
@DomName('HTMLMediaElement.src')
@DocsEditable()
String get src native "HTMLMediaElement_src_Getter";
@DomName('HTMLMediaElement.src')
@DocsEditable()
void set src(String value) native "HTMLMediaElement_src_Setter";
@DomName('HTMLMediaElement.startTime')
@DocsEditable()
@Experimental() // non-standard
double get startTime native "HTMLMediaElement_startTime_Getter";
@DomName('HTMLMediaElement.textTracks')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-media-texttracks
@Experimental()
TextTrackList get textTracks native "HTMLMediaElement_textTracks_Getter";
@DomName('HTMLMediaElement.volume')
@DocsEditable()
num get volume native "HTMLMediaElement_volume_Getter";
@DomName('HTMLMediaElement.volume')
@DocsEditable()
void set volume(num value) native "HTMLMediaElement_volume_Setter";
@DomName('HTMLMediaElement.webkitAudioDecodedByteCount')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
int get audioDecodedByteCount native "HTMLMediaElement_webkitAudioDecodedByteCount_Getter";
@DomName('HTMLMediaElement.webkitClosedCaptionsVisible')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
bool get closedCaptionsVisible native "HTMLMediaElement_webkitClosedCaptionsVisible_Getter";
@DomName('HTMLMediaElement.webkitClosedCaptionsVisible')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
void set closedCaptionsVisible(bool value) native "HTMLMediaElement_webkitClosedCaptionsVisible_Setter";
@DomName('HTMLMediaElement.webkitHasClosedCaptions')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
bool get hasClosedCaptions native "HTMLMediaElement_webkitHasClosedCaptions_Getter";
@DomName('HTMLMediaElement.webkitPreservesPitch')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
bool get preservesPitch native "HTMLMediaElement_webkitPreservesPitch_Getter";
@DomName('HTMLMediaElement.webkitPreservesPitch')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
void set preservesPitch(bool value) native "HTMLMediaElement_webkitPreservesPitch_Setter";
@DomName('HTMLMediaElement.webkitVideoDecodedByteCount')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // nonstandard
int get videoDecodedByteCount native "HTMLMediaElement_webkitVideoDecodedByteCount_Getter";
TextTrack addTextTrack(String kind, [String label, String language]) {
if (language != null) {
return _addTextTrack_1(kind, label, language);
}
if (label != null) {
return _addTextTrack_2(kind, label);
}
return _addTextTrack_3(kind);
}
TextTrack _addTextTrack_1(kind, label, language) native "HTMLMediaElement__addTextTrack_1_Callback";
TextTrack _addTextTrack_2(kind, label) native "HTMLMediaElement__addTextTrack_2_Callback";
TextTrack _addTextTrack_3(kind) native "HTMLMediaElement__addTextTrack_3_Callback";
@DomName('HTMLMediaElement.canPlayType')
@DocsEditable()
@Unstable()
String canPlayType(String type, [String keySystem]) native "HTMLMediaElement_canPlayType_Callback";
@DomName('HTMLMediaElement.load')
@DocsEditable()
void load() native "HTMLMediaElement_load_Callback";
@DomName('HTMLMediaElement.pause')
@DocsEditable()
void pause() native "HTMLMediaElement_pause_Callback";
@DomName('HTMLMediaElement.play')
@DocsEditable()
void play() native "HTMLMediaElement_play_Callback";
void addKey(String keySystem, Uint8List key, [Uint8List initData, String sessionId]) {
if (initData != null) {
_webkitAddKey_1(keySystem, key, initData, sessionId);
return;
}
_webkitAddKey_2(keySystem, key);
return;
}
void _webkitAddKey_1(keySystem, key, initData, sessionId) native "HTMLMediaElement__webkitAddKey_1_Callback";
void _webkitAddKey_2(keySystem, key) native "HTMLMediaElement__webkitAddKey_2_Callback";
@DomName('HTMLMediaElement.webkitCancelKeyRequest')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#extensions
void cancelKeyRequest(String keySystem, String sessionId) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
void generateKeyRequest(String keySystem, [Uint8List initData]) {
if (initData != null) {
_webkitGenerateKeyRequest_1(keySystem, initData);
return;
}
_webkitGenerateKeyRequest_2(keySystem);
return;
}
void _webkitGenerateKeyRequest_1(keySystem, initData) native "HTMLMediaElement__webkitGenerateKeyRequest_1_Callback";
void _webkitGenerateKeyRequest_2(keySystem) native "HTMLMediaElement__webkitGenerateKeyRequest_2_Callback";
@DomName('HTMLMediaElement.oncanplay')
@DocsEditable()
ElementStream<Event> get onCanPlay => canPlayEvent.forElement(this);
@DomName('HTMLMediaElement.oncanplaythrough')
@DocsEditable()
ElementStream<Event> get onCanPlayThrough => canPlayThroughEvent.forElement(this);
@DomName('HTMLMediaElement.ondurationchange')
@DocsEditable()
ElementStream<Event> get onDurationChange => durationChangeEvent.forElement(this);
@DomName('HTMLMediaElement.onemptied')
@DocsEditable()
ElementStream<Event> get onEmptied => emptiedEvent.forElement(this);
@DomName('HTMLMediaElement.onended')
@DocsEditable()
ElementStream<Event> get onEnded => endedEvent.forElement(this);
@DomName('HTMLMediaElement.onloadeddata')
@DocsEditable()
ElementStream<Event> get onLoadedData => loadedDataEvent.forElement(this);
@DomName('HTMLMediaElement.onloadedmetadata')
@DocsEditable()
ElementStream<Event> get onLoadedMetadata => loadedMetadataEvent.forElement(this);
@DomName('HTMLMediaElement.onloadstart')
@DocsEditable()
ElementStream<Event> get onLoadStart => loadStartEvent.forElement(this);
@DomName('HTMLMediaElement.onpause')
@DocsEditable()
ElementStream<Event> get onPause => pauseEvent.forElement(this);
@DomName('HTMLMediaElement.onplay')
@DocsEditable()
ElementStream<Event> get onPlay => playEvent.forElement(this);
@DomName('HTMLMediaElement.onplaying')
@DocsEditable()
ElementStream<Event> get onPlaying => playingEvent.forElement(this);
@DomName('HTMLMediaElement.onprogress')
@DocsEditable()
ElementStream<Event> get onProgress => progressEvent.forElement(this);
@DomName('HTMLMediaElement.onratechange')
@DocsEditable()
ElementStream<Event> get onRateChange => rateChangeEvent.forElement(this);
@DomName('HTMLMediaElement.onseeked')
@DocsEditable()
ElementStream<Event> get onSeeked => seekedEvent.forElement(this);
@DomName('HTMLMediaElement.onseeking')
@DocsEditable()
ElementStream<Event> get onSeeking => seekingEvent.forElement(this);
@DomName('HTMLMediaElement.onshow')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#event-media-loadstart
@Experimental()
ElementStream<Event> get onShow => showEvent.forElement(this);
@DomName('HTMLMediaElement.onstalled')
@DocsEditable()
ElementStream<Event> get onStalled => stalledEvent.forElement(this);
@DomName('HTMLMediaElement.onsuspend')
@DocsEditable()
ElementStream<Event> get onSuspend => suspendEvent.forElement(this);
@DomName('HTMLMediaElement.ontimeupdate')
@DocsEditable()
ElementStream<Event> get onTimeUpdate => timeUpdateEvent.forElement(this);
@DomName('HTMLMediaElement.onvolumechange')
@DocsEditable()
ElementStream<Event> get onVolumeChange => volumeChangeEvent.forElement(this);
@DomName('HTMLMediaElement.onwaiting')
@DocsEditable()
ElementStream<Event> get onWaiting => waitingEvent.forElement(this);
@DomName('HTMLMediaElement.onwebkitkeyadded')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
@Experimental()
ElementStream<MediaKeyEvent> get onKeyAdded => keyAddedEvent.forElement(this);
@DomName('HTMLMediaElement.onwebkitkeyerror')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
@Experimental()
ElementStream<MediaKeyEvent> get onKeyError => keyErrorEvent.forElement(this);
@DomName('HTMLMediaElement.onwebkitkeymessage')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
@Experimental()
ElementStream<MediaKeyEvent> get onKeyMessage => keyMessageEvent.forElement(this);
@DomName('HTMLMediaElement.onwebkitneedkey')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
@Experimental()
ElementStream<MediaKeyEvent> get onNeedKey => needKeyEvent.forElement(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaError')
@Unstable()
class MediaError extends NativeFieldWrapperClass1 {
@DomName('MediaError.MEDIA_ERR_ABORTED')
@DocsEditable()
static const int MEDIA_ERR_ABORTED = 1;
@DomName('MediaError.MEDIA_ERR_DECODE')
@DocsEditable()
static const int MEDIA_ERR_DECODE = 3;
@DomName('MediaError.MEDIA_ERR_ENCRYPTED')
@DocsEditable()
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#error-codes
@Experimental()
static const int MEDIA_ERR_ENCRYPTED = 5;
@DomName('MediaError.MEDIA_ERR_NETWORK')
@DocsEditable()
static const int MEDIA_ERR_NETWORK = 2;
@DomName('MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED')
@DocsEditable()
static const int MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
@DomName('MediaError.code')
@DocsEditable()
int get code native "MediaError_code_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaKeyError')
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#error-codes
@Experimental()
class MediaKeyError extends NativeFieldWrapperClass1 {
@DomName('MediaKeyError.MEDIA_KEYERR_CLIENT')
@DocsEditable()
static const int MEDIA_KEYERR_CLIENT = 2;
@DomName('MediaKeyError.MEDIA_KEYERR_DOMAIN')
@DocsEditable()
static const int MEDIA_KEYERR_DOMAIN = 6;
@DomName('MediaKeyError.MEDIA_KEYERR_HARDWARECHANGE')
@DocsEditable()
static const int MEDIA_KEYERR_HARDWARECHANGE = 5;
@DomName('MediaKeyError.MEDIA_KEYERR_OUTPUT')
@DocsEditable()
static const int MEDIA_KEYERR_OUTPUT = 4;
@DomName('MediaKeyError.MEDIA_KEYERR_SERVICE')
@DocsEditable()
static const int MEDIA_KEYERR_SERVICE = 3;
@DomName('MediaKeyError.MEDIA_KEYERR_UNKNOWN')
@DocsEditable()
static const int MEDIA_KEYERR_UNKNOWN = 1;
@DomName('MediaKeyError.code')
@DocsEditable()
int get code native "MediaKeyError_code_Getter";
@DomName('MediaKeyError.systemCode')
@DocsEditable()
@Experimental() // non-standard
int get systemCode native "MediaKeyError_systemCode_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaKeyEvent')
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#event-definitions
@Experimental()
class MediaKeyEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MediaKeyEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaKeyEvent.defaultURL')
@DocsEditable()
String get defaultUrl native "MediaKeyEvent_defaultURL_Getter";
@DomName('MediaKeyEvent.errorCode')
@DocsEditable()
MediaKeyError get errorCode native "MediaKeyEvent_errorCode_Getter";
@DomName('MediaKeyEvent.initData')
@DocsEditable()
Uint8List get initData native "MediaKeyEvent_initData_Getter";
@DomName('MediaKeyEvent.keySystem')
@DocsEditable()
String get keySystem native "MediaKeyEvent_keySystem_Getter";
@DomName('MediaKeyEvent.message')
@DocsEditable()
Uint8List get message native "MediaKeyEvent_message_Getter";
@DomName('MediaKeyEvent.sessionId')
@DocsEditable()
String get sessionId native "MediaKeyEvent_sessionId_Getter";
@DomName('MediaKeyEvent.systemCode')
@DocsEditable()
int get systemCode native "MediaKeyEvent_systemCode_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaKeyMessageEvent')
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-mediakeymessageevent
@Experimental()
class MediaKeyMessageEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MediaKeyMessageEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaKeyMessageEvent.destinationURL')
@DocsEditable()
String get destinationUrl native "MediaKeyMessageEvent_destinationURL_Getter";
@DomName('MediaKeyMessageEvent.message')
@DocsEditable()
Uint8List get message native "MediaKeyMessageEvent_message_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaKeyNeededEvent')
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-mediakeyneededevent
@Experimental()
class MediaKeyNeededEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MediaKeyNeededEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaKeyNeededEvent.initData')
@DocsEditable()
Uint8List get initData native "MediaKeyNeededEvent_initData_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaKeySession')
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-mediakeysession
@Experimental()
class MediaKeySession extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MediaKeySession._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaKeySession.webkitkeyaddedEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
static const EventStreamProvider<MediaKeyEvent> keyAddedEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyadded');
@DomName('MediaKeySession.webkitkeyerrorEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
static const EventStreamProvider<MediaKeyEvent> keyErrorEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyerror');
@DomName('MediaKeySession.webkitkeymessageEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
static const EventStreamProvider<MediaKeyEvent> keyMessageEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeymessage');
@DomName('MediaKeySession.error')
@DocsEditable()
MediaKeyError get error native "MediaKeySession_error_Getter";
@DomName('MediaKeySession.keySystem')
@DocsEditable()
String get keySystem native "MediaKeySession_keySystem_Getter";
@DomName('MediaKeySession.sessionId')
@DocsEditable()
String get sessionId native "MediaKeySession_sessionId_Getter";
@DomName('MediaKeySession.close')
@DocsEditable()
void close() native "MediaKeySession_close_Callback";
@DomName('MediaKeySession.update')
@DocsEditable()
void update(Uint8List key) native "MediaKeySession_update_Callback";
@DomName('MediaKeySession.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MediaKeySession_addEventListener_Callback";
@DomName('MediaKeySession.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MediaKeySession_dispatchEvent_Callback";
@DomName('MediaKeySession.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaKeySession_removeEventListener_Callback";
@DomName('MediaKeySession.onwebkitkeyadded')
@DocsEditable()
Stream<MediaKeyEvent> get onKeyAdded => keyAddedEvent.forTarget(this);
@DomName('MediaKeySession.onwebkitkeyerror')
@DocsEditable()
Stream<MediaKeyEvent> get onKeyError => keyErrorEvent.forTarget(this);
@DomName('MediaKeySession.onwebkitkeymessage')
@DocsEditable()
Stream<MediaKeyEvent> get onKeyMessage => keyMessageEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaKeys')
// https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html
@Experimental()
class MediaKeys extends NativeFieldWrapperClass1 {
@DomName('MediaKeys.MediaKeys')
@DocsEditable()
factory MediaKeys(String keySystem) {
return MediaKeys._create_1(keySystem);
}
@DocsEditable()
static MediaKeys _create_1(keySystem) native "MediaKeys__create_1constructorCallback";
@DomName('MediaKeys.keySystem')
@DocsEditable()
String get keySystem native "MediaKeys_keySystem_Getter";
@DomName('MediaKeys.createSession')
@DocsEditable()
MediaKeySession createSession(String type, Uint8List initData) native "MediaKeys_createSession_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaList')
@Unstable()
class MediaList extends NativeFieldWrapperClass1 {
@DomName('MediaList.length')
@DocsEditable()
int get length native "MediaList_length_Getter";
@DomName('MediaList.mediaText')
@DocsEditable()
String get mediaText native "MediaList_mediaText_Getter";
@DomName('MediaList.mediaText')
@DocsEditable()
void set mediaText(String value) native "MediaList_mediaText_Setter";
@DomName('MediaList.appendMedium')
@DocsEditable()
void appendMedium(String newMedium) native "MediaList_appendMedium_Callback";
@DomName('MediaList.deleteMedium')
@DocsEditable()
void deleteMedium(String oldMedium) native "MediaList_deleteMedium_Callback";
@DomName('MediaList.item')
@DocsEditable()
String item(int index) native "MediaList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaQueryList')
@Unstable()
class MediaQueryList extends NativeFieldWrapperClass1 {
@DomName('MediaQueryList.matches')
@DocsEditable()
bool get matches native "MediaQueryList_matches_Getter";
@DomName('MediaQueryList.media')
@DocsEditable()
String get media native "MediaQueryList_media_Getter";
@DomName('MediaQueryList.addListener')
@DocsEditable()
void addListener(MediaQueryListListener listener) native "MediaQueryList_addListener_Callback";
@DomName('MediaQueryList.removeListener')
@DocsEditable()
void removeListener(MediaQueryListListener listener) native "MediaQueryList_removeListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaQueryListListener')
@Unstable()
abstract class MediaQueryListListener extends NativeFieldWrapperClass1 {
@DomName('MediaQueryListListener.queryChanged')
@DocsEditable()
void queryChanged(MediaQueryList list) native "MediaQueryListListener_queryChanged_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaSource')
// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#mediasource
@Experimental()
class MediaSource extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MediaSource._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaSource.MediaSource')
@DocsEditable()
factory MediaSource() {
return MediaSource._create_1();
}
@DocsEditable()
static MediaSource _create_1() native "MediaSource__create_1constructorCallback";
@DomName('MediaSource.activeSourceBuffers')
@DocsEditable()
SourceBufferList get activeSourceBuffers native "MediaSource_activeSourceBuffers_Getter";
@DomName('MediaSource.duration')
@DocsEditable()
num get duration native "MediaSource_duration_Getter";
@DomName('MediaSource.duration')
@DocsEditable()
void set duration(num value) native "MediaSource_duration_Setter";
@DomName('MediaSource.readyState')
@DocsEditable()
String get readyState native "MediaSource_readyState_Getter";
@DomName('MediaSource.sourceBuffers')
@DocsEditable()
SourceBufferList get sourceBuffers native "MediaSource_sourceBuffers_Getter";
@DomName('MediaSource.addSourceBuffer')
@DocsEditable()
SourceBuffer addSourceBuffer(String type) native "MediaSource_addSourceBuffer_Callback";
@DomName('MediaSource.endOfStream')
@DocsEditable()
void endOfStream(String error) native "MediaSource_endOfStream_Callback";
@DomName('MediaSource.isTypeSupported')
@DocsEditable()
static bool isTypeSupported(String type) native "MediaSource_isTypeSupported_Callback";
@DomName('MediaSource.removeSourceBuffer')
@DocsEditable()
void removeSourceBuffer(SourceBuffer buffer) native "MediaSource_removeSourceBuffer_Callback";
@DomName('MediaSource.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MediaSource_addEventListener_Callback";
@DomName('MediaSource.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MediaSource_dispatchEvent_Callback";
@DomName('MediaSource.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaSource_removeEventListener_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('MediaStream')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastream
class MediaStream extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MediaStream._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaStream.addtrackEvent')
@DocsEditable()
static const EventStreamProvider<Event> addTrackEvent = const EventStreamProvider<Event>('addtrack');
@DomName('MediaStream.endedEvent')
@DocsEditable()
static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
@DomName('MediaStream.removetrackEvent')
@DocsEditable()
static const EventStreamProvider<Event> removeTrackEvent = const EventStreamProvider<Event>('removetrack');
@DomName('MediaStream.MediaStream')
@DocsEditable()
factory MediaStream([stream_OR_tracks]) {
if (stream_OR_tracks == null) {
return MediaStream._create_1();
}
if ((stream_OR_tracks is MediaStream || stream_OR_tracks == null)) {
return MediaStream._create_2(stream_OR_tracks);
}
if ((stream_OR_tracks is List<MediaStreamTrack> || stream_OR_tracks == null)) {
return MediaStream._create_3(stream_OR_tracks);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@DocsEditable()
static MediaStream _create_1() native "MediaStream__create_1constructorCallback";
@DocsEditable()
static MediaStream _create_2(stream_OR_tracks) native "MediaStream__create_2constructorCallback";
@DocsEditable()
static MediaStream _create_3(stream_OR_tracks) native "MediaStream__create_3constructorCallback";
@DomName('MediaStream.ended')
@DocsEditable()
bool get ended native "MediaStream_ended_Getter";
@DomName('MediaStream.id')
@DocsEditable()
String get id native "MediaStream_id_Getter";
@DomName('MediaStream.label')
@DocsEditable()
@Experimental() // non-standard
String get label native "MediaStream_label_Getter";
@DomName('MediaStream.addTrack')
@DocsEditable()
void addTrack(MediaStreamTrack track) native "MediaStream_addTrack_Callback";
@DomName('MediaStream.getAudioTracks')
@DocsEditable()
List<MediaStreamTrack> getAudioTracks() native "MediaStream_getAudioTracks_Callback";
@DomName('MediaStream.getTrackById')
@DocsEditable()
MediaStreamTrack getTrackById(String trackId) native "MediaStream_getTrackById_Callback";
@DomName('MediaStream.getVideoTracks')
@DocsEditable()
List<MediaStreamTrack> getVideoTracks() native "MediaStream_getVideoTracks_Callback";
@DomName('MediaStream.removeTrack')
@DocsEditable()
void removeTrack(MediaStreamTrack track) native "MediaStream_removeTrack_Callback";
@DomName('MediaStream.stop')
@DocsEditable()
void stop() native "MediaStream_stop_Callback";
@DomName('MediaStream.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStream_addEventListener_Callback";
@DomName('MediaStream.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MediaStream_dispatchEvent_Callback";
@DomName('MediaStream.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStream_removeEventListener_Callback";
@DomName('MediaStream.onaddtrack')
@DocsEditable()
Stream<Event> get onAddTrack => addTrackEvent.forTarget(this);
@DomName('MediaStream.onended')
@DocsEditable()
Stream<Event> get onEnded => endedEvent.forTarget(this);
@DomName('MediaStream.onremovetrack')
@DocsEditable()
Stream<Event> get onRemoveTrack => removeTrackEvent.forTarget(this);
/**
* Checks if the MediaStream APIs are supported on the current platform.
*
* See also:
*
* * [Navigator.getUserMedia]
*/
static bool get supported => true;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaStreamEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html
class MediaStreamEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MediaStreamEvent._() { throw new UnsupportedError("Not supported"); }
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('MediaStreamEvent.stream')
@DocsEditable()
MediaStream get stream native "MediaStreamEvent_stream_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaStreamTrack')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack
class MediaStreamTrack extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MediaStreamTrack._() { throw new UnsupportedError("Not supported"); }
@DomName('MediaStreamTrack.endedEvent')
@DocsEditable()
static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
@DomName('MediaStreamTrack.muteEvent')
@DocsEditable()
static const EventStreamProvider<Event> muteEvent = const EventStreamProvider<Event>('mute');
@DomName('MediaStreamTrack.unmuteEvent')
@DocsEditable()
static const EventStreamProvider<Event> unmuteEvent = const EventStreamProvider<Event>('unmute');
@DomName('MediaStreamTrack.enabled')
@DocsEditable()
bool get enabled native "MediaStreamTrack_enabled_Getter";
@DomName('MediaStreamTrack.enabled')
@DocsEditable()
void set enabled(bool value) native "MediaStreamTrack_enabled_Setter";
@DomName('MediaStreamTrack.id')
@DocsEditable()
String get id native "MediaStreamTrack_id_Getter";
@DomName('MediaStreamTrack.kind')
@DocsEditable()
String get kind native "MediaStreamTrack_kind_Getter";
@DomName('MediaStreamTrack.label')
@DocsEditable()
String get label native "MediaStreamTrack_label_Getter";
@DomName('MediaStreamTrack.readyState')
@DocsEditable()
String get readyState native "MediaStreamTrack_readyState_Getter";
@DomName('MediaStreamTrack.getSources')
@DocsEditable()
@Experimental() // untriaged
static void getSources(MediaStreamTrackSourcesCallback callback) native "MediaStreamTrack_getSources_Callback";
@DomName('MediaStreamTrack.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStreamTrack_addEventListener_Callback";
@DomName('MediaStreamTrack.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MediaStreamTrack_dispatchEvent_Callback";
@DomName('MediaStreamTrack.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStreamTrack_removeEventListener_Callback";
@DomName('MediaStreamTrack.onended')
@DocsEditable()
Stream<Event> get onEnded => endedEvent.forTarget(this);
@DomName('MediaStreamTrack.onmute')
@DocsEditable()
Stream<Event> get onMute => muteEvent.forTarget(this);
@DomName('MediaStreamTrack.onunmute')
@DocsEditable()
Stream<Event> get onUnmute => unmuteEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MediaStreamTrackEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html
class MediaStreamTrackEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MediaStreamTrackEvent._() { throw new UnsupportedError("Not supported"); }
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('MediaStreamTrackEvent.track')
@DocsEditable()
MediaStreamTrack get track native "MediaStreamTrackEvent_track_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MediaStreamTrackSourcesCallback')
@Experimental() // untriaged
typedef void MediaStreamTrackSourcesCallback(List<SourceInfo> sources);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MemoryInfo')
@Experimental() // nonstandard
class MemoryInfo extends NativeFieldWrapperClass1 {
@DomName('MemoryInfo.jsHeapSizeLimit')
@DocsEditable()
int get jsHeapSizeLimit native "MemoryInfo_jsHeapSizeLimit_Getter";
@DomName('MemoryInfo.totalJSHeapSize')
@DocsEditable()
int get totalJSHeapSize native "MemoryInfo_totalJSHeapSize_Getter";
@DomName('MemoryInfo.usedJSHeapSize')
@DocsEditable()
int get usedJSHeapSize native "MemoryInfo_usedJSHeapSize_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* An HTML <menu> element.
*
* A <menu> element represents an unordered list of menu commands.
*
* See also:
*
* * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
* * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
*/
@DomName('HTMLMenuElement')
class MenuElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory MenuElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLMenuElement.HTMLMenuElement')
@DocsEditable()
factory MenuElement() => document.$dom_createElement("menu");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MessageChannel')
@Unstable()
class MessageChannel extends NativeFieldWrapperClass1 {
@DomName('MessageChannel.port1')
@DocsEditable()
MessagePort get port1 native "MessageChannel_port1_Getter";
@DomName('MessageChannel.port2')
@DocsEditable()
MessagePort get port2 native "MessageChannel_port2_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MessageEvent')
class MessageEvent extends Event {
factory MessageEvent(String type,
{bool canBubble: false, bool cancelable: false, Object data,
String origin, String lastEventId,
Window source, List messagePorts}) {
if (source == null) {
source = window;
}
var event = document._createEvent("MessageEvent");
event._initMessageEvent(type, canBubble, cancelable, data, origin,
lastEventId, source, messagePorts);
return event;
}
// To suppress missing implicit constructor warnings.
factory MessageEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MessageEvent.data')
@DocsEditable()
Object get data native "MessageEvent_data_Getter";
@DomName('MessageEvent.lastEventId')
@DocsEditable()
@Unstable()
String get lastEventId native "MessageEvent_lastEventId_Getter";
@DomName('MessageEvent.origin')
@DocsEditable()
String get origin native "MessageEvent_origin_Getter";
@DomName('MessageEvent.ports')
@DocsEditable()
@Unstable()
List<MessagePort> get ports native "MessageEvent_ports_Getter";
@DomName('MessageEvent.source')
@DocsEditable()
EventTarget get source native "MessageEvent_source_Getter";
@DomName('MessageEvent.initMessageEvent')
@DocsEditable()
void _initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List messagePorts) native "MessageEvent_initMessageEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MessagePort')
@Unstable()
class MessagePort extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MessagePort._() { throw new UnsupportedError("Not supported"); }
@DomName('MessagePort.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('MessagePort.close')
@DocsEditable()
void close() native "MessagePort_close_Callback";
@DomName('MessagePort.postMessage')
@DocsEditable()
void postMessage(Object message, [List messagePorts]) native "MessagePort_postMessage_Callback";
@DomName('MessagePort.start')
@DocsEditable()
void start() native "MessagePort_start_Callback";
@DomName('MessagePort.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MessagePort_addEventListener_Callback";
@DomName('MessagePort.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MessagePort_dispatchEvent_Callback";
@DomName('MessagePort.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MessagePort_removeEventListener_Callback";
@DomName('MessagePort.onmessage')
@DocsEditable()
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLMetaElement')
class MetaElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory MetaElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLMetaElement.HTMLMetaElement')
@DocsEditable()
factory MetaElement() => document.$dom_createElement("meta");
@DomName('HTMLMetaElement.content')
@DocsEditable()
String get content native "HTMLMetaElement_content_Getter";
@DomName('HTMLMetaElement.content')
@DocsEditable()
void set content(String value) native "HTMLMetaElement_content_Setter";
@DomName('HTMLMetaElement.httpEquiv')
@DocsEditable()
String get httpEquiv native "HTMLMetaElement_httpEquiv_Getter";
@DomName('HTMLMetaElement.httpEquiv')
@DocsEditable()
void set httpEquiv(String value) native "HTMLMetaElement_httpEquiv_Setter";
@DomName('HTMLMetaElement.name')
@DocsEditable()
String get name native "HTMLMetaElement_name_Getter";
@DomName('HTMLMetaElement.name')
@DocsEditable()
void set name(String value) native "HTMLMetaElement_name_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Metadata')
// http://www.w3.org/TR/file-system-api/#the-metadata-interface
@Experimental()
class Metadata extends NativeFieldWrapperClass1 {
@DomName('Metadata.modificationTime')
@DocsEditable()
DateTime get modificationTime native "Metadata_modificationTime_Getter";
@DomName('Metadata.size')
@DocsEditable()
int get size native "Metadata_size_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MetadataCallback')
// http://www.w3.org/TR/file-system-api/#idl-def-MetadataCallback
@Experimental()
typedef void MetadataCallback(Metadata metadata);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLMeterElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Unstable()
class MeterElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory MeterElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLMeterElement.HTMLMeterElement')
@DocsEditable()
factory MeterElement() => document.$dom_createElement("meter");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLMeterElement.high')
@DocsEditable()
num get high native "HTMLMeterElement_high_Getter";
@DomName('HTMLMeterElement.high')
@DocsEditable()
void set high(num value) native "HTMLMeterElement_high_Setter";
@DomName('HTMLMeterElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLMeterElement_labels_Getter";
@DomName('HTMLMeterElement.low')
@DocsEditable()
num get low native "HTMLMeterElement_low_Getter";
@DomName('HTMLMeterElement.low')
@DocsEditable()
void set low(num value) native "HTMLMeterElement_low_Setter";
@DomName('HTMLMeterElement.max')
@DocsEditable()
num get max native "HTMLMeterElement_max_Getter";
@DomName('HTMLMeterElement.max')
@DocsEditable()
void set max(num value) native "HTMLMeterElement_max_Setter";
@DomName('HTMLMeterElement.min')
@DocsEditable()
num get min native "HTMLMeterElement_min_Getter";
@DomName('HTMLMeterElement.min')
@DocsEditable()
void set min(num value) native "HTMLMeterElement_min_Setter";
@DomName('HTMLMeterElement.optimum')
@DocsEditable()
num get optimum native "HTMLMeterElement_optimum_Getter";
@DomName('HTMLMeterElement.optimum')
@DocsEditable()
void set optimum(num value) native "HTMLMeterElement_optimum_Setter";
@DomName('HTMLMeterElement.value')
@DocsEditable()
num get value native "HTMLMeterElement_value_Getter";
@DomName('HTMLMeterElement.value')
@DocsEditable()
void set value(num value) native "HTMLMeterElement_value_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIAccess')
// http://webaudio.github.io/web-midi-api/#midiaccess-interface
@Experimental()
class MidiAccess extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MidiAccess._() { throw new UnsupportedError("Not supported"); }
@DomName('MIDIAccess.connectEvent')
@DocsEditable()
static const EventStreamProvider<MidiConnectionEvent> connectEvent = const EventStreamProvider<MidiConnectionEvent>('connect');
@DomName('MIDIAccess.disconnectEvent')
@DocsEditable()
static const EventStreamProvider<MidiConnectionEvent> disconnectEvent = const EventStreamProvider<MidiConnectionEvent>('disconnect');
@DomName('MIDIAccess.inputs')
@DocsEditable()
List<MidiInput> inputs() native "MIDIAccess_inputs_Callback";
@DomName('MIDIAccess.outputs')
@DocsEditable()
List<MidiOutput> outputs() native "MIDIAccess_outputs_Callback";
@DomName('MIDIAccess.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MIDIAccess_addEventListener_Callback";
@DomName('MIDIAccess.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MIDIAccess_dispatchEvent_Callback";
@DomName('MIDIAccess.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MIDIAccess_removeEventListener_Callback";
@DomName('MIDIAccess.onconnect')
@DocsEditable()
Stream<MidiConnectionEvent> get onConnect => connectEvent.forTarget(this);
@DomName('MIDIAccess.ondisconnect')
@DocsEditable()
Stream<MidiConnectionEvent> get onDisconnect => disconnectEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIAccessPromise')
@Experimental() // untriaged
class MidiAccessPromise extends NativeFieldWrapperClass1 {
@DomName('MIDIAccessPromise.then')
@DocsEditable()
@Experimental() // untriaged
void then(MidiSuccessCallback successCallback, MidiErrorCallback errorCallback) native "MIDIAccessPromise_then_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIConnectionEvent')
// http://webaudio.github.io/web-midi-api/#midiconnectionevent-interface
@Experimental()
class MidiConnectionEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MidiConnectionEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MIDIConnectionEvent.port')
@DocsEditable()
MidiPort get port native "MIDIConnectionEvent_port_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIInput')
// http://webaudio.github.io/web-midi-api/#idl-def-MIDIInput
@Experimental()
class MidiInput extends MidiPort {
// To suppress missing implicit constructor warnings.
factory MidiInput._() { throw new UnsupportedError("Not supported"); }
@DomName('MIDIInput.midimessageEvent')
@DocsEditable()
static const EventStreamProvider<MidiMessageEvent> midiMessageEvent = const EventStreamProvider<MidiMessageEvent>('midimessage');
@DomName('MIDIInput.onmidimessage')
@DocsEditable()
Stream<MidiMessageEvent> get onMidiMessage => midiMessageEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIMessageEvent')
// http://webaudio.github.io/web-midi-api/#midimessageevent-interface
@Experimental()
class MidiMessageEvent extends Event {
// To suppress missing implicit constructor warnings.
factory MidiMessageEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MIDIMessageEvent.data')
@DocsEditable()
Uint8List get data native "MIDIMessageEvent_data_Getter";
@DomName('MIDIMessageEvent.receivedTime')
@DocsEditable()
double get receivedTime native "MIDIMessageEvent_receivedTime_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIOutput')
// http://webaudio.github.io/web-midi-api/#midioutput-interface
@Experimental()
class MidiOutput extends MidiPort {
// To suppress missing implicit constructor warnings.
factory MidiOutput._() { throw new UnsupportedError("Not supported"); }
void send(Uint8List data, [num timestamp]) {
if (timestamp != null) {
_send_1(data, timestamp);
return;
}
_send_2(data);
return;
}
void _send_1(data, timestamp) native "MIDIOutput__send_1_Callback";
void _send_2(data) native "MIDIOutput__send_2_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MIDIPort')
// http://webaudio.github.io/web-midi-api/#idl-def-MIDIPort
@Experimental()
class MidiPort extends EventTarget {
// To suppress missing implicit constructor warnings.
factory MidiPort._() { throw new UnsupportedError("Not supported"); }
@DomName('MIDIPort.disconnectEvent')
@DocsEditable()
static const EventStreamProvider<MidiConnectionEvent> disconnectEvent = const EventStreamProvider<MidiConnectionEvent>('disconnect');
@DomName('MIDIPort.id')
@DocsEditable()
String get id native "MIDIPort_id_Getter";
@DomName('MIDIPort.manufacturer')
@DocsEditable()
String get manufacturer native "MIDIPort_manufacturer_Getter";
@DomName('MIDIPort.name')
@DocsEditable()
String get name native "MIDIPort_name_Getter";
@DomName('MIDIPort.type')
@DocsEditable()
String get type native "MIDIPort_type_Getter";
@DomName('MIDIPort.version')
@DocsEditable()
String get version native "MIDIPort_version_Getter";
@DomName('MIDIPort.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "MIDIPort_addEventListener_Callback";
@DomName('MIDIPort.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "MIDIPort_dispatchEvent_Callback";
@DomName('MIDIPort.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MIDIPort_removeEventListener_Callback";
@DomName('MIDIPort.ondisconnect')
@DocsEditable()
Stream<MidiConnectionEvent> get onDisconnect => disconnectEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MimeType')
@Experimental() // non-standard
class MimeType extends NativeFieldWrapperClass1 {
@DomName('MimeType.description')
@DocsEditable()
String get description native "MimeType_description_Getter";
@DomName('MimeType.enabledPlugin')
@DocsEditable()
Plugin get enabledPlugin native "MimeType_enabledPlugin_Getter";
@DomName('MimeType.suffixes')
@DocsEditable()
String get suffixes native "MimeType_suffixes_Getter";
@DomName('MimeType.type')
@DocsEditable()
String get type native "MimeType_type_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MimeTypeArray')
@Experimental() // non-standard
class MimeTypeArray extends NativeFieldWrapperClass1 with ListMixin<MimeType>, ImmutableListMixin<MimeType> implements List<MimeType> {
@DomName('MimeTypeArray.length')
@DocsEditable()
int get length native "MimeTypeArray_length_Getter";
MimeType operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
MimeType _nativeIndexedGetter(int index) native "MimeTypeArray_item_Callback";
void operator[]=(int index, MimeType value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<MimeType> mixins.
// MimeType is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
MimeType get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
MimeType get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
MimeType get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
MimeType elementAt(int index) => this[index];
// -- end List<MimeType> mixins.
@DomName('MimeTypeArray.__getter__')
@DocsEditable()
MimeType __getter__(String name) native "MimeTypeArray___getter___Callback";
@DomName('MimeTypeArray.item')
@DocsEditable()
MimeType item(int index) native "MimeTypeArray_item_Callback";
@DomName('MimeTypeArray.namedItem')
@DocsEditable()
MimeType namedItem(String name) native "MimeTypeArray_namedItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLModElement')
@Unstable()
class ModElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ModElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLModElement.cite')
@DocsEditable()
String get cite native "HTMLModElement_cite_Getter";
@DomName('HTMLModElement.cite')
@DocsEditable()
void set cite(String value) native "HTMLModElement_cite_Setter";
@DomName('HTMLModElement.dateTime')
@DocsEditable()
String get dateTime native "HTMLModElement_dateTime_Getter";
@DomName('HTMLModElement.dateTime')
@DocsEditable()
void set dateTime(String value) native "HTMLModElement_dateTime_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MouseEvent')
class MouseEvent extends UIEvent {
factory MouseEvent(String type,
{Window view, int detail: 0, int screenX: 0, int screenY: 0,
int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
bool cancelable: true, bool ctrlKey: false, bool altKey: false,
bool shiftKey: false, bool metaKey: false, EventTarget relatedTarget}) {
if (view == null) {
view = window;
}
var event = document._createEvent('MouseEvent');
event._initMouseEvent(type, canBubble, cancelable, view, detail,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey,
button, relatedTarget);
return event;
}
// To suppress missing implicit constructor warnings.
factory MouseEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MouseEvent.altKey')
@DocsEditable()
bool get altKey native "MouseEvent_altKey_Getter";
@DomName('MouseEvent.button')
@DocsEditable()
int get button native "MouseEvent_button_Getter";
@DomName('MouseEvent.clientX')
@DocsEditable()
int get _clientX native "MouseEvent_clientX_Getter";
@DomName('MouseEvent.clientY')
@DocsEditable()
int get _clientY native "MouseEvent_clientY_Getter";
@DomName('MouseEvent.ctrlKey')
@DocsEditable()
bool get ctrlKey native "MouseEvent_ctrlKey_Getter";
@DomName('MouseEvent.dataTransfer')
@DocsEditable()
@Unstable()
DataTransfer get dataTransfer native "MouseEvent_dataTransfer_Getter";
@DomName('MouseEvent.fromElement')
@DocsEditable()
@Experimental() // nonstandard
Node get fromElement native "MouseEvent_fromElement_Getter";
@DomName('MouseEvent.metaKey')
@DocsEditable()
bool get metaKey native "MouseEvent_metaKey_Getter";
@DomName('MouseEvent.offsetX')
@DocsEditable()
@Unstable()
int get _offsetX native "MouseEvent_offsetX_Getter";
@DomName('MouseEvent.offsetY')
@DocsEditable()
@Unstable()
int get _offsetY native "MouseEvent_offsetY_Getter";
@DomName('MouseEvent.relatedTarget')
@DocsEditable()
EventTarget get relatedTarget native "MouseEvent_relatedTarget_Getter";
@DomName('MouseEvent.screenX')
@DocsEditable()
int get _screenX native "MouseEvent_screenX_Getter";
@DomName('MouseEvent.screenY')
@DocsEditable()
int get _screenY native "MouseEvent_screenY_Getter";
@DomName('MouseEvent.shiftKey')
@DocsEditable()
bool get shiftKey native "MouseEvent_shiftKey_Getter";
@DomName('MouseEvent.toElement')
@DocsEditable()
@Experimental() // nonstandard
Node get toElement native "MouseEvent_toElement_Getter";
@DomName('MouseEvent.webkitMovementX')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
int get _webkitMovementX native "MouseEvent_webkitMovementX_Getter";
@DomName('MouseEvent.webkitMovementY')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
int get _webkitMovementY native "MouseEvent_webkitMovementY_Getter";
@DomName('MouseEvent.initMouseEvent')
@DocsEditable()
void _initMouseEvent(String type, bool canBubble, bool cancelable, Window view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, int button, EventTarget relatedTarget) native "MouseEvent_initMouseEvent_Callback";
@deprecated
int get clientX => client.x;
@deprecated
int get clientY => client.y;
@deprecated
int get offsetX => offset.x;
@deprecated
int get offsetY => offset.y;
@deprecated
int get movementX => movement.x;
@deprecated
int get movementY => movement.y;
@deprecated
int get screenX => screen.x;
@deprecated
int get screenY => screen.y;
@DomName('MouseEvent.clientX')
@DomName('MouseEvent.clientY')
Point get client => new Point(_clientX, _clientY);
@DomName('MouseEvent.movementX')
@DomName('MouseEvent.movementY')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
Point get movement => new Point(_webkitMovementX, _webkitMovementY);
/**
* The coordinates of the mouse pointer in target node coordinates.
*
* This value may vary between platforms if the target node moves
* after the event has fired or if the element has CSS transforms affecting
* it.
*/
Point get offset => new Point(_offsetX, _offsetY);
@DomName('MouseEvent.screenX')
@DomName('MouseEvent.screenY')
Point get screen => new Point(_screenX, _screenY);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('MutationCallback')
typedef void MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('MutationEvent')
// http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents
@deprecated
class MutationEvent extends Event {
factory MutationEvent(String type,
{bool canBubble: false, bool cancelable: false, Node relatedNode,
String prevValue, String newValue, String attrName, int attrChange: 0}) {
var event = document._createEvent('MutationEvent');
event._initMutationEvent(type, canBubble, cancelable, relatedNode,
prevValue, newValue, attrName, attrChange);
return event;
}
// To suppress missing implicit constructor warnings.
factory MutationEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('MutationEvent.ADDITION')
@DocsEditable()
static const int ADDITION = 2;
@DomName('MutationEvent.MODIFICATION')
@DocsEditable()
static const int MODIFICATION = 1;
@DomName('MutationEvent.REMOVAL')
@DocsEditable()
static const int REMOVAL = 3;
@DomName('MutationEvent.attrChange')
@DocsEditable()
int get attrChange native "MutationEvent_attrChange_Getter";
@DomName('MutationEvent.attrName')
@DocsEditable()
String get attrName native "MutationEvent_attrName_Getter";
@DomName('MutationEvent.newValue')
@DocsEditable()
String get newValue native "MutationEvent_newValue_Getter";
@DomName('MutationEvent.prevValue')
@DocsEditable()
String get prevValue native "MutationEvent_prevValue_Getter";
@DomName('MutationEvent.relatedNode')
@DocsEditable()
Node get relatedNode native "MutationEvent_relatedNode_Getter";
@DomName('MutationEvent.initMutationEvent')
@DocsEditable()
void _initMutationEvent(String type, bool canBubble, bool cancelable, Node relatedNode, String prevValue, String newValue, String attrName, int attrChange) native "MutationEvent_initMutationEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('MutationObserver')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
class MutationObserver extends NativeFieldWrapperClass1 {
@DomName('MutationObserver.MutationObserver')
@DocsEditable()
factory MutationObserver(MutationCallback callback) => _create(callback);
@DocsEditable()
static MutationObserver _create(callback) native "MutationObserver_constructorCallback";
@DomName('MutationObserver.disconnect')
@DocsEditable()
void disconnect() native "MutationObserver_disconnect_Callback";
@DomName('MutationObserver.observe')
@DocsEditable()
void _observe(Node target, Map options) native "MutationObserver_observe_Callback";
@DomName('MutationObserver.takeRecords')
@DocsEditable()
List<MutationRecord> takeRecords() native "MutationObserver_takeRecords_Callback";
/**
* Checks to see if the mutation observer API is supported on the current
* platform.
*/
static bool get supported {
return true;
}
void observe(Node target,
{bool childList,
bool attributes,
bool characterData,
bool subtree,
bool attributeOldValue,
bool characterDataOldValue,
List<String> attributeFilter}) {
// Parse options into map of known type.
var parsedOptions = _createDict();
// Override options passed in the map with named optional arguments.
override(key, value) {
if (value != null) _add(parsedOptions, key, value);
}
override('childList', childList);
override('attributes', attributes);
override('characterData', characterData);
override('subtree', subtree);
override('attributeOldValue', attributeOldValue);
override('characterDataOldValue', characterDataOldValue);
if (attributeFilter != null) {
override('attributeFilter', _fixupList(attributeFilter));
}
_call(target, parsedOptions);
}
// TODO: Change to a set when const Sets are available.
static final _boolKeys =
const {'childList': true,
'attributes': true,
'characterData': true,
'subtree': true,
'attributeOldValue': true,
'characterDataOldValue': true };
static _createDict() => {};
static _add(m, String key, value) { m[key] = value; }
static _fixupList(list) => list;
void _call(Node target, options) {
_observe(target, options);
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('MutationRecord')
class MutationRecord extends NativeFieldWrapperClass1 {
@DomName('MutationRecord.addedNodes')
@DocsEditable()
List<Node> get addedNodes native "MutationRecord_addedNodes_Getter";
@DomName('MutationRecord.attributeName')
@DocsEditable()
String get attributeName native "MutationRecord_attributeName_Getter";
@DomName('MutationRecord.attributeNamespace')
@DocsEditable()
String get attributeNamespace native "MutationRecord_attributeNamespace_Getter";
@DomName('MutationRecord.nextSibling')
@DocsEditable()
Node get nextSibling native "MutationRecord_nextSibling_Getter";
@DomName('MutationRecord.oldValue')
@DocsEditable()
String get oldValue native "MutationRecord_oldValue_Getter";
@DomName('MutationRecord.previousSibling')
@DocsEditable()
Node get previousSibling native "MutationRecord_previousSibling_Getter";
@DomName('MutationRecord.removedNodes')
@DocsEditable()
List<Node> get removedNodes native "MutationRecord_removedNodes_Getter";
@DomName('MutationRecord.target')
@DocsEditable()
Node get target native "MutationRecord_target_Getter";
@DomName('MutationRecord.type')
@DocsEditable()
String get type native "MutationRecord_type_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitNamedFlow')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/css3-regions/#dom-named-flow-collection
class NamedFlow extends EventTarget {
// To suppress missing implicit constructor warnings.
factory NamedFlow._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitNamedFlow.firstEmptyRegionIndex')
@DocsEditable()
int get firstEmptyRegionIndex native "WebKitNamedFlow_firstEmptyRegionIndex_Getter";
@DomName('WebKitNamedFlow.name')
@DocsEditable()
String get name native "WebKitNamedFlow_name_Getter";
@DomName('WebKitNamedFlow.overset')
@DocsEditable()
bool get overset native "WebKitNamedFlow_overset_Getter";
@DomName('WebKitNamedFlow.getContent')
@DocsEditable()
List<Node> getContent() native "WebKitNamedFlow_getContent_Callback";
@DomName('WebKitNamedFlow.getRegions')
@DocsEditable()
List<Node> getRegions() native "WebKitNamedFlow_getRegions_Callback";
@DomName('WebKitNamedFlow.getRegionsByContent')
@DocsEditable()
List<Node> getRegionsByContent(Node contentNode) native "WebKitNamedFlow_getRegionsByContent_Callback";
@DomName('WebKitNamedFlow.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "WebKitNamedFlow_addEventListener_Callback";
@DomName('WebKitNamedFlow.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "WebKitNamedFlow_dispatchEvent_Callback";
@DomName('WebKitNamedFlow.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "WebKitNamedFlow_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitNamedFlowCollection')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://dev.w3.org/csswg/css-regions/#dom-named-flow-collection
class NamedFlowCollection extends NativeFieldWrapperClass1 {
@DomName('WebKitNamedFlowCollection.length')
@DocsEditable()
int get length native "WebKitNamedFlowCollection_length_Getter";
@DomName('WebKitNamedFlowCollection.__getter__')
@DocsEditable()
NamedFlow __getter__(String name) native "WebKitNamedFlowCollection___getter___Callback";
@DomName('WebKitNamedFlowCollection.item')
@DocsEditable()
NamedFlow item(int index) native "WebKitNamedFlowCollection_item_Callback";
@DomName('WebKitNamedFlowCollection.namedItem')
@DocsEditable()
NamedFlow namedItem(String name) native "WebKitNamedFlowCollection_namedItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('Navigator')
class Navigator extends NativeFieldWrapperClass1 implements NavigatorOnLine, NavigatorID {
/**
* Gets a stream (video and or audio) from the local computer.
*
* Use [MediaStream.supported] to check if this is supported by the current
* platform. The arguments `audio` and `video` default to `false` (stream does
* not use audio or video, respectively).
*
* Simple example usage:
*
* window.navigator.getUserMedia(audio: true, video: true).then((stream) {
* var video = new VideoElement()
* ..autoplay = true
* ..src = Url.createObjectUrlFromStream(stream);
* document.body.append(video);
* });
*
* The user can also pass in Maps to the audio or video parameters to specify
* mandatory and optional constraints for the media stream. Not passing in a
* map, but passing in `true` will provide a MediaStream with audio or
* video capabilities, but without any additional constraints. The particular
* constraint names for audio and video are still in flux, but as of this
* writing, here is an example providing more constraints.
*
* window.navigator.getUserMedia(
* audio: true,
* video: {'mandatory':
* { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 },
* 'optional':
* [{ 'minFrameRate': 60 },
* { 'maxWidth': 640 }]
* });
*
* See also:
* * [MediaStream.supported]
*/
@DomName('Navigator.webkitGetUserMedia')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
Future<MediaStream> getUserMedia({audio: false, video: false}) {
var completer = new Completer<MediaStream>();
var options = {
'audio': audio,
'video': video
};
this._getUserMedia(options,
(stream) {
completer.complete(stream);
},
(error) {
completer.completeError(error);
});
return completer.future;
}
@DomName('Navigator.appCodeName')
@DocsEditable()
@Experimental() // non-standard
String get appCodeName native "Navigator_appCodeName_Getter";
@DomName('Navigator.cookieEnabled')
@DocsEditable()
@Unstable()
bool get cookieEnabled native "Navigator_cookieEnabled_Getter";
@DomName('Navigator.doNotTrack')
@DocsEditable()
// http://www.w3.org/2011/tracking-protection/drafts/tracking-dnt.html#js-dom
@Experimental() // experimental
String get doNotTrack native "Navigator_doNotTrack_Getter";
@DomName('Navigator.geolocation')
@DocsEditable()
@Unstable()
Geolocation get geolocation native "Navigator_geolocation_Getter";
@DomName('Navigator.language')
@DocsEditable()
String get language native "Navigator_language_Getter";
@DomName('Navigator.mimeTypes')
@DocsEditable()
@Experimental() // nonstandard
MimeTypeArray get mimeTypes native "Navigator_mimeTypes_Getter";
@DomName('Navigator.plugins')
@DocsEditable()
@deprecated // nonstandard
PluginArray get plugins native "Navigator_plugins_Getter";
@DomName('Navigator.product')
@DocsEditable()
@Unstable()
String get product native "Navigator_product_Getter";
@DomName('Navigator.productSub')
@DocsEditable()
@Unstable()
String get productSub native "Navigator_productSub_Getter";
@DomName('Navigator.vendor')
@DocsEditable()
@Unstable()
String get vendor native "Navigator_vendor_Getter";
@DomName('Navigator.vendorSub')
@DocsEditable()
@Unstable()
String get vendorSub native "Navigator_vendorSub_Getter";
@DomName('Navigator.webkitPersistentStorage')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/quota-api/#accessing-storagequota
StorageQuota get persistentStorage native "Navigator_webkitPersistentStorage_Getter";
@DomName('Navigator.webkitTemporaryStorage')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/quota-api/#accessing-storagequota
StorageQuota get temporaryStorage native "Navigator_webkitTemporaryStorage_Getter";
@DomName('Navigator.getStorageUpdates')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#navigatorstorageutils
@Experimental()
void getStorageUpdates() native "Navigator_getStorageUpdates_Callback";
@DomName('Navigator.javaEnabled')
@DocsEditable()
@deprecated // nonstandard
bool javaEnabled() native "Navigator_javaEnabled_Callback";
@DomName('Navigator.registerProtocolHandler')
@DocsEditable()
@Unstable()
void registerProtocolHandler(String scheme, String url, String title) native "Navigator_registerProtocolHandler_Callback";
@DomName('Navigator.requestMIDIAccess')
@DocsEditable()
@Experimental() // untriaged
MidiAccessPromise requestMidiAccess([Map options]) native "Navigator_requestMIDIAccess_Callback";
@DomName('Navigator.webkitGetGamepads')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Navigator-getGamepads-Gamepad
List<Gamepad> getGamepads() native "Navigator_webkitGetGamepads_Callback";
@DomName('Navigator.webkitGetUserMedia')
@DocsEditable()
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia
@Experimental()
void _getUserMedia(Map options, _NavigatorUserMediaSuccessCallback successCallback, [_NavigatorUserMediaErrorCallback errorCallback]) native "Navigator_webkitGetUserMedia_Callback";
@DomName('Navigator.appName')
@DocsEditable()
String get appName native "Navigator_appName_Getter";
@DomName('Navigator.appVersion')
@DocsEditable()
String get appVersion native "Navigator_appVersion_Getter";
@DomName('Navigator.platform')
@DocsEditable()
String get platform native "Navigator_platform_Getter";
@DomName('Navigator.userAgent')
@DocsEditable()
String get userAgent native "Navigator_userAgent_Getter";
@DomName('Navigator.onLine')
@DocsEditable()
@Unstable()
bool get onLine native "Navigator_onLine_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NavigatorID')
@Experimental() // untriaged
abstract class NavigatorID extends NativeFieldWrapperClass1 {
@DomName('NavigatorID.appName')
@DocsEditable()
@Experimental() // untriaged
String get appName native "NavigatorID_appName_Getter";
@DomName('NavigatorID.appVersion')
@DocsEditable()
@Experimental() // untriaged
String get appVersion native "NavigatorID_appVersion_Getter";
@DomName('NavigatorID.platform')
@DocsEditable()
@Experimental() // untriaged
String get platform native "NavigatorID_platform_Getter";
@DomName('NavigatorID.userAgent')
@DocsEditable()
@Experimental() // untriaged
String get userAgent native "NavigatorID_userAgent_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NavigatorOnLine')
@Experimental() // untriaged
abstract class NavigatorOnLine extends NativeFieldWrapperClass1 {
@DomName('NavigatorOnLine.onLine')
@DocsEditable()
@Experimental() // untriaged
bool get onLine native "NavigatorOnLine_onLine_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NavigatorUserMediaError')
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaError
@Experimental()
class NavigatorUserMediaError extends NativeFieldWrapperClass1 {
@DomName('NavigatorUserMediaError.constraintName')
@DocsEditable()
String get constraintName native "NavigatorUserMediaError_constraintName_Getter";
@DomName('NavigatorUserMediaError.message')
@DocsEditable()
String get message native "NavigatorUserMediaError_message_Getter";
@DomName('NavigatorUserMediaError.name')
@DocsEditable()
String get name native "NavigatorUserMediaError_name_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('NavigatorUserMediaErrorCallback')
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaErrorCallback
@Experimental()
typedef void _NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('NavigatorUserMediaSuccessCallback')
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaSuccessCallback
@Experimental()
typedef void _NavigatorUserMediaSuccessCallback(MediaStream stream);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Lazy implementation of the child nodes of an element that does not request
* the actual child nodes of an element until strictly necessary greatly
* improving performance for the typical cases where it is not required.
*/
class _ChildNodeListLazy extends ListBase<Node> {
final Node _this;
_ChildNodeListLazy(this._this);
Node get first {
Node result = _this.firstChild;
if (result == null) throw new StateError("No elements");
return result;
}
Node get last {
Node result = _this.lastChild;
if (result == null) throw new StateError("No elements");
return result;
}
Node get single {
int l = this.length;
if (l == 0) throw new StateError("No elements");
if (l > 1) throw new StateError("More than one element");
return _this.firstChild;
}
void add(Node value) {
_this.append(value);
}
void addAll(Iterable<Node> iterable) {
if (iterable is _ChildNodeListLazy) {
_ChildNodeListLazy otherList = iterable;
if (!identical(otherList._this, _this)) {
// Optimized route for copying between nodes.
for (var i = 0, len = otherList.length; i < len; ++i) {
_this.append(otherList._this.firstChild);
}
}
return;
}
for (Node node in iterable) {
_this.append(node);
}
}
void insert(int index, Node node) {
if (index < 0 || index > length) {
throw new RangeError.range(index, 0, length);
}
if (index == length) {
_this.append(node);
} else {
_this.insertBefore(node, this[index]);
}
}
void insertAll(int index, Iterable<Node> iterable) {
var item = this[index];
_this.insertAllBefore(iterable, item);
}
void setAll(int index, Iterable<Node> iterable) {
throw new UnsupportedError("Cannot setAll on Node list");
}
Node removeLast() {
final result = last;
if (result != null) {
_this._removeChild(result);
}
return result;
}
Node removeAt(int index) {
var result = this[index];
if (result != null) {
_this._removeChild(result);
}
return result;
}
bool remove(Object object) {
if (object is! Node) return false;
Node node = object;
if (!identical(_this, node.parentNode)) return false;
_this._removeChild(node);
return true;
}
void _filter(bool test(Node node), bool removeMatching) {
// This implementation of removeWhere/retainWhere is more efficient
// than the default in ListBase. Child nodes can be removed in constant
// time.
Node child = _this.firstChild;
while (child != null) {
Node nextChild = child.nextNode;
if (test(child) == removeMatching) {
_this._removeChild(child);
}
child = nextChild;
}
}
void removeWhere(bool test(Node node)) {
_filter(test, true);
}
void retainWhere(bool test(Node node)) {
_filter(test, false);
}
void clear() {
_this.text = '';
}
void operator []=(int index, Node value) {
_this._replaceChild(value, this[index]);
}
Iterator<Node> get iterator => _this._childNodes.iterator;
// From List<Node>:
// TODO(jacobr): this could be implemented for child node lists.
// The exception we throw here is misleading.
void sort([Comparator<Node> compare]) {
throw new UnsupportedError("Cannot sort Node list");
}
// FIXME: implement these.
void setRange(int start, int end, Iterable<Node> iterable,
[int skipCount = 0]) {
throw new UnsupportedError("Cannot setRange on Node list");
}
void fillRange(int start, int end, [Node fill]) {
throw new UnsupportedError("Cannot fillRange on Node list");
}
// -- end List<Node> mixins.
// TODO(jacobr): benchmark whether this is more efficient or whether caching
// a local copy of _childNodes is more efficient.
int get length => _this._childNodes.length;
void set length(int value) {
throw new UnsupportedError(
"Cannot set length on immutable List.");
}
Node operator[](int index) => _this._childNodes[index];
}
/** Information about the instantiated template. */
class TemplateInstance {
// TODO(rafaelw): firstNode & lastNode should be read-synchronous
// in cases where script has modified the template instance boundary.
/** The first node of this template instantiation. */
final Node firstNode;
/**
* The last node of this template instantiation.
* This could be identical to [firstNode] if the template only expanded to a
* single node.
*/
final Node lastNode;
/** The model used to instantiate the template. */
final model;
TemplateInstance(this.firstNode, this.lastNode, this.model);
}
@DomName('Node')
class Node extends EventTarget {
List<Node> get nodes {
return new _ChildNodeListLazy(this);
}
void set nodes(Iterable<Node> value) {
// Copy list first since we don't want liveness during iteration.
// TODO(jacobr): there is a better way to do this.
List copy = new List.from(value);
text = '';
for (Node node in copy) {
append(node);
}
}
/**
* Removes this node from the DOM.
*/
@DomName('Node.removeChild')
void remove() {
// TODO(jacobr): should we throw an exception if parent is already null?
// TODO(vsm): Use the native remove when available.
if (this.parentNode != null) {
final Node parent = this.parentNode;
parentNode._removeChild(this);
}
}
/**
* Replaces this node with another node.
*/
@DomName('Node.replaceChild')
Node replaceWith(Node otherNode) {
try {
final Node parent = this.parentNode;
parent._replaceChild(otherNode, this);
} catch (e) {
};
return this;
}
/**
* Inserts all of the nodes into this node directly before refChild.
*
* See also:
*
* * [insertBefore]
*/
Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
if (newNodes is _ChildNodeListLazy) {
_ChildNodeListLazy otherList = newNodes;
if (identical(otherList._this, this)) {
throw new ArgumentError(newNodes);
}
// Optimized route for copying between nodes.
for (var i = 0, len = otherList.length; i < len; ++i) {
this.insertBefore(otherList._this.firstChild, refChild);
}
} else {
for (var node in newNodes) {
this.insertBefore(node, refChild);
}
}
}
/**
* Print out a String representation of this Node.
*/
String toString() => nodeValue == null ? super.toString() : nodeValue;
/**
* Creates a binding to the attribute [name] to the [path] of the [model].
*
* This can be overridden by custom elements to provide the binding used in
* [Node.bind]. This will only create the binding; it will not add it to
* [bindings].
*
* You should not need to call this directly except from [Node.bind].
*/
@Experimental()
createBinding(String name, model, String path) =>
TemplateElement.mdvPackage(this).createBinding(name, model, path);
/**
* Binds the attribute [name] to the [path] of the [model].
* Path is a String of accessors such as `foo.bar.baz`.
* Returns the `NodeBinding` instance.
*/
@Experimental()
bind(String name, model, String path) =>
TemplateElement.mdvPackage(this).bind(name, model, path);
/** Unbinds the attribute [name]. */
@Experimental()
void unbind(String name) {
TemplateElement.mdvPackage(this).unbind(name);
}
/** Unbinds all bound attributes. */
@Experimental()
void unbindAll() {
TemplateElement.mdvPackage(this).unbindAll();
}
/** Gets the data bindings that are associated with this node. */
@Experimental()
Map<String, dynamic> get bindings =>
TemplateElement.mdvPackage(this).bindings;
/** Gets the template instance that instantiated this node, if any. */
@Experimental()
TemplateInstance get templateInstance =>
TemplateElement.mdvPackage(this).templateInstance;
// To suppress missing implicit constructor warnings.
factory Node._() { throw new UnsupportedError("Not supported"); }
@DomName('Node.ATTRIBUTE_NODE')
@DocsEditable()
static const int ATTRIBUTE_NODE = 2;
@DomName('Node.CDATA_SECTION_NODE')
@DocsEditable()
static const int CDATA_SECTION_NODE = 4;
@DomName('Node.COMMENT_NODE')
@DocsEditable()
static const int COMMENT_NODE = 8;
@DomName('Node.DOCUMENT_FRAGMENT_NODE')
@DocsEditable()
static const int DOCUMENT_FRAGMENT_NODE = 11;
@DomName('Node.DOCUMENT_NODE')
@DocsEditable()
static const int DOCUMENT_NODE = 9;
@DomName('Node.DOCUMENT_TYPE_NODE')
@DocsEditable()
static const int DOCUMENT_TYPE_NODE = 10;
@DomName('Node.ELEMENT_NODE')
@DocsEditable()
static const int ELEMENT_NODE = 1;
@DomName('Node.ENTITY_NODE')
@DocsEditable()
static const int ENTITY_NODE = 6;
@DomName('Node.ENTITY_REFERENCE_NODE')
@DocsEditable()
static const int ENTITY_REFERENCE_NODE = 5;
@DomName('Node.NOTATION_NODE')
@DocsEditable()
static const int NOTATION_NODE = 12;
@DomName('Node.PROCESSING_INSTRUCTION_NODE')
@DocsEditable()
static const int PROCESSING_INSTRUCTION_NODE = 7;
@DomName('Node.TEXT_NODE')
@DocsEditable()
static const int TEXT_NODE = 3;
@DomName('Node.childNodes')
@DocsEditable()
List<Node> get _childNodes native "Node_childNodes_Getter";
@DomName('Node.firstChild')
@DocsEditable()
Node get firstChild native "Node_firstChild_Getter";
@DomName('Node.lastChild')
@DocsEditable()
Node get lastChild native "Node_lastChild_Getter";
@DomName('Node.localName')
@DocsEditable()
// http://dom.spec.whatwg.org/#dom-node-localname
@deprecated // deprecated
String get _localName native "Node_localName_Getter";
@DomName('Node.namespaceURI')
@DocsEditable()
// http://dom.spec.whatwg.org/#dom-node-namespaceuri
@deprecated // deprecated
String get _namespaceUri native "Node_namespaceURI_Getter";
@DomName('Node.nextSibling')
@DocsEditable()
Node get nextNode native "Node_nextSibling_Getter";
@DomName('Node.nodeName')
@DocsEditable()
String get nodeName native "Node_nodeName_Getter";
@DomName('Node.nodeType')
@DocsEditable()
int get nodeType native "Node_nodeType_Getter";
@DomName('Node.nodeValue')
@DocsEditable()
String get nodeValue native "Node_nodeValue_Getter";
@DomName('Node.ownerDocument')
@DocsEditable()
Document get document native "Node_ownerDocument_Getter";
@DomName('Node.parentElement')
@DocsEditable()
Element get parent native "Node_parentElement_Getter";
@DomName('Node.parentNode')
@DocsEditable()
Node get parentNode native "Node_parentNode_Getter";
@DomName('Node.previousSibling')
@DocsEditable()
Node get previousNode native "Node_previousSibling_Getter";
@DomName('Node.textContent')
@DocsEditable()
String get text native "Node_textContent_Getter";
@DomName('Node.textContent')
@DocsEditable()
void set text(String value) native "Node_textContent_Setter";
/**
* Adds a node to the end of the child [nodes] list of this node.
*
* If the node already exists in this document, it will be removed from its
* current parent node, then added to this node.
*
* This method is more efficient than `nodes.add`, and is the preferred
* way of appending a child node.
*/
@DomName('Node.appendChild')
@DocsEditable()
Node append(Node newChild) native "Node_appendChild_Callback";
@DomName('Node.cloneNode')
@DocsEditable()
Node clone(bool deep) native "Node_cloneNode_Callback";
@DomName('Node.contains')
@DocsEditable()
bool contains(Node other) native "Node_contains_Callback";
@DomName('Node.hasChildNodes')
@DocsEditable()
bool hasChildNodes() native "Node_hasChildNodes_Callback";
@DomName('Node.insertBefore')
@DocsEditable()
Node insertBefore(Node newChild, Node refChild) native "Node_insertBefore_Callback";
@DomName('Node.removeChild')
@DocsEditable()
Node _removeChild(Node oldChild) native "Node_removeChild_Callback";
@DomName('Node.replaceChild')
@DocsEditable()
Node _replaceChild(Node newChild, Node oldChild) native "Node_replaceChild_Callback";
@DomName('Node.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "Node_addEventListener_Callback";
@DomName('Node.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "Node_dispatchEvent_Callback";
@DomName('Node.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "Node_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NodeFilter')
@Unstable()
class NodeFilter extends NativeFieldWrapperClass1 {
@DomName('NodeFilter.FILTER_ACCEPT')
@DocsEditable()
static const int FILTER_ACCEPT = 1;
@DomName('NodeFilter.FILTER_REJECT')
@DocsEditable()
static const int FILTER_REJECT = 2;
@DomName('NodeFilter.FILTER_SKIP')
@DocsEditable()
static const int FILTER_SKIP = 3;
@DomName('NodeFilter.SHOW_ALL')
@DocsEditable()
static const int SHOW_ALL = 0xFFFFFFFF;
@DomName('NodeFilter.SHOW_ATTRIBUTE')
@DocsEditable()
@deprecated // deprecated
static const int SHOW_ATTRIBUTE = 0x00000002;
@DomName('NodeFilter.SHOW_CDATA_SECTION')
@DocsEditable()
@deprecated // deprecated
static const int SHOW_CDATA_SECTION = 0x00000008;
@DomName('NodeFilter.SHOW_COMMENT')
@DocsEditable()
static const int SHOW_COMMENT = 0x00000080;
@DomName('NodeFilter.SHOW_DOCUMENT')
@DocsEditable()
static const int SHOW_DOCUMENT = 0x00000100;
@DomName('NodeFilter.SHOW_DOCUMENT_FRAGMENT')
@DocsEditable()
static const int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
@DomName('NodeFilter.SHOW_DOCUMENT_TYPE')
@DocsEditable()
static const int SHOW_DOCUMENT_TYPE = 0x00000200;
@DomName('NodeFilter.SHOW_ELEMENT')
@DocsEditable()
static const int SHOW_ELEMENT = 0x00000001;
@DomName('NodeFilter.SHOW_ENTITY')
@DocsEditable()
@deprecated // deprecated
static const int SHOW_ENTITY = 0x00000020;
@DomName('NodeFilter.SHOW_ENTITY_REFERENCE')
@DocsEditable()
@deprecated // deprecated
static const int SHOW_ENTITY_REFERENCE = 0x00000010;
@DomName('NodeFilter.SHOW_NOTATION')
@DocsEditable()
@deprecated // deprecated
static const int SHOW_NOTATION = 0x00000800;
@DomName('NodeFilter.SHOW_PROCESSING_INSTRUCTION')
@DocsEditable()
static const int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
@DomName('NodeFilter.SHOW_TEXT')
@DocsEditable()
static const int SHOW_TEXT = 0x00000004;
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('NodeIterator')
@Unstable()
class NodeIterator extends NativeFieldWrapperClass1 {
factory NodeIterator(Node root, int whatToShow) {
return document._createNodeIterator(root, whatToShow, null, false);
}
@DomName('NodeIterator.pointerBeforeReferenceNode')
@DocsEditable()
bool get pointerBeforeReferenceNode native "NodeIterator_pointerBeforeReferenceNode_Getter";
@DomName('NodeIterator.referenceNode')
@DocsEditable()
Node get referenceNode native "NodeIterator_referenceNode_Getter";
@DomName('NodeIterator.root')
@DocsEditable()
Node get root native "NodeIterator_root_Getter";
@DomName('NodeIterator.whatToShow')
@DocsEditable()
int get whatToShow native "NodeIterator_whatToShow_Getter";
@DomName('NodeIterator.detach')
@DocsEditable()
void detach() native "NodeIterator_detach_Callback";
@DomName('NodeIterator.nextNode')
@DocsEditable()
Node nextNode() native "NodeIterator_nextNode_Callback";
@DomName('NodeIterator.previousNode')
@DocsEditable()
Node previousNode() native "NodeIterator_previousNode_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NodeList')
class NodeList extends NativeFieldWrapperClass1 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
@DomName('NodeList.length')
@DocsEditable()
int get length native "NodeList_length_Getter";
Node operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Node _nativeIndexedGetter(int index) native "NodeList_item_Callback";
void operator[]=(int index, Node value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Node> mixins.
// Node is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Node get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Node get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Node get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Node elementAt(int index) => this[index];
// -- end List<Node> mixins.
@DomName('NodeList.item')
@DocsEditable()
Node _item(int index) native "NodeList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Notation')
// http://dom.spec.whatwg.org/#notation
@deprecated // deprecated
class Notation extends Node {
// To suppress missing implicit constructor warnings.
factory Notation._() { throw new UnsupportedError("Not supported"); }
@DomName('Notation.publicId')
@DocsEditable()
String get publicId native "Notation_publicId_Getter";
@DomName('Notation.systemId')
@DocsEditable()
String get systemId native "Notation_systemId_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('Notification')
// http://www.w3.org/TR/notifications/#notification
@Experimental() // experimental
class Notification extends EventTarget {
factory Notification(String title, {String titleDir: null, String body: null,
String bodyDir: null, String tag: null, String iconUrl: null}) {
var parsedOptions = {};
if (titleDir != null) parsedOptions['titleDir'] = titleDir;
if (body != null) parsedOptions['body'] = body;
if (bodyDir != null) parsedOptions['bodyDir'] = bodyDir;
if (tag != null) parsedOptions['tag'] = tag;
if (iconUrl != null) parsedOptions['iconUrl'] = iconUrl;
return Notification._factoryNotification(title, parsedOptions);
}
// To suppress missing implicit constructor warnings.
factory Notification._() { throw new UnsupportedError("Not supported"); }
@DomName('Notification.clickEvent')
@DocsEditable()
static const EventStreamProvider<Event> clickEvent = const EventStreamProvider<Event>('click');
@DomName('Notification.closeEvent')
@DocsEditable()
static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
@DomName('Notification.displayEvent')
@DocsEditable()
@Experimental() // nonstandard
static const EventStreamProvider<Event> displayEvent = const EventStreamProvider<Event>('display');
@DomName('Notification.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('Notification.showEvent')
@DocsEditable()
static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
@DomName('Notification.Notification')
@DocsEditable()
static Notification _factoryNotification(String title, [Map options]) {
return Notification._create_1(title, options);
}
@DocsEditable()
static Notification _create_1(title, options) native "Notification__create_1constructorCallback";
@DomName('Notification.dir')
@DocsEditable()
@Experimental() // nonstandard
String get dir native "Notification_dir_Getter";
@DomName('Notification.dir')
@DocsEditable()
@Experimental() // nonstandard
void set dir(String value) native "Notification_dir_Setter";
@DomName('Notification.permission')
@DocsEditable()
String get permission native "Notification_permission_Getter";
@DomName('Notification.replaceId')
@DocsEditable()
@Experimental() // nonstandard
String get replaceId native "Notification_replaceId_Getter";
@DomName('Notification.replaceId')
@DocsEditable()
@Experimental() // nonstandard
void set replaceId(String value) native "Notification_replaceId_Setter";
@DomName('Notification.tag')
@DocsEditable()
@Experimental() // nonstandard
String get tag native "Notification_tag_Getter";
@DomName('Notification.tag')
@DocsEditable()
@Experimental() // nonstandard
void set tag(String value) native "Notification_tag_Setter";
@DomName('Notification.cancel')
@DocsEditable()
@Experimental() // nonstandard
void cancel() native "Notification_cancel_Callback";
@DomName('Notification.close')
@DocsEditable()
void close() native "Notification_close_Callback";
@DomName('Notification.requestPermission')
@DocsEditable()
static void _requestPermission([_NotificationPermissionCallback callback]) native "Notification_requestPermission_Callback";
static Future<String> requestPermission() {
var completer = new Completer<String>();
_requestPermission(
(value) { completer.complete(value); });
return completer.future;
}
@DomName('Notification.show')
@DocsEditable()
@Experimental() // nonstandard
void show() native "Notification_show_Callback";
@DomName('Notification.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "Notification_addEventListener_Callback";
@DomName('Notification.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "Notification_dispatchEvent_Callback";
@DomName('Notification.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "Notification_removeEventListener_Callback";
@DomName('Notification.onclick')
@DocsEditable()
Stream<Event> get onClick => clickEvent.forTarget(this);
@DomName('Notification.onclose')
@DocsEditable()
Stream<Event> get onClose => closeEvent.forTarget(this);
@DomName('Notification.ondisplay')
@DocsEditable()
@Experimental() // nonstandard
Stream<Event> get onDisplay => displayEvent.forTarget(this);
@DomName('Notification.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('Notification.onshow')
@DocsEditable()
Stream<Event> get onShow => showEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NotificationCenter')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/notifications/#showing-a-notification
@deprecated // deprecated
class NotificationCenter extends NativeFieldWrapperClass1 {
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('NotificationCenter.checkPermission')
@DocsEditable()
int checkPermission() native "NotificationCenter_checkPermission_Callback";
@DomName('NotificationCenter.createNotification')
@DocsEditable()
Notification createNotification(String iconUrl, String title, String body) native "NotificationCenter_createNotification_Callback";
@DomName('NotificationCenter.requestPermission')
@DocsEditable()
void _requestPermission([VoidCallback callback]) native "NotificationCenter_requestPermission_Callback";
Future requestPermission() {
var completer = new Completer();
_requestPermission(
() { completer.complete(); });
return completer.future;
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('NotificationPermissionCallback')
// http://www.w3.org/TR/notifications/#notificationpermissioncallback
@Experimental()
typedef void _NotificationPermissionCallback(String permission);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLOListElement')
class OListElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory OListElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLOListElement.HTMLOListElement')
@DocsEditable()
factory OListElement() => document.$dom_createElement("ol");
@DomName('HTMLOListElement.reversed')
@DocsEditable()
bool get reversed native "HTMLOListElement_reversed_Getter";
@DomName('HTMLOListElement.reversed')
@DocsEditable()
void set reversed(bool value) native "HTMLOListElement_reversed_Setter";
@DomName('HTMLOListElement.start')
@DocsEditable()
int get start native "HTMLOListElement_start_Getter";
@DomName('HTMLOListElement.start')
@DocsEditable()
void set start(int value) native "HTMLOListElement_start_Setter";
@DomName('HTMLOListElement.type')
@DocsEditable()
String get type native "HTMLOListElement_type_Getter";
@DomName('HTMLOListElement.type')
@DocsEditable()
void set type(String value) native "HTMLOListElement_type_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLObjectElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.IE)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Unstable()
class ObjectElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ObjectElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLObjectElement.HTMLObjectElement')
@DocsEditable()
factory ObjectElement() => document.$dom_createElement("object");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLObjectElement.code')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLObjectElement-partial
@deprecated // deprecated
String get code native "HTMLObjectElement_code_Getter";
@DomName('HTMLObjectElement.code')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLObjectElement-partial
@deprecated // deprecated
void set code(String value) native "HTMLObjectElement_code_Setter";
@DomName('HTMLObjectElement.data')
@DocsEditable()
String get data native "HTMLObjectElement_data_Getter";
@DomName('HTMLObjectElement.data')
@DocsEditable()
void set data(String value) native "HTMLObjectElement_data_Setter";
@DomName('HTMLObjectElement.form')
@DocsEditable()
FormElement get form native "HTMLObjectElement_form_Getter";
@DomName('HTMLObjectElement.height')
@DocsEditable()
String get height native "HTMLObjectElement_height_Getter";
@DomName('HTMLObjectElement.height')
@DocsEditable()
void set height(String value) native "HTMLObjectElement_height_Setter";
@DomName('HTMLObjectElement.name')
@DocsEditable()
String get name native "HTMLObjectElement_name_Getter";
@DomName('HTMLObjectElement.name')
@DocsEditable()
void set name(String value) native "HTMLObjectElement_name_Setter";
@DomName('HTMLObjectElement.type')
@DocsEditable()
String get type native "HTMLObjectElement_type_Getter";
@DomName('HTMLObjectElement.type')
@DocsEditable()
void set type(String value) native "HTMLObjectElement_type_Setter";
@DomName('HTMLObjectElement.useMap')
@DocsEditable()
String get useMap native "HTMLObjectElement_useMap_Getter";
@DomName('HTMLObjectElement.useMap')
@DocsEditable()
void set useMap(String value) native "HTMLObjectElement_useMap_Setter";
@DomName('HTMLObjectElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLObjectElement_validationMessage_Getter";
@DomName('HTMLObjectElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLObjectElement_validity_Getter";
@DomName('HTMLObjectElement.width')
@DocsEditable()
String get width native "HTMLObjectElement_width_Getter";
@DomName('HTMLObjectElement.width')
@DocsEditable()
void set width(String value) native "HTMLObjectElement_width_Setter";
@DomName('HTMLObjectElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLObjectElement_willValidate_Getter";
@DomName('HTMLObjectElement.__getter__')
@DocsEditable()
bool __getter__(index_OR_name) native "HTMLObjectElement___getter___Callback";
@DomName('HTMLObjectElement.__setter__')
@DocsEditable()
void __setter__(index_OR_name, Node value) native "HTMLObjectElement___setter___Callback";
@DomName('HTMLObjectElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLObjectElement_checkValidity_Callback";
@DomName('HTMLObjectElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLObjectElement_setCustomValidity_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLOptGroupElement')
class OptGroupElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory OptGroupElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLOptGroupElement.HTMLOptGroupElement')
@DocsEditable()
factory OptGroupElement() => document.$dom_createElement("optgroup");
@DomName('HTMLOptGroupElement.disabled')
@DocsEditable()
bool get disabled native "HTMLOptGroupElement_disabled_Getter";
@DomName('HTMLOptGroupElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLOptGroupElement_disabled_Setter";
@DomName('HTMLOptGroupElement.label')
@DocsEditable()
String get label native "HTMLOptGroupElement_label_Getter";
@DomName('HTMLOptGroupElement.label')
@DocsEditable()
void set label(String value) native "HTMLOptGroupElement_label_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLOptionElement')
class OptionElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory OptionElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLOptionElement.HTMLOptionElement')
@DocsEditable()
factory OptionElement([String data, String value, bool defaultSelected, bool selected]) {
return OptionElement._create_1(data, value, defaultSelected, selected);
}
@DocsEditable()
static OptionElement _create_1(data, value, defaultSelected, selected) native "HTMLOptionElement__create_1constructorCallback";
@DomName('HTMLOptionElement.defaultSelected')
@DocsEditable()
bool get defaultSelected native "HTMLOptionElement_defaultSelected_Getter";
@DomName('HTMLOptionElement.defaultSelected')
@DocsEditable()
void set defaultSelected(bool value) native "HTMLOptionElement_defaultSelected_Setter";
@DomName('HTMLOptionElement.disabled')
@DocsEditable()
bool get disabled native "HTMLOptionElement_disabled_Getter";
@DomName('HTMLOptionElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLOptionElement_disabled_Setter";
@DomName('HTMLOptionElement.form')
@DocsEditable()
FormElement get form native "HTMLOptionElement_form_Getter";
@DomName('HTMLOptionElement.index')
@DocsEditable()
int get index native "HTMLOptionElement_index_Getter";
@DomName('HTMLOptionElement.label')
@DocsEditable()
String get label native "HTMLOptionElement_label_Getter";
@DomName('HTMLOptionElement.label')
@DocsEditable()
void set label(String value) native "HTMLOptionElement_label_Setter";
@DomName('HTMLOptionElement.selected')
@DocsEditable()
bool get selected native "HTMLOptionElement_selected_Getter";
@DomName('HTMLOptionElement.selected')
@DocsEditable()
void set selected(bool value) native "HTMLOptionElement_selected_Setter";
@DomName('HTMLOptionElement.value')
@DocsEditable()
String get value native "HTMLOptionElement_value_Getter";
@DomName('HTMLOptionElement.value')
@DocsEditable()
void set value(String value) native "HTMLOptionElement_value_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLOutputElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
class OutputElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory OutputElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLOutputElement.HTMLOutputElement')
@DocsEditable()
factory OutputElement() => document.$dom_createElement("output");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLOutputElement.defaultValue')
@DocsEditable()
String get defaultValue native "HTMLOutputElement_defaultValue_Getter";
@DomName('HTMLOutputElement.defaultValue')
@DocsEditable()
void set defaultValue(String value) native "HTMLOutputElement_defaultValue_Setter";
@DomName('HTMLOutputElement.form')
@DocsEditable()
FormElement get form native "HTMLOutputElement_form_Getter";
@DomName('HTMLOutputElement.htmlFor')
@DocsEditable()
DomSettableTokenList get htmlFor native "HTMLOutputElement_htmlFor_Getter";
@DomName('HTMLOutputElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLOutputElement_labels_Getter";
@DomName('HTMLOutputElement.name')
@DocsEditable()
String get name native "HTMLOutputElement_name_Getter";
@DomName('HTMLOutputElement.name')
@DocsEditable()
void set name(String value) native "HTMLOutputElement_name_Setter";
@DomName('HTMLOutputElement.type')
@DocsEditable()
String get type native "HTMLOutputElement_type_Getter";
@DomName('HTMLOutputElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLOutputElement_validationMessage_Getter";
@DomName('HTMLOutputElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLOutputElement_validity_Getter";
@DomName('HTMLOutputElement.value')
@DocsEditable()
String get value native "HTMLOutputElement_value_Getter";
@DomName('HTMLOutputElement.value')
@DocsEditable()
void set value(String value) native "HTMLOutputElement_value_Setter";
@DomName('HTMLOutputElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLOutputElement_willValidate_Getter";
@DomName('HTMLOutputElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLOutputElement_checkValidity_Callback";
@DomName('HTMLOutputElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLOutputElement_setCustomValidity_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('OverflowEvent')
@Experimental() // nonstandard
class OverflowEvent extends Event {
// To suppress missing implicit constructor warnings.
factory OverflowEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('OverflowEvent.BOTH')
@DocsEditable()
static const int BOTH = 2;
@DomName('OverflowEvent.HORIZONTAL')
@DocsEditable()
static const int HORIZONTAL = 0;
@DomName('OverflowEvent.VERTICAL')
@DocsEditable()
static const int VERTICAL = 1;
@DomName('OverflowEvent.horizontalOverflow')
@DocsEditable()
bool get horizontalOverflow native "OverflowEvent_horizontalOverflow_Getter";
@DomName('OverflowEvent.orient')
@DocsEditable()
int get orient native "OverflowEvent_orient_Getter";
@DomName('OverflowEvent.verticalOverflow')
@DocsEditable()
bool get verticalOverflow native "OverflowEvent_verticalOverflow_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PageTransitionEvent')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#pagetransitionevent
@Experimental()
class PageTransitionEvent extends Event {
// To suppress missing implicit constructor warnings.
factory PageTransitionEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('PageTransitionEvent.persisted')
@DocsEditable()
bool get persisted native "PageTransitionEvent_persisted_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLParagraphElement')
class ParagraphElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ParagraphElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLParagraphElement.HTMLParagraphElement')
@DocsEditable()
factory ParagraphElement() => document.$dom_createElement("p");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLParamElement')
@Unstable()
class ParamElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ParamElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLParamElement.HTMLParamElement')
@DocsEditable()
factory ParamElement() => document.$dom_createElement("param");
@DomName('HTMLParamElement.name')
@DocsEditable()
String get name native "HTMLParamElement_name_Getter";
@DomName('HTMLParamElement.name')
@DocsEditable()
void set name(String value) native "HTMLParamElement_name_Setter";
@DomName('HTMLParamElement.value')
@DocsEditable()
String get value native "HTMLParamElement_value_Getter";
@DomName('HTMLParamElement.value')
@DocsEditable()
void set value(String value) native "HTMLParamElement_value_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ParentNode')
@Experimental() // untriaged
abstract class ParentNode extends NativeFieldWrapperClass1 {
@DomName('ParentNode.childElementCount')
@DocsEditable()
@Experimental() // untriaged
int get _childElementCount native "ParentNode_childElementCount_Getter";
@DomName('ParentNode.children')
@DocsEditable()
@Experimental() // untriaged
HtmlCollection get _children native "ParentNode_children_Getter";
@DomName('ParentNode.firstElementChild')
@DocsEditable()
@Experimental() // untriaged
Element get _firstElementChild native "ParentNode_firstElementChild_Getter";
@DomName('ParentNode.lastElementChild')
@DocsEditable()
@Experimental() // untriaged
Element get _lastElementChild native "ParentNode_lastElementChild_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Path')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
@Experimental()
class Path extends NativeFieldWrapperClass1 {
@DomName('Path.Path')
@DocsEditable()
factory Path([path_OR_text]) {
if (path_OR_text == null) {
return Path._create_1();
}
if ((path_OR_text is Path || path_OR_text == null)) {
return Path._create_2(path_OR_text);
}
if ((path_OR_text is String || path_OR_text == null)) {
return Path._create_3(path_OR_text);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@DocsEditable()
static Path _create_1() native "Path__create_1constructorCallback";
@DocsEditable()
static Path _create_2(path_OR_text) native "Path__create_2constructorCallback";
@DocsEditable()
static Path _create_3(path_OR_text) native "Path__create_3constructorCallback";
@DomName('Path.arc')
@DocsEditable()
void arc(num x, num y, num radius, num startAngle, num endAngle, bool anticlockwise) native "Path_arc_Callback";
@DomName('Path.arcTo')
@DocsEditable()
void arcTo(num x1, num y1, num x2, num y2, num radius) native "Path_arcTo_Callback";
@DomName('Path.bezierCurveTo')
@DocsEditable()
void bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y) native "Path_bezierCurveTo_Callback";
@DomName('Path.closePath')
@DocsEditable()
void closePath() native "Path_closePath_Callback";
@DomName('Path.lineTo')
@DocsEditable()
void lineTo(num x, num y) native "Path_lineTo_Callback";
@DomName('Path.moveTo')
@DocsEditable()
void moveTo(num x, num y) native "Path_moveTo_Callback";
@DomName('Path.quadraticCurveTo')
@DocsEditable()
void quadraticCurveTo(num cpx, num cpy, num x, num y) native "Path_quadraticCurveTo_Callback";
@DomName('Path.rect')
@DocsEditable()
void rect(num x, num y, num width, num height) native "Path_rect_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Performance')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE)
class Performance extends EventTarget {
// To suppress missing implicit constructor warnings.
factory Performance._() { throw new UnsupportedError("Not supported"); }
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('Performance.memory')
@DocsEditable()
@Experimental() // nonstandard
MemoryInfo get memory native "Performance_memory_Getter";
@DomName('Performance.navigation')
@DocsEditable()
PerformanceNavigation get navigation native "Performance_navigation_Getter";
@DomName('Performance.timing')
@DocsEditable()
PerformanceTiming get timing native "Performance_timing_Getter";
@DomName('Performance.clearMarks')
@DocsEditable()
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html#extensions-performance-interface
@Experimental()
void clearMarks(String markName) native "Performance_clearMarks_Callback";
@DomName('Performance.clearMeasures')
@DocsEditable()
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html#extensions-performance-interface
@Experimental()
void clearMeasures(String measureName) native "Performance_clearMeasures_Callback";
@DomName('Performance.getEntries')
@DocsEditable()
// http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
@Experimental()
List<PerformanceEntry> getEntries() native "Performance_getEntries_Callback";
@DomName('Performance.getEntriesByName')
@DocsEditable()
// http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
@Experimental()
List<PerformanceEntry> getEntriesByName(String name, String entryType) native "Performance_getEntriesByName_Callback";
@DomName('Performance.getEntriesByType')
@DocsEditable()
// http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
@Experimental()
List<PerformanceEntry> getEntriesByType(String entryType) native "Performance_getEntriesByType_Callback";
@DomName('Performance.mark')
@DocsEditable()
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html#extensions-performance-interface
@Experimental()
void mark(String markName) native "Performance_mark_Callback";
@DomName('Performance.measure')
@DocsEditable()
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/UserTiming/Overview.html#extensions-performance-interface
@Experimental()
void measure(String measureName, String startMark, String endMark) native "Performance_measure_Callback";
@DomName('Performance.now')
@DocsEditable()
double now() native "Performance_now_Callback";
@DomName('Performance.webkitClearResourceTimings')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3c-test.org/webperf/specs/ResourceTiming/#extensions-performance-interface
void clearResourceTimings() native "Performance_webkitClearResourceTimings_Callback";
@DomName('Performance.webkitSetResourceTimingBufferSize')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3c-test.org/webperf/specs/ResourceTiming/#performanceresourcetiming-methods
void setResourceTimingBufferSize(int maxSize) native "Performance_webkitSetResourceTimingBufferSize_Callback";
@DomName('Performance.addEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "Performance_addEventListener_Callback";
@DomName('Performance.dispatchEvent')
@DocsEditable()
@Experimental() // untriaged
bool dispatchEvent(Event event) native "Performance_dispatchEvent_Callback";
@DomName('Performance.removeEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "Performance_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PerformanceEntry')
// http://www.w3.org/TR/performance-timeline/#sec-PerformanceEntry-interface
@Experimental()
class PerformanceEntry extends NativeFieldWrapperClass1 {
@DomName('PerformanceEntry.duration')
@DocsEditable()
double get duration native "PerformanceEntry_duration_Getter";
@DomName('PerformanceEntry.entryType')
@DocsEditable()
String get entryType native "PerformanceEntry_entryType_Getter";
@DomName('PerformanceEntry.name')
@DocsEditable()
String get name native "PerformanceEntry_name_Getter";
@DomName('PerformanceEntry.startTime')
@DocsEditable()
double get startTime native "PerformanceEntry_startTime_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PerformanceMark')
// http://www.w3.org/TR/user-timing/#performancemark
@Experimental()
class PerformanceMark extends PerformanceEntry {
// To suppress missing implicit constructor warnings.
factory PerformanceMark._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PerformanceMeasure')
// http://www.w3.org/TR/user-timing/#performancemeasure
@Experimental()
class PerformanceMeasure extends PerformanceEntry {
// To suppress missing implicit constructor warnings.
factory PerformanceMeasure._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PerformanceNavigation')
@Unstable()
class PerformanceNavigation extends NativeFieldWrapperClass1 {
@DomName('PerformanceNavigation.TYPE_BACK_FORWARD')
@DocsEditable()
static const int TYPE_BACK_FORWARD = 2;
@DomName('PerformanceNavigation.TYPE_NAVIGATE')
@DocsEditable()
static const int TYPE_NAVIGATE = 0;
@DomName('PerformanceNavigation.TYPE_RELOAD')
@DocsEditable()
static const int TYPE_RELOAD = 1;
@DomName('PerformanceNavigation.TYPE_RESERVED')
@DocsEditable()
static const int TYPE_RESERVED = 255;
@DomName('PerformanceNavigation.redirectCount')
@DocsEditable()
int get redirectCount native "PerformanceNavigation_redirectCount_Getter";
@DomName('PerformanceNavigation.type')
@DocsEditable()
int get type native "PerformanceNavigation_type_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PerformanceResourceTiming')
// http://www.w3c-test.org/webperf/specs/ResourceTiming/#performanceresourcetiming
@Experimental()
class PerformanceResourceTiming extends PerformanceEntry {
// To suppress missing implicit constructor warnings.
factory PerformanceResourceTiming._() { throw new UnsupportedError("Not supported"); }
@DomName('PerformanceResourceTiming.connectEnd')
@DocsEditable()
double get connectEnd native "PerformanceResourceTiming_connectEnd_Getter";
@DomName('PerformanceResourceTiming.connectStart')
@DocsEditable()
double get connectStart native "PerformanceResourceTiming_connectStart_Getter";
@DomName('PerformanceResourceTiming.domainLookupEnd')
@DocsEditable()
double get domainLookupEnd native "PerformanceResourceTiming_domainLookupEnd_Getter";
@DomName('PerformanceResourceTiming.domainLookupStart')
@DocsEditable()
double get domainLookupStart native "PerformanceResourceTiming_domainLookupStart_Getter";
@DomName('PerformanceResourceTiming.fetchStart')
@DocsEditable()
double get fetchStart native "PerformanceResourceTiming_fetchStart_Getter";
@DomName('PerformanceResourceTiming.initiatorType')
@DocsEditable()
String get initiatorType native "PerformanceResourceTiming_initiatorType_Getter";
@DomName('PerformanceResourceTiming.redirectEnd')
@DocsEditable()
double get redirectEnd native "PerformanceResourceTiming_redirectEnd_Getter";
@DomName('PerformanceResourceTiming.redirectStart')
@DocsEditable()
double get redirectStart native "PerformanceResourceTiming_redirectStart_Getter";
@DomName('PerformanceResourceTiming.requestStart')
@DocsEditable()
@Experimental() // nonstandard
double get requestStart native "PerformanceResourceTiming_requestStart_Getter";
@DomName('PerformanceResourceTiming.responseEnd')
@DocsEditable()
@Experimental() // nonstandard
double get responseEnd native "PerformanceResourceTiming_responseEnd_Getter";
@DomName('PerformanceResourceTiming.responseStart')
@DocsEditable()
@Experimental() // nonstandard
double get responseStart native "PerformanceResourceTiming_responseStart_Getter";
@DomName('PerformanceResourceTiming.secureConnectionStart')
@DocsEditable()
double get secureConnectionStart native "PerformanceResourceTiming_secureConnectionStart_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PerformanceTiming')
@Unstable()
class PerformanceTiming extends NativeFieldWrapperClass1 {
@DomName('PerformanceTiming.connectEnd')
@DocsEditable()
int get connectEnd native "PerformanceTiming_connectEnd_Getter";
@DomName('PerformanceTiming.connectStart')
@DocsEditable()
int get connectStart native "PerformanceTiming_connectStart_Getter";
@DomName('PerformanceTiming.domComplete')
@DocsEditable()
int get domComplete native "PerformanceTiming_domComplete_Getter";
@DomName('PerformanceTiming.domContentLoadedEventEnd')
@DocsEditable()
int get domContentLoadedEventEnd native "PerformanceTiming_domContentLoadedEventEnd_Getter";
@DomName('PerformanceTiming.domContentLoadedEventStart')
@DocsEditable()
int get domContentLoadedEventStart native "PerformanceTiming_domContentLoadedEventStart_Getter";
@DomName('PerformanceTiming.domInteractive')
@DocsEditable()
int get domInteractive native "PerformanceTiming_domInteractive_Getter";
@DomName('PerformanceTiming.domLoading')
@DocsEditable()
int get domLoading native "PerformanceTiming_domLoading_Getter";
@DomName('PerformanceTiming.domainLookupEnd')
@DocsEditable()
int get domainLookupEnd native "PerformanceTiming_domainLookupEnd_Getter";
@DomName('PerformanceTiming.domainLookupStart')
@DocsEditable()
int get domainLookupStart native "PerformanceTiming_domainLookupStart_Getter";
@DomName('PerformanceTiming.fetchStart')
@DocsEditable()
int get fetchStart native "PerformanceTiming_fetchStart_Getter";
@DomName('PerformanceTiming.loadEventEnd')
@DocsEditable()
int get loadEventEnd native "PerformanceTiming_loadEventEnd_Getter";
@DomName('PerformanceTiming.loadEventStart')
@DocsEditable()
int get loadEventStart native "PerformanceTiming_loadEventStart_Getter";
@DomName('PerformanceTiming.navigationStart')
@DocsEditable()
int get navigationStart native "PerformanceTiming_navigationStart_Getter";
@DomName('PerformanceTiming.redirectEnd')
@DocsEditable()
int get redirectEnd native "PerformanceTiming_redirectEnd_Getter";
@DomName('PerformanceTiming.redirectStart')
@DocsEditable()
int get redirectStart native "PerformanceTiming_redirectStart_Getter";
@DomName('PerformanceTiming.requestStart')
@DocsEditable()
int get requestStart native "PerformanceTiming_requestStart_Getter";
@DomName('PerformanceTiming.responseEnd')
@DocsEditable()
int get responseEnd native "PerformanceTiming_responseEnd_Getter";
@DomName('PerformanceTiming.responseStart')
@DocsEditable()
int get responseStart native "PerformanceTiming_responseStart_Getter";
@DomName('PerformanceTiming.secureConnectionStart')
@DocsEditable()
int get secureConnectionStart native "PerformanceTiming_secureConnectionStart_Getter";
@DomName('PerformanceTiming.unloadEventEnd')
@DocsEditable()
int get unloadEventEnd native "PerformanceTiming_unloadEventEnd_Getter";
@DomName('PerformanceTiming.unloadEventStart')
@DocsEditable()
int get unloadEventStart native "PerformanceTiming_unloadEventStart_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Plugin')
@Experimental() // non-standard
class Plugin extends NativeFieldWrapperClass1 {
@DomName('Plugin.description')
@DocsEditable()
String get description native "Plugin_description_Getter";
@DomName('Plugin.filename')
@DocsEditable()
String get filename native "Plugin_filename_Getter";
@DomName('Plugin.length')
@DocsEditable()
int get length native "Plugin_length_Getter";
@DomName('Plugin.name')
@DocsEditable()
String get name native "Plugin_name_Getter";
@DomName('Plugin.__getter__')
@DocsEditable()
MimeType __getter__(String name) native "Plugin___getter___Callback";
@DomName('Plugin.item')
@DocsEditable()
MimeType item(int index) native "Plugin_item_Callback";
@DomName('Plugin.namedItem')
@DocsEditable()
MimeType namedItem(String name) native "Plugin_namedItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PluginArray')
@Experimental() // non-standard
class PluginArray extends NativeFieldWrapperClass1 with ListMixin<Plugin>, ImmutableListMixin<Plugin> implements List<Plugin> {
@DomName('PluginArray.length')
@DocsEditable()
int get length native "PluginArray_length_Getter";
Plugin operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Plugin _nativeIndexedGetter(int index) native "PluginArray_item_Callback";
void operator[]=(int index, Plugin value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Plugin> mixins.
// Plugin is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Plugin get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Plugin get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Plugin get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Plugin elementAt(int index) => this[index];
// -- end List<Plugin> mixins.
@DomName('PluginArray.__getter__')
@DocsEditable()
Plugin __getter__(String name) native "PluginArray___getter___Callback";
@DomName('PluginArray.item')
@DocsEditable()
Plugin item(int index) native "PluginArray_item_Callback";
@DomName('PluginArray.namedItem')
@DocsEditable()
Plugin namedItem(String name) native "PluginArray_namedItem_Callback";
@DomName('PluginArray.refresh')
@DocsEditable()
void refresh(bool reload) native "PluginArray_refresh_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PopStateEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
class PopStateEvent extends Event {
// To suppress missing implicit constructor warnings.
factory PopStateEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('PopStateEvent.state')
@DocsEditable()
Object get state native "PopStateEvent_state_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('PositionCallback')
@Unstable()
typedef void _PositionCallback(Geoposition position);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PositionError')
@Unstable()
class PositionError extends NativeFieldWrapperClass1 {
@DomName('PositionError.PERMISSION_DENIED')
@DocsEditable()
static const int PERMISSION_DENIED = 1;
@DomName('PositionError.POSITION_UNAVAILABLE')
@DocsEditable()
static const int POSITION_UNAVAILABLE = 2;
@DomName('PositionError.TIMEOUT')
@DocsEditable()
static const int TIMEOUT = 3;
@DomName('PositionError.code')
@DocsEditable()
int get code native "PositionError_code_Getter";
@DomName('PositionError.message')
@DocsEditable()
String get message native "PositionError_message_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('PositionErrorCallback')
@Unstable()
typedef void _PositionErrorCallback(PositionError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLPreElement')
class PreElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory PreElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLPreElement.HTMLPreElement')
@DocsEditable()
factory PreElement() => document.$dom_createElement("pre");
@DomName('HTMLPreElement.wrap')
@DocsEditable()
@deprecated // deprecated
bool get wrap native "HTMLPreElement_wrap_Getter";
@DomName('HTMLPreElement.wrap')
@DocsEditable()
@deprecated // deprecated
void set wrap(bool value) native "HTMLPreElement_wrap_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ProcessingInstruction')
@Unstable()
class ProcessingInstruction extends CharacterData {
// To suppress missing implicit constructor warnings.
factory ProcessingInstruction._() { throw new UnsupportedError("Not supported"); }
@DomName('ProcessingInstruction.sheet')
@DocsEditable()
@Experimental() // non-standard
StyleSheet get sheet native "ProcessingInstruction_sheet_Getter";
@DomName('ProcessingInstruction.target')
@DocsEditable()
String get target native "ProcessingInstruction_target_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLProgressElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
class ProgressElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ProgressElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLProgressElement.HTMLProgressElement')
@DocsEditable()
factory ProgressElement() => document.$dom_createElement("progress");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLProgressElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLProgressElement_labels_Getter";
@DomName('HTMLProgressElement.max')
@DocsEditable()
num get max native "HTMLProgressElement_max_Getter";
@DomName('HTMLProgressElement.max')
@DocsEditable()
void set max(num value) native "HTMLProgressElement_max_Setter";
@DomName('HTMLProgressElement.position')
@DocsEditable()
double get position native "HTMLProgressElement_position_Getter";
@DomName('HTMLProgressElement.value')
@DocsEditable()
num get value native "HTMLProgressElement_value_Getter";
@DomName('HTMLProgressElement.value')
@DocsEditable()
void set value(num value) native "HTMLProgressElement_value_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ProgressEvent')
class ProgressEvent extends Event {
// To suppress missing implicit constructor warnings.
factory ProgressEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('ProgressEvent.lengthComputable')
@DocsEditable()
bool get lengthComputable native "ProgressEvent_lengthComputable_Getter";
@DomName('ProgressEvent.loaded')
@DocsEditable()
int get loaded native "ProgressEvent_loaded_Getter";
@DomName('ProgressEvent.total')
@DocsEditable()
int get total native "ProgressEvent_total_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Promise')
@Experimental() // untriaged
class Promise extends NativeFieldWrapperClass1 {
@DomName('Promise._any')
@DocsEditable()
@Experimental() // untriaged
static Promise _any(Object values) native "Promise__any_Callback";
@DomName('Promise.every')
@DocsEditable()
@Experimental() // untriaged
static Promise every(Object values) native "Promise_every_Callback";
@DomName('Promise.fulfill')
@DocsEditable()
@Experimental() // untriaged
static Promise fulfill(Object value) native "Promise_fulfill_Callback";
@DomName('Promise.reject')
@DocsEditable()
@Experimental() // untriaged
static Promise reject(Object value) native "Promise_reject_Callback";
@DomName('Promise.resolve')
@DocsEditable()
@Experimental() // untriaged
static Promise resolve(Object value) native "Promise_resolve_Callback";
@DomName('Promise.some')
@DocsEditable()
@Experimental() // untriaged
static Promise some(Object values) native "Promise_some_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PromiseResolver')
@Experimental() // untriaged
class PromiseResolver extends NativeFieldWrapperClass1 {
@DomName('PromiseResolver.fulfill')
@DocsEditable()
@Experimental() // untriaged
void fulfill([Object value]) native "PromiseResolver_fulfill_Callback";
@DomName('PromiseResolver.reject')
@DocsEditable()
@Experimental() // untriaged
void reject([Object value]) native "PromiseResolver_reject_Callback";
@DomName('PromiseResolver.resolve')
@DocsEditable()
@Experimental() // untriaged
void resolve([Object value]) native "PromiseResolver_resolve_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLQuoteElement')
class QuoteElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory QuoteElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLQuoteElement.HTMLQuoteElement')
@DocsEditable()
factory QuoteElement() => document.$dom_createElement("q");
@DomName('HTMLQuoteElement.cite')
@DocsEditable()
String get cite native "HTMLQuoteElement_cite_Getter";
@DomName('HTMLQuoteElement.cite')
@DocsEditable()
void set cite(String value) native "HTMLQuoteElement_cite_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('RTCErrorCallback')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcerror
@Experimental()
typedef void _RtcErrorCallback(String errorInformation);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('RTCSessionDescriptionCallback')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSessionDescription
@Experimental()
typedef void _RtcSessionDescriptionCallback(RtcSessionDescription sdp);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('RTCStatsCallback')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCStatsCallback
@Experimental()
typedef void RtcStatsCallback(RtcStatsResponse response);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('Range')
@Unstable()
class Range extends NativeFieldWrapperClass1 {
factory Range() => document.createRange();
factory Range.fromPoint(Point point) =>
document._caretRangeFromPoint(point.x, point.y);
@DomName('Range.END_TO_END')
@DocsEditable()
static const int END_TO_END = 2;
@DomName('Range.END_TO_START')
@DocsEditable()
static const int END_TO_START = 3;
@DomName('Range.NODE_AFTER')
@DocsEditable()
@Experimental() // nonstandard
static const int NODE_AFTER = 1;
@DomName('Range.NODE_BEFORE')
@DocsEditable()
@Experimental() // nonstandard
static const int NODE_BEFORE = 0;
@DomName('Range.NODE_BEFORE_AND_AFTER')
@DocsEditable()
@Experimental() // nonstandard
static const int NODE_BEFORE_AND_AFTER = 2;
@DomName('Range.NODE_INSIDE')
@DocsEditable()
@Experimental() // nonstandard
static const int NODE_INSIDE = 3;
@DomName('Range.START_TO_END')
@DocsEditable()
static const int START_TO_END = 1;
@DomName('Range.START_TO_START')
@DocsEditable()
static const int START_TO_START = 0;
@DomName('Range.collapsed')
@DocsEditable()
bool get collapsed native "Range_collapsed_Getter";
@DomName('Range.commonAncestorContainer')
@DocsEditable()
Node get commonAncestorContainer native "Range_commonAncestorContainer_Getter";
@DomName('Range.endContainer')
@DocsEditable()
Node get endContainer native "Range_endContainer_Getter";
@DomName('Range.endOffset')
@DocsEditable()
int get endOffset native "Range_endOffset_Getter";
@DomName('Range.startContainer')
@DocsEditable()
Node get startContainer native "Range_startContainer_Getter";
@DomName('Range.startOffset')
@DocsEditable()
int get startOffset native "Range_startOffset_Getter";
@DomName('Range.cloneContents')
@DocsEditable()
DocumentFragment cloneContents() native "Range_cloneContents_Callback";
@DomName('Range.cloneRange')
@DocsEditable()
Range cloneRange() native "Range_cloneRange_Callback";
@DomName('Range.collapse')
@DocsEditable()
void collapse(bool toStart) native "Range_collapse_Callback";
@DomName('Range.compareNode')
@DocsEditable()
@deprecated // deprecated
int compareNode(Node refNode) native "Range_compareNode_Callback";
@DomName('Range.comparePoint')
@DocsEditable()
int comparePoint(Node refNode, int offset) native "Range_comparePoint_Callback";
@DomName('Range.createContextualFragment')
@DocsEditable()
DocumentFragment createContextualFragment(String html) native "Range_createContextualFragment_Callback";
@DomName('Range.deleteContents')
@DocsEditable()
void deleteContents() native "Range_deleteContents_Callback";
@DomName('Range.detach')
@DocsEditable()
void detach() native "Range_detach_Callback";
@DomName('Range.expand')
@DocsEditable()
@Experimental() // non-standard
void expand(String unit) native "Range_expand_Callback";
@DomName('Range.extractContents')
@DocsEditable()
DocumentFragment extractContents() native "Range_extractContents_Callback";
@DomName('Range.getBoundingClientRect')
@DocsEditable()
Rect getBoundingClientRect() native "Range_getBoundingClientRect_Callback";
@DomName('Range.getClientRects')
@DocsEditable()
List<Rect> getClientRects() native "Range_getClientRects_Callback";
@DomName('Range.insertNode')
@DocsEditable()
void insertNode(Node newNode) native "Range_insertNode_Callback";
@DomName('Range.intersectsNode')
@DocsEditable()
@deprecated // deprecated
bool intersectsNode(Node refNode) native "Range_intersectsNode_Callback";
@DomName('Range.isPointInRange')
@DocsEditable()
bool isPointInRange(Node refNode, int offset) native "Range_isPointInRange_Callback";
@DomName('Range.selectNode')
@DocsEditable()
void selectNode(Node refNode) native "Range_selectNode_Callback";
@DomName('Range.selectNodeContents')
@DocsEditable()
void selectNodeContents(Node refNode) native "Range_selectNodeContents_Callback";
@DomName('Range.setEnd')
@DocsEditable()
void setEnd(Node refNode, int offset) native "Range_setEnd_Callback";
@DomName('Range.setEndAfter')
@DocsEditable()
void setEndAfter(Node refNode) native "Range_setEndAfter_Callback";
@DomName('Range.setEndBefore')
@DocsEditable()
void setEndBefore(Node refNode) native "Range_setEndBefore_Callback";
@DomName('Range.setStart')
@DocsEditable()
void setStart(Node refNode, int offset) native "Range_setStart_Callback";
@DomName('Range.setStartAfter')
@DocsEditable()
void setStartAfter(Node refNode) native "Range_setStartAfter_Callback";
@DomName('Range.setStartBefore')
@DocsEditable()
void setStartBefore(Node refNode) native "Range_setStartBefore_Callback";
@DomName('Range.surroundContents')
@DocsEditable()
void surroundContents(Node newParent) native "Range_surroundContents_Callback";
@DomName('Range.toString')
@DocsEditable()
String toString() native "Range_toString_Callback";
/**
* Checks if createContextualFragment is supported.
*
* See also:
*
* * [createContextualFragment]
*/
static bool get supportsCreateContextualFragment => true;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('RequestAnimationFrameCallback')
typedef void RequestAnimationFrameCallback(num highResTime);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ResourceProgressEvent')
// https://chromiumcodereview.appspot.com/14773025/
@deprecated // experimental
class ResourceProgressEvent extends ProgressEvent {
// To suppress missing implicit constructor warnings.
factory ResourceProgressEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('ResourceProgressEvent.url')
@DocsEditable()
String get url native "ResourceProgressEvent_url_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RsaKeyGenParams')
@Experimental() // untriaged
class RsaKeyGenParams extends Algorithm {
// To suppress missing implicit constructor warnings.
factory RsaKeyGenParams._() { throw new UnsupportedError("Not supported"); }
@DomName('RsaKeyGenParams.modulusLength')
@DocsEditable()
@Experimental() // untriaged
int get modulusLength native "RsaKeyGenParams_modulusLength_Getter";
@DomName('RsaKeyGenParams.publicExponent')
@DocsEditable()
@Experimental() // untriaged
Uint8List get publicExponent native "RsaKeyGenParams_publicExponent_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RsaSsaParams')
@Experimental() // untriaged
class RsaSsaParams extends Algorithm {
// To suppress missing implicit constructor warnings.
factory RsaSsaParams._() { throw new UnsupportedError("Not supported"); }
@DomName('RsaSsaParams.hash')
@DocsEditable()
@Experimental() // untriaged
Algorithm get hash native "RsaSsaParams_hash_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCDataChannel')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannel
@Experimental()
class RtcDataChannel extends EventTarget {
// To suppress missing implicit constructor warnings.
factory RtcDataChannel._() { throw new UnsupportedError("Not supported"); }
@DomName('RTCDataChannel.closeEvent')
@DocsEditable()
static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
@DomName('RTCDataChannel.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('RTCDataChannel.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('RTCDataChannel.openEvent')
@DocsEditable()
static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
@DomName('RTCDataChannel.binaryType')
@DocsEditable()
String get binaryType native "RTCDataChannel_binaryType_Getter";
@DomName('RTCDataChannel.binaryType')
@DocsEditable()
void set binaryType(String value) native "RTCDataChannel_binaryType_Setter";
@DomName('RTCDataChannel.bufferedAmount')
@DocsEditable()
int get bufferedAmount native "RTCDataChannel_bufferedAmount_Getter";
@DomName('RTCDataChannel.id')
@DocsEditable()
@Experimental() // untriaged
int get id native "RTCDataChannel_id_Getter";
@DomName('RTCDataChannel.label')
@DocsEditable()
String get label native "RTCDataChannel_label_Getter";
@DomName('RTCDataChannel.maxRetransmitTime')
@DocsEditable()
@Experimental() // untriaged
int get maxRetransmitTime native "RTCDataChannel_maxRetransmitTime_Getter";
@DomName('RTCDataChannel.maxRetransmits')
@DocsEditable()
@Experimental() // untriaged
int get maxRetransmits native "RTCDataChannel_maxRetransmits_Getter";
@DomName('RTCDataChannel.negotiated')
@DocsEditable()
@Experimental() // untriaged
bool get negotiated native "RTCDataChannel_negotiated_Getter";
@DomName('RTCDataChannel.ordered')
@DocsEditable()
@Experimental() // untriaged
bool get ordered native "RTCDataChannel_ordered_Getter";
@DomName('RTCDataChannel.protocol')
@DocsEditable()
@Experimental() // untriaged
String get protocol native "RTCDataChannel_protocol_Getter";
@DomName('RTCDataChannel.readyState')
@DocsEditable()
String get readyState native "RTCDataChannel_readyState_Getter";
@DomName('RTCDataChannel.reliable')
@DocsEditable()
bool get reliable native "RTCDataChannel_reliable_Getter";
@DomName('RTCDataChannel.close')
@DocsEditable()
void close() native "RTCDataChannel_close_Callback";
void send(data) {
if ((data is TypedData || data == null)) {
_send_1(data);
return;
}
if ((data is ByteBuffer || data == null)) {
_send_2(data);
return;
}
if ((data is Blob || data == null)) {
_send_3(data);
return;
}
if ((data is String || data == null)) {
_send_4(data);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void _send_1(data) native "RTCDataChannel__send_1_Callback";
void _send_2(data) native "RTCDataChannel__send_2_Callback";
void _send_3(data) native "RTCDataChannel__send_3_Callback";
void _send_4(data) native "RTCDataChannel__send_4_Callback";
@DomName('RTCDataChannel.sendBlob')
@DocsEditable()
void sendBlob(Blob data) native "RTCDataChannel_sendBlob_Callback";
@DomName('RTCDataChannel.sendByteBuffer')
@DocsEditable()
void sendByteBuffer(ByteBuffer data) native "RTCDataChannel_sendByteBuffer_Callback";
@DomName('RTCDataChannel.sendString')
@DocsEditable()
void sendString(String data) native "RTCDataChannel_sendString_Callback";
@DomName('RTCDataChannel.sendTypedData')
@DocsEditable()
void sendTypedData(TypedData data) native "RTCDataChannel_sendTypedData_Callback";
@DomName('RTCDataChannel.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "RTCDataChannel_addEventListener_Callback";
@DomName('RTCDataChannel.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "RTCDataChannel_dispatchEvent_Callback";
@DomName('RTCDataChannel.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "RTCDataChannel_removeEventListener_Callback";
@DomName('RTCDataChannel.onclose')
@DocsEditable()
Stream<Event> get onClose => closeEvent.forTarget(this);
@DomName('RTCDataChannel.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('RTCDataChannel.onmessage')
@DocsEditable()
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
@DomName('RTCDataChannel.onopen')
@DocsEditable()
Stream<Event> get onOpen => openEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCDataChannelEvent')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcdatachannelevent
@Experimental()
class RtcDataChannelEvent extends Event {
// To suppress missing implicit constructor warnings.
factory RtcDataChannelEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('RTCDataChannelEvent.channel')
@DocsEditable()
RtcDataChannel get channel native "RTCDataChannelEvent_channel_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCDTMFSender')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDTMFSender
@Experimental()
class RtcDtmfSender extends EventTarget {
// To suppress missing implicit constructor warnings.
factory RtcDtmfSender._() { throw new UnsupportedError("Not supported"); }
@DomName('RTCDTMFSender.tonechangeEvent')
@DocsEditable()
static const EventStreamProvider<RtcDtmfToneChangeEvent> toneChangeEvent = const EventStreamProvider<RtcDtmfToneChangeEvent>('tonechange');
@DomName('RTCDTMFSender.canInsertDTMF')
@DocsEditable()
bool get canInsertDtmf native "RTCDTMFSender_canInsertDTMF_Getter";
@DomName('RTCDTMFSender.duration')
@DocsEditable()
int get duration native "RTCDTMFSender_duration_Getter";
@DomName('RTCDTMFSender.interToneGap')
@DocsEditable()
int get interToneGap native "RTCDTMFSender_interToneGap_Getter";
@DomName('RTCDTMFSender.toneBuffer')
@DocsEditable()
String get toneBuffer native "RTCDTMFSender_toneBuffer_Getter";
@DomName('RTCDTMFSender.track')
@DocsEditable()
MediaStreamTrack get track native "RTCDTMFSender_track_Getter";
void insertDtmf(String tones, [int duration, int interToneGap]) {
if (interToneGap != null) {
_insertDTMF_1(tones, duration, interToneGap);
return;
}
if (duration != null) {
_insertDTMF_2(tones, duration);
return;
}
_insertDTMF_3(tones);
return;
}
void _insertDTMF_1(tones, duration, interToneGap) native "RTCDTMFSender__insertDTMF_1_Callback";
void _insertDTMF_2(tones, duration) native "RTCDTMFSender__insertDTMF_2_Callback";
void _insertDTMF_3(tones) native "RTCDTMFSender__insertDTMF_3_Callback";
@DomName('RTCDTMFSender.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "RTCDTMFSender_addEventListener_Callback";
@DomName('RTCDTMFSender.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "RTCDTMFSender_dispatchEvent_Callback";
@DomName('RTCDTMFSender.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "RTCDTMFSender_removeEventListener_Callback";
@DomName('RTCDTMFSender.ontonechange')
@DocsEditable()
Stream<RtcDtmfToneChangeEvent> get onToneChange => toneChangeEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCDTMFToneChangeEvent')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDTMFToneChangeEvent
@Experimental()
class RtcDtmfToneChangeEvent extends Event {
// To suppress missing implicit constructor warnings.
factory RtcDtmfToneChangeEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('RTCDTMFToneChangeEvent.tone')
@DocsEditable()
String get tone native "RTCDTMFToneChangeEvent_tone_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCIceCandidate')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCIceCandidate
class RtcIceCandidate extends NativeFieldWrapperClass1 {
@DomName('RTCIceCandidate.RTCIceCandidate')
@DocsEditable()
factory RtcIceCandidate(Map dictionary) {
return RtcIceCandidate._create_1(dictionary);
}
@DocsEditable()
static RtcIceCandidate _create_1(dictionary) native "RTCIceCandidate__create_1constructorCallback";
@DomName('RTCIceCandidate.candidate')
@DocsEditable()
String get candidate native "RTCIceCandidate_candidate_Getter";
@DomName('RTCIceCandidate.sdpMLineIndex')
@DocsEditable()
int get sdpMLineIndex native "RTCIceCandidate_sdpMLineIndex_Getter";
@DomName('RTCIceCandidate.sdpMid')
@DocsEditable()
String get sdpMid native "RTCIceCandidate_sdpMid_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCIceCandidateEvent')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcicecandidate-type
@Experimental()
class RtcIceCandidateEvent extends Event {
// To suppress missing implicit constructor warnings.
factory RtcIceCandidateEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('RTCIceCandidateEvent.candidate')
@DocsEditable()
RtcIceCandidate get candidate native "RTCIceCandidateEvent_candidate_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('RTCPeerConnection')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection
class RtcPeerConnection extends EventTarget {
/**
* Checks if Real Time Communication (RTC) APIs are supported and enabled on
* the current platform.
*/
static bool get supported => true;
Future<RtcSessionDescription> createOffer([Map mediaConstraints]) {
var completer = new Completer<RtcSessionDescription>();
_createOffer(
(value) { completer.complete(value); },
(error) { completer.completeError(error); }, mediaConstraints);
return completer.future;
}
Future<RtcSessionDescription> createAnswer([Map mediaConstraints]) {
var completer = new Completer<RtcSessionDescription>();
_createAnswer(
(value) { completer.complete(value); },
(error) { completer.completeError(error); }, mediaConstraints);
return completer.future;
}
// To suppress missing implicit constructor warnings.
factory RtcPeerConnection._() { throw new UnsupportedError("Not supported"); }
@DomName('RTCPeerConnection.addstreamEvent')
@DocsEditable()
static const EventStreamProvider<MediaStreamEvent> addStreamEvent = const EventStreamProvider<MediaStreamEvent>('addstream');
@DomName('RTCPeerConnection.datachannelEvent')
@DocsEditable()
static const EventStreamProvider<RtcDataChannelEvent> dataChannelEvent = const EventStreamProvider<RtcDataChannelEvent>('datachannel');
@DomName('RTCPeerConnection.icecandidateEvent')
@DocsEditable()
static const EventStreamProvider<RtcIceCandidateEvent> iceCandidateEvent = const EventStreamProvider<RtcIceCandidateEvent>('icecandidate');
@DomName('RTCPeerConnection.iceconnectionstatechangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> iceConnectionStateChangeEvent = const EventStreamProvider<Event>('iceconnectionstatechange');
@DomName('RTCPeerConnection.negotiationneededEvent')
@DocsEditable()
static const EventStreamProvider<Event> negotiationNeededEvent = const EventStreamProvider<Event>('negotiationneeded');
@DomName('RTCPeerConnection.removestreamEvent')
@DocsEditable()
static const EventStreamProvider<MediaStreamEvent> removeStreamEvent = const EventStreamProvider<MediaStreamEvent>('removestream');
@DomName('RTCPeerConnection.signalingstatechangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> signalingStateChangeEvent = const EventStreamProvider<Event>('signalingstatechange');
@DomName('RTCPeerConnection.RTCPeerConnection')
@DocsEditable()
factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
return RtcPeerConnection._create_1(rtcIceServers, mediaConstraints);
}
@DocsEditable()
static RtcPeerConnection _create_1(rtcIceServers, mediaConstraints) native "RTCPeerConnection__create_1constructorCallback";
@DomName('RTCPeerConnection.iceConnectionState')
@DocsEditable()
String get iceConnectionState native "RTCPeerConnection_iceConnectionState_Getter";
@DomName('RTCPeerConnection.iceGatheringState')
@DocsEditable()
String get iceGatheringState native "RTCPeerConnection_iceGatheringState_Getter";
@DomName('RTCPeerConnection.localDescription')
@DocsEditable()
RtcSessionDescription get localDescription native "RTCPeerConnection_localDescription_Getter";
@DomName('RTCPeerConnection.remoteDescription')
@DocsEditable()
RtcSessionDescription get remoteDescription native "RTCPeerConnection_remoteDescription_Getter";
@DomName('RTCPeerConnection.signalingState')
@DocsEditable()
String get signalingState native "RTCPeerConnection_signalingState_Getter";
@DomName('RTCPeerConnection.addIceCandidate')
@DocsEditable()
void addIceCandidate(RtcIceCandidate candidate) native "RTCPeerConnection_addIceCandidate_Callback";
@DomName('RTCPeerConnection.addStream')
@DocsEditable()
void addStream(MediaStream stream, [Map mediaConstraints]) native "RTCPeerConnection_addStream_Callback";
@DomName('RTCPeerConnection.close')
@DocsEditable()
void close() native "RTCPeerConnection_close_Callback";
@DomName('RTCPeerConnection.createAnswer')
@DocsEditable()
void _createAnswer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) native "RTCPeerConnection_createAnswer_Callback";
@DomName('RTCPeerConnection.createDTMFSender')
@DocsEditable()
RtcDtmfSender createDtmfSender(MediaStreamTrack track) native "RTCPeerConnection_createDTMFSender_Callback";
@DomName('RTCPeerConnection.createDataChannel')
@DocsEditable()
RtcDataChannel createDataChannel(String label, [Map options]) native "RTCPeerConnection_createDataChannel_Callback";
@DomName('RTCPeerConnection.createOffer')
@DocsEditable()
void _createOffer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) native "RTCPeerConnection_createOffer_Callback";
@DomName('RTCPeerConnection.getLocalStreams')
@DocsEditable()
List<MediaStream> getLocalStreams() native "RTCPeerConnection_getLocalStreams_Callback";
@DomName('RTCPeerConnection.getRemoteStreams')
@DocsEditable()
List<MediaStream> getRemoteStreams() native "RTCPeerConnection_getRemoteStreams_Callback";
@DomName('RTCPeerConnection.getStats')
@DocsEditable()
void getStats(RtcStatsCallback successCallback, MediaStreamTrack selector) native "RTCPeerConnection_getStats_Callback";
@DomName('RTCPeerConnection.getStreamById')
@DocsEditable()
MediaStream getStreamById(String streamId) native "RTCPeerConnection_getStreamById_Callback";
@DomName('RTCPeerConnection.removeStream')
@DocsEditable()
void removeStream(MediaStream stream) native "RTCPeerConnection_removeStream_Callback";
@DomName('RTCPeerConnection.setLocalDescription')
@DocsEditable()
void _setLocalDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) native "RTCPeerConnection_setLocalDescription_Callback";
Future setLocalDescription(RtcSessionDescription description) {
var completer = new Completer();
_setLocalDescription(description,
() { completer.complete(); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('RTCPeerConnection.setRemoteDescription')
@DocsEditable()
void _setRemoteDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) native "RTCPeerConnection_setRemoteDescription_Callback";
Future setRemoteDescription(RtcSessionDescription description) {
var completer = new Completer();
_setRemoteDescription(description,
() { completer.complete(); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('RTCPeerConnection.updateIce')
@DocsEditable()
void updateIce([Map configuration, Map mediaConstraints]) native "RTCPeerConnection_updateIce_Callback";
@DomName('RTCPeerConnection.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "RTCPeerConnection_addEventListener_Callback";
@DomName('RTCPeerConnection.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "RTCPeerConnection_dispatchEvent_Callback";
@DomName('RTCPeerConnection.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "RTCPeerConnection_removeEventListener_Callback";
@DomName('RTCPeerConnection.onaddstream')
@DocsEditable()
Stream<MediaStreamEvent> get onAddStream => addStreamEvent.forTarget(this);
@DomName('RTCPeerConnection.ondatachannel')
@DocsEditable()
Stream<RtcDataChannelEvent> get onDataChannel => dataChannelEvent.forTarget(this);
@DomName('RTCPeerConnection.onicecandidate')
@DocsEditable()
Stream<RtcIceCandidateEvent> get onIceCandidate => iceCandidateEvent.forTarget(this);
@DomName('RTCPeerConnection.oniceconnectionstatechange')
@DocsEditable()
Stream<Event> get onIceConnectionStateChange => iceConnectionStateChangeEvent.forTarget(this);
@DomName('RTCPeerConnection.onnegotiationneeded')
@DocsEditable()
Stream<Event> get onNegotiationNeeded => negotiationNeededEvent.forTarget(this);
@DomName('RTCPeerConnection.onremovestream')
@DocsEditable()
Stream<MediaStreamEvent> get onRemoveStream => removeStreamEvent.forTarget(this);
@DomName('RTCPeerConnection.onsignalingstatechange')
@DocsEditable()
Stream<Event> get onSignalingStateChange => signalingStateChangeEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCSessionDescription')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSessionDescription
class RtcSessionDescription extends NativeFieldWrapperClass1 {
@DomName('RTCSessionDescription.RTCSessionDescription')
@DocsEditable()
factory RtcSessionDescription(Map dictionary) {
return RtcSessionDescription._create_1(dictionary);
}
@DocsEditable()
static RtcSessionDescription _create_1(dictionary) native "RTCSessionDescription__create_1constructorCallback";
@DomName('RTCSessionDescription.sdp')
@DocsEditable()
String get sdp native "RTCSessionDescription_sdp_Getter";
@DomName('RTCSessionDescription.sdp')
@DocsEditable()
void set sdp(String value) native "RTCSessionDescription_sdp_Setter";
@DomName('RTCSessionDescription.type')
@DocsEditable()
String get type native "RTCSessionDescription_type_Getter";
@DomName('RTCSessionDescription.type')
@DocsEditable()
void set type(String value) native "RTCSessionDescription_type_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCStatsReport')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCStatsReport
@Experimental()
class RtcStatsReport extends NativeFieldWrapperClass1 {
@DomName('RTCStatsReport.id')
@DocsEditable()
String get id native "RTCStatsReport_id_Getter";
@DomName('RTCStatsReport.local')
@DocsEditable()
RtcStatsReport get local native "RTCStatsReport_local_Getter";
@DomName('RTCStatsReport.remote')
@DocsEditable()
RtcStatsReport get remote native "RTCStatsReport_remote_Getter";
@DomName('RTCStatsReport.timestamp')
@DocsEditable()
DateTime get timestamp native "RTCStatsReport_timestamp_Getter";
@DomName('RTCStatsReport.type')
@DocsEditable()
String get type native "RTCStatsReport_type_Getter";
@DomName('RTCStatsReport.names')
@DocsEditable()
List<String> names() native "RTCStatsReport_names_Callback";
@DomName('RTCStatsReport.stat')
@DocsEditable()
String stat(String name) native "RTCStatsReport_stat_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RTCStatsResponse')
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-RTCStatsReport-RTCStats-getter-DOMString-id
@Experimental()
class RtcStatsResponse extends NativeFieldWrapperClass1 {
@DomName('RTCStatsResponse.__getter__')
@DocsEditable()
RtcStatsReport __getter__(String name) native "RTCStatsResponse___getter___Callback";
@DomName('RTCStatsResponse.namedItem')
@DocsEditable()
RtcStatsReport namedItem(String name) native "RTCStatsResponse_namedItem_Callback";
@DomName('RTCStatsResponse.result')
@DocsEditable()
List<RtcStatsReport> result() native "RTCStatsResponse_result_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('Screen')
class Screen extends NativeFieldWrapperClass1 {
@DomName('Screen.availHeight')
@DomName('Screen.availLeft')
@DomName('Screen.availTop')
@DomName('Screen.availWidth')
Rect get available => new Rect(_availLeft, _availTop, _availWidth,
_availHeight);
@DomName('Screen.availHeight')
@DocsEditable()
int get _availHeight native "Screen_availHeight_Getter";
@DomName('Screen.availLeft')
@DocsEditable()
@Experimental() // nonstandard
int get _availLeft native "Screen_availLeft_Getter";
@DomName('Screen.availTop')
@DocsEditable()
@Experimental() // nonstandard
int get _availTop native "Screen_availTop_Getter";
@DomName('Screen.availWidth')
@DocsEditable()
int get _availWidth native "Screen_availWidth_Getter";
@DomName('Screen.colorDepth')
@DocsEditable()
int get colorDepth native "Screen_colorDepth_Getter";
@DomName('Screen.height')
@DocsEditable()
int get height native "Screen_height_Getter";
@DomName('Screen.pixelDepth')
@DocsEditable()
int get pixelDepth native "Screen_pixelDepth_Getter";
@DomName('Screen.width')
@DocsEditable()
int get width native "Screen_width_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLScriptElement')
class ScriptElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ScriptElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLScriptElement.HTMLScriptElement')
@DocsEditable()
factory ScriptElement() => document.$dom_createElement("script");
@DomName('HTMLScriptElement.async')
@DocsEditable()
bool get async native "HTMLScriptElement_async_Getter";
@DomName('HTMLScriptElement.async')
@DocsEditable()
void set async(bool value) native "HTMLScriptElement_async_Setter";
@DomName('HTMLScriptElement.charset')
@DocsEditable()
String get charset native "HTMLScriptElement_charset_Getter";
@DomName('HTMLScriptElement.charset')
@DocsEditable()
void set charset(String value) native "HTMLScriptElement_charset_Setter";
@DomName('HTMLScriptElement.crossOrigin')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#attr-script-crossorigin
@Experimental()
String get crossOrigin native "HTMLScriptElement_crossOrigin_Getter";
@DomName('HTMLScriptElement.crossOrigin')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#attr-script-crossorigin
@Experimental()
void set crossOrigin(String value) native "HTMLScriptElement_crossOrigin_Setter";
@DomName('HTMLScriptElement.defer')
@DocsEditable()
bool get defer native "HTMLScriptElement_defer_Getter";
@DomName('HTMLScriptElement.defer')
@DocsEditable()
void set defer(bool value) native "HTMLScriptElement_defer_Setter";
@DomName('HTMLScriptElement.event')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLScriptElement-partial
@deprecated // deprecated
String get event native "HTMLScriptElement_event_Getter";
@DomName('HTMLScriptElement.event')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLScriptElement-partial
@deprecated // deprecated
void set event(String value) native "HTMLScriptElement_event_Setter";
@DomName('HTMLScriptElement.htmlFor')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLScriptElement-partial
@deprecated // deprecated
String get htmlFor native "HTMLScriptElement_htmlFor_Getter";
@DomName('HTMLScriptElement.htmlFor')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLScriptElement-partial
@deprecated // deprecated
void set htmlFor(String value) native "HTMLScriptElement_htmlFor_Setter";
@DomName('HTMLScriptElement.nonce')
@DocsEditable()
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#interaction-with-the-script-src-directive
@Experimental()
String get nonce native "HTMLScriptElement_nonce_Getter";
@DomName('HTMLScriptElement.nonce')
@DocsEditable()
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#interaction-with-the-script-src-directive
@Experimental()
void set nonce(String value) native "HTMLScriptElement_nonce_Setter";
@DomName('HTMLScriptElement.src')
@DocsEditable()
String get src native "HTMLScriptElement_src_Getter";
@DomName('HTMLScriptElement.src')
@DocsEditable()
void set src(String value) native "HTMLScriptElement_src_Setter";
@DomName('HTMLScriptElement.type')
@DocsEditable()
String get type native "HTMLScriptElement_type_Getter";
@DomName('HTMLScriptElement.type')
@DocsEditable()
void set type(String value) native "HTMLScriptElement_type_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SecurityPolicy')
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicy
@Experimental()
class SecurityPolicy extends NativeFieldWrapperClass1 {
@DomName('SecurityPolicy.allowsEval')
@DocsEditable()
bool get allowsEval native "SecurityPolicy_allowsEval_Getter";
@DomName('SecurityPolicy.allowsInlineScript')
@DocsEditable()
bool get allowsInlineScript native "SecurityPolicy_allowsInlineScript_Getter";
@DomName('SecurityPolicy.allowsInlineStyle')
@DocsEditable()
bool get allowsInlineStyle native "SecurityPolicy_allowsInlineStyle_Getter";
@DomName('SecurityPolicy.isActive')
@DocsEditable()
bool get isActive native "SecurityPolicy_isActive_Getter";
@DomName('SecurityPolicy.reportURIs')
@DocsEditable()
List<String> get reportURIs native "SecurityPolicy_reportURIs_Getter";
@DomName('SecurityPolicy.allowsConnectionTo')
@DocsEditable()
bool allowsConnectionTo(String url) native "SecurityPolicy_allowsConnectionTo_Callback";
@DomName('SecurityPolicy.allowsFontFrom')
@DocsEditable()
bool allowsFontFrom(String url) native "SecurityPolicy_allowsFontFrom_Callback";
@DomName('SecurityPolicy.allowsFormAction')
@DocsEditable()
bool allowsFormAction(String url) native "SecurityPolicy_allowsFormAction_Callback";
@DomName('SecurityPolicy.allowsFrameFrom')
@DocsEditable()
bool allowsFrameFrom(String url) native "SecurityPolicy_allowsFrameFrom_Callback";
@DomName('SecurityPolicy.allowsImageFrom')
@DocsEditable()
bool allowsImageFrom(String url) native "SecurityPolicy_allowsImageFrom_Callback";
@DomName('SecurityPolicy.allowsMediaFrom')
@DocsEditable()
bool allowsMediaFrom(String url) native "SecurityPolicy_allowsMediaFrom_Callback";
@DomName('SecurityPolicy.allowsObjectFrom')
@DocsEditable()
bool allowsObjectFrom(String url) native "SecurityPolicy_allowsObjectFrom_Callback";
@DomName('SecurityPolicy.allowsPluginType')
@DocsEditable()
bool allowsPluginType(String type) native "SecurityPolicy_allowsPluginType_Callback";
@DomName('SecurityPolicy.allowsScriptFrom')
@DocsEditable()
bool allowsScriptFrom(String url) native "SecurityPolicy_allowsScriptFrom_Callback";
@DomName('SecurityPolicy.allowsStyleFrom')
@DocsEditable()
bool allowsStyleFrom(String url) native "SecurityPolicy_allowsStyleFrom_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SecurityPolicyViolationEvent')
// https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicyviolationevent-events
@Experimental()
class SecurityPolicyViolationEvent extends Event {
// To suppress missing implicit constructor warnings.
factory SecurityPolicyViolationEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('SecurityPolicyViolationEvent.blockedURI')
@DocsEditable()
String get blockedUri native "SecurityPolicyViolationEvent_blockedURI_Getter";
@DomName('SecurityPolicyViolationEvent.columnNumber')
@DocsEditable()
int get columnNumber native "SecurityPolicyViolationEvent_columnNumber_Getter";
@DomName('SecurityPolicyViolationEvent.documentURI')
@DocsEditable()
String get documentUri native "SecurityPolicyViolationEvent_documentURI_Getter";
@DomName('SecurityPolicyViolationEvent.effectiveDirective')
@DocsEditable()
String get effectiveDirective native "SecurityPolicyViolationEvent_effectiveDirective_Getter";
@DomName('SecurityPolicyViolationEvent.lineNumber')
@DocsEditable()
int get lineNumber native "SecurityPolicyViolationEvent_lineNumber_Getter";
@DomName('SecurityPolicyViolationEvent.originalPolicy')
@DocsEditable()
String get originalPolicy native "SecurityPolicyViolationEvent_originalPolicy_Getter";
@DomName('SecurityPolicyViolationEvent.referrer')
@DocsEditable()
String get referrer native "SecurityPolicyViolationEvent_referrer_Getter";
@DomName('SecurityPolicyViolationEvent.sourceFile')
@DocsEditable()
String get sourceFile native "SecurityPolicyViolationEvent_sourceFile_Getter";
@DomName('SecurityPolicyViolationEvent.statusCode')
@DocsEditable()
@Experimental() // untriaged
int get statusCode native "SecurityPolicyViolationEvent_statusCode_Getter";
@DomName('SecurityPolicyViolationEvent.violatedDirective')
@DocsEditable()
String get violatedDirective native "SecurityPolicyViolationEvent_violatedDirective_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('HTMLSelectElement')
class SelectElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory SelectElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLSelectElement.HTMLSelectElement')
@DocsEditable()
factory SelectElement() => document.$dom_createElement("select");
@DomName('HTMLSelectElement.autofocus')
@DocsEditable()
bool get autofocus native "HTMLSelectElement_autofocus_Getter";
@DomName('HTMLSelectElement.autofocus')
@DocsEditable()
void set autofocus(bool value) native "HTMLSelectElement_autofocus_Setter";
@DomName('HTMLSelectElement.disabled')
@DocsEditable()
bool get disabled native "HTMLSelectElement_disabled_Getter";
@DomName('HTMLSelectElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLSelectElement_disabled_Setter";
@DomName('HTMLSelectElement.form')
@DocsEditable()
FormElement get form native "HTMLSelectElement_form_Getter";
@DomName('HTMLSelectElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLSelectElement_labels_Getter";
@DomName('HTMLSelectElement.length')
@DocsEditable()
int get length native "HTMLSelectElement_length_Getter";
@DomName('HTMLSelectElement.length')
@DocsEditable()
void set length(int value) native "HTMLSelectElement_length_Setter";
@DomName('HTMLSelectElement.multiple')
@DocsEditable()
bool get multiple native "HTMLSelectElement_multiple_Getter";
@DomName('HTMLSelectElement.multiple')
@DocsEditable()
void set multiple(bool value) native "HTMLSelectElement_multiple_Setter";
@DomName('HTMLSelectElement.name')
@DocsEditable()
String get name native "HTMLSelectElement_name_Getter";
@DomName('HTMLSelectElement.name')
@DocsEditable()
void set name(String value) native "HTMLSelectElement_name_Setter";
@DomName('HTMLSelectElement.required')
@DocsEditable()
bool get required native "HTMLSelectElement_required_Getter";
@DomName('HTMLSelectElement.required')
@DocsEditable()
void set required(bool value) native "HTMLSelectElement_required_Setter";
@DomName('HTMLSelectElement.selectedIndex')
@DocsEditable()
int get selectedIndex native "HTMLSelectElement_selectedIndex_Getter";
@DomName('HTMLSelectElement.selectedIndex')
@DocsEditable()
void set selectedIndex(int value) native "HTMLSelectElement_selectedIndex_Setter";
@DomName('HTMLSelectElement.size')
@DocsEditable()
int get size native "HTMLSelectElement_size_Getter";
@DomName('HTMLSelectElement.size')
@DocsEditable()
void set size(int value) native "HTMLSelectElement_size_Setter";
@DomName('HTMLSelectElement.type')
@DocsEditable()
String get type native "HTMLSelectElement_type_Getter";
@DomName('HTMLSelectElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLSelectElement_validationMessage_Getter";
@DomName('HTMLSelectElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLSelectElement_validity_Getter";
@DomName('HTMLSelectElement.value')
@DocsEditable()
String get value native "HTMLSelectElement_value_Getter";
@DomName('HTMLSelectElement.value')
@DocsEditable()
void set value(String value) native "HTMLSelectElement_value_Setter";
@DomName('HTMLSelectElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLSelectElement_willValidate_Getter";
@DomName('HTMLSelectElement.__setter__')
@DocsEditable()
void __setter__(int index, OptionElement value) native "HTMLSelectElement___setter___Callback";
@DomName('HTMLSelectElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLSelectElement_checkValidity_Callback";
@DomName('HTMLSelectElement.item')
@DocsEditable()
Node item(int index) native "HTMLSelectElement_item_Callback";
@DomName('HTMLSelectElement.namedItem')
@DocsEditable()
Node namedItem(String name) native "HTMLSelectElement_namedItem_Callback";
@DomName('HTMLSelectElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLSelectElement_setCustomValidity_Callback";
// Override default options, since IE returns SelectElement itself and it
// does not operate as a List.
List<OptionElement> get options {
var options =
this.queryAll('option').where((e) => e is OptionElement).toList();
return new UnmodifiableListView(options);
}
List<OptionElement> get selectedOptions {
// IE does not change the selected flag for single-selection items.
if (this.multiple) {
var options = this.options.where((o) => o.selected).toList();
return new UnmodifiableListView(options);
} else {
return [this.options[this.selectedIndex]];
}
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Selection')
class Selection extends NativeFieldWrapperClass1 {
@DomName('Selection.anchorNode')
@DocsEditable()
Node get anchorNode native "Selection_anchorNode_Getter";
@DomName('Selection.anchorOffset')
@DocsEditable()
int get anchorOffset native "Selection_anchorOffset_Getter";
@DomName('Selection.baseNode')
@DocsEditable()
@Experimental() // non-standard
Node get baseNode native "Selection_baseNode_Getter";
@DomName('Selection.baseOffset')
@DocsEditable()
@Experimental() // non-standard
int get baseOffset native "Selection_baseOffset_Getter";
@DomName('Selection.extentNode')
@DocsEditable()
@Experimental() // non-standard
Node get extentNode native "Selection_extentNode_Getter";
@DomName('Selection.extentOffset')
@DocsEditable()
@Experimental() // non-standard
int get extentOffset native "Selection_extentOffset_Getter";
@DomName('Selection.focusNode')
@DocsEditable()
Node get focusNode native "Selection_focusNode_Getter";
@DomName('Selection.focusOffset')
@DocsEditable()
int get focusOffset native "Selection_focusOffset_Getter";
@DomName('Selection.isCollapsed')
@DocsEditable()
bool get isCollapsed native "Selection_isCollapsed_Getter";
@DomName('Selection.rangeCount')
@DocsEditable()
int get rangeCount native "Selection_rangeCount_Getter";
@DomName('Selection.type')
@DocsEditable()
@Experimental() // non-standard
String get type native "Selection_type_Getter";
@DomName('Selection.addRange')
@DocsEditable()
void addRange(Range range) native "Selection_addRange_Callback";
@DomName('Selection.collapse')
@DocsEditable()
void collapse(Node node, int index) native "Selection_collapse_Callback";
@DomName('Selection.collapseToEnd')
@DocsEditable()
void collapseToEnd() native "Selection_collapseToEnd_Callback";
@DomName('Selection.collapseToStart')
@DocsEditable()
void collapseToStart() native "Selection_collapseToStart_Callback";
@DomName('Selection.containsNode')
@DocsEditable()
@Experimental() // non-standard
bool containsNode(Node node, bool allowPartial) native "Selection_containsNode_Callback";
@DomName('Selection.deleteFromDocument')
@DocsEditable()
void deleteFromDocument() native "Selection_deleteFromDocument_Callback";
@DomName('Selection.empty')
@DocsEditable()
@Experimental() // non-standard
void empty() native "Selection_empty_Callback";
@DomName('Selection.extend')
@DocsEditable()
void extend(Node node, int offset) native "Selection_extend_Callback";
@DomName('Selection.getRangeAt')
@DocsEditable()
Range getRangeAt(int index) native "Selection_getRangeAt_Callback";
@DomName('Selection.modify')
@DocsEditable()
@Experimental() // non-standard
void modify(String alter, String direction, String granularity) native "Selection_modify_Callback";
@DomName('Selection.removeAllRanges')
@DocsEditable()
void removeAllRanges() native "Selection_removeAllRanges_Callback";
@DomName('Selection.selectAllChildren')
@DocsEditable()
void selectAllChildren(Node node) native "Selection_selectAllChildren_Callback";
@DomName('Selection.setBaseAndExtent')
@DocsEditable()
@Experimental() // non-standard
void setBaseAndExtent(Node baseNode, int baseOffset, Node extentNode, int extentOffset) native "Selection_setBaseAndExtent_Callback";
@DomName('Selection.setPosition')
@DocsEditable()
@Experimental() // non-standard
void setPosition(Node node, int offset) native "Selection_setPosition_Callback";
@DomName('Selection.toString')
@DocsEditable()
String toString() native "Selection_toString_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLShadowElement')
@SupportedBrowser(SupportedBrowser.CHROME, '26')
@Experimental()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-element
class ShadowElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory ShadowElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLShadowElement.HTMLShadowElement')
@DocsEditable()
factory ShadowElement() => document.$dom_createElement("shadow");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLShadowElement.olderShadowRoot')
@DocsEditable()
ShadowRoot get olderShadowRoot native "HTMLShadowElement_olderShadowRoot_Getter";
@DomName('HTMLShadowElement.resetStyleInheritance')
@DocsEditable()
bool get resetStyleInheritance native "HTMLShadowElement_resetStyleInheritance_Getter";
@DomName('HTMLShadowElement.resetStyleInheritance')
@DocsEditable()
void set resetStyleInheritance(bool value) native "HTMLShadowElement_resetStyleInheritance_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('ShadowRoot')
@SupportedBrowser(SupportedBrowser.CHROME, '26')
@Experimental()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-shadow-root
class ShadowRoot extends DocumentFragment {
// To suppress missing implicit constructor warnings.
factory ShadowRoot._() { throw new UnsupportedError("Not supported"); }
@DomName('ShadowRoot.activeElement')
@DocsEditable()
Element get activeElement native "ShadowRoot_activeElement_Getter";
@DomName('ShadowRoot.applyAuthorStyles')
@DocsEditable()
bool get applyAuthorStyles native "ShadowRoot_applyAuthorStyles_Getter";
@DomName('ShadowRoot.applyAuthorStyles')
@DocsEditable()
void set applyAuthorStyles(bool value) native "ShadowRoot_applyAuthorStyles_Setter";
@DomName('ShadowRoot.innerHTML')
@DocsEditable()
String get innerHtml native "ShadowRoot_innerHTML_Getter";
@DomName('ShadowRoot.innerHTML')
@DocsEditable()
void set innerHtml(String value) native "ShadowRoot_innerHTML_Setter";
@DomName('ShadowRoot.olderShadowRoot')
@DocsEditable()
@Experimental() // untriaged
ShadowRoot get olderShadowRoot native "ShadowRoot_olderShadowRoot_Getter";
@DomName('ShadowRoot.resetStyleInheritance')
@DocsEditable()
bool get resetStyleInheritance native "ShadowRoot_resetStyleInheritance_Getter";
@DomName('ShadowRoot.resetStyleInheritance')
@DocsEditable()
void set resetStyleInheritance(bool value) native "ShadowRoot_resetStyleInheritance_Setter";
@DomName('ShadowRoot.cloneNode')
@DocsEditable()
Node clone(bool deep) native "ShadowRoot_cloneNode_Callback";
@DomName('ShadowRoot.elementFromPoint')
@DocsEditable()
Element elementFromPoint(int x, int y) native "ShadowRoot_elementFromPoint_Callback";
@DomName('ShadowRoot.getElementById')
@DocsEditable()
Element getElementById(String elementId) native "ShadowRoot_getElementById_Callback";
@DomName('ShadowRoot.getElementsByClassName')
@DocsEditable()
List<Node> getElementsByClassName(String className) native "ShadowRoot_getElementsByClassName_Callback";
@DomName('ShadowRoot.getElementsByTagName')
@DocsEditable()
List<Node> getElementsByTagName(String tagName) native "ShadowRoot_getElementsByTagName_Callback";
@DomName('ShadowRoot.getSelection')
@DocsEditable()
Selection getSelection() native "ShadowRoot_getSelection_Callback";
static final bool supported = true;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SharedWorkerGlobalScope')
@Experimental() // untriaged
class SharedWorkerGlobalScope extends WorkerGlobalScope {
// To suppress missing implicit constructor warnings.
factory SharedWorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
@DomName('SharedWorkerGlobalScope.name')
@DocsEditable()
@Experimental() // untriaged
String get name native "SharedWorkerGlobalScope_name_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SourceBuffer')
// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer
@Experimental()
class SourceBuffer extends EventTarget {
// To suppress missing implicit constructor warnings.
factory SourceBuffer._() { throw new UnsupportedError("Not supported"); }
@DomName('SourceBuffer.appendWindowEnd')
@DocsEditable()
@Experimental() // untriaged
num get appendWindowEnd native "SourceBuffer_appendWindowEnd_Getter";
@DomName('SourceBuffer.appendWindowEnd')
@DocsEditable()
@Experimental() // untriaged
void set appendWindowEnd(num value) native "SourceBuffer_appendWindowEnd_Setter";
@DomName('SourceBuffer.appendWindowStart')
@DocsEditable()
@Experimental() // untriaged
num get appendWindowStart native "SourceBuffer_appendWindowStart_Getter";
@DomName('SourceBuffer.appendWindowStart')
@DocsEditable()
@Experimental() // untriaged
void set appendWindowStart(num value) native "SourceBuffer_appendWindowStart_Setter";
@DomName('SourceBuffer.buffered')
@DocsEditable()
TimeRanges get buffered native "SourceBuffer_buffered_Getter";
@DomName('SourceBuffer.timestampOffset')
@DocsEditable()
num get timestampOffset native "SourceBuffer_timestampOffset_Getter";
@DomName('SourceBuffer.timestampOffset')
@DocsEditable()
void set timestampOffset(num value) native "SourceBuffer_timestampOffset_Setter";
@DomName('SourceBuffer.updating')
@DocsEditable()
@Experimental() // untriaged
bool get updating native "SourceBuffer_updating_Getter";
@DomName('SourceBuffer.abort')
@DocsEditable()
void abort() native "SourceBuffer_abort_Callback";
@DomName('SourceBuffer.appendBuffer')
@DocsEditable()
@Experimental() // untriaged
void appendBuffer(ByteBuffer data) native "SourceBuffer_appendBuffer_Callback";
@DomName('SourceBuffer.appendBufferView')
@DocsEditable()
@Experimental() // untriaged
void appendBufferView(TypedData data) native "SourceBuffer_appendBufferView_Callback";
@DomName('SourceBuffer.remove')
@DocsEditable()
@Experimental() // untriaged
void remove(num start, num end) native "SourceBuffer_remove_Callback";
@DomName('SourceBuffer.addEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "SourceBuffer_addEventListener_Callback";
@DomName('SourceBuffer.dispatchEvent')
@DocsEditable()
@Experimental() // untriaged
bool dispatchEvent(Event event) native "SourceBuffer_dispatchEvent_Callback";
@DomName('SourceBuffer.removeEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "SourceBuffer_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SourceBufferList')
// https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebufferlist
@Experimental()
class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, ImmutableListMixin<SourceBuffer> implements List<SourceBuffer> {
// To suppress missing implicit constructor warnings.
factory SourceBufferList._() { throw new UnsupportedError("Not supported"); }
@DomName('SourceBufferList.length')
@DocsEditable()
int get length native "SourceBufferList_length_Getter";
SourceBuffer operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
SourceBuffer _nativeIndexedGetter(int index) native "SourceBufferList_item_Callback";
void operator[]=(int index, SourceBuffer value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<SourceBuffer> mixins.
// SourceBuffer is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
SourceBuffer get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
SourceBuffer get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
SourceBuffer get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
SourceBuffer elementAt(int index) => this[index];
// -- end List<SourceBuffer> mixins.
@DomName('SourceBufferList.item')
@DocsEditable()
SourceBuffer item(int index) native "SourceBufferList_item_Callback";
@DomName('SourceBufferList.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "SourceBufferList_addEventListener_Callback";
@DomName('SourceBufferList.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "SourceBufferList_dispatchEvent_Callback";
@DomName('SourceBufferList.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "SourceBufferList_removeEventListener_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLSourceElement')
class SourceElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory SourceElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLSourceElement.HTMLSourceElement')
@DocsEditable()
factory SourceElement() => document.$dom_createElement("source");
@DomName('HTMLSourceElement.media')
@DocsEditable()
String get media native "HTMLSourceElement_media_Getter";
@DomName('HTMLSourceElement.media')
@DocsEditable()
void set media(String value) native "HTMLSourceElement_media_Setter";
@DomName('HTMLSourceElement.src')
@DocsEditable()
String get src native "HTMLSourceElement_src_Getter";
@DomName('HTMLSourceElement.src')
@DocsEditable()
void set src(String value) native "HTMLSourceElement_src_Setter";
@DomName('HTMLSourceElement.type')
@DocsEditable()
String get type native "HTMLSourceElement_type_Getter";
@DomName('HTMLSourceElement.type')
@DocsEditable()
void set type(String value) native "HTMLSourceElement_type_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SourceInfo')
@Experimental() // untriaged
class SourceInfo extends NativeFieldWrapperClass1 {
@DomName('SourceInfo.facing')
@DocsEditable()
@Experimental() // untriaged
String get facing native "SourceInfo_facing_Getter";
@DomName('SourceInfo.id')
@DocsEditable()
@Experimental() // untriaged
String get id native "SourceInfo_id_Getter";
@DomName('SourceInfo.kind')
@DocsEditable()
@Experimental() // untriaged
String get kind native "SourceInfo_kind_Getter";
@DomName('SourceInfo.label')
@DocsEditable()
@Experimental() // untriaged
String get label native "SourceInfo_label_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLSpanElement')
class SpanElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory SpanElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLSpanElement.HTMLSpanElement')
@DocsEditable()
factory SpanElement() => document.$dom_createElement("span");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechGrammar')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-speechgrammar
@Experimental()
class SpeechGrammar extends NativeFieldWrapperClass1 {
@DomName('SpeechGrammar.SpeechGrammar')
@DocsEditable()
factory SpeechGrammar() {
return SpeechGrammar._create_1();
}
@DocsEditable()
static SpeechGrammar _create_1() native "SpeechGrammar__create_1constructorCallback";
@DomName('SpeechGrammar.src')
@DocsEditable()
String get src native "SpeechGrammar_src_Getter";
@DomName('SpeechGrammar.src')
@DocsEditable()
void set src(String value) native "SpeechGrammar_src_Setter";
@DomName('SpeechGrammar.weight')
@DocsEditable()
num get weight native "SpeechGrammar_weight_Getter";
@DomName('SpeechGrammar.weight')
@DocsEditable()
void set weight(num value) native "SpeechGrammar_weight_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechGrammarList')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-speechgrammarlist
@Experimental()
class SpeechGrammarList extends NativeFieldWrapperClass1 with ListMixin<SpeechGrammar>, ImmutableListMixin<SpeechGrammar> implements List<SpeechGrammar> {
@DomName('SpeechGrammarList.SpeechGrammarList')
@DocsEditable()
factory SpeechGrammarList() {
return SpeechGrammarList._create_1();
}
@DocsEditable()
static SpeechGrammarList _create_1() native "SpeechGrammarList__create_1constructorCallback";
@DomName('SpeechGrammarList.length')
@DocsEditable()
int get length native "SpeechGrammarList_length_Getter";
SpeechGrammar operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
SpeechGrammar _nativeIndexedGetter(int index) native "SpeechGrammarList_item_Callback";
void operator[]=(int index, SpeechGrammar value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<SpeechGrammar> mixins.
// SpeechGrammar is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
SpeechGrammar get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
SpeechGrammar get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
SpeechGrammar get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
SpeechGrammar elementAt(int index) => this[index];
// -- end List<SpeechGrammar> mixins.
void addFromString(String string, [num weight]) {
if (weight != null) {
_addFromString_1(string, weight);
return;
}
_addFromString_2(string);
return;
}
void _addFromString_1(string, weight) native "SpeechGrammarList__addFromString_1_Callback";
void _addFromString_2(string) native "SpeechGrammarList__addFromString_2_Callback";
void addFromUri(String src, [num weight]) {
if (weight != null) {
_addFromUri_1(src, weight);
return;
}
_addFromUri_2(src);
return;
}
void _addFromUri_1(src, weight) native "SpeechGrammarList__addFromUri_1_Callback";
void _addFromUri_2(src) native "SpeechGrammarList__addFromUri_2_Callback";
@DomName('SpeechGrammarList.item')
@DocsEditable()
SpeechGrammar item(int index) native "SpeechGrammarList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechInputEvent')
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#speech_input_event_interface
@Experimental()
class SpeechInputEvent extends Event {
// To suppress missing implicit constructor warnings.
factory SpeechInputEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('SpeechInputEvent.results')
@DocsEditable()
List<SpeechInputResult> get results native "SpeechInputEvent_results_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechInputResult')
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#speech_input_result_interface
@Experimental()
class SpeechInputResult extends NativeFieldWrapperClass1 {
@DomName('SpeechInputResult.confidence')
@DocsEditable()
double get confidence native "SpeechInputResult_confidence_Getter";
@DomName('SpeechInputResult.utterance')
@DocsEditable()
String get utterance native "SpeechInputResult_utterance_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechRecognition')
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-section
class SpeechRecognition extends EventTarget {
// To suppress missing implicit constructor warnings.
factory SpeechRecognition._() { throw new UnsupportedError("Not supported"); }
@DomName('SpeechRecognition.audioendEvent')
@DocsEditable()
static const EventStreamProvider<Event> audioEndEvent = const EventStreamProvider<Event>('audioend');
@DomName('SpeechRecognition.audiostartEvent')
@DocsEditable()
static const EventStreamProvider<Event> audioStartEvent = const EventStreamProvider<Event>('audiostart');
@DomName('SpeechRecognition.endEvent')
@DocsEditable()
static const EventStreamProvider<Event> endEvent = const EventStreamProvider<Event>('end');
@DomName('SpeechRecognition.errorEvent')
@DocsEditable()
static const EventStreamProvider<SpeechRecognitionError> errorEvent = const EventStreamProvider<SpeechRecognitionError>('error');
@DomName('SpeechRecognition.nomatchEvent')
@DocsEditable()
static const EventStreamProvider<SpeechRecognitionEvent> noMatchEvent = const EventStreamProvider<SpeechRecognitionEvent>('nomatch');
@DomName('SpeechRecognition.resultEvent')
@DocsEditable()
static const EventStreamProvider<SpeechRecognitionEvent> resultEvent = const EventStreamProvider<SpeechRecognitionEvent>('result');
@DomName('SpeechRecognition.soundendEvent')
@DocsEditable()
static const EventStreamProvider<Event> soundEndEvent = const EventStreamProvider<Event>('soundend');
@DomName('SpeechRecognition.soundstartEvent')
@DocsEditable()
static const EventStreamProvider<Event> soundStartEvent = const EventStreamProvider<Event>('soundstart');
@DomName('SpeechRecognition.speechendEvent')
@DocsEditable()
static const EventStreamProvider<Event> speechEndEvent = const EventStreamProvider<Event>('speechend');
@DomName('SpeechRecognition.speechstartEvent')
@DocsEditable()
static const EventStreamProvider<Event> speechStartEvent = const EventStreamProvider<Event>('speechstart');
@DomName('SpeechRecognition.startEvent')
@DocsEditable()
static const EventStreamProvider<Event> startEvent = const EventStreamProvider<Event>('start');
@DomName('SpeechRecognition.SpeechRecognition')
@DocsEditable()
factory SpeechRecognition() {
return SpeechRecognition._create_1();
}
@DocsEditable()
static SpeechRecognition _create_1() native "SpeechRecognition__create_1constructorCallback";
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('SpeechRecognition.continuous')
@DocsEditable()
bool get continuous native "SpeechRecognition_continuous_Getter";
@DomName('SpeechRecognition.continuous')
@DocsEditable()
void set continuous(bool value) native "SpeechRecognition_continuous_Setter";
@DomName('SpeechRecognition.grammars')
@DocsEditable()
SpeechGrammarList get grammars native "SpeechRecognition_grammars_Getter";
@DomName('SpeechRecognition.grammars')
@DocsEditable()
void set grammars(SpeechGrammarList value) native "SpeechRecognition_grammars_Setter";
@DomName('SpeechRecognition.interimResults')
@DocsEditable()
bool get interimResults native "SpeechRecognition_interimResults_Getter";
@DomName('SpeechRecognition.interimResults')
@DocsEditable()
void set interimResults(bool value) native "SpeechRecognition_interimResults_Setter";
@DomName('SpeechRecognition.lang')
@DocsEditable()
String get lang native "SpeechRecognition_lang_Getter";
@DomName('SpeechRecognition.lang')
@DocsEditable()
void set lang(String value) native "SpeechRecognition_lang_Setter";
@DomName('SpeechRecognition.maxAlternatives')
@DocsEditable()
int get maxAlternatives native "SpeechRecognition_maxAlternatives_Getter";
@DomName('SpeechRecognition.maxAlternatives')
@DocsEditable()
void set maxAlternatives(int value) native "SpeechRecognition_maxAlternatives_Setter";
@DomName('SpeechRecognition.abort')
@DocsEditable()
void abort() native "SpeechRecognition_abort_Callback";
@DomName('SpeechRecognition.start')
@DocsEditable()
void start() native "SpeechRecognition_start_Callback";
@DomName('SpeechRecognition.stop')
@DocsEditable()
void stop() native "SpeechRecognition_stop_Callback";
@DomName('SpeechRecognition.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "SpeechRecognition_addEventListener_Callback";
@DomName('SpeechRecognition.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "SpeechRecognition_dispatchEvent_Callback";
@DomName('SpeechRecognition.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "SpeechRecognition_removeEventListener_Callback";
@DomName('SpeechRecognition.onaudioend')
@DocsEditable()
Stream<Event> get onAudioEnd => audioEndEvent.forTarget(this);
@DomName('SpeechRecognition.onaudiostart')
@DocsEditable()
Stream<Event> get onAudioStart => audioStartEvent.forTarget(this);
@DomName('SpeechRecognition.onend')
@DocsEditable()
Stream<Event> get onEnd => endEvent.forTarget(this);
@DomName('SpeechRecognition.onerror')
@DocsEditable()
Stream<SpeechRecognitionError> get onError => errorEvent.forTarget(this);
@DomName('SpeechRecognition.onnomatch')
@DocsEditable()
Stream<SpeechRecognitionEvent> get onNoMatch => noMatchEvent.forTarget(this);
@DomName('SpeechRecognition.onresult')
@DocsEditable()
Stream<SpeechRecognitionEvent> get onResult => resultEvent.forTarget(this);
@DomName('SpeechRecognition.onsoundend')
@DocsEditable()
Stream<Event> get onSoundEnd => soundEndEvent.forTarget(this);
@DomName('SpeechRecognition.onsoundstart')
@DocsEditable()
Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
@DomName('SpeechRecognition.onspeechend')
@DocsEditable()
Stream<Event> get onSpeechEnd => speechEndEvent.forTarget(this);
@DomName('SpeechRecognition.onspeechstart')
@DocsEditable()
Stream<Event> get onSpeechStart => speechStartEvent.forTarget(this);
@DomName('SpeechRecognition.onstart')
@DocsEditable()
Stream<Event> get onStart => startEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechRecognitionAlternative')
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionalternative
class SpeechRecognitionAlternative extends NativeFieldWrapperClass1 {
@DomName('SpeechRecognitionAlternative.confidence')
@DocsEditable()
double get confidence native "SpeechRecognitionAlternative_confidence_Getter";
@DomName('SpeechRecognitionAlternative.transcript')
@DocsEditable()
String get transcript native "SpeechRecognitionAlternative_transcript_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechRecognitionError')
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-error
class SpeechRecognitionError extends Event {
// To suppress missing implicit constructor warnings.
factory SpeechRecognitionError._() { throw new UnsupportedError("Not supported"); }
@DomName('SpeechRecognitionError.error')
@DocsEditable()
String get error native "SpeechRecognitionError_error_Getter";
@DomName('SpeechRecognitionError.message')
@DocsEditable()
String get message native "SpeechRecognitionError_message_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechRecognitionEvent')
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-event
class SpeechRecognitionEvent extends Event {
// To suppress missing implicit constructor warnings.
factory SpeechRecognitionEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('SpeechRecognitionEvent.emma')
@DocsEditable()
Document get emma native "SpeechRecognitionEvent_emma_Getter";
@DomName('SpeechRecognitionEvent.interpretation')
@DocsEditable()
Document get interpretation native "SpeechRecognitionEvent_interpretation_Getter";
@DomName('SpeechRecognitionEvent.resultIndex')
@DocsEditable()
int get resultIndex native "SpeechRecognitionEvent_resultIndex_Getter";
@DomName('SpeechRecognitionEvent.results')
@DocsEditable()
List<SpeechRecognitionResult> get results native "SpeechRecognitionEvent_results_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechRecognitionResult')
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental()
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionresult
class SpeechRecognitionResult extends NativeFieldWrapperClass1 {
@DomName('SpeechRecognitionResult.isFinal')
@DocsEditable()
bool get isFinal native "SpeechRecognitionResult_isFinal_Getter";
@DomName('SpeechRecognitionResult.length')
@DocsEditable()
int get length native "SpeechRecognitionResult_length_Getter";
@DomName('SpeechRecognitionResult.item')
@DocsEditable()
SpeechRecognitionAlternative item(int index) native "SpeechRecognitionResult_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechSynthesis')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
@Experimental()
class SpeechSynthesis extends NativeFieldWrapperClass1 {
@DomName('SpeechSynthesis.paused')
@DocsEditable()
bool get paused native "SpeechSynthesis_paused_Getter";
@DomName('SpeechSynthesis.pending')
@DocsEditable()
bool get pending native "SpeechSynthesis_pending_Getter";
@DomName('SpeechSynthesis.speaking')
@DocsEditable()
bool get speaking native "SpeechSynthesis_speaking_Getter";
@DomName('SpeechSynthesis.cancel')
@DocsEditable()
void cancel() native "SpeechSynthesis_cancel_Callback";
@DomName('SpeechSynthesis.getVoices')
@DocsEditable()
List<SpeechSynthesisVoice> getVoices() native "SpeechSynthesis_getVoices_Callback";
@DomName('SpeechSynthesis.pause')
@DocsEditable()
void pause() native "SpeechSynthesis_pause_Callback";
@DomName('SpeechSynthesis.resume')
@DocsEditable()
void resume() native "SpeechSynthesis_resume_Callback";
@DomName('SpeechSynthesis.speak')
@DocsEditable()
void speak(SpeechSynthesisUtterance utterance) native "SpeechSynthesis_speak_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechSynthesisEvent')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
@Experimental()
class SpeechSynthesisEvent extends Event {
// To suppress missing implicit constructor warnings.
factory SpeechSynthesisEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('SpeechSynthesisEvent.charIndex')
@DocsEditable()
int get charIndex native "SpeechSynthesisEvent_charIndex_Getter";
@DomName('SpeechSynthesisEvent.elapsedTime')
@DocsEditable()
double get elapsedTime native "SpeechSynthesisEvent_elapsedTime_Getter";
@DomName('SpeechSynthesisEvent.name')
@DocsEditable()
String get name native "SpeechSynthesisEvent_name_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechSynthesisUtterance')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
@Experimental()
class SpeechSynthesisUtterance extends EventTarget {
// To suppress missing implicit constructor warnings.
factory SpeechSynthesisUtterance._() { throw new UnsupportedError("Not supported"); }
@DomName('SpeechSynthesisUtterance.boundaryEvent')
@DocsEditable()
static const EventStreamProvider<SpeechSynthesisEvent> boundaryEvent = const EventStreamProvider<SpeechSynthesisEvent>('boundary');
@DomName('SpeechSynthesisUtterance.endEvent')
@DocsEditable()
static const EventStreamProvider<SpeechSynthesisEvent> endEvent = const EventStreamProvider<SpeechSynthesisEvent>('end');
@DomName('SpeechSynthesisUtterance.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('SpeechSynthesisUtterance.markEvent')
@DocsEditable()
static const EventStreamProvider<SpeechSynthesisEvent> markEvent = const EventStreamProvider<SpeechSynthesisEvent>('mark');
@DomName('SpeechSynthesisUtterance.pauseEvent')
@DocsEditable()
static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider<Event>('pause');
@DomName('SpeechSynthesisUtterance.resumeEvent')
@DocsEditable()
static const EventStreamProvider<SpeechSynthesisEvent> resumeEvent = const EventStreamProvider<SpeechSynthesisEvent>('resume');
@DomName('SpeechSynthesisUtterance.startEvent')
@DocsEditable()
static const EventStreamProvider<SpeechSynthesisEvent> startEvent = const EventStreamProvider<SpeechSynthesisEvent>('start');
@DomName('SpeechSynthesisUtterance.SpeechSynthesisUtterance')
@DocsEditable()
factory SpeechSynthesisUtterance([String text]) {
return SpeechSynthesisUtterance._create_1(text);
}
@DocsEditable()
static SpeechSynthesisUtterance _create_1(text) native "SpeechSynthesisUtterance__create_1constructorCallback";
@DomName('SpeechSynthesisUtterance.lang')
@DocsEditable()
String get lang native "SpeechSynthesisUtterance_lang_Getter";
@DomName('SpeechSynthesisUtterance.lang')
@DocsEditable()
void set lang(String value) native "SpeechSynthesisUtterance_lang_Setter";
@DomName('SpeechSynthesisUtterance.pitch')
@DocsEditable()
num get pitch native "SpeechSynthesisUtterance_pitch_Getter";
@DomName('SpeechSynthesisUtterance.pitch')
@DocsEditable()
void set pitch(num value) native "SpeechSynthesisUtterance_pitch_Setter";
@DomName('SpeechSynthesisUtterance.rate')
@DocsEditable()
num get rate native "SpeechSynthesisUtterance_rate_Getter";
@DomName('SpeechSynthesisUtterance.rate')
@DocsEditable()
void set rate(num value) native "SpeechSynthesisUtterance_rate_Setter";
@DomName('SpeechSynthesisUtterance.text')
@DocsEditable()
String get text native "SpeechSynthesisUtterance_text_Getter";
@DomName('SpeechSynthesisUtterance.text')
@DocsEditable()
void set text(String value) native "SpeechSynthesisUtterance_text_Setter";
@DomName('SpeechSynthesisUtterance.voice')
@DocsEditable()
SpeechSynthesisVoice get voice native "SpeechSynthesisUtterance_voice_Getter";
@DomName('SpeechSynthesisUtterance.voice')
@DocsEditable()
void set voice(SpeechSynthesisVoice value) native "SpeechSynthesisUtterance_voice_Setter";
@DomName('SpeechSynthesisUtterance.volume')
@DocsEditable()
num get volume native "SpeechSynthesisUtterance_volume_Getter";
@DomName('SpeechSynthesisUtterance.volume')
@DocsEditable()
void set volume(num value) native "SpeechSynthesisUtterance_volume_Setter";
@DomName('SpeechSynthesisUtterance.addEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "SpeechSynthesisUtterance_addEventListener_Callback";
@DomName('SpeechSynthesisUtterance.dispatchEvent')
@DocsEditable()
@Experimental() // untriaged
bool dispatchEvent(Event event) native "SpeechSynthesisUtterance_dispatchEvent_Callback";
@DomName('SpeechSynthesisUtterance.removeEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "SpeechSynthesisUtterance_removeEventListener_Callback";
@DomName('SpeechSynthesisUtterance.onboundary')
@DocsEditable()
Stream<SpeechSynthesisEvent> get onBoundary => boundaryEvent.forTarget(this);
@DomName('SpeechSynthesisUtterance.onend')
@DocsEditable()
Stream<SpeechSynthesisEvent> get onEnd => endEvent.forTarget(this);
@DomName('SpeechSynthesisUtterance.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('SpeechSynthesisUtterance.onmark')
@DocsEditable()
Stream<SpeechSynthesisEvent> get onMark => markEvent.forTarget(this);
@DomName('SpeechSynthesisUtterance.onpause')
@DocsEditable()
Stream<Event> get onPause => pauseEvent.forTarget(this);
@DomName('SpeechSynthesisUtterance.onresume')
@DocsEditable()
Stream<SpeechSynthesisEvent> get onResume => resumeEvent.forTarget(this);
@DomName('SpeechSynthesisUtterance.onstart')
@DocsEditable()
Stream<SpeechSynthesisEvent> get onStart => startEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechSynthesisVoice')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
@Experimental()
class SpeechSynthesisVoice extends NativeFieldWrapperClass1 {
@DomName('SpeechSynthesisVoice.default')
@DocsEditable()
bool get defaultValue native "SpeechSynthesisVoice_default_Getter";
@DomName('SpeechSynthesisVoice.lang')
@DocsEditable()
String get lang native "SpeechSynthesisVoice_lang_Getter";
@DomName('SpeechSynthesisVoice.localService')
@DocsEditable()
bool get localService native "SpeechSynthesisVoice_localService_Getter";
@DomName('SpeechSynthesisVoice.name')
@DocsEditable()
String get name native "SpeechSynthesisVoice_name_Getter";
@DomName('SpeechSynthesisVoice.voiceURI')
@DocsEditable()
String get voiceUri native "SpeechSynthesisVoice_voiceURI_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* The type used by the
* [Window.localStorage] and [Window.sessionStorage] properties.
* Storage is implemented as a Map&lt;String, String>.
*
* To store and get values, use Dart's built-in map syntax:
*
* window.localStorage['key1'] = 'val1';
* window.localStorage['key2'] = 'val2';
* window.localStorage['key3'] = 'val3';
* assert(window.localStorage['key3'] == 'val3');
*
* You can use [Map](http://api.dartlang.org/dart_core/Map.html) APIs
* such as containsValue(), clear(), and length:
*
* assert(window.localStorage.containsValue('does not exist') == false);
* window.localStorage.clear();
* assert(window.localStorage.length == 0);
*
* For more examples of using this API, see
* [localstorage_test.dart](http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/tests/html/localstorage_test.dart).
* For details on using the Map API, see the
* [Maps](http://www.dartlang.org/docs/library-tour/#maps-aka-dictionaries-or-hashes)
* section of the library tour.
*/
@DomName('Storage')
@Unstable()
class Storage extends NativeFieldWrapperClass1
implements Map<String, String> {
// TODO(nweiz): update this when maps support lazy iteration
bool containsValue(String value) => values.any((e) => e == value);
bool containsKey(String key) => _getItem(key) != null;
String operator [](String key) => _getItem(key);
void operator []=(String key, String value) { _setItem(key, value); }
String putIfAbsent(String key, String ifAbsent()) {
if (!containsKey(key)) this[key] = ifAbsent();
return this[key];
}
String remove(String key) {
final value = this[key];
_removeItem(key);
return value;
}
void clear() => _clear();
void forEach(void f(String key, String value)) {
for (var i = 0; true; i++) {
final key = _key(i);
if (key == null) return;
f(key, this[key]);
}
}
Iterable<String> get keys {
final keys = [];
forEach((k, v) => keys.add(k));
return keys;
}
Iterable<String> get values {
final values = [];
forEach((k, v) => values.add(v));
return values;
}
int get length => _length;
bool get isEmpty => _key(0) == null;
bool get isNotEmpty => !isEmpty;
@DomName('Storage.length')
@DocsEditable()
int get _length native "Storage_length_Getter";
bool __delete__(index_OR_name) {
if ((index_OR_name is int || index_OR_name == null)) {
return ___delete___1(index_OR_name);
}
if ((index_OR_name is String || index_OR_name == null)) {
return ___delete___2(index_OR_name);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
bool ___delete___1(index_OR_name) native "Storage____delete___1_Callback";
bool ___delete___2(index_OR_name) native "Storage____delete___2_Callback";
String __getter__(index_OR_name) {
if ((index_OR_name is int || index_OR_name == null)) {
return ___getter___1(index_OR_name);
}
if ((index_OR_name is String || index_OR_name == null)) {
return ___getter___2(index_OR_name);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
String ___getter___1(index_OR_name) native "Storage____getter___1_Callback";
String ___getter___2(index_OR_name) native "Storage____getter___2_Callback";
void __setter__(index_OR_name, String value) {
if ((value is String || value == null) && (index_OR_name is int || index_OR_name == null)) {
___setter___1(index_OR_name, value);
return;
}
if ((value is String || value == null) && (index_OR_name is String || index_OR_name == null)) {
___setter___2(index_OR_name, value);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void ___setter___1(index_OR_name, value) native "Storage____setter___1_Callback";
void ___setter___2(index_OR_name, value) native "Storage____setter___2_Callback";
@DomName('Storage.clear')
@DocsEditable()
void _clear() native "Storage_clear_Callback";
@DomName('Storage.getItem')
@DocsEditable()
String _getItem(String key) native "Storage_getItem_Callback";
@DomName('Storage.key')
@DocsEditable()
String _key(int index) native "Storage_key_Callback";
@DomName('Storage.removeItem')
@DocsEditable()
void _removeItem(String key) native "Storage_removeItem_Callback";
@DomName('Storage.setItem')
@DocsEditable()
void _setItem(String key, String data) native "Storage_setItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('StorageErrorCallback')
// http://www.w3.org/TR/quota-api/#storageerrorcallback-callback
@Experimental()
typedef void StorageErrorCallback(DomError error);
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('StorageEvent')
@Unstable()
class StorageEvent extends Event {
factory StorageEvent(String type,
{bool canBubble: false, bool cancelable: false, String key, String oldValue,
String newValue, String url, Storage storageArea}) {
var e = document._createEvent("StorageEvent");
e._initStorageEvent(type, canBubble, cancelable, key, oldValue,
newValue, url, storageArea);
return e;
}
// To suppress missing implicit constructor warnings.
factory StorageEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('StorageEvent.key')
@DocsEditable()
String get key native "StorageEvent_key_Getter";
@DomName('StorageEvent.newValue')
@DocsEditable()
String get newValue native "StorageEvent_newValue_Getter";
@DomName('StorageEvent.oldValue')
@DocsEditable()
String get oldValue native "StorageEvent_oldValue_Getter";
@DomName('StorageEvent.storageArea')
@DocsEditable()
Storage get storageArea native "StorageEvent_storageArea_Getter";
@DomName('StorageEvent.url')
@DocsEditable()
String get url native "StorageEvent_url_Getter";
@DomName('StorageEvent.initStorageEvent')
@DocsEditable()
void _initStorageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, String keyArg, String oldValueArg, String newValueArg, String urlArg, Storage storageAreaArg) native "StorageEvent_initStorageEvent_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('StorageInfo')
// http://www.w3.org/TR/file-system-api/
@Experimental()
class StorageInfo extends NativeFieldWrapperClass1 {
@DomName('StorageInfo.PERSISTENT')
@DocsEditable()
static const int PERSISTENT = 1;
@DomName('StorageInfo.TEMPORARY')
@DocsEditable()
static const int TEMPORARY = 0;
@DomName('StorageInfo.queryUsageAndQuota')
@DocsEditable()
void _queryUsageAndQuota(int storageType, [StorageUsageCallback usageCallback, StorageErrorCallback errorCallback]) native "StorageInfo_queryUsageAndQuota_Callback";
@DomName('StorageInfo.requestQuota')
@DocsEditable()
void _requestQuota(int storageType, int newQuotaInBytes, [StorageQuotaCallback quotaCallback, StorageErrorCallback errorCallback]) native "StorageInfo_requestQuota_Callback";
Future<int> requestQuota(int storageType, int newQuotaInBytes) {
var completer = new Completer<int>();
_requestQuota(storageType, newQuotaInBytes,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
Future<StorageInfoUsage> queryUsageAndQuota(int storageType) {
var completer = new Completer<StorageInfoUsage>();
_queryUsageAndQuota(storageType,
(currentUsageInBytes, currentQuotaInBytes) {
completer.complete(new StorageInfoUsage(currentUsageInBytes,
currentQuotaInBytes));
},
(error) { completer.completeError(error); });
return completer.future;
}
}
/**
* A simple container class for the two values that are returned from the
* futures in requestQuota and queryUsageAndQuota.
*/
class StorageInfoUsage {
final int currentUsageInBytes;
final int currentQuotaInBytes;
const StorageInfoUsage(this.currentUsageInBytes, this.currentQuotaInBytes);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('StorageQuota')
// http://www.w3.org/TR/quota-api/#idl-def-StorageQuota
@Experimental()
class StorageQuota extends NativeFieldWrapperClass1 {
@DomName('StorageQuota.queryUsageAndQuota')
@DocsEditable()
void queryUsageAndQuota(StorageUsageCallback usageCallback, [StorageErrorCallback errorCallback]) native "StorageQuota_queryUsageAndQuota_Callback";
@DomName('StorageQuota.requestQuota')
@DocsEditable()
void requestQuota(int newQuotaInBytes, [StorageQuotaCallback quotaCallback, StorageErrorCallback errorCallback]) native "StorageQuota_requestQuota_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('StorageQuotaCallback')
// http://www.w3.org/TR/quota-api/#idl-def-StorageQuotaCallback
@Experimental()
typedef void StorageQuotaCallback(int grantedQuotaInBytes);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('StorageUsageCallback')
// http://www.w3.org/TR/quota-api/#idl-def-StorageUsageCallback
@Experimental()
typedef void StorageUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('StringCallback')
// http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html#the-datatransferitem-interface
@Experimental()
typedef void _StringCallback(String data);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLStyleElement')
class StyleElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory StyleElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLStyleElement.HTMLStyleElement')
@DocsEditable()
factory StyleElement() => document.$dom_createElement("style");
@DomName('HTMLStyleElement.disabled')
@DocsEditable()
bool get disabled native "HTMLStyleElement_disabled_Getter";
@DomName('HTMLStyleElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLStyleElement_disabled_Setter";
@DomName('HTMLStyleElement.media')
@DocsEditable()
String get media native "HTMLStyleElement_media_Getter";
@DomName('HTMLStyleElement.media')
@DocsEditable()
void set media(String value) native "HTMLStyleElement_media_Setter";
@DomName('HTMLStyleElement.scoped')
@DocsEditable()
bool get scoped native "HTMLStyleElement_scoped_Getter";
@DomName('HTMLStyleElement.scoped')
@DocsEditable()
void set scoped(bool value) native "HTMLStyleElement_scoped_Setter";
@DomName('HTMLStyleElement.sheet')
@DocsEditable()
StyleSheet get sheet native "HTMLStyleElement_sheet_Getter";
@DomName('HTMLStyleElement.type')
@DocsEditable()
String get type native "HTMLStyleElement_type_Getter";
@DomName('HTMLStyleElement.type')
@DocsEditable()
void set type(String value) native "HTMLStyleElement_type_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('StyleMedia')
// http://developer.apple.com/library/safari/#documentation/SafariDOMAdditions/Reference/StyleMedia/StyleMedia/StyleMedia.html
@Experimental() // nonstandard
class StyleMedia extends NativeFieldWrapperClass1 {
@DomName('StyleMedia.type')
@DocsEditable()
String get type native "StyleMedia_type_Getter";
@DomName('StyleMedia.matchMedium')
@DocsEditable()
bool matchMedium(String mediaquery) native "StyleMedia_matchMedium_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('StyleSheet')
class StyleSheet extends NativeFieldWrapperClass1 {
@DomName('StyleSheet.disabled')
@DocsEditable()
bool get disabled native "StyleSheet_disabled_Getter";
@DomName('StyleSheet.disabled')
@DocsEditable()
void set disabled(bool value) native "StyleSheet_disabled_Setter";
@DomName('StyleSheet.href')
@DocsEditable()
String get href native "StyleSheet_href_Getter";
@DomName('StyleSheet.media')
@DocsEditable()
MediaList get media native "StyleSheet_media_Getter";
@DomName('StyleSheet.ownerNode')
@DocsEditable()
Node get ownerNode native "StyleSheet_ownerNode_Getter";
@DomName('StyleSheet.parentStyleSheet')
@DocsEditable()
StyleSheet get parentStyleSheet native "StyleSheet_parentStyleSheet_Getter";
@DomName('StyleSheet.title')
@DocsEditable()
String get title native "StyleSheet_title_Getter";
@DomName('StyleSheet.type')
@DocsEditable()
String get type native "StyleSheet_type_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SubtleCrypto')
@Experimental() // untriaged
class SubtleCrypto extends NativeFieldWrapperClass1 {
@DomName('SubtleCrypto.decrypt')
@DocsEditable()
@Experimental() // untriaged
Object decrypt(Map algorithm, CryptoKey key, TypedData data) native "SubtleCrypto_decrypt_Callback";
@DomName('SubtleCrypto.digest')
@DocsEditable()
@Experimental() // untriaged
Object digest(Map algorithm, TypedData data) native "SubtleCrypto_digest_Callback";
@DomName('SubtleCrypto.encrypt')
@DocsEditable()
@Experimental() // untriaged
Object encrypt(Map algorithm, CryptoKey key, TypedData data) native "SubtleCrypto_encrypt_Callback";
@DomName('SubtleCrypto.generateKey')
@DocsEditable()
@Experimental() // untriaged
Object generateKey(Map algorithm, bool extractable, List<String> keyUsages) native "SubtleCrypto_generateKey_Callback";
@DomName('SubtleCrypto.importKey')
@DocsEditable()
@Experimental() // untriaged
Object importKey(String format, TypedData keyData, Map algorithm, bool extractable, List<String> keyUsages) native "SubtleCrypto_importKey_Callback";
@DomName('SubtleCrypto.sign')
@DocsEditable()
@Experimental() // untriaged
Object sign(Map algorithm, CryptoKey key, TypedData data) native "SubtleCrypto_sign_Callback";
@DomName('SubtleCrypto.verify')
@DocsEditable()
@Experimental() // untriaged
Object verify(Map algorithm, CryptoKey key, TypedData signature, TypedData data) native "SubtleCrypto_verify_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLTableCaptionElement')
class TableCaptionElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TableCaptionElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTableCaptionElement.HTMLTableCaptionElement')
@DocsEditable()
factory TableCaptionElement() => document.$dom_createElement("caption");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLTableCellElement')
class TableCellElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TableCellElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTableCellElement.HTMLTableCellElement')
@DocsEditable()
factory TableCellElement() => document.$dom_createElement("td");
@DomName('HTMLTableCellElement.cellIndex')
@DocsEditable()
int get cellIndex native "HTMLTableCellElement_cellIndex_Getter";
@DomName('HTMLTableCellElement.colSpan')
@DocsEditable()
int get colSpan native "HTMLTableCellElement_colSpan_Getter";
@DomName('HTMLTableCellElement.colSpan')
@DocsEditable()
void set colSpan(int value) native "HTMLTableCellElement_colSpan_Setter";
@DomName('HTMLTableCellElement.headers')
@DocsEditable()
String get headers native "HTMLTableCellElement_headers_Getter";
@DomName('HTMLTableCellElement.headers')
@DocsEditable()
void set headers(String value) native "HTMLTableCellElement_headers_Setter";
@DomName('HTMLTableCellElement.rowSpan')
@DocsEditable()
int get rowSpan native "HTMLTableCellElement_rowSpan_Getter";
@DomName('HTMLTableCellElement.rowSpan')
@DocsEditable()
void set rowSpan(int value) native "HTMLTableCellElement_rowSpan_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLTableColElement')
class TableColElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TableColElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTableColElement.HTMLTableColElement')
@DocsEditable()
factory TableColElement() => document.$dom_createElement("col");
@DomName('HTMLTableColElement.span')
@DocsEditable()
int get span native "HTMLTableColElement_span_Getter";
@DomName('HTMLTableColElement.span')
@DocsEditable()
void set span(int value) native "HTMLTableColElement_span_Setter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('HTMLTableElement')
class TableElement extends HtmlElement {
@DomName('HTMLTableElement.tBodies')
List<TableSectionElement> get tBodies =>
new _WrappedList<TableSectionElement>(_tBodies);
@DomName('HTMLTableElement.rows')
List<TableRowElement> get rows =>
new _WrappedList<TableRowElement>(_rows);
TableRowElement addRow() {
return insertRow(-1);
}
TableCaptionElement createCaption() => _createCaption();
TableSectionElement createTBody() => _createTBody();
TableSectionElement createTFoot() => _createTFoot();
TableSectionElement createTHead() => _createTHead();
TableRowElement insertRow(int index) => _insertRow(index);
// To suppress missing implicit constructor warnings.
factory TableElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTableElement.HTMLTableElement')
@DocsEditable()
factory TableElement() => document.$dom_createElement("table");
@DomName('HTMLTableElement.border')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLTableElement-partial
@deprecated // deprecated
String get border native "HTMLTableElement_border_Getter";
@DomName('HTMLTableElement.border')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#HTMLTableElement-partial
@deprecated // deprecated
void set border(String value) native "HTMLTableElement_border_Setter";
@DomName('HTMLTableElement.caption')
@DocsEditable()
TableCaptionElement get caption native "HTMLTableElement_caption_Getter";
@DomName('HTMLTableElement.caption')
@DocsEditable()
void set caption(TableCaptionElement value) native "HTMLTableElement_caption_Setter";
@DomName('HTMLTableElement.rows')
@DocsEditable()
HtmlCollection get _rows native "HTMLTableElement_rows_Getter";
@DomName('HTMLTableElement.tBodies')
@DocsEditable()
HtmlCollection get _tBodies native "HTMLTableElement_tBodies_Getter";
@DomName('HTMLTableElement.tFoot')
@DocsEditable()
TableSectionElement get tFoot native "HTMLTableElement_tFoot_Getter";
@DomName('HTMLTableElement.tFoot')
@DocsEditable()
void set tFoot(TableSectionElement value) native "HTMLTableElement_tFoot_Setter";
@DomName('HTMLTableElement.tHead')
@DocsEditable()
TableSectionElement get tHead native "HTMLTableElement_tHead_Getter";
@DomName('HTMLTableElement.tHead')
@DocsEditable()
void set tHead(TableSectionElement value) native "HTMLTableElement_tHead_Setter";
@DomName('HTMLTableElement.createCaption')
@DocsEditable()
HtmlElement _createCaption() native "HTMLTableElement_createCaption_Callback";
@DomName('HTMLTableElement.createTBody')
@DocsEditable()
HtmlElement _createTBody() native "HTMLTableElement_createTBody_Callback";
@DomName('HTMLTableElement.createTFoot')
@DocsEditable()
HtmlElement _createTFoot() native "HTMLTableElement_createTFoot_Callback";
@DomName('HTMLTableElement.createTHead')
@DocsEditable()
HtmlElement _createTHead() native "HTMLTableElement_createTHead_Callback";
@DomName('HTMLTableElement.deleteCaption')
@DocsEditable()
void deleteCaption() native "HTMLTableElement_deleteCaption_Callback";
@DomName('HTMLTableElement.deleteRow')
@DocsEditable()
void deleteRow(int index) native "HTMLTableElement_deleteRow_Callback";
@DomName('HTMLTableElement.deleteTFoot')
@DocsEditable()
void deleteTFoot() native "HTMLTableElement_deleteTFoot_Callback";
@DomName('HTMLTableElement.deleteTHead')
@DocsEditable()
void deleteTHead() native "HTMLTableElement_deleteTHead_Callback";
@DomName('HTMLTableElement.insertRow')
@DocsEditable()
HtmlElement _insertRow(int index) native "HTMLTableElement_insertRow_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('HTMLTableRowElement')
class TableRowElement extends HtmlElement {
@DomName('HTMLTableRowElement.cells')
List<TableCellElement> get cells =>
new _WrappedList<TableCellElement>(_cells);
TableCellElement addCell() {
return insertCell(-1);
}
TableCellElement insertCell(int index) => _insertCell(index);
// To suppress missing implicit constructor warnings.
factory TableRowElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTableRowElement.HTMLTableRowElement')
@DocsEditable()
factory TableRowElement() => document.$dom_createElement("tr");
@DomName('HTMLTableRowElement.cells')
@DocsEditable()
HtmlCollection get _cells native "HTMLTableRowElement_cells_Getter";
@DomName('HTMLTableRowElement.rowIndex')
@DocsEditable()
int get rowIndex native "HTMLTableRowElement_rowIndex_Getter";
@DomName('HTMLTableRowElement.sectionRowIndex')
@DocsEditable()
int get sectionRowIndex native "HTMLTableRowElement_sectionRowIndex_Getter";
@DomName('HTMLTableRowElement.deleteCell')
@DocsEditable()
void deleteCell(int index) native "HTMLTableRowElement_deleteCell_Callback";
@DomName('HTMLTableRowElement.insertCell')
@DocsEditable()
HtmlElement _insertCell(int index) native "HTMLTableRowElement_insertCell_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('HTMLTableSectionElement')
class TableSectionElement extends HtmlElement {
@DomName('HTMLTableSectionElement.rows')
List<TableRowElement> get rows =>
new _WrappedList<TableRowElement>(_rows);
TableRowElement addRow() {
return insertRow(-1);
}
TableRowElement insertRow(int index) => _insertRow(index);
// To suppress missing implicit constructor warnings.
factory TableSectionElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTableSectionElement.rows')
@DocsEditable()
HtmlCollection get _rows native "HTMLTableSectionElement_rows_Getter";
@DomName('HTMLTableSectionElement.deleteRow')
@DocsEditable()
void deleteRow(int index) native "HTMLTableSectionElement_deleteRow_Callback";
@DomName('HTMLTableSectionElement.insertRow')
@DocsEditable()
HtmlElement _insertRow(int index) native "HTMLTableSectionElement_insertRow_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
/**
* Model-Driven Views (MDV)'s native features enables a wide-range of use cases,
* but (by design) don't attempt to implement a wide array of specialized
* behaviors.
*
* Enabling these features in MDV is a matter of implementing and registering an
* MDV Custom Syntax. A Custom Syntax is an object which contains one or more
* delegation functions which implement specialized behavior. This object is
* registered with MDV via [Element.bindingDelegate]:
*
*
* HTML:
* <template bind>
* {{ What!Ever('crazy')->thing^^^I+Want(data) }}
* </template>
*
* Dart:
* class MySyntax extends BindingDelegate {
* getBinding(model, path, name, node) {
* // The magic happens here!
* }
* }
* ...
* query('template').bindingDelegate = new MySyntax();
* query('template').model = new MyModel();
*
* See <https://github.com/polymer-project/mdv/blob/master/docs/syntax.md> for
* more information about Custom Syntax.
*/
// TODO(jmesserly): move this type to the MDV package? Two issues: we'd lose
// type annotation on [Element.bindingDelegate], and "mdv" is normally imported
// with a prefix.
@Experimental()
abstract class BindingDelegate {
/**
* This syntax method allows for a custom interpretation of the contents of
* mustaches (`{{` ... `}}`).
*
* When a template is inserting an instance, it will invoke this method for
* each mustache which is encountered. The function is invoked with four
* arguments:
*
* - [model]: The data context for which this instance is being created.
* - [path]: The text contents (trimmed of outer whitespace) of the mustache.
* - [name]: The context in which the mustache occurs. Within element
* attributes, this will be the name of the attribute. Within text,
* this will be 'text'.
* - [node]: A reference to the node to which this binding will be created.
*
* If the method wishes to handle binding, it is required to return an object
* which has at least a `value` property that can be observed. If it does,
* then MDV will call [Node.bind on the node:
*
* node.bind(name, retval, 'value');
*
* If the 'getBinding' does not wish to override the binding, it should return
* null.
*/
// TODO(jmesserly): I had to remove type annotations from "name" and "node"
// Normally they are String and Node respectively. But sometimes it will pass
// (int name, CompoundBinding node). That seems very confusing; we may want
// to change this API.
getBinding(model, String path, name, node) => null;
/**
* This syntax method allows a syntax to provide an alterate model than the
* one the template would otherwise use when producing an instance.
*
* When a template is about to create an instance, it will invoke this method
* The function is invoked with two arguments:
*
* - [template]: The template element which is about to create and insert an
* instance.
* - [model]: The data context for which this instance is being created.
*
* The template element will always use the return value of `getInstanceModel`
* as the model for the new instance. If the syntax does not wish to override
* the value, it should simply return the `model` value it was passed.
*/
getInstanceModel(Element template, model) => model;
}
@Experimental()
@DomName('HTMLTemplateElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#template-element
class TemplateElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TemplateElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTemplateElement.HTMLTemplateElement')
@DocsEditable()
factory TemplateElement() => document.$dom_createElement("template");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLTemplateElement.content')
@DocsEditable()
DocumentFragment get _content native "HTMLTemplateElement_content_Getter";
// For real TemplateElement use the actual DOM .content field instead of
// our polyfilled expando.
@Experimental()
DocumentFragment get content => _content;
/**
* The MDV package, if available.
*
* This can be used to initialize MDV support via:
*
* import 'dart:html';
* import 'package:mdv/mdv.dart' as mdv;
* main() {
* mdv.initialize();
* }
*/
static Function mdvPackage = (node) {
throw new UnsupportedError("The MDV package is not available. "
"You can enable it with `import 'package:mdv/mdv.dart' as mdv;` and "
"`mdv.initialize()`");
};
/**
* Ensures proper API and content model for template elements.
*
* [instanceRef] can be used to set the [Element.ref] property of [template],
* and use the ref's content will be used as source when createInstance() is
* invoked.
*
* Returns true if this template was just decorated, or false if it was
* already decorated.
*/
@Experimental()
static bool decorate(Element template, [Element instanceRef]) {
// == true check because it starts as a null field.
if (template._templateIsDecorated == true) return false;
_injectStylesheet();
var templateElement = template;
templateElement._templateIsDecorated = true;
var isNative = templateElement is TemplateElement;
var bootstrapContents = isNative;
var liftContents = !isNative;
var liftRoot = false;
if (!isNative && templateElement._isAttributeTemplate) {
if (instanceRef != null) {
// TODO(jmesserly): this is just an assert in MDV.
throw new ArgumentError('instanceRef should not be supplied for '
'attribute templates.');
}
templateElement = _extractTemplateFromAttributeTemplate(template);
templateElement._templateIsDecorated = true;
isNative = templateElement is TemplateElement;
liftRoot = true;
}
if (!isNative) {
var doc = _getTemplateContentsOwner(templateElement.document);
templateElement._templateContent = doc.createDocumentFragment();
}
if (instanceRef != null) {
// template is contained within an instance, its direct content must be
// empty
templateElement._templateInstanceRef = instanceRef;
} else if (liftContents) {
_liftNonNativeChildrenIntoContent(templateElement, template, liftRoot);
} else if (bootstrapContents) {
bootstrap(templateElement.content);
}
return true;
}
// http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#dfn-template-contents-owner
static Document _getTemplateContentsOwner(HtmlDocument doc) {
if (doc.window == null) {
return doc;
}
var d = doc._templateContentsOwner;
if (d == null) {
// TODO(arv): This should either be a Document or HTMLDocument depending
// on doc.
d = doc.implementation.createHtmlDocument('');
while (d.lastChild != null) {
d.lastChild.remove();
}
doc._templateContentsOwner = d;
}
return d;
}
// For non-template browsers, the parser will disallow <template> in certain
// locations, so we allow "attribute templates" which combine the template
// element with the top-level container node of the content, e.g.
//
// <tr template repeat="{{ foo }}"" class="bar"><td>Bar</td></tr>
//
// becomes
//
// <template repeat="{{ foo }}">
// + #document-fragment
// + <tr class="bar">
// + <td>Bar</td>
//
static Element _extractTemplateFromAttributeTemplate(Element el) {
var template = el.document.$dom_createElement('template');
el.parentNode.insertBefore(template, el);
for (var name in el.attributes.keys.toList()) {
switch (name) {
case 'template':
el.attributes.remove(name);
break;
case 'repeat':
case 'bind':
case 'ref':
template.attributes[name] = el.attributes.remove(name);
break;
}
}
return template;
}
static void _liftNonNativeChildrenIntoContent(Element template, Element el,
bool useRoot) {
var content = template.content;
if (useRoot) {
content.append(el);
return;
}
var child;
while ((child = el.firstChild) != null) {
content.append(child);
}
}
/**
* This used to decorate recursively all templates from a given node.
*
* By default [decorate] will be called on templates lazily when certain
* properties such as [model] are accessed, but it can be run eagerly to
* decorate an entire tree recursively.
*/
// TODO(rafaelw): Review whether this is the right public API.
@Experimental()
static void bootstrap(Node content) {
void _bootstrap(template) {
if (!TemplateElement.decorate(template)) {
bootstrap(template.content);
}
}
// Need to do this first as the contents may get lifted if |node| is
// template.
// TODO(jmesserly): content is DocumentFragment or Element
var descendents = (content as dynamic).queryAll(_allTemplatesSelectors);
if (content is Element && (content as Element).isTemplate) {
_bootstrap(content);
}
descendents.forEach(_bootstrap);
}
static final String _allTemplatesSelectors =
'template, option[template], optgroup[template], ' +
Element._TABLE_TAGS.keys.map((k) => "$k[template]").join(", ");
static bool _initStyles;
static void _injectStylesheet() {
if (_initStyles == true) return;
_initStyles = true;
var style = new StyleElement();
style.text = r'''
template,
thead[template],
tbody[template],
tfoot[template],
th[template],
tr[template],
td[template],
caption[template],
colgroup[template],
col[template],
option[template] {
display: none;
}''';
document.head.append(style);
}
/**
* An override to place the contents into content rather than as child nodes.
*
* See also:
*
* * <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#innerhtml-on-templates>
*/
void setInnerHtml(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
text = null;
var fragment = createFragment(
html, validator: validator, treeSanitizer: treeSanitizer);
content.append(fragment);
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('Text')
class Text extends CharacterData {
factory Text(String data) => document._createTextNode(data);
// To suppress missing implicit constructor warnings.
factory Text._() { throw new UnsupportedError("Not supported"); }
@DomName('Text.wholeText')
@DocsEditable()
String get wholeText native "Text_wholeText_Getter";
@DomName('Text.getDestinationInsertionPoints')
@DocsEditable()
@Experimental() // untriaged
List<Node> getDestinationInsertionPoints() native "Text_getDestinationInsertionPoints_Callback";
@DomName('Text.replaceWholeText')
@DocsEditable()
// http://dom.spec.whatwg.org/#dom-text-replacewholetext
@deprecated // deprecated
Text replaceWholeText(String content) native "Text_replaceWholeText_Callback";
@DomName('Text.splitText')
@DocsEditable()
Text splitText(int offset) native "Text_splitText_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLTextAreaElement')
class TextAreaElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TextAreaElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTextAreaElement.HTMLTextAreaElement')
@DocsEditable()
factory TextAreaElement() => document.$dom_createElement("textarea");
@DomName('HTMLTextAreaElement.autofocus')
@DocsEditable()
bool get autofocus native "HTMLTextAreaElement_autofocus_Getter";
@DomName('HTMLTextAreaElement.autofocus')
@DocsEditable()
void set autofocus(bool value) native "HTMLTextAreaElement_autofocus_Setter";
@DomName('HTMLTextAreaElement.cols')
@DocsEditable()
int get cols native "HTMLTextAreaElement_cols_Getter";
@DomName('HTMLTextAreaElement.cols')
@DocsEditable()
void set cols(int value) native "HTMLTextAreaElement_cols_Setter";
@DomName('HTMLTextAreaElement.defaultValue')
@DocsEditable()
String get defaultValue native "HTMLTextAreaElement_defaultValue_Getter";
@DomName('HTMLTextAreaElement.defaultValue')
@DocsEditable()
void set defaultValue(String value) native "HTMLTextAreaElement_defaultValue_Setter";
@DomName('HTMLTextAreaElement.dirName')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-textarea-dirname
@Experimental()
String get dirName native "HTMLTextAreaElement_dirName_Getter";
@DomName('HTMLTextAreaElement.dirName')
@DocsEditable()
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-textarea-dirname
@Experimental()
void set dirName(String value) native "HTMLTextAreaElement_dirName_Setter";
@DomName('HTMLTextAreaElement.disabled')
@DocsEditable()
bool get disabled native "HTMLTextAreaElement_disabled_Getter";
@DomName('HTMLTextAreaElement.disabled')
@DocsEditable()
void set disabled(bool value) native "HTMLTextAreaElement_disabled_Setter";
@DomName('HTMLTextAreaElement.form')
@DocsEditable()
FormElement get form native "HTMLTextAreaElement_form_Getter";
@DomName('HTMLTextAreaElement.inputMode')
@DocsEditable()
@Experimental() // untriaged
String get inputMode native "HTMLTextAreaElement_inputMode_Getter";
@DomName('HTMLTextAreaElement.inputMode')
@DocsEditable()
@Experimental() // untriaged
void set inputMode(String value) native "HTMLTextAreaElement_inputMode_Setter";
@DomName('HTMLTextAreaElement.labels')
@DocsEditable()
@Unstable()
List<Node> get labels native "HTMLTextAreaElement_labels_Getter";
@DomName('HTMLTextAreaElement.maxLength')
@DocsEditable()
int get maxLength native "HTMLTextAreaElement_maxLength_Getter";
@DomName('HTMLTextAreaElement.maxLength')
@DocsEditable()
void set maxLength(int value) native "HTMLTextAreaElement_maxLength_Setter";
@DomName('HTMLTextAreaElement.name')
@DocsEditable()
String get name native "HTMLTextAreaElement_name_Getter";
@DomName('HTMLTextAreaElement.name')
@DocsEditable()
void set name(String value) native "HTMLTextAreaElement_name_Setter";
@DomName('HTMLTextAreaElement.placeholder')
@DocsEditable()
String get placeholder native "HTMLTextAreaElement_placeholder_Getter";
@DomName('HTMLTextAreaElement.placeholder')
@DocsEditable()
void set placeholder(String value) native "HTMLTextAreaElement_placeholder_Setter";
@DomName('HTMLTextAreaElement.readOnly')
@DocsEditable()
bool get readOnly native "HTMLTextAreaElement_readOnly_Getter";
@DomName('HTMLTextAreaElement.readOnly')
@DocsEditable()
void set readOnly(bool value) native "HTMLTextAreaElement_readOnly_Setter";
@DomName('HTMLTextAreaElement.required')
@DocsEditable()
bool get required native "HTMLTextAreaElement_required_Getter";
@DomName('HTMLTextAreaElement.required')
@DocsEditable()
void set required(bool value) native "HTMLTextAreaElement_required_Setter";
@DomName('HTMLTextAreaElement.rows')
@DocsEditable()
int get rows native "HTMLTextAreaElement_rows_Getter";
@DomName('HTMLTextAreaElement.rows')
@DocsEditable()
void set rows(int value) native "HTMLTextAreaElement_rows_Setter";
@DomName('HTMLTextAreaElement.selectionDirection')
@DocsEditable()
String get selectionDirection native "HTMLTextAreaElement_selectionDirection_Getter";
@DomName('HTMLTextAreaElement.selectionDirection')
@DocsEditable()
void set selectionDirection(String value) native "HTMLTextAreaElement_selectionDirection_Setter";
@DomName('HTMLTextAreaElement.selectionEnd')
@DocsEditable()
int get selectionEnd native "HTMLTextAreaElement_selectionEnd_Getter";
@DomName('HTMLTextAreaElement.selectionEnd')
@DocsEditable()
void set selectionEnd(int value) native "HTMLTextAreaElement_selectionEnd_Setter";
@DomName('HTMLTextAreaElement.selectionStart')
@DocsEditable()
int get selectionStart native "HTMLTextAreaElement_selectionStart_Getter";
@DomName('HTMLTextAreaElement.selectionStart')
@DocsEditable()
void set selectionStart(int value) native "HTMLTextAreaElement_selectionStart_Setter";
@DomName('HTMLTextAreaElement.textLength')
@DocsEditable()
int get textLength native "HTMLTextAreaElement_textLength_Getter";
@DomName('HTMLTextAreaElement.type')
@DocsEditable()
String get type native "HTMLTextAreaElement_type_Getter";
@DomName('HTMLTextAreaElement.validationMessage')
@DocsEditable()
String get validationMessage native "HTMLTextAreaElement_validationMessage_Getter";
@DomName('HTMLTextAreaElement.validity')
@DocsEditable()
ValidityState get validity native "HTMLTextAreaElement_validity_Getter";
@DomName('HTMLTextAreaElement.value')
@DocsEditable()
String get value native "HTMLTextAreaElement_value_Getter";
@DomName('HTMLTextAreaElement.value')
@DocsEditable()
void set value(String value) native "HTMLTextAreaElement_value_Setter";
@DomName('HTMLTextAreaElement.willValidate')
@DocsEditable()
bool get willValidate native "HTMLTextAreaElement_willValidate_Getter";
@DomName('HTMLTextAreaElement.wrap')
@DocsEditable()
String get wrap native "HTMLTextAreaElement_wrap_Getter";
@DomName('HTMLTextAreaElement.wrap')
@DocsEditable()
void set wrap(String value) native "HTMLTextAreaElement_wrap_Setter";
@DomName('HTMLTextAreaElement.checkValidity')
@DocsEditable()
bool checkValidity() native "HTMLTextAreaElement_checkValidity_Callback";
@DomName('HTMLTextAreaElement.select')
@DocsEditable()
void select() native "HTMLTextAreaElement_select_Callback";
@DomName('HTMLTextAreaElement.setCustomValidity')
@DocsEditable()
void setCustomValidity(String error) native "HTMLTextAreaElement_setCustomValidity_Callback";
void setRangeText(String replacement, {int start, int end, String selectionMode}) {
if ((replacement is String || replacement == null) && start == null && end == null && selectionMode == null) {
_setRangeText_1(replacement);
return;
}
if ((selectionMode is String || selectionMode == null) && (end is int || end == null) && (start is int || start == null) && (replacement is String || replacement == null)) {
_setRangeText_2(replacement, start, end, selectionMode);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
void _setRangeText_1(replacement) native "HTMLTextAreaElement__setRangeText_1_Callback";
void _setRangeText_2(replacement, start, end, selectionMode) native "HTMLTextAreaElement__setRangeText_2_Callback";
void setSelectionRange(int start, int end, [String direction]) {
if (direction != null) {
_setSelectionRange_1(start, end, direction);
return;
}
_setSelectionRange_2(start, end);
return;
}
void _setSelectionRange_1(start, end, direction) native "HTMLTextAreaElement__setSelectionRange_1_Callback";
void _setSelectionRange_2(start, end) native "HTMLTextAreaElement__setSelectionRange_2_Callback";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('TextEvent')
@Unstable()
class TextEvent extends UIEvent {
factory TextEvent(String type,
{bool canBubble: false, bool cancelable: false, Window view, String data}) {
if (view == null) {
view = window;
}
var e = document._createEvent("TextEvent");
e._initTextEvent(type, canBubble, cancelable, view, data);
return e;
}
// To suppress missing implicit constructor warnings.
factory TextEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('TextEvent.data')
@DocsEditable()
String get data native "TextEvent_data_Getter";
@DomName('TextEvent.initTextEvent')
@DocsEditable()
void _initTextEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Window viewArg, String dataArg) native "TextEvent_initTextEvent_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TextMetrics')
class TextMetrics extends NativeFieldWrapperClass1 {
@DomName('TextMetrics.width')
@DocsEditable()
double get width native "TextMetrics_width_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TextTrack')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrack
@Experimental()
class TextTrack extends EventTarget {
// To suppress missing implicit constructor warnings.
factory TextTrack._() { throw new UnsupportedError("Not supported"); }
@DomName('TextTrack.cuechangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> cueChangeEvent = const EventStreamProvider<Event>('cuechange');
@DomName('TextTrack.activeCues')
@DocsEditable()
TextTrackCueList get activeCues native "TextTrack_activeCues_Getter";
@DomName('TextTrack.cues')
@DocsEditable()
TextTrackCueList get cues native "TextTrack_cues_Getter";
@DomName('TextTrack.kind')
@DocsEditable()
String get kind native "TextTrack_kind_Getter";
@DomName('TextTrack.label')
@DocsEditable()
String get label native "TextTrack_label_Getter";
@DomName('TextTrack.language')
@DocsEditable()
String get language native "TextTrack_language_Getter";
@DomName('TextTrack.mode')
@DocsEditable()
String get mode native "TextTrack_mode_Getter";
@DomName('TextTrack.mode')
@DocsEditable()
void set mode(String value) native "TextTrack_mode_Setter";
@DomName('TextTrack.addCue')
@DocsEditable()
void addCue(TextTrackCue cue) native "TextTrack_addCue_Callback";
@DomName('TextTrack.removeCue')
@DocsEditable()
void removeCue(TextTrackCue cue) native "TextTrack_removeCue_Callback";
@DomName('TextTrack.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrack_addEventListener_Callback";
@DomName('TextTrack.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "TextTrack_dispatchEvent_Callback";
@DomName('TextTrack.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrack_removeEventListener_Callback";
@DomName('TextTrack.oncuechange')
@DocsEditable()
Stream<Event> get onCueChange => cueChangeEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TextTrackCue')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue
@Experimental()
class TextTrackCue extends EventTarget {
// To suppress missing implicit constructor warnings.
factory TextTrackCue._() { throw new UnsupportedError("Not supported"); }
@DomName('TextTrackCue.enterEvent')
@DocsEditable()
static const EventStreamProvider<Event> enterEvent = const EventStreamProvider<Event>('enter');
@DomName('TextTrackCue.exitEvent')
@DocsEditable()
static const EventStreamProvider<Event> exitEvent = const EventStreamProvider<Event>('exit');
@DomName('TextTrackCue.TextTrackCue')
@DocsEditable()
factory TextTrackCue(num startTime, num endTime, String text) {
return TextTrackCue._create_1(startTime, endTime, text);
}
@DocsEditable()
static TextTrackCue _create_1(startTime, endTime, text) native "TextTrackCue__create_1constructorCallback";
@DomName('TextTrackCue.align')
@DocsEditable()
@Experimental() // nonstandard
String get align native "TextTrackCue_align_Getter";
@DomName('TextTrackCue.align')
@DocsEditable()
@Experimental() // nonstandard
void set align(String value) native "TextTrackCue_align_Setter";
@DomName('TextTrackCue.endTime')
@DocsEditable()
num get endTime native "TextTrackCue_endTime_Getter";
@DomName('TextTrackCue.endTime')
@DocsEditable()
void set endTime(num value) native "TextTrackCue_endTime_Setter";
@DomName('TextTrackCue.id')
@DocsEditable()
String get id native "TextTrackCue_id_Getter";
@DomName('TextTrackCue.id')
@DocsEditable()
void set id(String value) native "TextTrackCue_id_Setter";
@DomName('TextTrackCue.line')
@DocsEditable()
@Experimental() // nonstandard
int get line native "TextTrackCue_line_Getter";
@DomName('TextTrackCue.line')
@DocsEditable()
@Experimental() // nonstandard
void set line(int value) native "TextTrackCue_line_Setter";
@DomName('TextTrackCue.pauseOnExit')
@DocsEditable()
bool get pauseOnExit native "TextTrackCue_pauseOnExit_Getter";
@DomName('TextTrackCue.pauseOnExit')
@DocsEditable()
void set pauseOnExit(bool value) native "TextTrackCue_pauseOnExit_Setter";
@DomName('TextTrackCue.position')
@DocsEditable()
@Experimental() // nonstandard
int get position native "TextTrackCue_position_Getter";
@DomName('TextTrackCue.position')
@DocsEditable()
@Experimental() // nonstandard
void set position(int value) native "TextTrackCue_position_Setter";
@DomName('TextTrackCue.size')
@DocsEditable()
@Experimental() // nonstandard
int get size native "TextTrackCue_size_Getter";
@DomName('TextTrackCue.size')
@DocsEditable()
@Experimental() // nonstandard
void set size(int value) native "TextTrackCue_size_Setter";
@DomName('TextTrackCue.snapToLines')
@DocsEditable()
@Experimental() // nonstandard
bool get snapToLines native "TextTrackCue_snapToLines_Getter";
@DomName('TextTrackCue.snapToLines')
@DocsEditable()
@Experimental() // nonstandard
void set snapToLines(bool value) native "TextTrackCue_snapToLines_Setter";
@DomName('TextTrackCue.startTime')
@DocsEditable()
num get startTime native "TextTrackCue_startTime_Getter";
@DomName('TextTrackCue.startTime')
@DocsEditable()
void set startTime(num value) native "TextTrackCue_startTime_Setter";
@DomName('TextTrackCue.text')
@DocsEditable()
@Experimental() // nonstandard
String get text native "TextTrackCue_text_Getter";
@DomName('TextTrackCue.text')
@DocsEditable()
@Experimental() // nonstandard
void set text(String value) native "TextTrackCue_text_Setter";
@DomName('TextTrackCue.track')
@DocsEditable()
TextTrack get track native "TextTrackCue_track_Getter";
@DomName('TextTrackCue.vertical')
@DocsEditable()
@Experimental() // nonstandard
String get vertical native "TextTrackCue_vertical_Getter";
@DomName('TextTrackCue.vertical')
@DocsEditable()
@Experimental() // nonstandard
void set vertical(String value) native "TextTrackCue_vertical_Setter";
@DomName('TextTrackCue.getCueAsHTML')
@DocsEditable()
@Experimental() // nonstandard
DocumentFragment getCueAsHtml() native "TextTrackCue_getCueAsHTML_Callback";
@DomName('TextTrackCue.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrackCue_addEventListener_Callback";
@DomName('TextTrackCue.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "TextTrackCue_dispatchEvent_Callback";
@DomName('TextTrackCue.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrackCue_removeEventListener_Callback";
@DomName('TextTrackCue.onenter')
@DocsEditable()
Stream<Event> get onEnter => enterEvent.forTarget(this);
@DomName('TextTrackCue.onexit')
@DocsEditable()
Stream<Event> get onExit => exitEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TextTrackCueList')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcuelist
@Experimental()
class TextTrackCueList extends NativeFieldWrapperClass1 with ListMixin<TextTrackCue>, ImmutableListMixin<TextTrackCue> implements List<TextTrackCue> {
@DomName('TextTrackCueList.length')
@DocsEditable()
int get length native "TextTrackCueList_length_Getter";
TextTrackCue operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
TextTrackCue _nativeIndexedGetter(int index) native "TextTrackCueList_item_Callback";
void operator[]=(int index, TextTrackCue value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<TextTrackCue> mixins.
// TextTrackCue is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
TextTrackCue get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
TextTrackCue get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
TextTrackCue get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
TextTrackCue elementAt(int index) => this[index];
// -- end List<TextTrackCue> mixins.
@DomName('TextTrackCueList.getCueById')
@DocsEditable()
TextTrackCue getCueById(String id) native "TextTrackCueList_getCueById_Callback";
@DomName('TextTrackCueList.item')
@DocsEditable()
TextTrackCue item(int index) native "TextTrackCueList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TextTrackList')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttracklist
@Experimental()
class TextTrackList extends EventTarget with ListMixin<TextTrack>, ImmutableListMixin<TextTrack> implements List<TextTrack> {
// To suppress missing implicit constructor warnings.
factory TextTrackList._() { throw new UnsupportedError("Not supported"); }
@DomName('TextTrackList.addtrackEvent')
@DocsEditable()
static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStreamProvider<TrackEvent>('addtrack');
@DomName('TextTrackList.length')
@DocsEditable()
int get length native "TextTrackList_length_Getter";
TextTrack operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
TextTrack _nativeIndexedGetter(int index) native "TextTrackList_item_Callback";
void operator[]=(int index, TextTrack value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<TextTrack> mixins.
// TextTrack is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
TextTrack get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
TextTrack get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
TextTrack get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
TextTrack elementAt(int index) => this[index];
// -- end List<TextTrack> mixins.
@DomName('TextTrackList.item')
@DocsEditable()
TextTrack item(int index) native "TextTrackList_item_Callback";
@DomName('TextTrackList.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrackList_addEventListener_Callback";
@DomName('TextTrackList.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "TextTrackList_dispatchEvent_Callback";
@DomName('TextTrackList.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrackList_removeEventListener_Callback";
@DomName('TextTrackList.onaddtrack')
@DocsEditable()
Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TimeRanges')
@Unstable()
class TimeRanges extends NativeFieldWrapperClass1 {
@DomName('TimeRanges.length')
@DocsEditable()
int get length native "TimeRanges_length_Getter";
@DomName('TimeRanges.end')
@DocsEditable()
double end(int index) native "TimeRanges_end_Callback";
@DomName('TimeRanges.start')
@DocsEditable()
double start(int index) native "TimeRanges_start_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('TimeoutHandler')
typedef void TimeoutHandler();
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLTitleElement')
class TitleElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TitleElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTitleElement.HTMLTitleElement')
@DocsEditable()
factory TitleElement() => document.$dom_createElement("title");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('Touch')
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
class Touch extends NativeFieldWrapperClass1 {
@DomName('Touch.clientX')
@DocsEditable()
int get _clientX native "Touch_clientX_Getter";
@DomName('Touch.clientY')
@DocsEditable()
int get _clientY native "Touch_clientY_Getter";
@DomName('Touch.identifier')
@DocsEditable()
int get identifier native "Touch_identifier_Getter";
@DomName('Touch.pageX')
@DocsEditable()
int get _pageX native "Touch_pageX_Getter";
@DomName('Touch.pageY')
@DocsEditable()
int get _pageY native "Touch_pageY_Getter";
@DomName('Touch.screenX')
@DocsEditable()
int get _screenX native "Touch_screenX_Getter";
@DomName('Touch.screenY')
@DocsEditable()
int get _screenY native "Touch_screenY_Getter";
@DomName('Touch.target')
@DocsEditable()
EventTarget get target native "Touch_target_Getter";
@DomName('Touch.webkitForce')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
double get force native "Touch_webkitForce_Getter";
@DomName('Touch.webkitRadiusX')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
int get radiusX native "Touch_webkitRadiusX_Getter";
@DomName('Touch.webkitRadiusY')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
int get radiusY native "Touch_webkitRadiusY_Getter";
@DomName('Touch.webkitRotationAngle')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
double get rotationAngle native "Touch_webkitRotationAngle_Getter";
@DomName('Touch.clientX')
@DomName('Touch.clientY')
Point get client => new Point(_clientX, _clientY);
@DomName('Touch.pageX')
@DomName('Touch.pageY')
Point get page => new Point(_pageX, _pageY);
@DomName('Touch.screenX')
@DomName('Touch.screenY')
Point get screen => new Point(_screenX, _screenY);
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('TouchEvent')
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
class TouchEvent extends UIEvent {
factory TouchEvent(TouchList touches, TouchList targetTouches,
TouchList changedTouches, String type,
{Window view, int screenX: 0, int screenY: 0, int clientX: 0,
int clientY: 0, bool ctrlKey: false, bool altKey: false,
bool shiftKey: false, bool metaKey: false}) {
if (view == null) {
view = window;
}
var e = document._createEvent("TouchEvent");
e._initTouchEvent(touches, targetTouches, changedTouches, type, view,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey);
return e;
}
// To suppress missing implicit constructor warnings.
factory TouchEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('TouchEvent.altKey')
@DocsEditable()
bool get altKey native "TouchEvent_altKey_Getter";
@DomName('TouchEvent.changedTouches')
@DocsEditable()
TouchList get changedTouches native "TouchEvent_changedTouches_Getter";
@DomName('TouchEvent.ctrlKey')
@DocsEditable()
bool get ctrlKey native "TouchEvent_ctrlKey_Getter";
@DomName('TouchEvent.metaKey')
@DocsEditable()
bool get metaKey native "TouchEvent_metaKey_Getter";
@DomName('TouchEvent.shiftKey')
@DocsEditable()
bool get shiftKey native "TouchEvent_shiftKey_Getter";
@DomName('TouchEvent.targetTouches')
@DocsEditable()
TouchList get targetTouches native "TouchEvent_targetTouches_Getter";
@DomName('TouchEvent.touches')
@DocsEditable()
TouchList get touches native "TouchEvent_touches_Getter";
@DomName('TouchEvent.initTouchEvent')
@DocsEditable()
void _initTouchEvent(TouchList touches, TouchList targetTouches, TouchList changedTouches, String type, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native "TouchEvent_initTouchEvent_Callback";
/**
* Checks if touch events supported on the current platform.
*
* Note that touch events are only supported if the user is using a touch
* device.
*/
static bool get supported {
// Bug #8186 add equivalent 'ontouchstart' check for Dartium.
// Basically, this is a fairly common check and it'd be great if it did not
// throw exceptions.
return Device.isEventTypeSupported('TouchEvent');
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('TouchList')
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
class TouchList extends NativeFieldWrapperClass1 with ListMixin<Touch>, ImmutableListMixin<Touch> implements List<Touch> {
/// NB: This constructor likely does not work as you might expect it to! This
/// constructor will simply fail (returning null) if you are not on a device
/// with touch enabled. See dartbug.com/8314.
factory TouchList() => document._createTouchList();
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('TouchList.length')
@DocsEditable()
int get length native "TouchList_length_Getter";
Touch operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Touch _nativeIndexedGetter(int index) native "TouchList_item_Callback";
void operator[]=(int index, Touch value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Touch> mixins.
// Touch is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Touch get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Touch get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Touch get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Touch elementAt(int index) => this[index];
// -- end List<Touch> mixins.
@DomName('TouchList.item')
@DocsEditable()
Touch item(int index) native "TouchList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLTrackElement')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#the-track-element
@Experimental()
class TrackElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory TrackElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLTrackElement.HTMLTrackElement')
@DocsEditable()
factory TrackElement() => document.$dom_createElement("track");
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('HTMLTrackElement.ERROR')
@DocsEditable()
static const int ERROR = 3;
@DomName('HTMLTrackElement.LOADED')
@DocsEditable()
static const int LOADED = 2;
@DomName('HTMLTrackElement.LOADING')
@DocsEditable()
static const int LOADING = 1;
@DomName('HTMLTrackElement.NONE')
@DocsEditable()
static const int NONE = 0;
@DomName('HTMLTrackElement.default')
@DocsEditable()
bool get defaultValue native "HTMLTrackElement_default_Getter";
@DomName('HTMLTrackElement.default')
@DocsEditable()
void set defaultValue(bool value) native "HTMLTrackElement_default_Setter";
@DomName('HTMLTrackElement.kind')
@DocsEditable()
String get kind native "HTMLTrackElement_kind_Getter";
@DomName('HTMLTrackElement.kind')
@DocsEditable()
void set kind(String value) native "HTMLTrackElement_kind_Setter";
@DomName('HTMLTrackElement.label')
@DocsEditable()
String get label native "HTMLTrackElement_label_Getter";
@DomName('HTMLTrackElement.label')
@DocsEditable()
void set label(String value) native "HTMLTrackElement_label_Setter";
@DomName('HTMLTrackElement.readyState')
@DocsEditable()
int get readyState native "HTMLTrackElement_readyState_Getter";
@DomName('HTMLTrackElement.src')
@DocsEditable()
String get src native "HTMLTrackElement_src_Getter";
@DomName('HTMLTrackElement.src')
@DocsEditable()
void set src(String value) native "HTMLTrackElement_src_Setter";
@DomName('HTMLTrackElement.srclang')
@DocsEditable()
String get srclang native "HTMLTrackElement_srclang_Getter";
@DomName('HTMLTrackElement.srclang')
@DocsEditable()
void set srclang(String value) native "HTMLTrackElement_srclang_Setter";
@DomName('HTMLTrackElement.track')
@DocsEditable()
TextTrack get track native "HTMLTrackElement_track_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TrackEvent')
@Unstable()
class TrackEvent extends Event {
// To suppress missing implicit constructor warnings.
factory TrackEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('TrackEvent.track')
@DocsEditable()
Object get track native "TrackEvent_track_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('TransitionEvent')
class TransitionEvent extends Event {
// To suppress missing implicit constructor warnings.
factory TransitionEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('TransitionEvent.elapsedTime')
@DocsEditable()
double get elapsedTime native "TransitionEvent_elapsedTime_Getter";
@DomName('TransitionEvent.propertyName')
@DocsEditable()
String get propertyName native "TransitionEvent_propertyName_Getter";
@DomName('TransitionEvent.pseudoElement')
@DocsEditable()
String get pseudoElement native "TransitionEvent_pseudoElement_Getter";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('TreeWalker')
@Unstable()
class TreeWalker extends NativeFieldWrapperClass1 {
factory TreeWalker(Node root, int whatToShow) {
return document._createTreeWalker(root, whatToShow, null, false);
}
@DomName('TreeWalker.currentNode')
@DocsEditable()
Node get currentNode native "TreeWalker_currentNode_Getter";
@DomName('TreeWalker.currentNode')
@DocsEditable()
void set currentNode(Node value) native "TreeWalker_currentNode_Setter";
@DomName('TreeWalker.expandEntityReferences')
@DocsEditable()
// http://dom.spec.whatwg.org/#dom-traversal
@deprecated // deprecated
bool get expandEntityReferences native "TreeWalker_expandEntityReferences_Getter";
@DomName('TreeWalker.filter')
@DocsEditable()
NodeFilter get filter native "TreeWalker_filter_Getter";
@DomName('TreeWalker.root')
@DocsEditable()
Node get root native "TreeWalker_root_Getter";
@DomName('TreeWalker.whatToShow')
@DocsEditable()
int get whatToShow native "TreeWalker_whatToShow_Getter";
@DomName('TreeWalker.firstChild')
@DocsEditable()
Node firstChild() native "TreeWalker_firstChild_Callback";
@DomName('TreeWalker.lastChild')
@DocsEditable()
Node lastChild() native "TreeWalker_lastChild_Callback";
@DomName('TreeWalker.nextNode')
@DocsEditable()
Node nextNode() native "TreeWalker_nextNode_Callback";
@DomName('TreeWalker.nextSibling')
@DocsEditable()
Node nextSibling() native "TreeWalker_nextSibling_Callback";
@DomName('TreeWalker.parentNode')
@DocsEditable()
Node parentNode() native "TreeWalker_parentNode_Callback";
@DomName('TreeWalker.previousNode')
@DocsEditable()
Node previousNode() native "TreeWalker_previousNode_Callback";
@DomName('TreeWalker.previousSibling')
@DocsEditable()
Node previousSibling() native "TreeWalker_previousSibling_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('UIEvent')
class UIEvent extends Event {
// In JS, canBubble and cancelable are technically required parameters to
// init*Event. In practice, though, if they aren't provided they simply
// default to false (since that's Boolean(undefined)).
//
// Contrary to JS, we default canBubble and cancelable to true, since that's
// what people want most of the time anyway.
factory UIEvent(String type,
{Window view, int detail: 0, bool canBubble: true,
bool cancelable: true}) {
if (view == null) {
view = window;
}
final e = document._createEvent("UIEvent");
e._initUIEvent(type, canBubble, cancelable, view, detail);
return e;
}
// To suppress missing implicit constructor warnings.
factory UIEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('UIEvent.charCode')
@DocsEditable()
@Unstable()
int get _charCode native "UIEvent_charCode_Getter";
@DomName('UIEvent.detail')
@DocsEditable()
int get detail native "UIEvent_detail_Getter";
@DomName('UIEvent.keyCode')
@DocsEditable()
@Unstable()
int get _keyCode native "UIEvent_keyCode_Getter";
@DomName('UIEvent.layerX')
@DocsEditable()
// http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-mouseevents
@Experimental() // nonstandard
int get _layerX native "UIEvent_layerX_Getter";
@DomName('UIEvent.layerY')
@DocsEditable()
// http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-mouseevents
@Experimental() // nonstandard
int get _layerY native "UIEvent_layerY_Getter";
@DomName('UIEvent.pageX')
@DocsEditable()
// http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-mouseevents
@Experimental() // nonstandard
int get _pageX native "UIEvent_pageX_Getter";
@DomName('UIEvent.pageY')
@DocsEditable()
// http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-mouseevents
@Experimental() // nonstandard
int get _pageY native "UIEvent_pageY_Getter";
@DomName('UIEvent.view')
@DocsEditable()
WindowBase get view native "UIEvent_view_Getter";
@DomName('UIEvent.which')
@DocsEditable()
@Unstable()
int get which native "UIEvent_which_Getter";
@DomName('UIEvent.initUIEvent')
@DocsEditable()
void _initUIEvent(String type, bool canBubble, bool cancelable, Window view, int detail) native "UIEvent_initUIEvent_Callback";
@deprecated
int get layerX => layer.x;
@deprecated
int get layerY => layer.y;
@deprecated
int get pageX => page.x;
@deprecated
int get pageY => page.y;
@DomName('UIEvent.layerX')
@DomName('UIEvent.layerY')
Point get layer => new Point(_layerX, _layerY);
@DomName('UIEvent.pageX')
@DomName('UIEvent.pageY')
Point get page => new Point(_pageX, _pageY);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLUListElement')
class UListElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory UListElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLUListElement.HTMLUListElement')
@DocsEditable()
factory UListElement() => document.$dom_createElement("ul");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLUnknownElement')
class UnknownElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory UnknownElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('URL')
class Url extends NativeFieldWrapperClass1 {
@DomName('URL._createObjectUrlFromWebKitSource')
@DocsEditable()
@Experimental() // untriaged
static String _createObjectUrlFromWebKitSource(_WebKitMediaSource source) native "URL__createObjectUrlFromWebKitSource_Callback";
static String createObjectUrl(blob_OR_source_OR_stream) {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _createObjectURL_1(blob_OR_source_OR_stream);
}
if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
return _createObjectURL_2(blob_OR_source_OR_stream);
}
if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
return _createObjectURL_3(blob_OR_source_OR_stream);
}
if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
return _createObjectURL_4(blob_OR_source_OR_stream);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
static String _createObjectURL_1(blob_OR_source_OR_stream) native "URL__createObjectURL_1_Callback";
static String _createObjectURL_2(blob_OR_source_OR_stream) native "URL__createObjectURL_2_Callback";
static String _createObjectURL_3(blob_OR_source_OR_stream) native "URL__createObjectURL_3_Callback";
static String _createObjectURL_4(blob_OR_source_OR_stream) native "URL__createObjectURL_4_Callback";
@DomName('URL.createObjectUrlFromBlob')
@DocsEditable()
static String createObjectUrlFromBlob(Blob blob) native "URL_createObjectUrlFromBlob_Callback";
@DomName('URL.createObjectUrlFromSource')
@DocsEditable()
static String createObjectUrlFromSource(MediaSource source) native "URL_createObjectUrlFromSource_Callback";
@DomName('URL.createObjectUrlFromStream')
@DocsEditable()
static String createObjectUrlFromStream(MediaStream stream) native "URL_createObjectUrlFromStream_Callback";
@DomName('URL.revokeObjectURL')
@DocsEditable()
static void revokeObjectUrl(String url) native "URL_revokeObjectURL_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ValidityState')
class ValidityState extends NativeFieldWrapperClass1 {
@DomName('ValidityState.badInput')
@DocsEditable()
bool get badInput native "ValidityState_badInput_Getter";
@DomName('ValidityState.customError')
@DocsEditable()
bool get customError native "ValidityState_customError_Getter";
@DomName('ValidityState.patternMismatch')
@DocsEditable()
bool get patternMismatch native "ValidityState_patternMismatch_Getter";
@DomName('ValidityState.rangeOverflow')
@DocsEditable()
bool get rangeOverflow native "ValidityState_rangeOverflow_Getter";
@DomName('ValidityState.rangeUnderflow')
@DocsEditable()
bool get rangeUnderflow native "ValidityState_rangeUnderflow_Getter";
@DomName('ValidityState.stepMismatch')
@DocsEditable()
bool get stepMismatch native "ValidityState_stepMismatch_Getter";
@DomName('ValidityState.tooLong')
@DocsEditable()
bool get tooLong native "ValidityState_tooLong_Getter";
@DomName('ValidityState.typeMismatch')
@DocsEditable()
bool get typeMismatch native "ValidityState_typeMismatch_Getter";
@DomName('ValidityState.valid')
@DocsEditable()
bool get valid native "ValidityState_valid_Getter";
@DomName('ValidityState.valueMissing')
@DocsEditable()
bool get valueMissing native "ValidityState_valueMissing_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('HTMLVideoElement')
class VideoElement extends MediaElement implements CanvasImageSource {
// To suppress missing implicit constructor warnings.
factory VideoElement._() { throw new UnsupportedError("Not supported"); }
@DomName('HTMLVideoElement.HTMLVideoElement')
@DocsEditable()
factory VideoElement() => document.$dom_createElement("video");
@DomName('HTMLVideoElement.height')
@DocsEditable()
int get height native "HTMLVideoElement_height_Getter";
@DomName('HTMLVideoElement.height')
@DocsEditable()
void set height(int value) native "HTMLVideoElement_height_Setter";
@DomName('HTMLVideoElement.poster')
@DocsEditable()
String get poster native "HTMLVideoElement_poster_Getter";
@DomName('HTMLVideoElement.poster')
@DocsEditable()
void set poster(String value) native "HTMLVideoElement_poster_Setter";
@DomName('HTMLVideoElement.videoHeight')
@DocsEditable()
int get videoHeight native "HTMLVideoElement_videoHeight_Getter";
@DomName('HTMLVideoElement.videoWidth')
@DocsEditable()
int get videoWidth native "HTMLVideoElement_videoWidth_Getter";
@DomName('HTMLVideoElement.webkitDecodedFrameCount')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
int get decodedFrameCount native "HTMLVideoElement_webkitDecodedFrameCount_Getter";
@DomName('HTMLVideoElement.webkitDisplayingFullscreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@deprecated // deprecated
bool get displayingFullscreen native "HTMLVideoElement_webkitDisplayingFullscreen_Getter";
@DomName('HTMLVideoElement.webkitDroppedFrameCount')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
int get droppedFrameCount native "HTMLVideoElement_webkitDroppedFrameCount_Getter";
@DomName('HTMLVideoElement.webkitSupportsFullscreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@deprecated // deprecated
bool get supportsFullscreen native "HTMLVideoElement_webkitSupportsFullscreen_Getter";
@DomName('HTMLVideoElement.width')
@DocsEditable()
int get width native "HTMLVideoElement_width_Getter";
@DomName('HTMLVideoElement.width')
@DocsEditable()
void set width(int value) native "HTMLVideoElement_width_Setter";
@DomName('HTMLVideoElement.webkitEnterFullScreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
@deprecated // deprecated
void enterFullScreen() native "HTMLVideoElement_webkitEnterFullScreen_Callback";
@DomName('HTMLVideoElement.webkitEnterFullscreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
void enterFullscreen() native "HTMLVideoElement_webkitEnterFullscreen_Callback";
@DomName('HTMLVideoElement.webkitExitFullScreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-document-exitfullscreen
@deprecated // deprecated
void exitFullScreen() native "HTMLVideoElement_webkitExitFullScreen_Callback";
@DomName('HTMLVideoElement.webkitExitFullscreen')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#dom-document-exitfullscreen
void exitFullscreen() native "HTMLVideoElement_webkitExitFullscreen_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DomName('VoidCallback')
// http://www.w3.org/TR/file-system-api/#the-voidcallback-interface
@Experimental()
typedef void VoidCallback();
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
/**
* Use the WebSocket interface to connect to a WebSocket,
* and to send and receive data on that WebSocket.
*
* To use a WebSocket in your web app, first create a WebSocket object,
* passing the WebSocket URL as an argument to the constructor.
*
* var webSocket = new WebSocket('ws://127.0.0.1:1337/ws');
*
* To send data on the WebSocket, use the [send] method.
*
* if (webSocket != null && webSocket.readyState == WebSocket.OPEN) {
* webSocket.send(data);
* } else {
* print('WebSocket not connected, message $data not sent');
* }
*
* To receive data on the WebSocket, register a listener for message events.
*
* webSocket.onMessage.listen((MessageEvent e) {
* receivedData(e.data);
* });
*
* The message event handler receives a [MessageEvent] object
* as its sole argument.
* You can also define open, close, and error handlers,
* as specified by [WebSocketEvents].
*
* For more information, see the
* [WebSockets](http://www.dartlang.org/docs/library-tour/#html-websockets)
* section of the library tour and
* [Introducing WebSockets](http://www.html5rocks.com/en/tutorials/websockets/basics/),
* an HTML5Rocks.com tutorial.
*/
@DomName('WebSocket')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
@Unstable()
class WebSocket extends EventTarget {
// To suppress missing implicit constructor warnings.
factory WebSocket._() { throw new UnsupportedError("Not supported"); }
@DomName('WebSocket.closeEvent')
@DocsEditable()
static const EventStreamProvider<CloseEvent> closeEvent = const EventStreamProvider<CloseEvent>('close');
@DomName('WebSocket.errorEvent')
@DocsEditable()
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('WebSocket.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('WebSocket.openEvent')
@DocsEditable()
static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
@DomName('WebSocket.WebSocket')
@DocsEditable()
factory WebSocket(String url, [protocol_OR_protocols]) {
if ((url is String || url == null) && protocol_OR_protocols == null) {
return WebSocket._create_1(url);
}
if ((protocol_OR_protocols is List<String> || protocol_OR_protocols == null) && (url is String || url == null)) {
return WebSocket._create_2(url, protocol_OR_protocols);
}
if ((protocol_OR_protocols is String || protocol_OR_protocols == null) && (url is String || url == null)) {
return WebSocket._create_3(url, protocol_OR_protocols);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@DocsEditable()
static WebSocket _create_1(url) native "WebSocket__create_1constructorCallback";
@DocsEditable()
static WebSocket _create_2(url, protocol_OR_protocols) native "WebSocket__create_2constructorCallback";
@DocsEditable()
static WebSocket _create_3(url, protocol_OR_protocols) native "WebSocket__create_3constructorCallback";
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('WebSocket.CLOSED')
@DocsEditable()
static const int CLOSED = 3;
@DomName('WebSocket.CLOSING')
@DocsEditable()
static const int CLOSING = 2;
@DomName('WebSocket.CONNECTING')
@DocsEditable()
static const int CONNECTING = 0;
@DomName('WebSocket.OPEN')
@DocsEditable()
static const int OPEN = 1;
@DomName('WebSocket.URL')
@DocsEditable()
@deprecated // deprecated
String get Url native "WebSocket_URL_Getter";
@DomName('WebSocket.binaryType')
@DocsEditable()
String get binaryType native "WebSocket_binaryType_Getter";
@DomName('WebSocket.binaryType')
@DocsEditable()
void set binaryType(String value) native "WebSocket_binaryType_Setter";
@DomName('WebSocket.bufferedAmount')
@DocsEditable()
int get bufferedAmount native "WebSocket_bufferedAmount_Getter";
@DomName('WebSocket.extensions')
@DocsEditable()
String get extensions native "WebSocket_extensions_Getter";
@DomName('WebSocket.protocol')
@DocsEditable()
String get protocol native "WebSocket_protocol_Getter";
@DomName('WebSocket.readyState')
@DocsEditable()
int get readyState native "WebSocket_readyState_Getter";
@DomName('WebSocket.url')
@DocsEditable()
String get url native "WebSocket_url_Getter";
void close([int code, String reason]) {
if (reason != null) {
_close_1(code, reason);
return;
}
if (code != null) {
_close_2(code);
return;
}
_close_3();
return;
}
void _close_1(code, reason) native "WebSocket__close_1_Callback";
void _close_2(code) native "WebSocket__close_2_Callback";
void _close_3() native "WebSocket__close_3_Callback";
/**
* Transmit data to the server over this connection.
*
* This method accepts data of type [Blob], [ByteBuffer], [String], or
* [TypedData]. Named variants [sendBlob], [sendByteBuffer], [sendString],
* or [sendTypedData], in constrast, only accept data of the specified type.
*/
@DomName('WebSocket.send')
@DocsEditable()
void send(data) native "WebSocket_send_Callback";
@DomName('WebSocket.sendBlob')
@DocsEditable()
void sendBlob(Blob data) native "WebSocket_sendBlob_Callback";
@DomName('WebSocket.sendByteBuffer')
@DocsEditable()
void sendByteBuffer(ByteBuffer data) native "WebSocket_sendByteBuffer_Callback";
@DomName('WebSocket.sendString')
@DocsEditable()
void sendString(String data) native "WebSocket_sendString_Callback";
@DomName('WebSocket.sendTypedData')
@DocsEditable()
void sendTypedData(TypedData data) native "WebSocket_sendTypedData_Callback";
@DomName('WebSocket.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "WebSocket_addEventListener_Callback";
@DomName('WebSocket.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "WebSocket_dispatchEvent_Callback";
@DomName('WebSocket.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "WebSocket_removeEventListener_Callback";
@DomName('WebSocket.onclose')
@DocsEditable()
Stream<CloseEvent> get onClose => closeEvent.forTarget(this);
@DomName('WebSocket.onerror')
@DocsEditable()
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('WebSocket.onmessage')
@DocsEditable()
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
@DomName('WebSocket.onopen')
@DocsEditable()
Stream<Event> get onOpen => openEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('WheelEvent')
class WheelEvent extends MouseEvent {
factory WheelEvent(String type,
{Window view, int deltaX: 0, int deltaY: 0,
int detail: 0, int screenX: 0, int screenY: 0, int clientX: 0,
int clientY: 0, int button: 0, bool canBubble: true,
bool cancelable: true, bool ctrlKey: false, bool altKey: false,
bool shiftKey: false, bool metaKey: false, EventTarget relatedTarget}) {
if (view == null) {
view = window;
}
var eventType = 'WheelEvent';
if (Device.isFirefox) {
eventType = 'MouseScrollEvents';
}
final event = document._createEvent(eventType);
// Dartium always needs these flipped because we're using the legacy
// _initWebKitWheelEvent instead of the more modern WheelEvent constructor
// which isn't yet properly exposed by the Dartium bindings.
deltaX = -deltaX;
deltaY = -deltaY;
// Fallthrough for Dartium.
event._initMouseEvent(type, canBubble, cancelable, view, detail,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
metaKey, button, relatedTarget);
event._initWebKitWheelEvent(deltaX, deltaY,
view, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
metaKey);
return event;
}
// To suppress missing implicit constructor warnings.
factory WheelEvent._() { throw new UnsupportedError("Not supported"); }
@DomName('WheelEvent.DOM_DELTA_LINE')
@DocsEditable()
static const int DOM_DELTA_LINE = 0x01;
@DomName('WheelEvent.DOM_DELTA_PAGE')
@DocsEditable()
static const int DOM_DELTA_PAGE = 0x02;
@DomName('WheelEvent.DOM_DELTA_PIXEL')
@DocsEditable()
static const int DOM_DELTA_PIXEL = 0x00;
@DomName('WheelEvent.deltaMode')
@DocsEditable()
int get deltaMode native "WheelEvent_deltaMode_Getter";
@DomName('WheelEvent.deltaX')
@DocsEditable()
@Experimental() // untriaged
double get _deltaX native "WheelEvent_deltaX_Getter";
@DomName('WheelEvent.deltaY')
@DocsEditable()
@Experimental() // untriaged
double get _deltaY native "WheelEvent_deltaY_Getter";
@DomName('WheelEvent.deltaZ')
@DocsEditable()
@Experimental() // untriaged
double get deltaZ native "WheelEvent_deltaZ_Getter";
@DomName('WheelEvent.webkitDirectionInvertedFromDevice')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
bool get directionInvertedFromDevice native "WheelEvent_webkitDirectionInvertedFromDevice_Getter";
@DomName('WheelEvent.wheelDeltaX')
@DocsEditable()
@Experimental() // non-standard
int get wheelDeltaX native "WheelEvent_wheelDeltaX_Getter";
@DomName('WheelEvent.wheelDeltaY')
@DocsEditable()
@Experimental() // non-standard
int get wheelDeltaY native "WheelEvent_wheelDeltaY_Getter";
@DomName('WheelEvent.initWebKitWheelEvent')
@DocsEditable()
@Experimental()
void _initWebKitWheelEvent(int wheelDeltaX, int wheelDeltaY, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native "WheelEvent_initWebKitWheelEvent_Callback";
/**
* The amount that is expected to scroll horizontally, in units determined by
* [deltaMode].
*
* See also:
*
* * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
*/
@DomName('WheelEvent.deltaX')
num get deltaX => _deltaX;
/**
* The amount that is expected to scroll vertically, in units determined by
* [deltaMode].
*
* See also:
*
* * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
*/
@DomName('WheelEvent.deltaY')
num get deltaY => _deltaY;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('Window')
class Window extends EventTarget implements WindowBase, WindowTimers, WindowBase64 {
/**
* Executes a [callback] after the immediate execution stack has completed.
*
* This differs from using Timer.run(callback)
* because Timer will run in about 4-15 milliseconds, depending on browser,
* depending on load. [setImmediate], in contrast, makes browser-specific
* changes in behavior to attempt to run immediately after the current
* frame unwinds, causing the future to complete after all processing has
* completed for the current event, but before any subsequent events.
*/
void setImmediate(TimeoutHandler callback) {
_addMicrotaskCallback(callback);
}
/**
* Lookup a port by its [name]. Return null if no port is
* registered under [name].
*/
SendPortSync lookupPort(String name) {
var portStr = document.documentElement.attributes['dart-port:$name'];
if (portStr == null) {
return null;
}
var port = JSON.decode(portStr);
return _deserialize(port);
}
/**
* Register a [port] on this window under the given [name]. This
* port may be retrieved by any isolate (or JavaScript script)
* running in this window.
*/
void registerPort(String name, var port) {
var serialized = _serialize(port);
document.documentElement.attributes['dart-port:$name'] =
JSON.encode(serialized);
}
/**
* Deregister a [port] on this window under the given [name]. This
* port may be retrieved by any isolate (or JavaScript script)
* running in this window.
*/
void deregisterPort(String name) {
document.documentElement.attributes.remove('dart-port:$name');
}
/**
* Returns a Future that completes just before the window is about to
* repaint so the user can draw an animation frame.
*
* If you need to later cancel this animation, use [requestAnimationFrame]
* instead.
*
* The [Future] completes to a timestamp that represents a floating
* point value of the number of milliseconds that have elapsed since the page
* started to load (which is also the timestamp at this call to
* animationFrame).
*
* Note: The code that runs when the future completes should call
* [animationFrame] again for the animation to continue.
*/
Future<num> get animationFrame {
var completer = new Completer<num>();
requestAnimationFrame((time) {
completer.complete(time);
});
return completer.future;
}
/// Checks if _setImmediate is supported.
static bool get _supportsSetImmediate => false;
/// Dartium stub for IE's setImmediate.
void _setImmediate(void callback()) {
throw new UnsupportedError('setImmediate is not supported');
}
/**
* Access a sandboxed file system of the specified `size`. If `persistent` is
* true, the application will request permission from the user to create
* lasting storage. This storage cannot be freed without the user's
* permission. Returns a [Future] whose value stores a reference to the
* sandboxed file system for use. Because the file system is sandboxed,
* applications cannot access file systems created in other web pages.
*/
Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) {
return _requestFileSystem(persistent? 1 : 0, size);
}
@DomName('Window.convertPointFromNodeToPage')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
Point convertPointFromNodeToPage(Node node, Point point) {
var result = _convertPointFromNodeToPage(node,
new _DomPoint(point.x, point.y));
return new Point(result.x, result.y);
}
@DomName('Window.convertPointFromPageToNode')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
Point convertPointFromPageToNode(Node node, Point point) {
var result = _convertPointFromPageToNode(node,
new _DomPoint(point.x, point.y));
return new Point(result.x, result.y);
}
/**
* Checks whether [convertPointFromNodeToPage] and
* [convertPointFromPageToNode] are supported on the current platform.
*/
static bool get supportsPointConversions => _DomPoint.supported;
// To suppress missing implicit constructor warnings.
factory Window._() { throw new UnsupportedError("Not supported"); }
@DomName('Window.DOMContentLoadedEvent')
@DocsEditable()
static const EventStreamProvider<Event> contentLoadedEvent = const EventStreamProvider<Event>('DOMContentLoaded');
@DomName('Window.devicemotionEvent')
@DocsEditable()
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
static const EventStreamProvider<DeviceMotionEvent> deviceMotionEvent = const EventStreamProvider<DeviceMotionEvent>('devicemotion');
@DomName('Window.deviceorientationEvent')
@DocsEditable()
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
static const EventStreamProvider<DeviceOrientationEvent> deviceOrientationEvent = const EventStreamProvider<DeviceOrientationEvent>('deviceorientation');
@DomName('Window.hashchangeEvent')
@DocsEditable()
static const EventStreamProvider<Event> hashChangeEvent = const EventStreamProvider<Event>('hashchange');
@DomName('Window.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('Window.offlineEvent')
@DocsEditable()
static const EventStreamProvider<Event> offlineEvent = const EventStreamProvider<Event>('offline');
@DomName('Window.onlineEvent')
@DocsEditable()
static const EventStreamProvider<Event> onlineEvent = const EventStreamProvider<Event>('online');
@DomName('Window.pagehideEvent')
@DocsEditable()
static const EventStreamProvider<Event> pageHideEvent = const EventStreamProvider<Event>('pagehide');
@DomName('Window.pageshowEvent')
@DocsEditable()
static const EventStreamProvider<Event> pageShowEvent = const EventStreamProvider<Event>('pageshow');
@DomName('Window.popstateEvent')
@DocsEditable()
static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStreamProvider<PopStateEvent>('popstate');
@DomName('Window.resizeEvent')
@DocsEditable()
static const EventStreamProvider<Event> resizeEvent = const EventStreamProvider<Event>('resize');
@DomName('Window.storageEvent')
@DocsEditable()
static const EventStreamProvider<StorageEvent> storageEvent = const EventStreamProvider<StorageEvent>('storage');
@DomName('Window.unloadEvent')
@DocsEditable()
static const EventStreamProvider<Event> unloadEvent = const EventStreamProvider<Event>('unload');
@DomName('Window.webkitAnimationEndEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
static const EventStreamProvider<AnimationEvent> animationEndEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationEnd');
@DomName('Window.webkitAnimationIterationEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
static const EventStreamProvider<AnimationEvent> animationIterationEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationIteration');
@DomName('Window.webkitAnimationStartEvent')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
static const EventStreamProvider<AnimationEvent> animationStartEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationStart');
@DomName('Window.PERSISTENT')
@DocsEditable()
// http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem
@Experimental()
static const int PERSISTENT = 1;
@DomName('Window.TEMPORARY')
@DocsEditable()
// http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem
@Experimental()
static const int TEMPORARY = 0;
@DomName('Window.CSS')
@DocsEditable()
Css get css native "Window_CSS_Getter";
@DomName('Window.applicationCache')
@DocsEditable()
ApplicationCache get applicationCache native "Window_applicationCache_Getter";
@DomName('Window.closed')
@DocsEditable()
bool get closed native "Window_closed_Getter";
@DomName('Window.console')
@DocsEditable()
Console get console native "Window_console_Getter";
@DomName('Window.crypto')
@DocsEditable()
// http://www.w3.org/TR/WebCryptoAPI/
@Experimental()
Crypto get crypto native "Window_crypto_Getter";
@DomName('Window.defaultStatus')
@DocsEditable()
String get defaultStatus native "Window_defaultStatus_Getter";
@DomName('Window.defaultStatus')
@DocsEditable()
void set defaultStatus(String value) native "Window_defaultStatus_Setter";
@DomName('Window.defaultstatus')
@DocsEditable()
@Experimental() // non-standard
String get defaultstatus native "Window_defaultstatus_Getter";
@DomName('Window.defaultstatus')
@DocsEditable()
@Experimental() // non-standard
void set defaultstatus(String value) native "Window_defaultstatus_Setter";
@DomName('Window.devicePixelRatio')
@DocsEditable()
// http://www.quirksmode.org/blog/archives/2012/06/devicepixelrati.html
@Experimental() // non-standard
double get devicePixelRatio native "Window_devicePixelRatio_Getter";
@DomName('Window.document')
@DocsEditable()
Document get document native "Window_document_Getter";
@DomName('Window.event')
@DocsEditable()
@deprecated // deprecated
Event get event native "Window_event_Getter";
@DomName('Window.history')
@DocsEditable()
History get history native "Window_history_Getter";
@DomName('Window.indexedDB')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX, '15')
@SupportedBrowser(SupportedBrowser.IE, '10')
@Experimental()
IdbFactory get indexedDB native "Window_indexedDB_Getter";
@DomName('Window.innerHeight')
@DocsEditable()
int get innerHeight native "Window_innerHeight_Getter";
@DomName('Window.innerWidth')
@DocsEditable()
int get innerWidth native "Window_innerWidth_Getter";
@DomName('Window.localStorage')
@DocsEditable()
Storage get localStorage native "Window_localStorage_Getter";
@DomName('Window.location')
@DocsEditable()
Location get location native "Window_location_Getter";
@DomName('Window.locationbar')
@DocsEditable()
BarProp get locationbar native "Window_locationbar_Getter";
@DomName('Window.menubar')
@DocsEditable()
BarProp get menubar native "Window_menubar_Getter";
@DomName('Window.name')
@DocsEditable()
String get name native "Window_name_Getter";
@DomName('Window.name')
@DocsEditable()
void set name(String value) native "Window_name_Setter";
@DomName('Window.navigator')
@DocsEditable()
Navigator get navigator native "Window_navigator_Getter";
@DomName('Window.offscreenBuffering')
@DocsEditable()
@Experimental() // non-standard
bool get offscreenBuffering native "Window_offscreenBuffering_Getter";
@DomName('Window.opener')
@DocsEditable()
WindowBase get opener native "Window_opener_Getter";
@DomName('Window.outerHeight')
@DocsEditable()
int get outerHeight native "Window_outerHeight_Getter";
@DomName('Window.outerWidth')
@DocsEditable()
int get outerWidth native "Window_outerWidth_Getter";
@DomName('Window.pageXOffset')
@DocsEditable()
int get pageXOffset native "Window_pageXOffset_Getter";
@DomName('Window.pageYOffset')
@DocsEditable()
int get pageYOffset native "Window_pageYOffset_Getter";
@DomName('Window.parent')
@DocsEditable()
WindowBase get parent native "Window_parent_Getter";
@DomName('Window.performance')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE)
Performance get performance native "Window_performance_Getter";
@DomName('Window.personalbar')
@DocsEditable()
// https://developer.mozilla.org/en-US/docs/DOM/window.personalbar
@deprecated // deprecated
BarProp get personalbar native "Window_personalbar_Getter";
@DomName('Window.screen')
@DocsEditable()
Screen get screen native "Window_screen_Getter";
@DomName('Window.screenLeft')
@DocsEditable()
int get screenLeft native "Window_screenLeft_Getter";
@DomName('Window.screenTop')
@DocsEditable()
int get screenTop native "Window_screenTop_Getter";
@DomName('Window.screenX')
@DocsEditable()
int get screenX native "Window_screenX_Getter";
@DomName('Window.screenY')
@DocsEditable()
int get screenY native "Window_screenY_Getter";
@DomName('Window.scrollX')
@DocsEditable()
int get scrollX native "Window_scrollX_Getter";
@DomName('Window.scrollY')
@DocsEditable()
int get scrollY native "Window_scrollY_Getter";
@DomName('Window.scrollbars')
@DocsEditable()
BarProp get scrollbars native "Window_scrollbars_Getter";
@DomName('Window.self')
@DocsEditable()
WindowBase get self native "Window_self_Getter";
@DomName('Window.sessionStorage')
@DocsEditable()
Storage get sessionStorage native "Window_sessionStorage_Getter";
@DomName('Window.speechSynthesis')
@DocsEditable()
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
@Experimental()
SpeechSynthesis get speechSynthesis native "Window_speechSynthesis_Getter";
@DomName('Window.status')
@DocsEditable()
String get status native "Window_status_Getter";
@DomName('Window.status')
@DocsEditable()
void set status(String value) native "Window_status_Setter";
@DomName('Window.statusbar')
@DocsEditable()
BarProp get statusbar native "Window_statusbar_Getter";
@DomName('Window.styleMedia')
@DocsEditable()
// http://developer.apple.com/library/safari/#documentation/SafariDOMAdditions/Reference/StyleMedia/StyleMedia/StyleMedia.html
@Experimental() // nonstandard
StyleMedia get styleMedia native "Window_styleMedia_Getter";
@DomName('Window.toolbar')
@DocsEditable()
BarProp get toolbar native "Window_toolbar_Getter";
@DomName('Window.top')
@DocsEditable()
WindowBase get top native "Window_top_Getter";
@DomName('Window.webkitNotifications')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// https://plus.sandbox.google.com/u/0/+GoogleChromeDevelopers/posts/8vWo8hq4pDm?e=Showroom
@deprecated // deprecated
NotificationCenter get notifications native "Window_webkitNotifications_Getter";
@DomName('Window.webkitStorageInfo')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/file-system-api/
@deprecated // deprecated
StorageInfo get storageInfo native "Window_webkitStorageInfo_Getter";
@DomName('Window.window')
@DocsEditable()
WindowBase get window native "Window_window_Getter";
WindowBase __getter__(index_OR_name) {
if ((index_OR_name is int || index_OR_name == null)) {
return ___getter___1(index_OR_name);
}
if ((index_OR_name is String || index_OR_name == null)) {
return ___getter___2(index_OR_name);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
WindowBase ___getter___1(index_OR_name) native "Window____getter___1_Callback";
WindowBase ___getter___2(index_OR_name) native "Window____getter___2_Callback";
@DomName('Window.alert')
@DocsEditable()
void alert(String message) native "Window_alert_Callback";
@DomName('Window.cancelAnimationFrame')
@DocsEditable()
void cancelAnimationFrame(int id) native "Window_cancelAnimationFrame_Callback";
@DomName('Window.captureEvents')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture
@deprecated // deprecated
void captureEvents() native "Window_captureEvents_Callback";
@DomName('Window.close')
@DocsEditable()
void close() native "Window_close_Callback";
@DomName('Window.confirm')
@DocsEditable()
bool confirm(String message) native "Window_confirm_Callback";
Object _createImageBitmap(canvas_OR_context_OR_image_OR_video, [int sx, int sy, int sw, int sh]) {
if ((canvas_OR_context_OR_image_OR_video is ImageElement || canvas_OR_context_OR_image_OR_video == null) && sx == null && sy == null && sw == null && sh == null) {
return _createImageBitmap_1(canvas_OR_context_OR_image_OR_video);
}
if ((sh is int || sh == null) && (sw is int || sw == null) && (sy is int || sy == null) && (sx is int || sx == null) && (canvas_OR_context_OR_image_OR_video is ImageElement || canvas_OR_context_OR_image_OR_video == null)) {
return _createImageBitmap_2(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh);
}
if ((canvas_OR_context_OR_image_OR_video is CanvasRenderingContext2D || canvas_OR_context_OR_image_OR_video == null) && sx == null && sy == null && sw == null && sh == null) {
return _createImageBitmap_3(canvas_OR_context_OR_image_OR_video);
}
if ((sh is int || sh == null) && (sw is int || sw == null) && (sy is int || sy == null) && (sx is int || sx == null) && (canvas_OR_context_OR_image_OR_video is CanvasElement || canvas_OR_context_OR_image_OR_video == null)) {
return _createImageBitmap_4(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh);
}
if ((canvas_OR_context_OR_image_OR_video is CanvasElement || canvas_OR_context_OR_image_OR_video == null) && sx == null && sy == null && sw == null && sh == null) {
return _createImageBitmap_5(canvas_OR_context_OR_image_OR_video);
}
if ((canvas_OR_context_OR_image_OR_video is VideoElement || canvas_OR_context_OR_image_OR_video == null) && sx == null && sy == null && sw == null && sh == null) {
return _createImageBitmap_6(canvas_OR_context_OR_image_OR_video);
}
if ((sh is int || sh == null) && (sw is int || sw == null) && (sy is int || sy == null) && (sx is int || sx == null) && (canvas_OR_context_OR_image_OR_video is VideoElement || canvas_OR_context_OR_image_OR_video == null)) {
return _createImageBitmap_7(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh);
}
if ((sh is int || sh == null) && (sw is int || sw == null) && (sy is int || sy == null) && (sx is int || sx == null) && (canvas_OR_context_OR_image_OR_video is CanvasRenderingContext2D || canvas_OR_context_OR_image_OR_video == null)) {
return _createImageBitmap_8(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
Object _createImageBitmap_1(canvas_OR_context_OR_image_OR_video) native "Window__createImageBitmap_1_Callback";
Object _createImageBitmap_2(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh) native "Window__createImageBitmap_2_Callback";
Object _createImageBitmap_3(canvas_OR_context_OR_image_OR_video) native "Window__createImageBitmap_3_Callback";
Object _createImageBitmap_4(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh) native "Window__createImageBitmap_4_Callback";
Object _createImageBitmap_5(canvas_OR_context_OR_image_OR_video) native "Window__createImageBitmap_5_Callback";
Object _createImageBitmap_6(canvas_OR_context_OR_image_OR_video) native "Window__createImageBitmap_6_Callback";
Object _createImageBitmap_7(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh) native "Window__createImageBitmap_7_Callback";
Object _createImageBitmap_8(canvas_OR_context_OR_image_OR_video, sx, sy, sw, sh) native "Window__createImageBitmap_8_Callback";
@DomName('Window.find')
@DocsEditable()
@Experimental() // non-standard
bool find(String string, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog) native "Window_find_Callback";
@DomName('Window.getComputedStyle')
@DocsEditable()
CssStyleDeclaration _getComputedStyle(Element element, String pseudoElement) native "Window_getComputedStyle_Callback";
@DomName('Window.getMatchedCSSRules')
@DocsEditable()
@Experimental() // non-standard
List<CssRule> getMatchedCssRules(Element element, String pseudoElement) native "Window_getMatchedCSSRules_Callback";
@DomName('Window.getSelection')
@DocsEditable()
Selection getSelection() native "Window_getSelection_Callback";
@DomName('Window.matchMedia')
@DocsEditable()
MediaQueryList matchMedia(String query) native "Window_matchMedia_Callback";
@DomName('Window.moveBy')
@DocsEditable()
void moveBy(num x, num y) native "Window_moveBy_Callback";
@DomName('Window.moveTo')
@DocsEditable()
void _moveTo(num x, num y) native "Window_moveTo_Callback";
@DomName('Window.open')
@DocsEditable()
WindowBase open(String url, String name, [String options]) native "Window_open_Callback";
@DomName('Window.openDatabase')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/webdatabase/
@Experimental() // deprecated
SqlDatabase openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native "Window_openDatabase_Callback";
@DomName('Window.postMessage')
@DocsEditable()
void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) native "Window_postMessage_Callback";
@DomName('Window.print')
@DocsEditable()
void print() native "Window_print_Callback";
@DomName('Window.releaseEvents')
@DocsEditable()
// http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture
@deprecated // deprecated
void releaseEvents() native "Window_releaseEvents_Callback";
@DomName('Window.requestAnimationFrame')
@DocsEditable()
int requestAnimationFrame(RequestAnimationFrameCallback callback) native "Window_requestAnimationFrame_Callback";
@DomName('Window.resizeBy')
@DocsEditable()
void resizeBy(num x, num y) native "Window_resizeBy_Callback";
@DomName('Window.resizeTo')
@DocsEditable()
void resizeTo(num width, num height) native "Window_resizeTo_Callback";
@DomName('Window.scroll')
@DocsEditable()
void scroll(int x, int y) native "Window_scroll_Callback";
@DomName('Window.scrollBy')
@DocsEditable()
void scrollBy(int x, int y) native "Window_scrollBy_Callback";
@DomName('Window.scrollTo')
@DocsEditable()
void scrollTo(int x, int y) native "Window_scrollTo_Callback";
@DomName('Window.showModalDialog')
@DocsEditable()
Object showModalDialog(String url, [Object dialogArgs, String featureArgs]) native "Window_showModalDialog_Callback";
@DomName('Window.stop')
@DocsEditable()
void stop() native "Window_stop_Callback";
@DomName('Window.toString')
@DocsEditable()
String toString() native "Window_toString_Callback";
@DomName('Window.webkitConvertPointFromNodeToPage')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://developer.apple.com/library/safari/#documentation/DataManagement/Reference/DOMWindowAdditionsReference/DOMWindowAdditions/DOMWindowAdditions.html
_DomPoint _convertPointFromNodeToPage(Node node, _DomPoint p) native "Window_webkitConvertPointFromNodeToPage_Callback";
@DomName('Window.webkitConvertPointFromPageToNode')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://developer.apple.com/library/safari/#documentation/DataManagement/Reference/DOMWindowAdditionsReference/DOMWindowAdditions/DOMWindowAdditions.html
_DomPoint _convertPointFromPageToNode(Node node, _DomPoint p) native "Window_webkitConvertPointFromPageToNode_Callback";
@DomName('Window.webkitRequestFileSystem')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem
void __requestFileSystem(int type, int size, _FileSystemCallback successCallback, [_ErrorCallback errorCallback]) native "Window_webkitRequestFileSystem_Callback";
Future<FileSystem> _requestFileSystem(int type, int size) {
var completer = new Completer<FileSystem>();
__requestFileSystem(type, size,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('Window.webkitResolveLocalFileSystemURL')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem
void _resolveLocalFileSystemUrl(String url, _EntryCallback successCallback, [_ErrorCallback errorCallback]) native "Window_webkitResolveLocalFileSystemURL_Callback";
Future<Entry> resolveLocalFileSystemUrl(String url) {
var completer = new Completer<Entry>();
_resolveLocalFileSystemUrl(url,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('Window.addEventListener')
@DocsEditable()
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "Window_addEventListener_Callback";
@DomName('Window.dispatchEvent')
@DocsEditable()
bool dispatchEvent(Event event) native "Window_dispatchEvent_Callback";
@DomName('Window.removeEventListener')
@DocsEditable()
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "Window_removeEventListener_Callback";
@DomName('Window.atob')
@DocsEditable()
String atob(String string) native "Window_atob_Callback";
@DomName('Window.btoa')
@DocsEditable()
String btoa(String string) native "Window_btoa_Callback";
@DomName('Window.clearInterval')
@DocsEditable()
void _clearInterval(int handle) native "Window_clearInterval_Callback";
@DomName('Window.clearTimeout')
@DocsEditable()
void _clearTimeout(int handle) native "Window_clearTimeout_Callback";
@DomName('Window.setInterval')
@DocsEditable()
int _setInterval(Object handler, int timeout) native "Window_setInterval_Callback";
@DomName('Window.setTimeout')
@DocsEditable()
int _setTimeout(Object handler, int timeout) native "Window_setTimeout_Callback";
@DomName('Window.onDOMContentLoaded')
@DocsEditable()
Stream<Event> get onContentLoaded => contentLoadedEvent.forTarget(this);
@DomName('Window.onabort')
@DocsEditable()
Stream<Event> get onAbort => Element.abortEvent.forTarget(this);
@DomName('Window.onblur')
@DocsEditable()
Stream<Event> get onBlur => Element.blurEvent.forTarget(this);
@DomName('Window.onchange')
@DocsEditable()
Stream<Event> get onChange => Element.changeEvent.forTarget(this);
@DomName('Window.onclick')
@DocsEditable()
Stream<MouseEvent> get onClick => Element.clickEvent.forTarget(this);
@DomName('Window.oncontextmenu')
@DocsEditable()
Stream<MouseEvent> get onContextMenu => Element.contextMenuEvent.forTarget(this);
@DomName('Window.ondblclick')
@DocsEditable()
Stream<Event> get onDoubleClick => Element.doubleClickEvent.forTarget(this);
@DomName('Window.ondevicemotion')
@DocsEditable()
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
Stream<DeviceMotionEvent> get onDeviceMotion => deviceMotionEvent.forTarget(this);
@DomName('Window.ondeviceorientation')
@DocsEditable()
// http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
@Experimental()
Stream<DeviceOrientationEvent> get onDeviceOrientation => deviceOrientationEvent.forTarget(this);
@DomName('Window.ondrag')
@DocsEditable()
Stream<MouseEvent> get onDrag => Element.dragEvent.forTarget(this);
@DomName('Window.ondragend')
@DocsEditable()
Stream<MouseEvent> get onDragEnd => Element.dragEndEvent.forTarget(this);
@DomName('Window.ondragenter')
@DocsEditable()
Stream<MouseEvent> get onDragEnter => Element.dragEnterEvent.forTarget(this);
@DomName('Window.ondragleave')
@DocsEditable()
Stream<MouseEvent> get onDragLeave => Element.dragLeaveEvent.forTarget(this);
@DomName('Window.ondragover')
@DocsEditable()
Stream<MouseEvent> get onDragOver => Element.dragOverEvent.forTarget(this);
@DomName('Window.ondragstart')
@DocsEditable()
Stream<MouseEvent> get onDragStart => Element.dragStartEvent.forTarget(this);
@DomName('Window.ondrop')
@DocsEditable()
Stream<MouseEvent> get onDrop => Element.dropEvent.forTarget(this);
@DomName('Window.onerror')
@DocsEditable()
Stream<Event> get onError => Element.errorEvent.forTarget(this);
@DomName('Window.onfocus')
@DocsEditable()
Stream<Event> get onFocus => Element.focusEvent.forTarget(this);
@DomName('Window.onhashchange')
@DocsEditable()
Stream<Event> get onHashChange => hashChangeEvent.forTarget(this);
@DomName('Window.oninput')
@DocsEditable()
Stream<Event> get onInput => Element.inputEvent.forTarget(this);
@DomName('Window.oninvalid')
@DocsEditable()
Stream<Event> get onInvalid => Element.invalidEvent.forTarget(this);
@DomName('Window.onkeydown')
@DocsEditable()
Stream<KeyboardEvent> get onKeyDown => Element.keyDownEvent.forTarget(this);
@DomName('Window.onkeypress')
@DocsEditable()
Stream<KeyboardEvent> get onKeyPress => Element.keyPressEvent.forTarget(this);
@DomName('Window.onkeyup')
@DocsEditable()
Stream<KeyboardEvent> get onKeyUp => Element.keyUpEvent.forTarget(this);
@DomName('Window.onload')
@DocsEditable()
Stream<Event> get onLoad => Element.loadEvent.forTarget(this);
@DomName('Window.onmessage')
@DocsEditable()
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
@DomName('Window.onmousedown')
@DocsEditable()
Stream<MouseEvent> get onMouseDown => Element.mouseDownEvent.forTarget(this);
@DomName('Window.onmouseenter')
@DocsEditable()
@Experimental() // untriaged
Stream<MouseEvent> get onMouseEnter => Element.mouseEnterEvent.forTarget(this);
@DomName('Window.onmouseleave')
@DocsEditable()
@Experimental() // untriaged
Stream<MouseEvent> get onMouseLeave => Element.mouseLeaveEvent.forTarget(this);
@DomName('Window.onmousemove')
@DocsEditable()
Stream<MouseEvent> get onMouseMove => Element.mouseMoveEvent.forTarget(this);
@DomName('Window.onmouseout')
@DocsEditable()
Stream<MouseEvent> get onMouseOut => Element.mouseOutEvent.forTarget(this);
@DomName('Window.onmouseover')
@DocsEditable()
Stream<MouseEvent> get onMouseOver => Element.mouseOverEvent.forTarget(this);
@DomName('Window.onmouseup')
@DocsEditable()
Stream<MouseEvent> get onMouseUp => Element.mouseUpEvent.forTarget(this);
@DomName('Window.onmousewheel')
@DocsEditable()
Stream<WheelEvent> get onMouseWheel => Element.mouseWheelEvent.forTarget(this);
@DomName('Window.onoffline')
@DocsEditable()
Stream<Event> get onOffline => offlineEvent.forTarget(this);
@DomName('Window.ononline')
@DocsEditable()
Stream<Event> get onOnline => onlineEvent.forTarget(this);
@DomName('Window.onpagehide')
@DocsEditable()
Stream<Event> get onPageHide => pageHideEvent.forTarget(this);
@DomName('Window.onpageshow')
@DocsEditable()
Stream<Event> get onPageShow => pageShowEvent.forTarget(this);
@DomName('Window.onpopstate')
@DocsEditable()
Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
@DomName('Window.onreset')
@DocsEditable()
Stream<Event> get onReset => Element.resetEvent.forTarget(this);
@DomName('Window.onresize')
@DocsEditable()
Stream<Event> get onResize => resizeEvent.forTarget(this);
@DomName('Window.onscroll')
@DocsEditable()
Stream<Event> get onScroll => Element.scrollEvent.forTarget(this);
@DomName('Window.onsearch')
@DocsEditable()
// http://www.w3.org/TR/html-markup/input.search.html
@Experimental()
Stream<Event> get onSearch => Element.searchEvent.forTarget(this);
@DomName('Window.onselect')
@DocsEditable()
Stream<Event> get onSelect => Element.selectEvent.forTarget(this);
@DomName('Window.onstorage')
@DocsEditable()
Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
@DomName('Window.onsubmit')
@DocsEditable()
Stream<Event> get onSubmit => Element.submitEvent.forTarget(this);
@DomName('Window.ontouchcancel')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchCancel => Element.touchCancelEvent.forTarget(this);
@DomName('Window.ontouchend')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchEnd => Element.touchEndEvent.forTarget(this);
@DomName('Window.ontouchmove')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchMove => Element.touchMoveEvent.forTarget(this);
@DomName('Window.ontouchstart')
@DocsEditable()
// http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
@Experimental()
Stream<TouchEvent> get onTouchStart => Element.touchStartEvent.forTarget(this);
@DomName('Window.ontransitionend')
@DocsEditable()
Stream<TransitionEvent> get onTransitionEnd => Element.transitionEndEvent.forTarget(this);
@DomName('Window.onunload')
@DocsEditable()
Stream<Event> get onUnload => unloadEvent.forTarget(this);
@DomName('Window.onwebkitAnimationEnd')
@DocsEditable()
@Experimental()
Stream<AnimationEvent> get onAnimationEnd => animationEndEvent.forTarget(this);
@DomName('Window.onwebkitAnimationIteration')
@DocsEditable()
@Experimental()
Stream<AnimationEvent> get onAnimationIteration => animationIterationEvent.forTarget(this);
@DomName('Window.onwebkitAnimationStart')
@DocsEditable()
@Experimental()
Stream<AnimationEvent> get onAnimationStart => animationStartEvent.forTarget(this);
@DomName('Window.beforeunloadEvent')
@DocsEditable()
static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent =
const _BeforeUnloadEventStreamProvider('beforeunload');
@DomName('Window.onbeforeunload')
@DocsEditable()
Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
void moveTo(Point p) {
_moveTo(p.x, p.y);
}
}
/**
* Event object that is fired before the window is closed.
*
* The standard window close behavior can be prevented by setting the
* [returnValue]. This will display a dialog to the user confirming that they
* want to close the page.
*/
abstract class BeforeUnloadEvent implements Event {
/**
* If set to a non-null value, a dialog will be presented to the user
* confirming that they want to close the page.
*/
String returnValue;
}
class _BeforeUnloadEvent extends _WrappedEvent implements BeforeUnloadEvent {
String _returnValue;
_BeforeUnloadEvent(Event base): super(base);
String get returnValue => _returnValue;
void set returnValue(String value) {
_returnValue = value;
}
}
class _BeforeUnloadEventStreamProvider implements
EventStreamProvider<BeforeUnloadEvent> {
final String _eventType;
const _BeforeUnloadEventStreamProvider(this._eventType);
Stream<BeforeUnloadEvent> forTarget(EventTarget e, {bool useCapture: false}) {
var controller = new StreamController(sync: true);
var stream = new _EventStream(e, _eventType, useCapture);
stream.listen((event) {
var wrapped = new _BeforeUnloadEvent(event);
controller.add(wrapped);
return wrapped.returnValue;
});
return controller.stream;
}
String getEventType(EventTarget target) {
return _eventType;
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WindowBase64')
@Experimental() // untriaged
abstract class WindowBase64 extends NativeFieldWrapperClass1 {
@DomName('WindowBase64.atob')
@DocsEditable()
@Experimental() // untriaged
String atob(String string) native "WindowBase64_atob_Callback";
@DomName('WindowBase64.btoa')
@DocsEditable()
@Experimental() // untriaged
String btoa(String string) native "WindowBase64_btoa_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WindowTimers')
@Experimental() // untriaged
abstract class WindowTimers extends NativeFieldWrapperClass1 {
@DomName('WindowTimers.clearInterval')
@DocsEditable()
@Experimental() // untriaged
void clearInterval(int handle) native "WindowTimers_clearInterval_Callback";
@DomName('WindowTimers.clearTimeout')
@DocsEditable()
@Experimental() // untriaged
void clearTimeout(int handle) native "WindowTimers_clearTimeout_Callback";
@DomName('WindowTimers.setInterval')
@DocsEditable()
@Experimental() // untriaged
int setInterval(Object handler, int timeout) native "WindowTimers_setInterval_Callback";
@DomName('WindowTimers.setTimeout')
@DocsEditable()
@Experimental() // untriaged
int setTimeout(Object handler, int timeout) native "WindowTimers_setTimeout_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Worker')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
// http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#worker
@Experimental() // stable
class Worker extends EventTarget implements AbstractWorker {
// To suppress missing implicit constructor warnings.
factory Worker._() { throw new UnsupportedError("Not supported"); }
@DomName('Worker.errorEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('Worker.messageEvent')
@DocsEditable()
static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
@DomName('Worker.Worker')
@DocsEditable()
factory Worker(String scriptUrl) {
return Worker._create_1(scriptUrl);
}
@DocsEditable()
static Worker _create_1(scriptUrl) native "Worker__create_1constructorCallback";
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('Worker.postMessage')
@DocsEditable()
void postMessage(/*SerializedScriptValue*/ message, [List messagePorts]) native "Worker_postMessage_Callback";
@DomName('Worker.terminate')
@DocsEditable()
void terminate() native "Worker_terminate_Callback";
@DomName('Worker.addEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "Worker_addEventListener_Callback";
@DomName('Worker.dispatchEvent')
@DocsEditable()
@Experimental() // untriaged
bool dispatchEvent(Event event) native "Worker_dispatchEvent_Callback";
@DomName('Worker.removeEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "Worker_removeEventListener_Callback";
@DomName('Worker.onerror')
@DocsEditable()
@Experimental() // untriaged
Stream<Event> get onError => errorEvent.forTarget(this);
@DomName('Worker.onmessage')
@DocsEditable()
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WorkerConsole')
@Experimental() // untriaged
class WorkerConsole extends ConsoleBase {
// To suppress missing implicit constructor warnings.
factory WorkerConsole._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WorkerCrypto')
@Experimental() // untriaged
class WorkerCrypto extends NativeFieldWrapperClass1 {
@DomName('WorkerCrypto.getRandomValues')
@DocsEditable()
@Experimental() // untriaged
TypedData getRandomValues(TypedData array) native "WorkerCrypto_getRandomValues_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WorkerGlobalScope')
@Experimental() // untriaged
class WorkerGlobalScope extends EventTarget implements WindowTimers, WindowBase64 {
// To suppress missing implicit constructor warnings.
factory WorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
@DomName('WorkerGlobalScope.errorEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
@DomName('WorkerGlobalScope.PERSISTENT')
@DocsEditable()
@Experimental() // untriaged
static const int PERSISTENT = 1;
@DomName('WorkerGlobalScope.TEMPORARY')
@DocsEditable()
@Experimental() // untriaged
static const int TEMPORARY = 0;
@DomName('WorkerGlobalScope.console')
@DocsEditable()
@Experimental() // untriaged
WorkerConsole get console native "WorkerGlobalScope_console_Getter";
@DomName('WorkerGlobalScope.crypto')
@DocsEditable()
@Experimental() // untriaged
WorkerCrypto get crypto native "WorkerGlobalScope_crypto_Getter";
@DomName('WorkerGlobalScope.indexedDB')
@DocsEditable()
@Experimental() // untriaged
IdbFactory get indexedDB native "WorkerGlobalScope_indexedDB_Getter";
@DomName('WorkerGlobalScope.location')
@DocsEditable()
@Experimental() // untriaged
_WorkerLocation get location native "WorkerGlobalScope_location_Getter";
@DomName('WorkerGlobalScope.navigator')
@DocsEditable()
@Experimental() // untriaged
_WorkerNavigator get navigator native "WorkerGlobalScope_navigator_Getter";
@DomName('WorkerGlobalScope.performance')
@DocsEditable()
@Experimental() // untriaged
WorkerPerformance get performance native "WorkerGlobalScope_performance_Getter";
@DomName('WorkerGlobalScope.self')
@DocsEditable()
@Experimental() // untriaged
WorkerGlobalScope get self native "WorkerGlobalScope_self_Getter";
@DomName('WorkerGlobalScope.webkitNotifications')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // untriaged
NotificationCenter get notifications native "WorkerGlobalScope_webkitNotifications_Getter";
@DomName('WorkerGlobalScope.close')
@DocsEditable()
@Experimental() // untriaged
void close() native "WorkerGlobalScope_close_Callback";
@DomName('WorkerGlobalScope.openDatabase')
@DocsEditable()
@Experimental() // untriaged
SqlDatabase openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native "WorkerGlobalScope_openDatabase_Callback";
@DomName('WorkerGlobalScope.openDatabaseSync')
@DocsEditable()
@Experimental() // untriaged
_DatabaseSync openDatabaseSync(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native "WorkerGlobalScope_openDatabaseSync_Callback";
@DomName('WorkerGlobalScope.webkitRequestFileSystem')
@DocsEditable()
@Experimental() // untriaged
void _webkitRequestFileSystem(int type, int size, [_FileSystemCallback successCallback, _ErrorCallback errorCallback]) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
Future<FileSystem> webkitRequestFileSystem(int type, int size) {
var completer = new Completer<FileSystem>();
_webkitRequestFileSystem(type, size,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('WorkerGlobalScope.webkitRequestFileSystemSync')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // untriaged
_DOMFileSystemSync requestFileSystemSync(int type, int size) native "WorkerGlobalScope_webkitRequestFileSystemSync_Callback";
@DomName('WorkerGlobalScope.webkitResolveLocalFileSystemSyncURL')
@DocsEditable()
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
@Experimental() // untriaged
_EntrySync resolveLocalFileSystemSyncUrl(String url) native "WorkerGlobalScope_webkitResolveLocalFileSystemSyncURL_Callback";
@DomName('WorkerGlobalScope.webkitResolveLocalFileSystemURL')
@DocsEditable()
@Experimental() // untriaged
void _webkitResolveLocalFileSystemUrl(String url, _EntryCallback successCallback, [_ErrorCallback errorCallback]) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
Future<Entry> webkitResolveLocalFileSystemUrl(String url) {
var completer = new Completer<Entry>();
_webkitResolveLocalFileSystemUrl(url,
(value) { completer.complete(value); },
(error) { completer.completeError(error); });
return completer.future;
}
@DomName('WorkerGlobalScope.addEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "WorkerGlobalScope_addEventListener_Callback";
@DomName('WorkerGlobalScope.dispatchEvent')
@DocsEditable()
@Experimental() // untriaged
bool dispatchEvent(Event event) native "WorkerGlobalScope_dispatchEvent_Callback";
@DomName('WorkerGlobalScope.removeEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "WorkerGlobalScope_removeEventListener_Callback";
@DomName('WorkerGlobalScope.atob')
@DocsEditable()
@Experimental() // untriaged
String atob(String string) native "WorkerGlobalScope_atob_Callback";
@DomName('WorkerGlobalScope.btoa')
@DocsEditable()
@Experimental() // untriaged
String btoa(String string) native "WorkerGlobalScope_btoa_Callback";
@DomName('WorkerGlobalScope.clearInterval')
@DocsEditable()
@Experimental() // untriaged
void clearInterval(int handle) native "WorkerGlobalScope_clearInterval_Callback";
@DomName('WorkerGlobalScope.clearTimeout')
@DocsEditable()
@Experimental() // untriaged
void clearTimeout(int handle) native "WorkerGlobalScope_clearTimeout_Callback";
@DomName('WorkerGlobalScope.setInterval')
@DocsEditable()
@Experimental() // untriaged
int setInterval(Object handler, int timeout) native "WorkerGlobalScope_setInterval_Callback";
@DomName('WorkerGlobalScope.setTimeout')
@DocsEditable()
@Experimental() // untriaged
int setTimeout(Object handler, int timeout) native "WorkerGlobalScope_setTimeout_Callback";
@DomName('WorkerGlobalScope.onerror')
@DocsEditable()
@Experimental() // untriaged
Stream<Event> get onError => errorEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WorkerPerformance')
@Experimental() // untriaged
class WorkerPerformance extends NativeFieldWrapperClass1 {
@DomName('WorkerPerformance.now')
@DocsEditable()
@Experimental() // untriaged
double now() native "WorkerPerformance_now_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XPathEvaluator')
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
@deprecated // experimental
class XPathEvaluator extends NativeFieldWrapperClass1 {
@DomName('XPathEvaluator.XPathEvaluator')
@DocsEditable()
factory XPathEvaluator() {
return XPathEvaluator._create_1();
}
@DocsEditable()
static XPathEvaluator _create_1() native "XPathEvaluator__create_1constructorCallback";
@DomName('XPathEvaluator.createExpression')
@DocsEditable()
XPathExpression createExpression(String expression, XPathNSResolver resolver) native "XPathEvaluator_createExpression_Callback";
@DomName('XPathEvaluator.createNSResolver')
@DocsEditable()
XPathNSResolver createNSResolver(Node nodeResolver) native "XPathEvaluator_createNSResolver_Callback";
@DomName('XPathEvaluator.evaluate')
@DocsEditable()
XPathResult evaluate(String expression, Node contextNode, XPathNSResolver resolver, int type, XPathResult inResult) native "XPathEvaluator_evaluate_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XPathExpression')
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
@deprecated // experimental
class XPathExpression extends NativeFieldWrapperClass1 {
@DomName('XPathExpression.evaluate')
@DocsEditable()
XPathResult evaluate(Node contextNode, int type, XPathResult inResult) native "XPathExpression_evaluate_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XPathNSResolver')
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
@deprecated // experimental
class XPathNSResolver extends NativeFieldWrapperClass1 {
@DomName('XPathNSResolver.lookupNamespaceURI')
@DocsEditable()
String lookupNamespaceUri(String prefix) native "XPathNSResolver_lookupNamespaceURI_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XPathResult')
// http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
@deprecated // experimental
class XPathResult extends NativeFieldWrapperClass1 {
@DomName('XPathResult.ANY_TYPE')
@DocsEditable()
static const int ANY_TYPE = 0;
@DomName('XPathResult.ANY_UNORDERED_NODE_TYPE')
@DocsEditable()
static const int ANY_UNORDERED_NODE_TYPE = 8;
@DomName('XPathResult.BOOLEAN_TYPE')
@DocsEditable()
static const int BOOLEAN_TYPE = 3;
@DomName('XPathResult.FIRST_ORDERED_NODE_TYPE')
@DocsEditable()
static const int FIRST_ORDERED_NODE_TYPE = 9;
@DomName('XPathResult.NUMBER_TYPE')
@DocsEditable()
static const int NUMBER_TYPE = 1;
@DomName('XPathResult.ORDERED_NODE_ITERATOR_TYPE')
@DocsEditable()
static const int ORDERED_NODE_ITERATOR_TYPE = 5;
@DomName('XPathResult.ORDERED_NODE_SNAPSHOT_TYPE')
@DocsEditable()
static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;
@DomName('XPathResult.STRING_TYPE')
@DocsEditable()
static const int STRING_TYPE = 2;
@DomName('XPathResult.UNORDERED_NODE_ITERATOR_TYPE')
@DocsEditable()
static const int UNORDERED_NODE_ITERATOR_TYPE = 4;
@DomName('XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE')
@DocsEditable()
static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;
@DomName('XPathResult.booleanValue')
@DocsEditable()
bool get booleanValue native "XPathResult_booleanValue_Getter";
@DomName('XPathResult.invalidIteratorState')
@DocsEditable()
bool get invalidIteratorState native "XPathResult_invalidIteratorState_Getter";
@DomName('XPathResult.numberValue')
@DocsEditable()
double get numberValue native "XPathResult_numberValue_Getter";
@DomName('XPathResult.resultType')
@DocsEditable()
int get resultType native "XPathResult_resultType_Getter";
@DomName('XPathResult.singleNodeValue')
@DocsEditable()
Node get singleNodeValue native "XPathResult_singleNodeValue_Getter";
@DomName('XPathResult.snapshotLength')
@DocsEditable()
int get snapshotLength native "XPathResult_snapshotLength_Getter";
@DomName('XPathResult.stringValue')
@DocsEditable()
String get stringValue native "XPathResult_stringValue_Getter";
@DomName('XPathResult.iterateNext')
@DocsEditable()
Node iterateNext() native "XPathResult_iterateNext_Callback";
@DomName('XPathResult.snapshotItem')
@DocsEditable()
Node snapshotItem(int index) native "XPathResult_snapshotItem_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XMLHttpRequestEventTarget')
@Experimental() // untriaged
class XmlHttpRequestEventTarget extends EventTarget {
// To suppress missing implicit constructor warnings.
factory XmlHttpRequestEventTarget._() { throw new UnsupportedError("Not supported"); }
@DomName('XMLHttpRequestEventTarget.abortEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
@DomName('XMLHttpRequestEventTarget.errorEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
@DomName('XMLHttpRequestEventTarget.loadEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
@DomName('XMLHttpRequestEventTarget.loadendEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
@DomName('XMLHttpRequestEventTarget.loadstartEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
@DomName('XMLHttpRequestEventTarget.progressEvent')
@DocsEditable()
@Experimental() // untriaged
static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
@DomName('XMLHttpRequestEventTarget.addEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "XMLHttpRequestEventTarget_addEventListener_Callback";
@DomName('XMLHttpRequestEventTarget.dispatchEvent')
@DocsEditable()
@Experimental() // untriaged
bool dispatchEvent(Event event) native "XMLHttpRequestEventTarget_dispatchEvent_Callback";
@DomName('XMLHttpRequestEventTarget.removeEventListener')
@DocsEditable()
@Experimental() // untriaged
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "XMLHttpRequestEventTarget_removeEventListener_Callback";
@DomName('XMLHttpRequestEventTarget.onabort')
@DocsEditable()
@Experimental() // untriaged
Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
@DomName('XMLHttpRequestEventTarget.onerror')
@DocsEditable()
@Experimental() // untriaged
Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
@DomName('XMLHttpRequestEventTarget.onload')
@DocsEditable()
@Experimental() // untriaged
Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
@DomName('XMLHttpRequestEventTarget.onloadend')
@DocsEditable()
@Experimental() // untriaged
Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
@DomName('XMLHttpRequestEventTarget.onloadstart')
@DocsEditable()
@Experimental() // untriaged
Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
@DomName('XMLHttpRequestEventTarget.onprogress')
@DocsEditable()
@Experimental() // untriaged
Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XMLSerializer')
// http://domparsing.spec.whatwg.org/#the-xmlserializer-interface
@deprecated // stable
class XmlSerializer extends NativeFieldWrapperClass1 {
@DomName('XMLSerializer.XMLSerializer')
@DocsEditable()
factory XmlSerializer() {
return XmlSerializer._create_1();
}
@DocsEditable()
static XmlSerializer _create_1() native "XMLSerializer__create_1constructorCallback";
@DomName('XMLSerializer.serializeToString')
@DocsEditable()
String serializeToString(Node node) native "XMLSerializer_serializeToString_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('XSLTProcessor')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
@deprecated // nonstandard
class XsltProcessor extends NativeFieldWrapperClass1 {
@DomName('XSLTProcessor.XSLTProcessor')
@DocsEditable()
factory XsltProcessor() {
return XsltProcessor._create_1();
}
@DocsEditable()
static XsltProcessor _create_1() native "XSLTProcessor__create_1constructorCallback";
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('XSLTProcessor.clearParameters')
@DocsEditable()
void clearParameters() native "XSLTProcessor_clearParameters_Callback";
@DomName('XSLTProcessor.getParameter')
@DocsEditable()
String getParameter(String namespaceURI, String localName) native "XSLTProcessor_getParameter_Callback";
@DomName('XSLTProcessor.importStylesheet')
@DocsEditable()
void importStylesheet(Node stylesheet) native "XSLTProcessor_importStylesheet_Callback";
@DomName('XSLTProcessor.removeParameter')
@DocsEditable()
void removeParameter(String namespaceURI, String localName) native "XSLTProcessor_removeParameter_Callback";
@DomName('XSLTProcessor.reset')
@DocsEditable()
void reset() native "XSLTProcessor_reset_Callback";
@DomName('XSLTProcessor.setParameter')
@DocsEditable()
void setParameter(String namespaceURI, String localName, String value) native "XSLTProcessor_setParameter_Callback";
@DomName('XSLTProcessor.transformToDocument')
@DocsEditable()
Document transformToDocument(Node source) native "XSLTProcessor_transformToDocument_Callback";
@DomName('XSLTProcessor.transformToFragment')
@DocsEditable()
DocumentFragment transformToFragment(Node source, Document docVal) native "XSLTProcessor_transformToFragment_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Attr')
class _Attr extends Node {
// To suppress missing implicit constructor warnings.
factory _Attr._() { throw new UnsupportedError("Not supported"); }
@DomName('Attr.isId')
@DocsEditable()
bool get isId native "Attr_isId_Getter";
@DomName('Attr.localName')
@DocsEditable()
@Experimental() // untriaged
String get _localName native "Attr_localName_Getter";
@DomName('Attr.name')
@DocsEditable()
String get name native "Attr_name_Getter";
@DomName('Attr.namespaceURI')
@DocsEditable()
@Experimental() // untriaged
String get _namespaceUri native "Attr_namespaceURI_Getter";
@DomName('Attr.ownerElement')
@DocsEditable()
@deprecated // deprecated
Element get ownerElement native "Attr_ownerElement_Getter";
@DomName('Attr.specified')
@DocsEditable()
@deprecated // deprecated
bool get specified native "Attr_specified_Getter";
@DomName('Attr.value')
@DocsEditable()
String get value native "Attr_value_Getter";
@DomName('Attr.value')
@DocsEditable()
void set value(String value) native "Attr_value_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSPrimitiveValue')
// http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
@deprecated // deprecated
abstract class _CSSPrimitiveValue extends _CSSValue {
// To suppress missing implicit constructor warnings.
factory _CSSPrimitiveValue._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSValue')
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
abstract class _CSSValue extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('ClientRect')
class _ClientRect extends NativeFieldWrapperClass1 implements Rect {
// NOTE! All code below should be common with Rect.
// TODO(blois): implement with mixins when available.
String toString() {
return '($left, $top, $width, $height)';
}
bool operator ==(other) {
if (other is !Rect) return false;
return left == other.left && top == other.top && width == other.width &&
height == other.height;
}
int get hashCode => JenkinsSmiHash.hash4(left.hashCode, top.hashCode,
width.hashCode, height.hashCode);
/**
* Computes the intersection of this rectangle and the rectangle parameter.
* Returns null if there is no intersection.
*/
Rect intersection(Rect rect) {
var x0 = max(left, rect.left);
var x1 = min(left + width, rect.left + rect.width);
if (x0 <= x1) {
var y0 = max(top, rect.top);
var y1 = min(top + height, rect.top + rect.height);
if (y0 <= y1) {
return new Rect(x0, y0, x1 - x0, y1 - y0);
}
}
return null;
}
/**
* Returns whether a rectangle intersects this rectangle.
*/
bool intersects(Rect other) {
return (left <= other.left + other.width && other.left <= left + width &&
top <= other.top + other.height && other.top <= top + height);
}
/**
* Returns a new rectangle which completely contains this rectangle and the
* input rectangle.
*/
Rect union(Rect rect) {
var right = max(this.left + this.width, rect.left + rect.width);
var bottom = max(this.top + this.height, rect.top + rect.height);
var left = min(this.left, rect.left);
var top = min(this.top, rect.top);
return new Rect(left, top, right - left, bottom - top);
}
/**
* Tests whether this rectangle entirely contains another rectangle.
*/
bool containsRect(Rect another) {
return left <= another.left &&
left + width >= another.left + another.width &&
top <= another.top &&
top + height >= another.top + another.height;
}
/**
* Tests whether this rectangle entirely contains a point.
*/
bool containsPoint(Point another) {
return another.x >= left &&
another.x <= left + width &&
another.y >= top &&
another.y <= top + height;
}
Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
height.floor());
Rect round() => new Rect(left.round(), top.round(), width.round(),
height.round());
/**
* Truncates coordinates to integers and returns the result as a new
* rectangle.
*/
Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
height.toInt());
Point get topLeft => new Point(this.left, this.top);
Point get bottomRight => new Point(this.left + this.width,
this.top + this.height);
@DomName('ClientRect.bottom')
@DocsEditable()
double get bottom native "ClientRect_bottom_Getter";
@DomName('ClientRect.height')
@DocsEditable()
double get height native "ClientRect_height_Getter";
@DomName('ClientRect.left')
@DocsEditable()
double get left native "ClientRect_left_Getter";
@DomName('ClientRect.right')
@DocsEditable()
double get right native "ClientRect_right_Getter";
@DomName('ClientRect.top')
@DocsEditable()
double get top native "ClientRect_top_Getter";
@DomName('ClientRect.width')
@DocsEditable()
double get width native "ClientRect_width_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('ClientRectList')
class _ClientRectList extends NativeFieldWrapperClass1 with ListMixin<Rect>, ImmutableListMixin<Rect> implements List<Rect> {
@DomName('ClientRectList.length')
@DocsEditable()
int get length native "ClientRectList_length_Getter";
Rect operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Rect _nativeIndexedGetter(int index) native "ClientRectList_item_Callback";
void operator[]=(int index, Rect value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Rect> mixins.
// Rect is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Rect get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Rect get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Rect get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Rect elementAt(int index) => this[index];
// -- end List<Rect> mixins.
@DomName('ClientRectList.item')
@DocsEditable()
Rect item(int index) native "ClientRectList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Counter')
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
abstract class _Counter extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSRuleList')
class _CssRuleList extends NativeFieldWrapperClass1 with ListMixin<CssRule>, ImmutableListMixin<CssRule> implements List<CssRule> {
@DomName('CSSRuleList.length')
@DocsEditable()
int get length native "CSSRuleList_length_Getter";
CssRule operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
CssRule _nativeIndexedGetter(int index) native "CSSRuleList_item_Callback";
void operator[]=(int index, CssRule value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<CssRule> mixins.
// CssRule is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
CssRule get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
CssRule get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
CssRule get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
CssRule elementAt(int index) => this[index];
// -- end List<CssRule> mixins.
@DomName('CSSRuleList.item')
@DocsEditable()
CssRule item(int index) native "CSSRuleList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSValueList')
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
class _CssValueList extends _CSSValue with ListMixin<_CSSValue>, ImmutableListMixin<_CSSValue> implements List<_CSSValue> {
// To suppress missing implicit constructor warnings.
factory _CssValueList._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSValueList.length')
@DocsEditable()
int get length native "CSSValueList_length_Getter";
_CSSValue operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
_CSSValue _nativeIndexedGetter(int index) native "CSSValueList_item_Callback";
void operator[]=(int index, _CSSValue value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<_CSSValue> mixins.
// _CSSValue is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
_CSSValue get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
_CSSValue get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
_CSSValue get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
_CSSValue elementAt(int index) => this[index];
// -- end List<_CSSValue> mixins.
@DomName('CSSValueList.item')
@DocsEditable()
_CSSValue item(int index) native "CSSValueList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DOMFileSystemSync')
@SupportedBrowser(SupportedBrowser.CHROME)
@Experimental()
// http://www.w3.org/TR/file-system-api/#the-filesystemsync-interface
abstract class _DOMFileSystemSync extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DatabaseSync')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://www.w3.org/TR/webdatabase/#databasesync
@deprecated // deprecated
abstract class _DatabaseSync extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DirectoryEntrySync')
// http://www.w3.org/TR/file-system-api/#the-directoryentrysync-interface
@Experimental()
abstract class _DirectoryEntrySync extends _EntrySync {
// To suppress missing implicit constructor warnings.
factory _DirectoryEntrySync._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('DirectoryReaderSync')
// http://www.w3.org/TR/file-system-api/#idl-def-DirectoryReaderSync
@Experimental()
abstract class _DirectoryReaderSync extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitPoint')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental()
// http://developer.apple.com/library/safari/#documentation/DataManagement/Reference/DOMWindowAdditionsReference/DOMWindowAdditions/DOMWindowAdditions.html
@Experimental() // non-standard
class _DomPoint extends NativeFieldWrapperClass1 {
@DomName('WebKitPoint.WebKitPoint')
@DocsEditable()
factory _DomPoint(num x, num y) => _create(x, y);
@DocsEditable()
static _DomPoint _create(x, y) native "WebKitPoint_constructorCallback";
/// Checks if this type is supported on the current platform.
static bool get supported => true;
@DomName('WebKitPoint.x')
@DocsEditable()
num get x native "WebKitPoint_x_Getter";
@DomName('WebKitPoint.x')
@DocsEditable()
void set x(num value) native "WebKitPoint_x_Setter";
@DomName('WebKitPoint.y')
@DocsEditable()
num get y native "WebKitPoint_y_Getter";
@DomName('WebKitPoint.y')
@DocsEditable()
void set y(num value) native "WebKitPoint_y_Setter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Entity')
@deprecated // deprecated
class _Entity extends Node {
// To suppress missing implicit constructor warnings.
factory _Entity._() { throw new UnsupportedError("Not supported"); }
@DomName('Entity.notationName')
@DocsEditable()
String get notationName native "Entity_notationName_Getter";
@DomName('Entity.publicId')
@DocsEditable()
String get publicId native "Entity_publicId_Getter";
@DomName('Entity.systemId')
@DocsEditable()
String get systemId native "Entity_systemId_Getter";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('EntrySync')
// http://www.w3.org/TR/file-system-api/#idl-def-EntrySync
@Experimental()
abstract class _EntrySync extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileEntrySync')
// http://www.w3.org/TR/file-system-api/#the-fileentrysync-interface
@Experimental()
abstract class _FileEntrySync extends _EntrySync {
// To suppress missing implicit constructor warnings.
factory _FileEntrySync._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileReaderSync')
// http://www.w3.org/TR/FileAPI/#FileReaderSync
@Experimental()
abstract class _FileReaderSync extends NativeFieldWrapperClass1 {
@DomName('FileReaderSync.FileReaderSync')
@DocsEditable()
factory _FileReaderSync() {
return _FileReaderSync._create_1();
}
@DocsEditable()
static _FileReaderSync _create_1() native "FileReaderSync__create_1constructorCallback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('FileWriterSync')
// http://www.w3.org/TR/file-writer-api/#idl-def-FileWriterSync
@Experimental()
abstract class _FileWriterSync extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('GamepadList')
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html
@Experimental()
class _GamepadList extends NativeFieldWrapperClass1 with ListMixin<Gamepad>, ImmutableListMixin<Gamepad> implements List<Gamepad> {
@DomName('GamepadList.length')
@DocsEditable()
int get length native "GamepadList_length_Getter";
Gamepad operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Gamepad _nativeIndexedGetter(int index) native "GamepadList_item_Callback";
void operator[]=(int index, Gamepad value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Gamepad> mixins.
// Gamepad is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Gamepad get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Gamepad get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Gamepad get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Gamepad elementAt(int index) => this[index];
// -- end List<Gamepad> mixins.
@DomName('GamepadList.item')
@DocsEditable()
Gamepad item(int index) native "GamepadList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLAppletElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-applet-element
@deprecated // deprecated
abstract class _HTMLAppletElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLAppletElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLBaseFontElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#basefont
@deprecated // deprecated
abstract class _HTMLBaseFontElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLBaseFontElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLDirectoryElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dir
@deprecated // deprecated
abstract class _HTMLDirectoryElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLDirectoryElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLFontElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlfontelement
@deprecated // deprecated
abstract class _HTMLFontElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLFontElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLFrameElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlframeelement
@deprecated // deprecated
abstract class _HTMLFrameElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLFrameElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLFrameSetElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#frameset
@deprecated // deprecated
abstract class _HTMLFrameSetElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLFrameSetElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('HTMLMarqueeElement')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-marquee-element
@deprecated // deprecated
abstract class _HTMLMarqueeElement extends HtmlElement {
// To suppress missing implicit constructor warnings.
factory _HTMLMarqueeElement._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('NamedNodeMap')
// http://dom.spec.whatwg.org/#namednodemap
@deprecated // deprecated
class _NamedNodeMap extends NativeFieldWrapperClass1 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
@DomName('NamedNodeMap.length')
@DocsEditable()
int get length native "NamedNodeMap_length_Getter";
Node operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
Node _nativeIndexedGetter(int index) native "NamedNodeMap_item_Callback";
void operator[]=(int index, Node value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<Node> mixins.
// Node is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
Node get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
Node get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
Node get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
Node elementAt(int index) => this[index];
// -- end List<Node> mixins.
@DomName('NamedNodeMap.__getter__')
@DocsEditable()
Node __getter__(String name) native "NamedNodeMap___getter___Callback";
@DomName('NamedNodeMap.getNamedItem')
@DocsEditable()
Node getNamedItem(String name) native "NamedNodeMap_getNamedItem_Callback";
@DomName('NamedNodeMap.getNamedItemNS')
@DocsEditable()
Node getNamedItemNS(String namespaceURI, String localName) native "NamedNodeMap_getNamedItemNS_Callback";
@DomName('NamedNodeMap.item')
@DocsEditable()
Node item(int index) native "NamedNodeMap_item_Callback";
@DomName('NamedNodeMap.removeNamedItem')
@DocsEditable()
Node removeNamedItem(String name) native "NamedNodeMap_removeNamedItem_Callback";
@DomName('NamedNodeMap.removeNamedItemNS')
@DocsEditable()
Node removeNamedItemNS(String namespaceURI, String localName) native "NamedNodeMap_removeNamedItemNS_Callback";
@DomName('NamedNodeMap.setNamedItem')
@DocsEditable()
Node setNamedItem(Node node) native "NamedNodeMap_setNamedItem_Callback";
@DomName('NamedNodeMap.setNamedItemNS')
@DocsEditable()
Node setNamedItemNS(Node node) native "NamedNodeMap_setNamedItemNS_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('PagePopupController')
@deprecated // nonstandard
abstract class _PagePopupController extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('RGBColor')
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
abstract class _RGBColor extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DomName('RadioNodeList')
abstract class _RadioNodeList extends NodeList {
// To suppress missing implicit constructor warnings.
factory _RadioNodeList._() { throw new UnsupportedError("Not supported"); }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('Rect')
// http://dev.w3.org/csswg/cssom/
@deprecated // deprecated
abstract class _Rect extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SharedWorker')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#shared-workers-and-the-sharedworker-interface
@Experimental()
abstract class _SharedWorker extends EventTarget implements AbstractWorker {
// To suppress missing implicit constructor warnings.
factory _SharedWorker._() { throw new UnsupportedError("Not supported"); }
@DomName('SharedWorker.SharedWorker')
@DocsEditable()
factory _SharedWorker(String scriptURL, [String name]) {
return _SharedWorker._create_1(scriptURL, name);
}
@DocsEditable()
static _SharedWorker _create_1(scriptURL, name) native "SharedWorker__create_1constructorCallback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechInputResultList')
// http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#speech_input_result_list_interface
@Experimental()
class _SpeechInputResultList extends NativeFieldWrapperClass1 with ListMixin<SpeechInputResult>, ImmutableListMixin<SpeechInputResult> implements List<SpeechInputResult> {
@DomName('SpeechInputResultList.length')
@DocsEditable()
int get length native "SpeechInputResultList_length_Getter";
SpeechInputResult operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
SpeechInputResult _nativeIndexedGetter(int index) native "SpeechInputResultList_item_Callback";
void operator[]=(int index, SpeechInputResult value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<SpeechInputResult> mixins.
// SpeechInputResult is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
SpeechInputResult get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
SpeechInputResult get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
SpeechInputResult get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
SpeechInputResult elementAt(int index) => this[index];
// -- end List<SpeechInputResult> mixins.
@DomName('SpeechInputResultList.item')
@DocsEditable()
SpeechInputResult item(int index) native "SpeechInputResultList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('SpeechRecognitionResultList')
// https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionresultlist
@Experimental()
class _SpeechRecognitionResultList extends NativeFieldWrapperClass1 with ListMixin<SpeechRecognitionResult>, ImmutableListMixin<SpeechRecognitionResult> implements List<SpeechRecognitionResult> {
@DomName('SpeechRecognitionResultList.length')
@DocsEditable()
int get length native "SpeechRecognitionResultList_length_Getter";
SpeechRecognitionResult operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
SpeechRecognitionResult _nativeIndexedGetter(int index) native "SpeechRecognitionResultList_item_Callback";
void operator[]=(int index, SpeechRecognitionResult value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<SpeechRecognitionResult> mixins.
// SpeechRecognitionResult is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
SpeechRecognitionResult get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
SpeechRecognitionResult get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
SpeechRecognitionResult get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
SpeechRecognitionResult elementAt(int index) => this[index];
// -- end List<SpeechRecognitionResult> mixins.
@DomName('SpeechRecognitionResultList.item')
@DocsEditable()
SpeechRecognitionResult item(int index) native "SpeechRecognitionResultList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('StyleSheetList')
class _StyleSheetList extends NativeFieldWrapperClass1 with ListMixin<StyleSheet>, ImmutableListMixin<StyleSheet> implements List<StyleSheet> {
@DomName('StyleSheetList.length')
@DocsEditable()
int get length native "StyleSheetList_length_Getter";
StyleSheet operator[](int index) {
if (index < 0 || index >= length)
throw new RangeError.range(index, 0, length);
return _nativeIndexedGetter(index);
}
StyleSheet _nativeIndexedGetter(int index) native "StyleSheetList_item_Callback";
void operator[]=(int index, StyleSheet value) {
throw new UnsupportedError("Cannot assign element of immutable List.");
}
// -- start List<StyleSheet> mixins.
// StyleSheet is the element type.
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
StyleSheet get first {
if (this.length > 0) {
return this[0];
}
throw new StateError("No elements");
}
StyleSheet get last {
int len = this.length;
if (len > 0) {
return this[len - 1];
}
throw new StateError("No elements");
}
StyleSheet get single {
int len = this.length;
if (len == 1) {
return this[0];
}
if (len == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
StyleSheet elementAt(int index) => this[index];
// -- end List<StyleSheet> mixins.
@DomName('StyleSheetList.__getter__')
@DocsEditable()
CssStyleSheet __getter__(String name) native "StyleSheetList___getter___Callback";
@DomName('StyleSheetList.item')
@DocsEditable()
StyleSheet item(int index) native "StyleSheetList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitMediaSource')
@Experimental() // untriaged
abstract class _WebKitMediaSource extends EventTarget {
// To suppress missing implicit constructor warnings.
factory _WebKitMediaSource._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitMediaSource.WebKitMediaSource')
@DocsEditable()
factory _WebKitMediaSource() {
return _WebKitMediaSource._create_1();
}
@DocsEditable()
static _WebKitMediaSource _create_1() native "WebKitMediaSource__create_1constructorCallback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitSourceBuffer')
@Experimental() // untriaged
abstract class _WebKitSourceBuffer extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WebKitSourceBufferList')
@Experimental() // untriaged
abstract class _WebKitSourceBufferList extends EventTarget {
// To suppress missing implicit constructor warnings.
factory _WebKitSourceBufferList._() { throw new UnsupportedError("Not supported"); }
@DomName('WebKitSourceBufferList.item')
@DocsEditable()
@Experimental() // untriaged
_WebKitSourceBuffer _item(int index) native "WebKitSourceBufferList_item_Callback";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WorkerLocation')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workerlocation
@Experimental()
abstract class _WorkerLocation extends NativeFieldWrapperClass1 {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('WorkerNavigator')
// http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workernavigator
@Experimental()
abstract class _WorkerNavigator extends NativeFieldWrapperClass1 implements NavigatorOnLine, NavigatorID {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
abstract class _AttributeMap implements Map<String, String> {
final Element _element;
_AttributeMap(this._element);
bool containsValue(String value) {
for (var v in this.values) {
if (value == v) {
return true;
}
}
return false;
}
String putIfAbsent(String key, String ifAbsent()) {
if (!containsKey(key)) {
this[key] = ifAbsent();
}
return this[key];
}
void clear() {
for (var key in keys) {
remove(key);
}
}
void forEach(void f(String key, String value)) {
for (var key in keys) {
var value = this[key];
f(key, value);
}
}
Iterable<String> get keys {
// TODO: generate a lazy collection instead.
var attributes = _element._attributes;
var keys = new List<String>();
for (int i = 0, len = attributes.length; i < len; i++) {
if (_matches(attributes[i])) {
keys.add(attributes[i].name);
}
}
return keys;
}
Iterable<String> get values {
// TODO: generate a lazy collection instead.
var attributes = _element._attributes;
var values = new List<String>();
for (int i = 0, len = attributes.length; i < len; i++) {
if (_matches(attributes[i])) {
values.add(attributes[i].value);
}
}
return values;
}
/**
* Returns true if there is no {key, value} pair in the map.
*/
bool get isEmpty {
return length == 0;
}
/**
* Returns true if there is at least one {key, value} pair in the map.
*/
bool get isNotEmpty => !isEmpty;
/**
* Checks to see if the node should be included in this map.
*/
bool _matches(Node node);
}
/**
* Wrapper to expose [Element.attributes] as a typed map.
*/
class _ElementAttributeMap extends _AttributeMap {
_ElementAttributeMap(Element element): super(element);
bool containsKey(String key) {
return _element._hasAttribute(key);
}
String operator [](String key) {
return _element._getAttribute(key);
}
void operator []=(String key, String value) {
_element._setAttribute(key, value);
}
String remove(String key) {
String value = _element._getAttribute(key);
_element._removeAttribute(key);
return value;
}
/**
* The number of {key, value} pairs in the map.
*/
int get length {
return keys.length;
}
bool _matches(Node node) => node._namespaceUri == null;
}
/**
* Wrapper to expose namespaced attributes as a typed map.
*/
class _NamespacedAttributeMap extends _AttributeMap {
final String _namespace;
_NamespacedAttributeMap(Element element, this._namespace): super(element);
bool containsKey(String key) {
return _element._hasAttributeNS(_namespace, key);
}
String operator [](String key) {
return _element._getAttributeNS(_namespace, key);
}
void operator []=(String key, String value) {
_element._setAttributeNS(_namespace, key, value);
}
String remove(String key) {
String value = this[key];
_element._removeAttributeNS(_namespace, key);
return value;
}
/**
* The number of {key, value} pairs in the map.
*/
int get length {
return keys.length;
}
bool _matches(Node node) => node._namespaceUri == _namespace;
}
/**
* Provides a Map abstraction on top of data-* attributes, similar to the
* dataSet in the old DOM.
*/
class _DataAttributeMap implements Map<String, String> {
final Map<String, String> _attributes;
_DataAttributeMap(this._attributes);
// interface Map
// TODO: Use lazy iterator when it is available on Map.
bool containsValue(String value) => values.any((v) => v == value);
bool containsKey(String key) => _attributes.containsKey(_attr(key));
String operator [](String key) => _attributes[_attr(key)];
void operator []=(String key, String value) {
_attributes[_attr(key)] = value;
}
String putIfAbsent(String key, String ifAbsent()) =>
_attributes.putIfAbsent(_attr(key), ifAbsent);
String remove(String key) => _attributes.remove(_attr(key));
void clear() {
// Needs to operate on a snapshot since we are mutating the collection.
for (String key in keys) {
remove(key);
}
}
void forEach(void f(String key, String value)) {
_attributes.forEach((String key, String value) {
if (_matches(key)) {
f(_strip(key), value);
}
});
}
Iterable<String> get keys {
final keys = new List<String>();
_attributes.forEach((String key, String value) {
if (_matches(key)) {
keys.add(_strip(key));
}
});
return keys;
}
Iterable<String> get values {
final values = new List<String>();
_attributes.forEach((String key, String value) {
if (_matches(key)) {
values.add(value);
}
});
return values;
}
int get length => keys.length;
// TODO: Use lazy iterator when it is available on Map.
bool get isEmpty => length == 0;
bool get isNotEmpty => !isEmpty;
// Helpers.
String _attr(String key) => 'data-$key';
bool _matches(String key) => key.startsWith('data-');
String _strip(String key) => key.substring(5);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* An object that can be drawn to a [CanvasRenderingContext2D] object with
* [CanvasRenderingContext2D.drawImage],
* [CanvasRenderingContext2D.drawImageToRect],
* [CanvasRenderingContext2D.drawImageScaled], or
* [CanvasRenderingContext2D.drawImageScaledFromSource].
*
* If the CanvasImageSource is an [ImageElement] then the element's image is
* used. If the [ImageElement] is an animated image, then the poster frame is
* used. If there is no poster frame, then the first frame of animation is used.
*
* If the CanvasImageSource is a [VideoElement] then the frame at the current
* playback position is used as the image.
*
* If the CanvasImageSource is a [CanvasElement] then the element's bitmap is
* used.
*
* ** Note: ** Currently, all versions of Internet Explorer do not support
* drawing a VideoElement to a canvas. Also, you may experience problems drawing
* a video to a canvas in Firefox if the source of the video is a data URL.
*
* See also:
*
* * [CanvasImageSource](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#image-sources-for-2d-rendering-contexts)
* from the WHATWG.
* * [drawImage](http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage)
* from the WHATWG.
*/
abstract class CanvasImageSource {}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* An object representing the top-level context object for web scripting.
*
* In a web browser, a [Window] object represents the actual browser window.
* In a multi-tabbed browser, each tab has its own [Window] object. A [Window]
* is the container that displays a [Document]'s content. All web scripting
* happens within the context of a [Window] object.
*
* **Note:** This class represents any window, whereas [Window] is
* used to access the properties and content of the current window.
*
* See also:
*
* * [DOM Window](https://developer.mozilla.org/en-US/docs/DOM/window) from MDN.
* * [Window](http://www.w3.org/TR/Window/) from the W3C.
*/
abstract class WindowBase implements EventTarget {
// Fields.
/**
* The current location of this window.
*
* Location currentLocation = window.location;
* print(currentLocation.href); // 'http://www.example.com:80/'
*/
LocationBase get location;
HistoryBase get history;
/**
* Indicates whether this window has been closed.
*
* print(window.closed); // 'false'
* window.close();
* print(window.closed); // 'true'
*/
bool get closed;
/**
* A reference to the window that opened this one.
*
* Window thisWindow = window;
* WindowBase otherWindow = thisWindow.open('http://www.example.com/', 'foo');
* print(otherWindow.opener == thisWindow); // 'true'
*/
WindowBase get opener;
/**
* A reference to the parent of this window.
*
* If this [WindowBase] has no parent, [parent] will return a reference to
* the [WindowBase] itself.
*
* IFrameElement myIFrame = new IFrameElement();
* window.document.body.elements.add(myIFrame);
* print(myIframe.contentWindow.parent == window) // 'true'
*
* print(window.parent == window) // 'true'
*/
WindowBase get parent;
/**
* A reference to the topmost window in the window hierarchy.
*
* If this [WindowBase] is the topmost [WindowBase], [top] will return a
* reference to the [WindowBase] itself.
*
* // Add an IFrame to the current window.
* IFrameElement myIFrame = new IFrameElement();
* window.document.body.elements.add(myIFrame);
*
* // Add an IFrame inside of the other IFrame.
* IFrameElement innerIFrame = new IFrameElement();
* myIFrame.elements.add(innerIFrame);
*
* print(myIframe.contentWindow.top == window) // 'true'
* print(innerIFrame.contentWindow.top == window) // 'true'
*
* print(window.top == window) // 'true'
*/
WindowBase get top;
// Methods.
/**
* Closes the window.
*
* This method should only succeed if the [WindowBase] object is
* **script-closeable** and the window calling [close] is allowed to navigate
* the window.
*
* A window is script-closeable if it is either a window
* that was opened by another window, or if it is a window with only one
* document in its history.
*
* A window might not be allowed to navigate, and therefore close, another
* window due to browser security features.
*
* var other = window.open('http://www.example.com', 'foo');
* // Closes other window, as it is script-closeable.
* other.close();
* print(other.closed()); // 'true'
*
* window.location('http://www.mysite.com', 'foo');
* // Does not close this window, as the history has changed.
* window.close();
* print(window.closed()); // 'false'
*
* See also:
*
* * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-window-close) from the W3C
*/
void close();
void postMessage(var message, String targetOrigin, [List messagePorts]);
}
abstract class LocationBase {
void set href(String val);
}
abstract class HistoryBase {
void back();
void forward();
void go(int distance);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/** A Set that stores the CSS class names for an element. */
abstract class CssClassSet implements Set<String> {
/**
* Adds the class [value] to the element if it is not on it, removes it if it
* is.
*
* If [shouldAdd] is true, then we always add that [value] to the element. If
* [shouldAdd] is false then we always remove [value] from the element.
*/
bool toggle(String value, [bool shouldAdd]);
/**
* Returns [:true:] if classes cannot be added or removed from this
* [:CssClassSet:].
*/
bool get frozen;
/**
* Determine if this element contains the class [value].
*
* This is the Dart equivalent of jQuery's
* [hasClass](http://api.jquery.com/hasClass/).
*/
bool contains(String value);
/**
* Add the class [value] to element.
*
* This is the Dart equivalent of jQuery's
* [addClass](http://api.jquery.com/addClass/).
*/
void add(String value);
/**
* Remove the class [value] from element, and return true on successful
* removal.
*
* This is the Dart equivalent of jQuery's
* [removeClass](http://api.jquery.com/removeClass/).
*/
bool remove(Object value);
/**
* Add all classes specified in [iterable] to element.
*
* This is the Dart equivalent of jQuery's
* [addClass](http://api.jquery.com/addClass/).
*/
void addAll(Iterable<String> iterable);
/**
* Remove all classes specified in [iterable] from element.
*
* This is the Dart equivalent of jQuery's
* [removeClass](http://api.jquery.com/removeClass/).
*/
void removeAll(Iterable<String> iterable);
/**
* Toggles all classes specified in [iterable] on element.
*
* Iterate through [iterable]'s items, and add it if it is not on it, or
* remove it if it is. This is the Dart equivalent of jQuery's
* [toggleClass](http://api.jquery.com/toggleClass/).
* If [shouldAdd] is true, then we always add all the classes in [iterable]
* element. If [shouldAdd] is false then we always remove all the classes in
* [iterable] from the element.
*/
void toggleAll(Iterable<String> iterable, [bool shouldAdd]);
}
/**
* A set (union) of the CSS classes that are present in a set of elements.
* Implemented separately from _ElementCssClassSet for performance.
*/
class _MultiElementCssClassSet extends CssClassSetImpl {
final Iterable<Element> _elementIterable;
Iterable<_ElementCssClassSet> _elementCssClassSetIterable;
_MultiElementCssClassSet(this._elementIterable) {
_elementCssClassSetIterable = new List.from(_elementIterable).map(
(e) => new _ElementCssClassSet(e));
}
Set<String> readClasses() {
var s = new LinkedHashSet<String>();
_elementCssClassSetIterable.forEach((e) => s.addAll(e.readClasses()));
return s;
}
void writeClasses(Set<String> s) {
var classes = new List.from(s).join(' ');
for (Element e in _elementIterable) {
e.className = classes;
}
}
/**
* Helper method used to modify the set of css classes on this element.
*
* f - callback with:
* s - a Set of all the css class name currently on this element.
*
* After f returns, the modified set is written to the
* className property of this element.
*/
void modify( f(Set<String> s)) {
_elementCssClassSetIterable.forEach((e) => e.modify(f));
}
/**
* Adds the class [value] to the element if it is not on it, removes it if it
* is.
*/
bool toggle(String value, [bool shouldAdd]) =>
_modifyWithReturnValue((e) => e.toggle(value, shouldAdd));
/**
* Remove the class [value] from element, and return true on successful
* removal.
*
* This is the Dart equivalent of jQuery's
* [removeClass](http://api.jquery.com/removeClass/).
*/
bool remove(Object value) => _modifyWithReturnValue((e) => e.remove(value));
bool _modifyWithReturnValue(f) => _elementCssClassSetIterable.fold(
false, (prevValue, element) => f(element) || prevValue);
}
class _ElementCssClassSet extends CssClassSetImpl {
final Element _element;
_ElementCssClassSet(this._element);
Set<String> readClasses() {
var s = new LinkedHashSet<String>();
var classname = _element.className;
for (String name in classname.split(' ')) {
String trimmed = name.trim();
if (!trimmed.isEmpty) {
s.add(trimmed);
}
}
return s;
}
void writeClasses(Set<String> s) {
List list = new List.from(s);
_element.className = s.join(' ');
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* A rectangle representing all the content of the element in the
* [box model](http://www.w3.org/TR/CSS2/box.html).
*/
class _ContentCssRect extends CssRect {
_ContentCssRect(element) : super(element);
num get height => _element.offsetHeight +
_addOrSubtractToBoxModel(_HEIGHT, _CONTENT);
num get width => _element.offsetWidth +
_addOrSubtractToBoxModel(_WIDTH, _CONTENT);
/**
* Set the height to `newHeight`.
*
* newHeight can be either a [num] representing the height in pixels or a
* [Dimension] object. Values of newHeight that are less than zero are
* converted to effectively setting the height to 0. This is equivalent to the
* `height` function in jQuery and the calculated `height` CSS value,
* converted to a num in pixels.
*/
void set height(newHeight) {
if (newHeight is Dimension) {
if (newHeight.value < 0) newHeight = new Dimension.px(0);
_element.style.height = newHeight.toString();
} else {
if (newHeight < 0) newHeight = 0;
_element.style.height = '${newHeight}px';
}
}
/**
* Set the current computed width in pixels of this element.
*
* newWidth can be either a [num] representing the width in pixels or a
* [Dimension] object. This is equivalent to the `width` function in jQuery
* and the calculated
* `width` CSS value, converted to a dimensionless num in pixels.
*/
void set width(newWidth) {
if (newWidth is Dimension) {
if (newWidth.value < 0) newWidth = new Dimension.px(0);
_element.style.width = newWidth.toString();
} else {
if (newWidth < 0) newWidth = 0;
_element.style.width = '${newWidth}px';
}
}
num get left => _element.getBoundingClientRect().left -
_addOrSubtractToBoxModel(['left'], _CONTENT);
num get top => _element.getBoundingClientRect().top -
_addOrSubtractToBoxModel(['top'], _CONTENT);
}
/**
* A list of element content rectangles in the
* [box model](http://www.w3.org/TR/CSS2/box.html).
*/
class _ContentCssListRect extends _ContentCssRect {
List<Element> _elementList;
_ContentCssListRect(elementList) : super(elementList.first) {
_elementList = elementList;
}
/**
* Set the height to `newHeight`.
*
* Values of newHeight that are less than zero are converted to effectively
* setting the height to 0. This is equivalent to the `height`
* function in jQuery and the calculated `height` CSS value, converted to a
* num in pixels.
*/
void set height(newHeight) {
_elementList.forEach((e) => e.contentEdge.height = newHeight);
}
/**
* Set the current computed width in pixels of this element.
*
* This is equivalent to the `width` function in jQuery and the calculated
* `width` CSS value, converted to a dimensionless num in pixels.
*/
void set width(newWidth) {
_elementList.forEach((e) => e.contentEdge.width = newWidth);
}
}
/**
* A rectangle representing the dimensions of the space occupied by the
* element's content + padding in the
* [box model](http://www.w3.org/TR/CSS2/box.html).
*/
class _PaddingCssRect extends CssRect {
_PaddingCssRect(element) : super(element);
num get height => _element.offsetHeight +
_addOrSubtractToBoxModel(_HEIGHT, _PADDING);
num get width => _element.offsetWidth +
_addOrSubtractToBoxModel(_WIDTH, _PADDING);
num get left => _element.getBoundingClientRect().left -
_addOrSubtractToBoxModel(['left'], _PADDING);
num get top => _element.getBoundingClientRect().top -
_addOrSubtractToBoxModel(['top'], _PADDING);
}
/**
* A rectangle representing the dimensions of the space occupied by the
* element's content + padding + border in the
* [box model](http://www.w3.org/TR/CSS2/box.html).
*/
class _BorderCssRect extends CssRect {
_BorderCssRect(element) : super(element);
num get height => _element.offsetHeight;
num get width => _element.offsetWidth;
num get left => _element.getBoundingClientRect().left;
num get top => _element.getBoundingClientRect().top;
}
/**
* A rectangle representing the dimensions of the space occupied by the
* element's content + padding + border + margin in the
* [box model](http://www.w3.org/TR/CSS2/box.html).
*/
class _MarginCssRect extends CssRect {
_MarginCssRect(element) : super(element);
num get height => _element.offsetHeight +
_addOrSubtractToBoxModel(_HEIGHT, _MARGIN);
num get width =>
_element.offsetWidth + _addOrSubtractToBoxModel(_WIDTH, _MARGIN);
num get left => _element.getBoundingClientRect().left -
_addOrSubtractToBoxModel(['left'], _MARGIN);
num get top => _element.getBoundingClientRect().top -
_addOrSubtractToBoxModel(['top'], _MARGIN);
}
/**
* A class for representing CSS dimensions.
*
* In contrast to the more general purpose [Rect] class, this class's values are
* mutable, so one can change the height of an element programmatically.
*
* _Important_ _note_: use of these methods will perform CSS calculations that
* can trigger a browser reflow. Therefore, use of these properties _during_ an
* animation frame is discouraged. See also:
* [Browser Reflow](https://developers.google.com/speed/articles/reflow)
*/
abstract class CssRect extends RectBase implements Rect {
Element _element;
CssRect(this._element);
num get left;
num get top;
/**
* The height of this rectangle.
*
* This is equivalent to the `height` function in jQuery and the calculated
* `height` CSS value, converted to a dimensionless num in pixels. Unlike
* [getBoundingClientRect], `height` will return the same numerical width if
* the element is hidden or not.
*/
num get height;
/**
* The width of this rectangle.
*
* This is equivalent to the `width` function in jQuery and the calculated
* `width` CSS value, converted to a dimensionless num in pixels. Unlike
* [getBoundingClientRect], `width` will return the same numerical width if
* the element is hidden or not.
*/
num get width;
/**
* Set the height to `newHeight`.
*
* newHeight can be either a [num] representing the height in pixels or a
* [Dimension] object. Values of newHeight that are less than zero are
* converted to effectively setting the height to 0. This is equivalent to the
* `height` function in jQuery and the calculated `height` CSS value,
* converted to a num in pixels.
*
* Note that only the content height can actually be set via this method.
*/
void set height(newHeight) {
throw new UnsupportedError("Can only set height for content rect.");
}
/**
* Set the current computed width in pixels of this element.
*
* newWidth can be either a [num] representing the width in pixels or a
* [Dimension] object. This is equivalent to the `width` function in jQuery
* and the calculated
* `width` CSS value, converted to a dimensionless num in pixels.
*
* Note that only the content width can be set via this method.
*/
void set width(newWidth) {
throw new UnsupportedError("Can only set width for content rect.");
}
/**
* Return a value that is used to modify the initial height or width
* measurement of an element. Depending on the value (ideally an enum) passed
* to augmentingMeasurement, we may need to add or subtract margin, padding,
* or border values, depending on the measurement we're trying to obtain.
*/
num _addOrSubtractToBoxModel(List<String> dimensions,
String augmentingMeasurement) {
// getComputedStyle always returns pixel values (hence, computed), so we're
// always dealing with pixels in this method.
var styles = _element.getComputedStyle();
var val = 0;
for (String measurement in dimensions) {
// The border-box and default box model both exclude margin in the regular
// height/width calculation, so add it if we want it for this measurement.
if (augmentingMeasurement == _MARGIN) {
val += new Dimension.css(styles.getPropertyValue(
'$augmentingMeasurement-$measurement')).value;
}
// The border-box includes padding and border, so remove it if we want
// just the content itself.
if (augmentingMeasurement == _CONTENT) {
val -= new Dimension.css(
styles.getPropertyValue('${_PADDING}-$measurement')).value;
}
// At this point, we don't wan't to augment with border or margin,
// so remove border.
if (augmentingMeasurement != _MARGIN) {
val -= new Dimension.css(styles.getPropertyValue(
'border-${measurement}-width')).value;
}
}
return val;
}
}
final _HEIGHT = ['top', 'bottom'];
final _WIDTH = ['right', 'left'];
final _CONTENT = 'content';
final _PADDING = 'padding';
final _MARGIN = 'margin';
/**
* Class representing a
* [length measurement](https://developer.mozilla.org/en-US/docs/Web/CSS/length)
* in CSS.
*/
@Experimental()
class Dimension {
num _value;
String _unit;
/** Set this CSS Dimension to a percentage `value`. */
Dimension.percent(this._value) : _unit = '%';
/** Set this CSS Dimension to a pixel `value`. */
Dimension.px(this._value) : _unit = 'px';
/** Set this CSS Dimension to a pica `value`. */
Dimension.pc(this._value) : _unit = 'pc';
/** Set this CSS Dimension to a point `value`. */
Dimension.pt(this._value) : _unit = 'pt';
/** Set this CSS Dimension to an inch `value`. */
Dimension.inch(this._value) : _unit = 'in';
/** Set this CSS Dimension to a centimeter `value`. */
Dimension.cm(this._value) : _unit = 'cm';
/** Set this CSS Dimension to a millimeter `value`. */
Dimension.mm(this._value) : _unit = 'mm';
/**
* Set this CSS Dimension to the specified number of ems.
*
* 1em is equal to the current font size. (So 2ems is equal to double the font
* size). This is useful for producing website layouts that scale nicely with
* the user's desired font size.
*/
Dimension.em(this._value) : _unit = 'em';
/**
* Set this CSS Dimension to the specified number of x-heights.
*
* One ex is equal to the the x-height of a font's baseline to its mean line,
* generally the height of the letter "x" in the font, which is usually about
* half the font-size.
*/
Dimension.ex(this._value) : _unit = 'ex';
/**
* Construct a Dimension object from the valid, simple CSS string `cssValue`
* that represents a distance measurement.
*
* This constructor is intended as a convenience method for working with
* simplistic CSS length measurements. Non-numeric values such as `auto` or
* `inherit` or invalid CSS will cause this constructor to throw a
* FormatError.
*/
Dimension.css(String cssValue) {
if (cssValue == '') cssValue = '0px';
if (cssValue.endsWith('%')) {
_unit = '%';
} else {
_unit = cssValue.substring(cssValue.length - 2);
}
if (cssValue.contains('.')) {
_value = double.parse(cssValue.substring(0,
cssValue.length - _unit.length));
} else {
_value = int.parse(cssValue.substring(0, cssValue.length - _unit.length));
}
}
/** Print out the CSS String representation of this value. */
String toString() {
return '${_value}${_unit}';
}
/** Return a unitless, numerical value of this CSS value. */
num get value => this._value;
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
typedef EventListener(Event event);
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Adapter for exposing DOM events as Dart streams.
*/
class _EventStream<T extends Event> extends Stream<T> {
final EventTarget _target;
final String _eventType;
final bool _useCapture;
_EventStream(this._target, this._eventType, this._useCapture);
// DOM events are inherently multi-subscribers.
Stream<T> asBroadcastStream({void onListen(StreamSubscription subscription),
void onCancel(StreamSubscription subscription)})
=> this;
bool get isBroadcast => true;
StreamSubscription<T> listen(void onData(T event),
{ void onError(error),
void onDone(),
bool cancelOnError}) {
return new _EventStreamSubscription<T>(
this._target, this._eventType, onData, this._useCapture);
}
}
/** A specialized Stream available to [Element]s to enable event delegation. */
abstract class ElementStream<T extends Event> implements Stream<T> {
/**
* Return a stream that only fires when the particular event fires for
* elements matching the specified CSS selector.
*
* This is the Dart equivalent to jQuery's
* [delegate](http://api.jquery.com/delegate/).
*/
Stream<T> matches(String selector);
}
/**
* Adapter for exposing DOM Element events as streams, while also allowing
* event delegation.
*/
class _ElementEventStreamImpl<T extends Event> extends _EventStream<T>
implements ElementStream<T> {
_ElementEventStreamImpl(target, eventType, useCapture) :
super(target, eventType, useCapture);
Stream<T> matches(String selector) =>
this.where((event) => event.target.matchesWithAncestors(selector));
}
/**
* Adapter for exposing events on a collection of DOM Elements as streams,
* while also allowing event delegation.
*/
class _ElementListEventStreamImpl<T extends Event> extends Stream<T>
implements ElementStream<T> {
final _StreamPool _pool;
Stream<T> _stream;
_ElementListEventStreamImpl(targetList, eventType, useCapture) :
_pool = new _StreamPool.broadcast() {
for (Element target in targetList) {
var stream = new _EventStream(target, eventType, useCapture);
_pool.add(stream);
}
_stream = _pool.stream;
}
Stream<T> matches(String selector) =>
this.where((event) => event.target.matchesWithAncestors(selector));
// Delegate all regular Stream behavor to our wrapped Stream.
StreamSubscription<T> listen(void onData(T event),
{ void onError(error),
void onDone(),
bool cancelOnError}) =>
_stream.listen(onData, onError: onError, onDone: onDone,
cancelOnError: cancelOnError);
Stream<T> asBroadcastStream({void onListen(StreamSubscription subscription),
void onCancel(StreamSubscription subscription)})
=> _stream;
bool get isBroadcast => true;
}
/**
* A pool of streams whose events are unified and emitted through a central
* stream.
*/
// TODO (efortuna): Remove this when Issue 12218 is addressed.
class _StreamPool<T> {
StreamController<T> _controller;
/// Subscriptions to the streams that make up the pool.
var _subscriptions = new Map<Stream<T>, StreamSubscription<T>>();
/**
* Creates a new stream pool where [stream] can be listened to more than
* once.
*
* Any events from buffered streams in the pool will be emitted immediately,
* regardless of whether [stream] has any subscribers.
*/
_StreamPool.broadcast() {
_controller = new StreamController<T>.broadcast(sync: true,
onCancel: close);
}
/**
* The stream through which all events from streams in the pool are emitted.
*/
Stream<T> get stream => _controller.stream;
/**
* Adds [stream] as a member of this pool.
*
* Any events from [stream] will be emitted through [this.stream]. If
* [stream] is sync, they'll be emitted synchronously; if [stream] is async,
* they'll be emitted asynchronously.
*/
void add(Stream<T> stream) {
if (_subscriptions.containsKey(stream)) return;
_subscriptions[stream] = stream.listen(_controller.add,
onError: _controller.addError,
onDone: () => remove(stream));
}
/** Removes [stream] as a member of this pool. */
void remove(Stream<T> stream) {
var subscription = _subscriptions.remove(stream);
if (subscription != null) subscription.cancel();
}
/** Removes all streams from this pool and closes [stream]. */
void close() {
for (var subscription in _subscriptions.values) {
subscription.cancel();
}
_subscriptions.clear();
_controller.close();
}
}
class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
int _pauseCount = 0;
EventTarget _target;
final String _eventType;
var _onData;
final bool _useCapture;
_EventStreamSubscription(this._target, this._eventType, this._onData,
this._useCapture) {
_tryResume();
}
void cancel() {
if (_canceled) return;
_unlisten();
// Clear out the target to indicate this is complete.
_target = null;
_onData = null;
}
bool get _canceled => _target == null;
void onData(void handleData(T event)) {
if (_canceled) {
throw new StateError("Subscription has been canceled.");
}
// Remove current event listener.
_unlisten();
_onData = handleData;
_tryResume();
}
/// Has no effect.
void onError(void handleError(error)) {}
/// Has no effect.
void onDone(void handleDone()) {}
void pause([Future resumeSignal]) {
if (_canceled) return;
++_pauseCount;
_unlisten();
if (resumeSignal != null) {
resumeSignal.whenComplete(resume);
}
}
bool get isPaused => _pauseCount > 0;
void resume() {
if (_canceled || !isPaused) return;
--_pauseCount;
_tryResume();
}
void _tryResume() {
if (_onData != null && !isPaused) {
_target.$dom_addEventListener(_eventType, _onData, _useCapture);
}
}
void _unlisten() {
if (_onData != null) {
_target.$dom_removeEventListener(_eventType, _onData, _useCapture);
}
}
Future asFuture([var futureValue]) {
// We just need a future that will never succeed or fail.
Completer completer = new Completer();
return completer.future;
}
}
/**
* A factory to expose DOM events as Streams.
*/
class EventStreamProvider<T extends Event> {
final String _eventType;
const EventStreamProvider(this._eventType);
/**
* Gets a [Stream] for this event type, on the specified target.
*
* This will always return a broadcast stream so multiple listeners can be
* used simultaneously.
*
* This may be used to capture DOM events:
*
* Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
*
* Or for listening to an event which will bubble through the DOM tree:
*
* MediaElement.pauseEvent.forTarget(document.body).listen(...);
*
* See also:
*
* [addEventListener](http://docs.webplatform.org/wiki/dom/methods/addEventListener)
*/
Stream<T> forTarget(EventTarget e, {bool useCapture: false}) =>
new _EventStream(e, _eventType, useCapture);
/**
* Gets an [ElementEventStream] for this event type, on the specified element.
*
* This will always return a broadcast stream so multiple listeners can be
* used simultaneously.
*
* This may be used to capture DOM events:
*
* Element.keyDownEvent.forElement(element, useCapture: true).listen(...);
*
* See also:
*
* [addEventListener](http://docs.webplatform.org/wiki/dom/methods/addEventListener)
*/
ElementStream<T> forElement(Element e, {bool useCapture: false}) {
return new _ElementEventStreamImpl(e, _eventType, useCapture);
}
/**
* Gets an [ElementEventStream] for this event type, on the list of elements.
*
* This will always return a broadcast stream so multiple listeners can be
* used simultaneously.
*
* This may be used to capture DOM events:
*
* Element.keyDownEvent._forElementList(element, useCapture: true).listen(...);
*
* See also:
*
* [addEventListener](http://docs.webplatform.org/wiki/dom/methods/addEventListener)
*/
ElementStream<T> _forElementList(ElementList e, {bool useCapture: false}) {
return new _ElementListEventStreamImpl(e, _eventType, useCapture);
}
/**
* Gets the type of the event which this would listen for on the specified
* event target.
*
* The target is necessary because some browsers may use different event names
* for the same purpose and the target allows differentiating browser support.
*/
String getEventType(EventTarget target) {
return _eventType;
}
}
/**
* A factory to expose DOM events as streams, where the DOM event name has to
* be determined on the fly (for example, mouse wheel events).
*/
class _CustomEventStreamProvider<T extends Event>
implements EventStreamProvider<T> {
final _eventTypeGetter;
const _CustomEventStreamProvider(this._eventTypeGetter);
Stream<T> forTarget(EventTarget e, {bool useCapture: false}) {
return new _EventStream(e, _eventTypeGetter(e), useCapture);
}
ElementStream<T> forElement(Element e, {bool useCapture: false}) {
return new _ElementEventStreamImpl(e, _eventTypeGetter(e), useCapture);
}
ElementStream<T> _forElementList(ElementList e,
{bool useCapture: false}) {
return new _ElementListEventStreamImpl(e, _eventTypeGetter(e), useCapture);
}
String getEventType(EventTarget target) {
return _eventTypeGetter(target);
}
}
// DO NOT EDIT- this file is generated from running tool/generator.sh.
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* A Dart DOM validator generated from Caja whitelists.
*
* This contains a whitelist of known HTML tagNames and attributes and will only
* accept known good values.
*
* See also:
*
* * <https://code.google.com/p/google-caja/wiki/CajaWhitelists>
*/
class _Html5NodeValidator implements NodeValidator {
static final Set<String> _allowedElements = new Set.from([
'A',
'ABBR',
'ACRONYM',
'ADDRESS',
'AREA',
'ARTICLE',
'ASIDE',
'AUDIO',
'B',
'BDI',
'BDO',
'BIG',
'BLOCKQUOTE',
'BR',
'BUTTON',
'CANVAS',
'CAPTION',
'CENTER',
'CITE',
'CODE',
'COL',
'COLGROUP',
'COMMAND',
'DATA',
'DATALIST',
'DD',
'DEL',
'DETAILS',
'DFN',
'DIR',
'DIV',
'DL',
'DT',
'EM',
'FIELDSET',
'FIGCAPTION',
'FIGURE',
'FONT',
'FOOTER',
'FORM',
'H1',
'H2',
'H3',
'H4',
'H5',
'H6',
'HEADER',
'HGROUP',
'HR',
'I',
'IFRAME',
'IMG',
'INPUT',
'INS',
'KBD',
'LABEL',
'LEGEND',
'LI',
'MAP',
'MARK',
'MENU',
'METER',
'NAV',
'NOBR',
'OL',
'OPTGROUP',
'OPTION',
'OUTPUT',
'P',
'PRE',
'PROGRESS',
'Q',
'S',
'SAMP',
'SECTION',
'SELECT',
'SMALL',
'SOURCE',
'SPAN',
'STRIKE',
'STRONG',
'SUB',
'SUMMARY',
'SUP',
'TABLE',
'TBODY',
'TD',
'TEXTAREA',
'TFOOT',
'TH',
'THEAD',
'TIME',
'TR',
'TRACK',
'TT',
'U',
'UL',
'VAR',
'VIDEO',
'WBR',
]);
static const _standardAttributes = const <String>[
'*::class',
'*::dir',
'*::draggable',
'*::hidden',
'*::id',
'*::inert',
'*::itemprop',
'*::itemref',
'*::itemscope',
'*::lang',
'*::spellcheck',
'*::title',
'*::translate',
'A::accesskey',
'A::coords',
'A::hreflang',
'A::name',
'A::shape',
'A::tabindex',
'A::target',
'A::type',
'AREA::accesskey',
'AREA::alt',
'AREA::coords',
'AREA::nohref',
'AREA::shape',
'AREA::tabindex',
'AREA::target',
'AUDIO::controls',
'AUDIO::loop',
'AUDIO::mediagroup',
'AUDIO::muted',
'AUDIO::preload',
'BDO::dir',
'BODY::alink',
'BODY::bgcolor',
'BODY::link',
'BODY::text',
'BODY::vlink',
'BR::clear',
'BUTTON::accesskey',
'BUTTON::disabled',
'BUTTON::name',
'BUTTON::tabindex',
'BUTTON::type',
'BUTTON::value',
'CANVAS::height',
'CANVAS::width',
'CAPTION::align',
'COL::align',
'COL::char',
'COL::charoff',
'COL::span',
'COL::valign',
'COL::width',
'COLGROUP::align',
'COLGROUP::char',
'COLGROUP::charoff',
'COLGROUP::span',
'COLGROUP::valign',
'COLGROUP::width',
'COMMAND::checked',
'COMMAND::command',
'COMMAND::disabled',
'COMMAND::label',
'COMMAND::radiogroup',
'COMMAND::type',
'DATA::value',
'DEL::datetime',
'DETAILS::open',
'DIR::compact',
'DIV::align',
'DL::compact',
'FIELDSET::disabled',
'FONT::color',
'FONT::face',
'FONT::size',
'FORM::accept',
'FORM::autocomplete',
'FORM::enctype',
'FORM::method',
'FORM::name',
'FORM::novalidate',
'FORM::target',
'FRAME::name',
'H1::align',
'H2::align',
'H3::align',
'H4::align',
'H5::align',
'H6::align',
'HR::align',
'HR::noshade',
'HR::size',
'HR::width',
'HTML::version',
'IFRAME::align',
'IFRAME::frameborder',
'IFRAME::height',
'IFRAME::marginheight',
'IFRAME::marginwidth',
'IFRAME::width',
'IMG::align',
'IMG::alt',
'IMG::border',
'IMG::height',
'IMG::hspace',
'IMG::ismap',
'IMG::name',
'IMG::usemap',
'IMG::vspace',
'IMG::width',
'INPUT::accept',
'INPUT::accesskey',
'INPUT::align',
'INPUT::alt',
'INPUT::autocomplete',
'INPUT::checked',
'INPUT::disabled',
'INPUT::inputmode',
'INPUT::ismap',
'INPUT::list',
'INPUT::max',
'INPUT::maxlength',
'INPUT::min',
'INPUT::multiple',
'INPUT::name',
'INPUT::placeholder',
'INPUT::readonly',
'INPUT::required',
'INPUT::size',
'INPUT::step',
'INPUT::tabindex',
'INPUT::type',
'INPUT::usemap',
'INPUT::value',
'INS::datetime',
'KEYGEN::disabled',
'KEYGEN::keytype',
'KEYGEN::name',
'LABEL::accesskey',
'LABEL::for',
'LEGEND::accesskey',
'LEGEND::align',
'LI::type',
'LI::value',
'LINK::sizes',
'MAP::name',
'MENU::compact',
'MENU::label',
'MENU::type',
'METER::high',
'METER::low',
'METER::max',
'METER::min',
'METER::value',
'OBJECT::typemustmatch',
'OL::compact',
'OL::reversed',
'OL::start',
'OL::type',
'OPTGROUP::disabled',
'OPTGROUP::label',
'OPTION::disabled',
'OPTION::label',
'OPTION::selected',
'OPTION::value',
'OUTPUT::for',
'OUTPUT::name',
'P::align',
'PRE::width',
'PROGRESS::max',
'PROGRESS::min',
'PROGRESS::value',
'SELECT::autocomplete',
'SELECT::disabled',
'SELECT::multiple',
'SELECT::name',
'SELECT::required',
'SELECT::size',
'SELECT::tabindex',
'SOURCE::type',
'TABLE::align',
'TABLE::bgcolor',
'TABLE::border',
'TABLE::cellpadding',
'TABLE::cellspacing',
'TABLE::frame',
'TABLE::rules',
'TABLE::summary',
'TABLE::width',
'TBODY::align',
'TBODY::char',
'TBODY::charoff',
'TBODY::valign',
'TD::abbr',
'TD::align',
'TD::axis',
'TD::bgcolor',
'TD::char',
'TD::charoff',
'TD::colspan',
'TD::headers',
'TD::height',
'TD::nowrap',
'TD::rowspan',
'TD::scope',
'TD::valign',
'TD::width',
'TEXTAREA::accesskey',
'TEXTAREA::autocomplete',
'TEXTAREA::cols',
'TEXTAREA::disabled',
'TEXTAREA::inputmode',
'TEXTAREA::name',
'TEXTAREA::placeholder',
'TEXTAREA::readonly',
'TEXTAREA::required',
'TEXTAREA::rows',
'TEXTAREA::tabindex',
'TEXTAREA::wrap',
'TFOOT::align',
'TFOOT::char',
'TFOOT::charoff',
'TFOOT::valign',
'TH::abbr',
'TH::align',
'TH::axis',
'TH::bgcolor',
'TH::char',
'TH::charoff',
'TH::colspan',
'TH::headers',
'TH::height',
'TH::nowrap',
'TH::rowspan',
'TH::scope',
'TH::valign',
'TH::width',
'THEAD::align',
'THEAD::char',
'THEAD::charoff',
'THEAD::valign',
'TR::align',
'TR::bgcolor',
'TR::char',
'TR::charoff',
'TR::valign',
'TRACK::default',
'TRACK::kind',
'TRACK::label',
'TRACK::srclang',
'UL::compact',
'UL::type',
'VIDEO::controls',
'VIDEO::height',
'VIDEO::loop',
'VIDEO::mediagroup',
'VIDEO::muted',
'VIDEO::preload',
'VIDEO::width',
];
static const _uriAttributes = const <String>[
'A::href',
'AREA::href',
'BLOCKQUOTE::cite',
'BODY::background',
'COMMAND::icon',
'DEL::cite',
'FORM::action',
'IMG::src',
'INPUT::src',
'INS::cite',
'Q::cite',
'VIDEO::poster',
];
final UriPolicy uriPolicy;
static final Map<String, Function> _attributeValidators = {};
/**
* All known URI attributes will be validated against the UriPolicy, if
* [uriPolicy] is null then a default UriPolicy will be used.
*/
_Html5NodeValidator({UriPolicy uriPolicy})
:uriPolicy = uriPolicy != null ? uriPolicy : new UriPolicy() {
if (_attributeValidators.isEmpty) {
for (var attr in _standardAttributes) {
_attributeValidators[attr] = _standardAttributeValidator;
}
for (var attr in _uriAttributes) {
_attributeValidators[attr] = _uriAttributeValidator;
}
}
}
bool allowsElement(Element element) {
return _allowedElements.contains(element.tagName);
}
bool allowsAttribute(Element element, String attributeName, String value) {
var tagName = element.tagName;
var validator = _attributeValidators['$tagName::$attributeName'];
if (validator == null) {
validator = _attributeValidators['*::$attributeName'];
}
if (validator == null) {
return false;
}
return validator(element, attributeName, value, this);
}
static bool _standardAttributeValidator(Element element, String attributeName,
String value, _Html5NodeValidator context) {
return true;
}
static bool _uriAttributeValidator(Element element, String attributeName,
String value, _Html5NodeValidator context) {
return context.uriPolicy.allowsUri(value);
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
abstract class ImmutableListMixin<E> implements List<E> {
// From Iterable<$E>:
Iterator<E> get iterator {
// Note: NodeLists are not fixed size. And most probably length shouldn't
// be cached in both iterator _and_ forEach method. For now caching it
// for consistency.
return new FixedSizeListIterator<E>(this);
}
// From Collection<E>:
void add(E value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
void addAll(Iterable<E> iterable) {
throw new UnsupportedError("Cannot add to immutable List.");
}
// From List<E>:
void sort([int compare(E a, E b)]) {
throw new UnsupportedError("Cannot sort immutable List.");
}
void insert(int index, E element) {
throw new UnsupportedError("Cannot add to immutable List.");
}
void insertAll(int index, Iterable<E> iterable) {
throw new UnsupportedError("Cannot add to immutable List.");
}
void setAll(int index, Iterable<E> iterable) {
throw new UnsupportedError("Cannot modify an immutable List.");
}
E removeAt(int pos) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
E removeLast() {
throw new UnsupportedError("Cannot remove from immutable List.");
}
bool remove(Object object) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
void removeWhere(bool test(E element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
void retainWhere(bool test(E element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
throw new UnsupportedError("Cannot setRange on immutable List.");
}
void removeRange(int start, int end) {
throw new UnsupportedError("Cannot removeRange on immutable List.");
}
void replaceRange(int start, int end, Iterable<E> iterable) {
throw new UnsupportedError("Cannot modify an immutable List.");
}
void fillRange(int start, int end, [E fillValue]) {
throw new UnsupportedError("Cannot modify an immutable List.");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
_serialize(var message) {
return new _JsSerializer().traverse(message);
}
class _JsSerializer extends _Serializer {
visitSendPortSync(SendPortSync x) {
if (x is _JsSendPortSync) return visitJsSendPortSync(x);
if (x is _LocalSendPortSync) return visitLocalSendPortSync(x);
if (x is _RemoteSendPortSync) return visitRemoteSendPortSync(x);
throw "Unknown port type $x";
}
visitJsSendPortSync(_JsSendPortSync x) {
return [ 'sendport', 'nativejs', x._id ];
}
visitLocalSendPortSync(_LocalSendPortSync x) {
return [ 'sendport', 'dart',
ReceivePortSync._isolateId, x._receivePort._portId ];
}
visitSendPort(SendPort x) {
throw new UnimplementedError('Asynchronous send port not yet implemented.');
}
visitRemoteSendPortSync(_RemoteSendPortSync x) {
return [ 'sendport', 'dart', x._isolateId, x._portId ];
}
}
_deserialize(var message) {
return new _JsDeserializer().deserialize(message);
}
class _JsDeserializer extends _Deserializer {
static const _UNSPECIFIED = const Object();
deserializeSendPort(List x) {
String tag = x[1];
switch (tag) {
case 'nativejs':
num id = x[2];
return new _JsSendPortSync(id);
case 'dart':
num isolateId = x[2];
num portId = x[3];
return ReceivePortSync._lookup(isolateId, portId);
default:
throw 'Illegal SendPortSync type: $tag';
}
}
}
// The receiver is JS.
class _JsSendPortSync implements SendPortSync {
final num _id;
_JsSendPortSync(this._id);
callSync(var message) {
var serialized = _serialize(message);
var result = _callPortSync(_id, serialized);
return _deserialize(result);
}
bool operator==(var other) {
return (other is _JsSendPortSync) && (_id == other._id);
}
int get hashCode => _id;
}
// TODO(vsm): Differentiate between Dart2Js and Dartium isolates.
// The receiver is a different Dart isolate, compiled to JS.
class _RemoteSendPortSync implements SendPortSync {
int _isolateId;
int _portId;
_RemoteSendPortSync(this._isolateId, this._portId);
callSync(var message) {
var serialized = _serialize(message);
var result = _call(_isolateId, _portId, serialized);
return _deserialize(result);
}
static _call(int isolateId, int portId, var message) {
var target = 'dart-port-$isolateId-$portId';
// TODO(vsm): Make this re-entrant.
// TODO(vsm): Set this up set once, on the first call.
var source = '$target-result';
var result = null;
window.on[source].first.then((Event e) {
result = JSON.decode(_getPortSyncEventData(e));
});
_dispatchEvent(target, [source, message]);
return result;
}
bool operator==(var other) {
return (other is _RemoteSendPortSync) && (_isolateId == other._isolateId)
&& (_portId == other._portId);
}
int get hashCode => _isolateId >> 16 + _portId;
}
// The receiver is in the same Dart isolate, compiled to JS.
class _LocalSendPortSync implements SendPortSync {
ReceivePortSync _receivePort;
_LocalSendPortSync._internal(this._receivePort);
callSync(var message) {
// TODO(vsm): Do a more efficient deep copy.
var copy = _deserialize(_serialize(message));
var result = _receivePort._callback(copy);
return _deserialize(_serialize(result));
}
bool operator==(var other) {
return (other is _LocalSendPortSync)
&& (_receivePort == other._receivePort);
}
int get hashCode => _receivePort.hashCode;
}
// TODO(vsm): Move this to dart:isolate. This will take some
// refactoring as there are dependences here on the DOM. Users
// interact with this class (or interface if we change it) directly -
// new ReceivePortSync. I think most of the DOM logic could be
// delayed until the corresponding SendPort is registered on the
// window.
// A Dart ReceivePortSync (tagged 'dart' when serialized) is
// identifiable / resolvable by the combination of its isolateid and
// portid. When a corresponding SendPort is used within the same
// isolate, the _portMap below can be used to obtain the
// ReceivePortSync directly. Across isolates (or from JS), an
// EventListener can be used to communicate with the port indirectly.
class ReceivePortSync {
static Map<int, ReceivePortSync> _portMap;
static int _portIdCount;
static int _cachedIsolateId;
num _portId;
Function _callback;
StreamSubscription _portSubscription;
ReceivePortSync() {
if (_portIdCount == null) {
_portIdCount = 0;
_portMap = new Map<int, ReceivePortSync>();
}
_portId = _portIdCount++;
_portMap[_portId] = this;
}
static int get _isolateId {
// TODO(vsm): Make this coherent with existing isolate code.
if (_cachedIsolateId == null) {
_cachedIsolateId = _getNewIsolateId();
}
return _cachedIsolateId;
}
static String _getListenerName(isolateId, portId) =>
'dart-port-$isolateId-$portId';
String get _listenerName => _getListenerName(_isolateId, _portId);
void receive(callback(var message)) {
_callback = callback;
if (_portSubscription == null) {
_portSubscription = window.on[_listenerName].listen((Event e) {
var data = JSON.decode(_getPortSyncEventData(e));
var replyTo = data[0];
var message = _deserialize(data[1]);
var result = _callback(message);
_dispatchEvent(replyTo, _serialize(result));
});
}
}
void close() {
_portMap.remove(_portId);
if (_portSubscription != null) _portSubscription.cancel();
}
SendPortSync toSendPort() {
return new _LocalSendPortSync._internal(this);
}
static SendPortSync _lookup(int isolateId, int portId) {
if (isolateId == _isolateId) {
return _portMap[portId].toSendPort();
} else {
return new _RemoteSendPortSync(isolateId, portId);
}
}
}
get _isolateId => ReceivePortSync._isolateId;
void _dispatchEvent(String receiver, var message) {
var event = new CustomEvent(receiver, canBubble: false, cancelable:false,
detail: JSON.encode(message));
window.dispatchEvent(event);
}
String _getPortSyncEventData(CustomEvent event) => event.detail;
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Defines the keycode values for keys that are returned by
* KeyboardEvent.keyCode.
*
* Important note: There is substantial divergence in how different browsers
* handle keycodes and their variants in different locales/keyboard layouts. We
* provide these constants to help make code processing keys more readable.
*/
abstract class KeyCode {
// These constant names were borrowed from Closure's Keycode enumeration
// class.
// http://closure-library.googlecode.com/svn/docs/closure_goog_events_keycodes.js.source.html
static const int WIN_KEY_FF_LINUX = 0;
static const int MAC_ENTER = 3;
static const int BACKSPACE = 8;
static const int TAB = 9;
/** NUM_CENTER is also NUMLOCK for FF and Safari on Mac. */
static const int NUM_CENTER = 12;
static const int ENTER = 13;
static const int SHIFT = 16;
static const int CTRL = 17;
static const int ALT = 18;
static const int PAUSE = 19;
static const int CAPS_LOCK = 20;
static const int ESC = 27;
static const int SPACE = 32;
static const int PAGE_UP = 33;
static const int PAGE_DOWN = 34;
static const int END = 35;
static const int HOME = 36;
static const int LEFT = 37;
static const int UP = 38;
static const int RIGHT = 39;
static const int DOWN = 40;
static const int NUM_NORTH_EAST = 33;
static const int NUM_SOUTH_EAST = 34;
static const int NUM_SOUTH_WEST = 35;
static const int NUM_NORTH_WEST = 36;
static const int NUM_WEST = 37;
static const int NUM_NORTH = 38;
static const int NUM_EAST = 39;
static const int NUM_SOUTH = 40;
static const int PRINT_SCREEN = 44;
static const int INSERT = 45;
static const int NUM_INSERT = 45;
static const int DELETE = 46;
static const int NUM_DELETE = 46;
static const int ZERO = 48;
static const int ONE = 49;
static const int TWO = 50;
static const int THREE = 51;
static const int FOUR = 52;
static const int FIVE = 53;
static const int SIX = 54;
static const int SEVEN = 55;
static const int EIGHT = 56;
static const int NINE = 57;
static const int FF_SEMICOLON = 59;
static const int FF_EQUALS = 61;
/**
* CAUTION: The question mark is for US-keyboard layouts. It varies
* for other locales and keyboard layouts.
*/
static const int QUESTION_MARK = 63;
static const int A = 65;
static const int B = 66;
static const int C = 67;
static const int D = 68;
static const int E = 69;
static const int F = 70;
static const int G = 71;
static const int H = 72;
static const int I = 73;
static const int J = 74;
static const int K = 75;
static const int L = 76;
static const int M = 77;
static const int N = 78;
static const int O = 79;
static const int P = 80;
static const int Q = 81;
static const int R = 82;
static const int S = 83;
static const int T = 84;
static const int U = 85;
static const int V = 86;
static const int W = 87;
static const int X = 88;
static const int Y = 89;
static const int Z = 90;
static const int META = 91;
static const int WIN_KEY_LEFT = 91;
static const int WIN_KEY_RIGHT = 92;
static const int CONTEXT_MENU = 93;
static const int NUM_ZERO = 96;
static const int NUM_ONE = 97;
static const int NUM_TWO = 98;
static const int NUM_THREE = 99;
static const int NUM_FOUR = 100;
static const int NUM_FIVE = 101;
static const int NUM_SIX = 102;
static const int NUM_SEVEN = 103;
static const int NUM_EIGHT = 104;
static const int NUM_NINE = 105;
static const int NUM_MULTIPLY = 106;
static const int NUM_PLUS = 107;
static const int NUM_MINUS = 109;
static const int NUM_PERIOD = 110;
static const int NUM_DIVISION = 111;
static const int F1 = 112;
static const int F2 = 113;
static const int F3 = 114;
static const int F4 = 115;
static const int F5 = 116;
static const int F6 = 117;
static const int F7 = 118;
static const int F8 = 119;
static const int F9 = 120;
static const int F10 = 121;
static const int F11 = 122;
static const int F12 = 123;
static const int NUMLOCK = 144;
static const int SCROLL_LOCK = 145;
// OS-specific media keys like volume controls and browser controls.
static const int FIRST_MEDIA_KEY = 166;
static const int LAST_MEDIA_KEY = 183;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int SEMICOLON = 186;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int DASH = 189;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int EQUALS = 187;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int COMMA = 188;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int PERIOD = 190;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int SLASH = 191;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int APOSTROPHE = 192;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int TILDE = 192;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int SINGLE_QUOTE = 222;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int OPEN_SQUARE_BRACKET = 219;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int BACKSLASH = 220;
/**
* CAUTION: This constant requires localization for other locales and keyboard
* layouts.
*/
static const int CLOSE_SQUARE_BRACKET = 221;
static const int WIN_KEY = 224;
static const int MAC_FF_META = 224;
static const int WIN_IME = 229;
/** A sentinel value if the keycode could not be determined. */
static const int UNKNOWN = -1;
/**
* Returns true if the keyCode produces a (US keyboard) character.
* Note: This does not (yet) cover characters on non-US keyboards (Russian,
* Hebrew, etc.).
*/
static bool isCharacterKey(int keyCode) {
if ((keyCode >= ZERO && keyCode <= NINE) ||
(keyCode >= NUM_ZERO && keyCode <= NUM_MULTIPLY) ||
(keyCode >= A && keyCode <= Z)) {
return true;
}
// Safari sends zero key code for non-latin characters.
if (Device.isWebKit && keyCode == 0) {
return true;
}
return (keyCode == SPACE || keyCode == QUESTION_MARK || keyCode == NUM_PLUS
|| keyCode == NUM_MINUS || keyCode == NUM_PERIOD ||
keyCode == NUM_DIVISION || keyCode == SEMICOLON ||
keyCode == FF_SEMICOLON || keyCode == DASH || keyCode == EQUALS ||
keyCode == FF_EQUALS || keyCode == COMMA || keyCode == PERIOD ||
keyCode == SLASH || keyCode == APOSTROPHE || keyCode == SINGLE_QUOTE ||
keyCode == OPEN_SQUARE_BRACKET || keyCode == BACKSLASH ||
keyCode == CLOSE_SQUARE_BRACKET);
}
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Defines the standard key locations returned by
* KeyboardEvent.getKeyLocation.
*/
abstract class KeyLocation {
/**
* The event key is not distinguished as the left or right version
* of the key, and did not originate from the numeric keypad (or did not
* originate with a virtual key corresponding to the numeric keypad).
*/
static const int STANDARD = 0;
/**
* The event key is in the left key location.
*/
static const int LEFT = 1;
/**
* The event key is in the right key location.
*/
static const int RIGHT = 2;
/**
* The event key originated on the numeric keypad or with a virtual key
* corresponding to the numeric keypad.
*/
static const int NUMPAD = 3;
/**
* The event key originated on a mobile device, either on a physical
* keypad or a virtual keyboard.
*/
static const int MOBILE = 4;
/**
* The event key originated on a game controller or a joystick on a mobile
* device.
*/
static const int JOYSTICK = 5;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Defines the standard keyboard identifier names for keys that are returned
* by KeyEvent.getKeyboardIdentifier when the key does not have a direct
* unicode mapping.
*/
abstract class KeyName {
/** The Accept (Commit, OK) key */
static const String ACCEPT = "Accept";
/** The Add key */
static const String ADD = "Add";
/** The Again key */
static const String AGAIN = "Again";
/** The All Candidates key */
static const String ALL_CANDIDATES = "AllCandidates";
/** The Alphanumeric key */
static const String ALPHANUMERIC = "Alphanumeric";
/** The Alt (Menu) key */
static const String ALT = "Alt";
/** The Alt-Graph key */
static const String ALT_GRAPH = "AltGraph";
/** The Application key */
static const String APPS = "Apps";
/** The ATTN key */
static const String ATTN = "Attn";
/** The Browser Back key */
static const String BROWSER_BACK = "BrowserBack";
/** The Browser Favorites key */
static const String BROWSER_FAVORTIES = "BrowserFavorites";
/** The Browser Forward key */
static const String BROWSER_FORWARD = "BrowserForward";
/** The Browser Home key */
static const String BROWSER_NAME = "BrowserHome";
/** The Browser Refresh key */
static const String BROWSER_REFRESH = "BrowserRefresh";
/** The Browser Search key */
static const String BROWSER_SEARCH = "BrowserSearch";
/** The Browser Stop key */
static const String BROWSER_STOP = "BrowserStop";
/** The Camera key */
static const String CAMERA = "Camera";
/** The Caps Lock (Capital) key */
static const String CAPS_LOCK = "CapsLock";
/** The Clear key */
static const String CLEAR = "Clear";
/** The Code Input key */
static const String CODE_INPUT = "CodeInput";
/** The Compose key */
static const String COMPOSE = "Compose";
/** The Control (Ctrl) key */
static const String CONTROL = "Control";
/** The Crsel key */
static const String CRSEL = "Crsel";
/** The Convert key */
static const String CONVERT = "Convert";
/** The Copy key */
static const String COPY = "Copy";
/** The Cut key */
static const String CUT = "Cut";
/** The Decimal key */
static const String DECIMAL = "Decimal";
/** The Divide key */
static const String DIVIDE = "Divide";
/** The Down Arrow key */
static const String DOWN = "Down";
/** The diagonal Down-Left Arrow key */
static const String DOWN_LEFT = "DownLeft";
/** The diagonal Down-Right Arrow key */
static const String DOWN_RIGHT = "DownRight";
/** The Eject key */
static const String EJECT = "Eject";
/** The End key */
static const String END = "End";
/**
* The Enter key. Note: This key value must also be used for the Return
* (Macintosh numpad) key
*/
static const String ENTER = "Enter";
/** The Erase EOF key */
static const String ERASE_EOF= "EraseEof";
/** The Execute key */
static const String EXECUTE = "Execute";
/** The Exsel key */
static const String EXSEL = "Exsel";
/** The Function switch key */
static const String FN = "Fn";
/** The F1 key */
static const String F1 = "F1";
/** The F2 key */
static const String F2 = "F2";
/** The F3 key */
static const String F3 = "F3";
/** The F4 key */
static const String F4 = "F4";
/** The F5 key */
static const String F5 = "F5";
/** The F6 key */
static const String F6 = "F6";
/** The F7 key */
static const String F7 = "F7";
/** The F8 key */
static const String F8 = "F8";
/** The F9 key */
static const String F9 = "F9";
/** The F10 key */
static const String F10 = "F10";
/** The F11 key */
static const String F11 = "F11";
/** The F12 key */
static const String F12 = "F12";
/** The F13 key */
static const String F13 = "F13";
/** The F14 key */
static const String F14 = "F14";
/** The F15 key */
static const String F15 = "F15";
/** The F16 key */
static const String F16 = "F16";
/** The F17 key */
static const String F17 = "F17";
/** The F18 key */
static const String F18 = "F18";
/** The F19 key */
static const String F19 = "F19";
/** The F20 key */
static const String F20 = "F20";
/** The F21 key */
static const String F21 = "F21";
/** The F22 key */
static const String F22 = "F22";
/** The F23 key */
static const String F23 = "F23";
/** The F24 key */
static const String F24 = "F24";
/** The Final Mode (Final) key used on some asian keyboards */
static const String FINAL_MODE = "FinalMode";
/** The Find key */
static const String FIND = "Find";
/** The Full-Width Characters key */
static const String FULL_WIDTH = "FullWidth";
/** The Half-Width Characters key */
static const String HALF_WIDTH = "HalfWidth";
/** The Hangul (Korean characters) Mode key */
static const String HANGUL_MODE = "HangulMode";
/** The Hanja (Korean characters) Mode key */
static const String HANJA_MODE = "HanjaMode";
/** The Help key */
static const String HELP = "Help";
/** The Hiragana (Japanese Kana characters) key */
static const String HIRAGANA = "Hiragana";
/** The Home key */
static const String HOME = "Home";
/** The Insert (Ins) key */
static const String INSERT = "Insert";
/** The Japanese-Hiragana key */
static const String JAPANESE_HIRAGANA = "JapaneseHiragana";
/** The Japanese-Katakana key */
static const String JAPANESE_KATAKANA = "JapaneseKatakana";
/** The Japanese-Romaji key */
static const String JAPANESE_ROMAJI = "JapaneseRomaji";
/** The Junja Mode key */
static const String JUNJA_MODE = "JunjaMode";
/** The Kana Mode (Kana Lock) key */
static const String KANA_MODE = "KanaMode";
/**
* The Kanji (Japanese name for ideographic characters of Chinese origin)
* Mode key
*/
static const String KANJI_MODE = "KanjiMode";
/** The Katakana (Japanese Kana characters) key */
static const String KATAKANA = "Katakana";
/** The Start Application One key */
static const String LAUNCH_APPLICATION_1 = "LaunchApplication1";
/** The Start Application Two key */
static const String LAUNCH_APPLICATION_2 = "LaunchApplication2";
/** The Start Mail key */
static const String LAUNCH_MAIL = "LaunchMail";
/** The Left Arrow key */
static const String LEFT = "Left";
/** The Menu key */
static const String MENU = "Menu";
/**
* The Meta key. Note: This key value shall be also used for the Apple
* Command key
*/
static const String META = "Meta";
/** The Media Next Track key */
static const String MEDIA_NEXT_TRACK = "MediaNextTrack";
/** The Media Play Pause key */
static const String MEDIA_PAUSE_PLAY = "MediaPlayPause";
/** The Media Previous Track key */
static const String MEDIA_PREVIOUS_TRACK = "MediaPreviousTrack";
/** The Media Stop key */
static const String MEDIA_STOP = "MediaStop";
/** The Mode Change key */
static const String MODE_CHANGE = "ModeChange";
/** The Next Candidate function key */
static const String NEXT_CANDIDATE = "NextCandidate";
/** The Nonconvert (Don't Convert) key */
static const String NON_CONVERT = "Nonconvert";
/** The Number Lock key */
static const String NUM_LOCK = "NumLock";
/** The Page Down (Next) key */
static const String PAGE_DOWN = "PageDown";
/** The Page Up key */
static const String PAGE_UP = "PageUp";
/** The Paste key */
static const String PASTE = "Paste";
/** The Pause key */
static const String PAUSE = "Pause";
/** The Play key */
static const String PLAY = "Play";
/**
* The Power key. Note: Some devices may not expose this key to the
* operating environment
*/
static const String POWER = "Power";
/** The Previous Candidate function key */
static const String PREVIOUS_CANDIDATE = "PreviousCandidate";
/** The Print Screen (PrintScrn, SnapShot) key */
static const String PRINT_SCREEN = "PrintScreen";
/** The Process key */
static const String PROCESS = "Process";
/** The Props key */
static const String PROPS = "Props";
/** The Right Arrow key */
static const String RIGHT = "Right";
/** The Roman Characters function key */
static const String ROMAN_CHARACTERS = "RomanCharacters";
/** The Scroll Lock key */
static const String SCROLL = "Scroll";
/** The Select key */
static const String SELECT = "Select";
/** The Select Media key */
static const String SELECT_MEDIA = "SelectMedia";
/** The Separator key */
static const String SEPARATOR = "Separator";
/** The Shift key */
static const String SHIFT = "Shift";
/** The Soft1 key */
static const String SOFT_1 = "Soft1";
/** The Soft2 key */
static const String SOFT_2 = "Soft2";
/** The Soft3 key */
static const String SOFT_3 = "Soft3";
/** The Soft4 key */
static const String SOFT_4 = "Soft4";
/** The Stop key */
static const String STOP = "Stop";
/** The Subtract key */
static const String SUBTRACT = "Subtract";
/** The Symbol Lock key */
static const String SYMBOL_LOCK = "SymbolLock";
/** The Up Arrow key */
static const String UP = "Up";
/** The diagonal Up-Left Arrow key */
static const String UP_LEFT = "UpLeft";
/** The diagonal Up-Right Arrow key */
static const String UP_RIGHT = "UpRight";
/** The Undo key */
static const String UNDO = "Undo";
/** The Volume Down key */
static const String VOLUME_DOWN = "VolumeDown";
/** The Volume Mute key */
static const String VOLUMN_MUTE = "VolumeMute";
/** The Volume Up key */
static const String VOLUMN_UP = "VolumeUp";
/** The Windows Logo key */
static const String WIN = "Win";
/** The Zoom key */
static const String ZOOM = "Zoom";
/**
* The Backspace (Back) key. Note: This key value shall be also used for the
* key labeled 'delete' MacOS keyboards when not modified by the 'Fn' key
*/
static const String BACKSPACE = "Backspace";
/** The Horizontal Tabulation (Tab) key */
static const String TAB = "Tab";
/** The Cancel key */
static const String CANCEL = "Cancel";
/** The Escape (Esc) key */
static const String ESC = "Esc";
/** The Space (Spacebar) key: */
static const String SPACEBAR = "Spacebar";
/**
* The Delete (Del) Key. Note: This key value shall be also used for the key
* labeled 'delete' MacOS keyboards when modified by the 'Fn' key
*/
static const String DEL = "Del";
/** The Combining Grave Accent (Greek Varia, Dead Grave) key */
static const String DEAD_GRAVE = "DeadGrave";
/**
* The Combining Acute Accent (Stress Mark, Greek Oxia, Tonos, Dead Eacute)
* key
*/
static const String DEAD_EACUTE = "DeadEacute";
/** The Combining Circumflex Accent (Hat, Dead Circumflex) key */
static const String DEAD_CIRCUMFLEX = "DeadCircumflex";
/** The Combining Tilde (Dead Tilde) key */
static const String DEAD_TILDE = "DeadTilde";
/** The Combining Macron (Long, Dead Macron) key */
static const String DEAD_MACRON = "DeadMacron";
/** The Combining Breve (Short, Dead Breve) key */
static const String DEAD_BREVE = "DeadBreve";
/** The Combining Dot Above (Derivative, Dead Above Dot) key */
static const String DEAD_ABOVE_DOT = "DeadAboveDot";
/**
* The Combining Diaeresis (Double Dot Abode, Umlaut, Greek Dialytika,
* Double Derivative, Dead Diaeresis) key
*/
static const String DEAD_UMLAUT = "DeadUmlaut";
/** The Combining Ring Above (Dead Above Ring) key */
static const String DEAD_ABOVE_RING = "DeadAboveRing";
/** The Combining Double Acute Accent (Dead Doubleacute) key */
static const String DEAD_DOUBLEACUTE = "DeadDoubleacute";
/** The Combining Caron (Hacek, V Above, Dead Caron) key */
static const String DEAD_CARON = "DeadCaron";
/** The Combining Cedilla (Dead Cedilla) key */
static const String DEAD_CEDILLA = "DeadCedilla";
/** The Combining Ogonek (Nasal Hook, Dead Ogonek) key */
static const String DEAD_OGONEK = "DeadOgonek";
/**
* The Combining Greek Ypogegrammeni (Greek Non-Spacing Iota Below, Iota
* Subscript, Dead Iota) key
*/
static const String DEAD_IOTA = "DeadIota";
/**
* The Combining Katakana-Hiragana Voiced Sound Mark (Dead Voiced Sound) key
*/
static const String DEAD_VOICED_SOUND = "DeadVoicedSound";
/**
* The Combining Katakana-Hiragana Semi-Voiced Sound Mark (Dead Semivoiced
* Sound) key
*/
static const String DEC_SEMIVOICED_SOUND= "DeadSemivoicedSound";
/**
* Key value used when an implementation is unable to identify another key
* value, due to either hardware, platform, or software constraints
*/
static const String UNIDENTIFIED = "Unidentified";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Internal class that does the actual calculations to determine keyCode and
* charCode for keydown, keypress, and keyup events for all browsers.
*/
class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
// This code inspired by Closure's KeyHandling library.
// http://closure-library.googlecode.com/svn/docs/closure_goog_events_keyhandler.js.source.html
/**
* The set of keys that have been pressed down without seeing their
* corresponding keyup event.
*/
final List<KeyboardEvent> _keyDownList = <KeyboardEvent>[];
/** The type of KeyEvent we are tracking (keyup, keydown, keypress). */
final String _type;
/** The element we are watching for events to happen on. */
final EventTarget _target;
// The distance to shift from upper case alphabet Roman letters to lower case.
static final int _ROMAN_ALPHABET_OFFSET = "a".codeUnits[0] - "A".codeUnits[0];
/** Controller to produce KeyEvents for the stream. */
final StreamController _controller = new StreamController(sync: true);
static const _EVENT_TYPE = 'KeyEvent';
/**
* An enumeration of key identifiers currently part of the W3C draft for DOM3
* and their mappings to keyCodes.
* http://www.w3.org/TR/DOM-Level-3-Events/keyset.html#KeySet-Set
*/
static const Map<String, int> _keyIdentifier = const {
'Up': KeyCode.UP,
'Down': KeyCode.DOWN,
'Left': KeyCode.LEFT,
'Right': KeyCode.RIGHT,
'Enter': KeyCode.ENTER,
'F1': KeyCode.F1,
'F2': KeyCode.F2,
'F3': KeyCode.F3,
'F4': KeyCode.F4,
'F5': KeyCode.F5,
'F6': KeyCode.F6,
'F7': KeyCode.F7,
'F8': KeyCode.F8,
'F9': KeyCode.F9,
'F10': KeyCode.F10,
'F11': KeyCode.F11,
'F12': KeyCode.F12,
'U+007F': KeyCode.DELETE,
'Home': KeyCode.HOME,
'End': KeyCode.END,
'PageUp': KeyCode.PAGE_UP,
'PageDown': KeyCode.PAGE_DOWN,
'Insert': KeyCode.INSERT
};
/** Return a stream for KeyEvents for the specified target. */
Stream<KeyEvent> forTarget(EventTarget e, {bool useCapture: false}) {
return new _KeyboardEventHandler.initializeAllEventListeners(
_type, e).stream;
}
/**
* Accessor to the stream associated with a particular KeyboardEvent
* EventTarget.
*
* [forTarget] must be called to initialize this stream to listen to a
* particular EventTarget.
*/
Stream<KeyEvent> get stream {
if(_target != null) {
return _controller.stream;
} else {
throw new StateError("Not initialized. Call forTarget to access a stream "
"initialized with a particular EventTarget.");
}
}
/**
* General constructor, performs basic initialization for our improved
* KeyboardEvent controller.
*/
_KeyboardEventHandler(this._type) :
_target = null, super(_EVENT_TYPE) {
}
/**
* Hook up all event listeners under the covers so we can estimate keycodes
* and charcodes when they are not provided.
*/
_KeyboardEventHandler.initializeAllEventListeners(this._type, this._target) :
super(_EVENT_TYPE) {
Element.keyDownEvent.forTarget(_target, useCapture: true).listen(
processKeyDown);
Element.keyPressEvent.forTarget(_target, useCapture: true).listen(
processKeyPress);
Element.keyUpEvent.forTarget(_target, useCapture: true).listen(
processKeyUp);
}
/**
* Notify all callback listeners that a KeyEvent of the relevant type has
* occurred.
*/
bool _dispatch(KeyEvent event) {
if (event.type == _type)
_controller.add(event);
}
/** Determine if caps lock is one of the currently depressed keys. */
bool get _capsLockOn =>
_keyDownList.any((var element) => element.keyCode == KeyCode.CAPS_LOCK);
/**
* Given the previously recorded keydown key codes, see if we can determine
* the keycode of this keypress [event]. (Generally browsers only provide
* charCode information for keypress events, but with a little
* reverse-engineering, we can also determine the keyCode.) Returns
* KeyCode.UNKNOWN if the keycode could not be determined.
*/
int _determineKeyCodeForKeypress(KeyboardEvent event) {
// Note: This function is a work in progress. We'll expand this function
// once we get more information about other keyboards.
for (var prevEvent in _keyDownList) {
if (prevEvent._shadowCharCode == event.charCode) {
return prevEvent.keyCode;
}
if ((event.shiftKey || _capsLockOn) && event.charCode >= "A".codeUnits[0]
&& event.charCode <= "Z".codeUnits[0] && event.charCode +
_ROMAN_ALPHABET_OFFSET == prevEvent._shadowCharCode) {
return prevEvent.keyCode;
}
}
return KeyCode.UNKNOWN;
}
/**
* Given the charater code returned from a keyDown [event], try to ascertain
* and return the corresponding charCode for the character that was pressed.
* This information is not shown to the user, but used to help polyfill
* keypress events.
*/
int _findCharCodeKeyDown(KeyboardEvent event) {
if (event.keyLocation == 3) { // Numpad keys.
switch (event.keyCode) {
case KeyCode.NUM_ZERO:
// Even though this function returns _charCodes_, for some cases the
// KeyCode == the charCode we want, in which case we use the keycode
// constant for readability.
return KeyCode.ZERO;
case KeyCode.NUM_ONE:
return KeyCode.ONE;
case KeyCode.NUM_TWO:
return KeyCode.TWO;
case KeyCode.NUM_THREE:
return KeyCode.THREE;
case KeyCode.NUM_FOUR:
return KeyCode.FOUR;
case KeyCode.NUM_FIVE:
return KeyCode.FIVE;
case KeyCode.NUM_SIX:
return KeyCode.SIX;
case KeyCode.NUM_SEVEN:
return KeyCode.SEVEN;
case KeyCode.NUM_EIGHT:
return KeyCode.EIGHT;
case KeyCode.NUM_NINE:
return KeyCode.NINE;
case KeyCode.NUM_MULTIPLY:
return 42; // Char code for *
case KeyCode.NUM_PLUS:
return 43; // +
case KeyCode.NUM_MINUS:
return 45; // -
case KeyCode.NUM_PERIOD:
return 46; // .
case KeyCode.NUM_DIVISION:
return 47; // /
}
} else if (event.keyCode >= 65 && event.keyCode <= 90) {
// Set the "char code" for key down as the lower case letter. Again, this
// will not show up for the user, but will be helpful in estimating
// keyCode locations and other information during the keyPress event.
return event.keyCode + _ROMAN_ALPHABET_OFFSET;
}
switch(event.keyCode) {
case KeyCode.SEMICOLON:
return KeyCode.FF_SEMICOLON;
case KeyCode.EQUALS:
return KeyCode.FF_EQUALS;
case KeyCode.COMMA:
return 44; // Ascii value for ,
case KeyCode.DASH:
return 45; // -
case KeyCode.PERIOD:
return 46; // .
case KeyCode.SLASH:
return 47; // /
case KeyCode.APOSTROPHE:
return 96; // `
case KeyCode.OPEN_SQUARE_BRACKET:
return 91; // [
case KeyCode.BACKSLASH:
return 92; // \
case KeyCode.CLOSE_SQUARE_BRACKET:
return 93; // ]
case KeyCode.SINGLE_QUOTE:
return 39; // '
}
return event.keyCode;
}
/**
* Returns true if the key fires a keypress event in the current browser.
*/
bool _firesKeyPressEvent(KeyEvent event) {
if (!Device.isIE && !Device.isWebKit) {
return true;
}
if (Device.userAgent.contains('Mac') && event.altKey) {
return KeyCode.isCharacterKey(event.keyCode);
}
// Alt but not AltGr which is represented as Alt+Ctrl.
if (event.altKey && !event.ctrlKey) {
return false;
}
// Saves Ctrl or Alt + key for IE and WebKit, which won't fire keypress.
if (!event.shiftKey &&
(_keyDownList.last.keyCode == KeyCode.CTRL ||
_keyDownList.last.keyCode == KeyCode.ALT ||
Device.userAgent.contains('Mac') &&
_keyDownList.last.keyCode == KeyCode.META)) {
return false;
}
// Some keys with Ctrl/Shift do not issue keypress in WebKit.
if (Device.isWebKit && event.ctrlKey && event.shiftKey && (
event.keyCode == KeyCode.BACKSLASH ||
event.keyCode == KeyCode.OPEN_SQUARE_BRACKET ||
event.keyCode == KeyCode.CLOSE_SQUARE_BRACKET ||
event.keyCode == KeyCode.TILDE ||
event.keyCode == KeyCode.SEMICOLON || event.keyCode == KeyCode.DASH ||
event.keyCode == KeyCode.EQUALS || event.keyCode == KeyCode.COMMA ||
event.keyCode == KeyCode.PERIOD || event.keyCode == KeyCode.SLASH ||
event.keyCode == KeyCode.APOSTROPHE ||
event.keyCode == KeyCode.SINGLE_QUOTE)) {
return false;
}
switch (event.keyCode) {
case KeyCode.ENTER:
// IE9 does not fire keypress on ENTER.
return !Device.isIE;
case KeyCode.ESC:
return !Device.isWebKit;
}
return KeyCode.isCharacterKey(event.keyCode);
}
/**
* Normalize the keycodes to the IE KeyCodes (this is what Chrome, IE, and
* Opera all use).
*/
int _normalizeKeyCodes(KeyboardEvent event) {
// Note: This may change once we get input about non-US keyboards.
if (Device.isFirefox) {
switch(event.keyCode) {
case KeyCode.FF_EQUALS:
return KeyCode.EQUALS;
case KeyCode.FF_SEMICOLON:
return KeyCode.SEMICOLON;
case KeyCode.MAC_FF_META:
return KeyCode.META;
case KeyCode.WIN_KEY_FF_LINUX:
return KeyCode.WIN_KEY;
}
}
return event.keyCode;
}
/** Handle keydown events. */
void processKeyDown(KeyboardEvent e) {
// Ctrl-Tab and Alt-Tab can cause the focus to be moved to another window
// before we've caught a key-up event. If the last-key was one of these
// we reset the state.
if (_keyDownList.length > 0 &&
(_keyDownList.last.keyCode == KeyCode.CTRL && !e.ctrlKey ||
_keyDownList.last.keyCode == KeyCode.ALT && !e.altKey ||
Device.userAgent.contains('Mac') &&
_keyDownList.last.keyCode == KeyCode.META && !e.metaKey)) {
_keyDownList.clear();
}
var event = new KeyEvent(e);
event._shadowKeyCode = _normalizeKeyCodes(event);
// Technically a "keydown" event doesn't have a charCode. This is
// calculated nonetheless to provide us with more information in giving
// as much information as possible on keypress about keycode and also
// charCode.
event._shadowCharCode = _findCharCodeKeyDown(event);
if (_keyDownList.length > 0 && event.keyCode != _keyDownList.last.keyCode &&
!_firesKeyPressEvent(event)) {
// Some browsers have quirks not firing keypress events where all other
// browsers do. This makes them more consistent.
processKeyPress(e);
}
_keyDownList.add(event);
_dispatch(event);
}
/** Handle keypress events. */
void processKeyPress(KeyboardEvent event) {
var e = new KeyEvent(event);
// IE reports the character code in the keyCode field for keypress events.
// There are two exceptions however, Enter and Escape.
if (Device.isIE) {
if (e.keyCode == KeyCode.ENTER || e.keyCode == KeyCode.ESC) {
e._shadowCharCode = 0;
} else {
e._shadowCharCode = e.keyCode;
}
} else if (Device.isOpera) {
// Opera reports the character code in the keyCode field.
e._shadowCharCode = KeyCode.isCharacterKey(e.keyCode) ? e.keyCode : 0;
}
// Now we guestimate about what the keycode is that was actually
// pressed, given previous keydown information.
e._shadowKeyCode = _determineKeyCodeForKeypress(e);
// Correct the key value for certain browser-specific quirks.
if (e._shadowKeyIdentifier != null &&
_keyIdentifier.containsKey(e._shadowKeyIdentifier)) {
// This is needed for Safari Windows because it currently doesn't give a
// keyCode/which for non printable keys.
e._shadowKeyCode = _keyIdentifier[e._shadowKeyIdentifier];
}
e._shadowAltKey = _keyDownList.any((var element) => element.altKey);
_dispatch(e);
}
/** Handle keyup events. */
void processKeyUp(KeyboardEvent event) {
var e = new KeyEvent(event);
KeyboardEvent toRemove = null;
for (var key in _keyDownList) {
if (key.keyCode == e.keyCode) {
toRemove = key;
}
}
if (toRemove != null) {
_keyDownList.removeWhere((element) => element == toRemove);
} else if (_keyDownList.length > 0) {
// This happens when we've reached some international keyboard case we
// haven't accounted for or we haven't correctly eliminated all browser
// inconsistencies. Filing bugs on when this is reached is welcome!
_keyDownList.removeLast();
}
_dispatch(e);
}
}
/**
* Records KeyboardEvents that occur on a particular element, and provides a
* stream of outgoing KeyEvents with cross-browser consistent keyCode and
* charCode values despite the fact that a multitude of browsers that have
* varying keyboard default behavior.
*
* Example usage:
*
* KeyboardEventStream.onKeyDown(document.body).listen(
* keydownHandlerTest);
*
* This class is very much a work in progress, and we'd love to get information
* on how we can make this class work with as many international keyboards as
* possible. Bugs welcome!
*/
class KeyboardEventStream {
/** Named constructor to produce a stream for onKeyPress events. */
static Stream<KeyEvent> onKeyPress(EventTarget target) =>
new _KeyboardEventHandler('keypress').forTarget(target);
/** Named constructor to produce a stream for onKeyUp events. */
static Stream<KeyEvent> onKeyUp(EventTarget target) =>
new _KeyboardEventHandler('keyup').forTarget(target);
/** Named constructor to produce a stream for onKeyDown events. */
static Stream<KeyEvent> onKeyDown(EventTarget target) =>
new _KeyboardEventHandler('keydown').forTarget(target);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
typedef void _MicrotaskCallback();
/**
* This class attempts to invoke a callback as soon as the current event stack
* unwinds, but before the browser repaints.
*/
abstract class _MicrotaskScheduler {
bool _nextMicrotaskFrameScheduled = false;
final _MicrotaskCallback _callback;
_MicrotaskScheduler(this._callback);
/**
* Creates the best possible microtask scheduler for the current platform.
*/
factory _MicrotaskScheduler.best(_MicrotaskCallback callback) {
if (Window._supportsSetImmediate) {
return new _SetImmediateScheduler(callback);
} else if (MutationObserver.supported) {
return new _MutationObserverScheduler(callback);
}
return new _PostMessageScheduler(callback);
}
/**
* Schedules a microtask callback if one has not been scheduled already.
*/
void maybeSchedule() {
if (this._nextMicrotaskFrameScheduled) {
return;
}
this._nextMicrotaskFrameScheduled = true;
this._schedule();
}
/**
* Does the actual scheduling of the callback.
*/
void _schedule();
/**
* Handles the microtask callback and forwards it if necessary.
*/
void _onCallback() {
// Ignore spurious messages.
if (!_nextMicrotaskFrameScheduled) {
return;
}
_nextMicrotaskFrameScheduled = false;
this._callback();
}
}
/**
* Scheduler which uses window.postMessage to schedule events.
*/
class _PostMessageScheduler extends _MicrotaskScheduler {
const _MICROTASK_MESSAGE = "DART-MICROTASK";
_PostMessageScheduler(_MicrotaskCallback callback): super(callback) {
// Messages from other windows do not cause a security risk as
// all we care about is that _handleMessage is called
// after the current event loop is unwound and calling the function is
// a noop when zero requests are pending.
window.onMessage.listen(this._handleMessage);
}
void _schedule() {
window.postMessage(_MICROTASK_MESSAGE, "*");
}
void _handleMessage(e) {
this._onCallback();
}
}
/**
* Scheduler which uses a MutationObserver to schedule events.
*/
class _MutationObserverScheduler extends _MicrotaskScheduler {
MutationObserver _observer;
Element _dummy;
_MutationObserverScheduler(_MicrotaskCallback callback): super(callback) {
// Mutation events get fired as soon as the current event stack is unwound
// so we just make a dummy event and listen for that.
_observer = new MutationObserver(this._handleMutation);
_dummy = new DivElement();
_observer.observe(_dummy, attributes: true);
}
void _schedule() {
// Toggle it to trigger the mutation event.
_dummy.hidden = !_dummy.hidden;
}
_handleMutation(List<MutationRecord> mutations, MutationObserver observer) {
this._onCallback();
}
}
/**
* Scheduler which uses window.setImmediate to schedule events.
*/
class _SetImmediateScheduler extends _MicrotaskScheduler {
_SetImmediateScheduler(_MicrotaskCallback callback): super(callback);
void _schedule() {
window._setImmediate(_handleImmediate);
}
void _handleImmediate() {
this._onCallback();
}
}
List<TimeoutHandler> _pendingMicrotasks;
_MicrotaskScheduler _microtaskScheduler = null;
void _maybeScheduleMicrotaskFrame() {
if (_microtaskScheduler == null) {
_microtaskScheduler =
new _MicrotaskScheduler.best(_completeMicrotasks);
}
_microtaskScheduler.maybeSchedule();
}
/**
* Registers a [callback] which is called after the current execution stack
* unwinds.
*/
void _addMicrotaskCallback(TimeoutHandler callback) {
if (_pendingMicrotasks == null) {
_pendingMicrotasks = <TimeoutHandler>[];
_maybeScheduleMicrotaskFrame();
}
_pendingMicrotasks.add(callback);
}
/**
* Complete all pending microtasks.
*/
void _completeMicrotasks() {
var callbacks = _pendingMicrotasks;
_pendingMicrotasks = null;
for (var callback in callbacks) {
callback();
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Class which helps construct standard node validation policies.
*
* By default this will not accept anything, but the 'allow*' functions can be
* used to expand what types of elements or attributes are allowed.
*
* All allow functions are additive- elements will be accepted if they are
* accepted by any specific rule.
*
* It is important to remember that sanitization is not just intended to prevent
* cross-site scripting attacks, but also to prevent information from being
* displayed in unexpected ways. For example something displaying basic
* formatted text may not expect `<video>` tags to appear. In this case an
* empty NodeValidatorBuilder with just [allowTextElements] might be
* appropriate.
*/
class NodeValidatorBuilder implements NodeValidator {
final List<NodeValidator> _validators = <NodeValidator>[];
NodeValidatorBuilder() {
}
/**
* Creates a new NodeValidatorBuilder which accepts common constructs.
*
* By default this will accept HTML5 elements and attributes with the default
* [UriPolicy] and templating elements.
*
* Notable syntax which is filtered:
*
* * Only known-good HTML5 elements and attributes are allowed.
* * All URLs must be same-origin, use [allowNavigation] and [allowImages] to
* specify additional URI policies.
* * Inline-styles are not allowed.
* * Custom element tags are disallowed, use [allowCustomElement].
* * Custom tags extensions are disallowed, use [allowTagExtension].
* * SVG Elements are not allowed, use [allowSvg].
*
* For scenarios where the HTML should only contain formatted text
* [allowTextElements] is more appropriate.
*
* Use [allowSvg] to allow SVG elements.
*/
NodeValidatorBuilder.common() {
allowHtml5();
allowTemplating();
}
/**
* Allows navigation elements- Form and Anchor tags, along with common
* attributes.
*
* The UriPolicy can be used to restrict the locations the navigation elements
* are allowed to direct to. By default this will use the default [UriPolicy].
*/
void allowNavigation([UriPolicy uriPolicy]) {
if (uriPolicy == null) {
uriPolicy = new UriPolicy();
}
add(new _SimpleNodeValidator.allowNavigation(uriPolicy));
}
/**
* Allows image elements.
*
* The UriPolicy can be used to restrict the locations the images may be
* loaded from. By default this will use the default [UriPolicy].
*/
void allowImages([UriPolicy uriPolicy]) {
if (uriPolicy == null) {
uriPolicy = new UriPolicy();
}
add(new _SimpleNodeValidator.allowImages(uriPolicy));
}
/**
* Allow basic text elements.
*
* This allows a subset of HTML5 elements, specifically just these tags and
* no attributes.
*
* * B
* * BLOCKQUOTE
* * BR
* * EM
* * H1
* * H2
* * H3
* * H4
* * H5
* * H6
* * HR
* * I
* * LI
* * OL
* * P
* * SPAN
* * UL
*/
void allowTextElements() {
add(new _SimpleNodeValidator.allowTextElements());
}
/**
* Allow inline styles on elements.
*
* If [tagName] is not specified then this allows inline styles on all
* elements. Otherwise tagName limits the styles to the specified elements.
*/
void allowInlineStyles({String tagName}) {
if (tagName == null) {
tagName = '*';
} else {
tagName = tagName.toUpperCase();
}
add(new _SimpleNodeValidator(null, allowedAttributes: ['$tagName::style']));
}
/**
* Allow common safe HTML5 elements and attributes.
*
* This list is based off of the Caja whitelists at:
* https://code.google.com/p/google-caja/wiki/CajaWhitelists.
*
* Common things which are not allowed are script elements, style attributes
* and any script handlers.
*/
void allowHtml5({UriPolicy uriPolicy}) {
add(new _Html5NodeValidator(uriPolicy: uriPolicy));
}
/**
* Allow SVG elements and attributes except for known bad ones.
*/
void allowSvg() {
add(new _SvgNodeValidator());
}
/**
* Allow custom elements with the specified tag name and specified attributes.
*
* This will allow the elements as custom tags (such as <x-foo></x-foo>),
* but will not allow tag extensions. Use [allowTagExtension] to allow
* tag extensions.
*/
void allowCustomElement(String tagName,
{UriPolicy uriPolicy,
Iterable<String> attributes,
Iterable<String> uriAttributes}) {
var tagNameUpper = tagName.toUpperCase();
var attrs;
if (attributes != null) {
attrs =
attributes.map((name) => '$tagNameUpper::${name.toLowerCase()}');
}
var uriAttrs;
if (uriAttributes != null) {
uriAttrs =
uriAttributes.map((name) => '$tagNameUpper::${name.toLowerCase()}');
}
if (uriPolicy == null) {
uriPolicy = new UriPolicy();
}
add(new _CustomElementNodeValidator(
uriPolicy,
[tagNameUpper],
attrs,
uriAttrs,
false,
true));
}
/**
* Allow custom tag extensions with the specified type name and specified
* attributes.
*
* This will allow tag extensions (such as <div is="x-foo"></div>),
* but will not allow custom tags. Use [allowCustomElement] to allow
* custom tags.
*/
void allowTagExtension(String tagName, String baseName,
{UriPolicy uriPolicy,
Iterable<String> attributes,
Iterable<String> uriAttributes}) {
var baseNameUpper = baseName.toUpperCase();
var tagNameUpper = tagName.toUpperCase();
var attrs;
if (attributes != null) {
attrs =
attributes.map((name) => '$baseNameUpper::${name.toLowerCase()}');
}
var uriAttrs;
if (uriAttributes != null) {
uriAttrs =
uriAttributes.map((name) => '$baseNameUpper::${name.toLowerCase()}');
}
if (uriPolicy == null) {
uriPolicy = new UriPolicy();
}
add(new _CustomElementNodeValidator(
uriPolicy,
[tagNameUpper, baseNameUpper],
attrs,
uriAttrs,
true,
false));
}
void allowElement(String tagName, {UriPolicy uriPolicy,
Iterable<String> attributes,
Iterable<String> uriAttributes}) {
allowCustomElement(tagName, uriPolicy: uriPolicy,
attributes: attributes,
uriAttributes: uriAttributes);
}
/**
* Allow templating elements (such as <template> and template-related
* attributes.
*
* This still requires other validators to allow regular attributes to be
* bound (such as [allowHtml5]).
*/
void allowTemplating() {
add(new _TemplatingNodeValidator());
}
/**
* Add an additional validator to the current list of validators.
*
* Elements and attributes will be accepted if they are accepted by any
* validators.
*/
void add(NodeValidator validator) {
_validators.add(validator);
}
bool allowsElement(Element element) {
return _validators.any((v) => v.allowsElement(element));
}
bool allowsAttribute(Element element, String attributeName, String value) {
return _validators.any(
(v) => v.allowsAttribute(element, attributeName, value));
}
}
class _SimpleNodeValidator implements NodeValidator {
final Set<String> allowedElements;
final Set<String> allowedAttributes;
final Set<String> allowedUriAttributes;
final UriPolicy uriPolicy;
factory _SimpleNodeValidator.allowNavigation(UriPolicy uriPolicy) {
return new _SimpleNodeValidator(uriPolicy,
allowedElements: [
'A',
'FORM'],
allowedAttributes: [
'A::accesskey',
'A::coords',
'A::hreflang',
'A::name',
'A::shape',
'A::tabindex',
'A::target',
'A::type',
'FORM::accept',
'FORM::autocomplete',
'FORM::enctype',
'FORM::method',
'FORM::name',
'FORM::novalidate',
'FORM::target',
],
allowedUriAttributes: [
'A::href',
'FORM::action',
]);
}
factory _SimpleNodeValidator.allowImages(UriPolicy uriPolicy) {
return new _SimpleNodeValidator(uriPolicy,
allowedElements: [
'IMG'
],
allowedAttributes: [
'IMG::align',
'IMG::alt',
'IMG::border',
'IMG::height',
'IMG::hspace',
'IMG::ismap',
'IMG::name',
'IMG::usemap',
'IMG::vspace',
'IMG::width',
],
allowedUriAttributes: [
'IMG::src',
]);
}
factory _SimpleNodeValidator.allowTextElements() {
return new _SimpleNodeValidator(null,
allowedElements: [
'B',
'BLOCKQUOTE',
'BR',
'EM',
'H1',
'H2',
'H3',
'H4',
'H5',
'H6',
'HR',
'I',
'LI',
'OL',
'P',
'SPAN',
'UL',
]);
}
/**
* Elements must be uppercased tag names. For example `'IMG'`.
* Attributes must be uppercased tag name followed by :: followed by
* lowercase attribute name. For example `'IMG:src'`.
*/
_SimpleNodeValidator(this.uriPolicy,
{Iterable<String> allowedElements, Iterable<String> allowedAttributes,
Iterable<String> allowedUriAttributes}):
this.allowedElements = allowedElements != null ?
new Set.from(allowedElements) : new Set(),
this.allowedAttributes = allowedAttributes != null ?
new Set.from(allowedAttributes) : new Set(),
this.allowedUriAttributes = allowedUriAttributes != null ?
new Set.from(allowedUriAttributes) : new Set();
bool allowsElement(Element element) {
return allowedElements.contains(element.tagName);
}
bool allowsAttribute(Element element, String attributeName, String value) {
var tagName = element.tagName;
if (allowedUriAttributes.contains('$tagName::$attributeName')) {
return uriPolicy.allowsUri(value);
} else if (allowedUriAttributes.contains('*::$attributeName')) {
return uriPolicy.allowsUri(value);
} else if (allowedAttributes.contains('$tagName::$attributeName')) {
return true;
} else if (allowedAttributes.contains('*::$attributeName')) {
return true;
} else if (allowedAttributes.contains('$tagName::*')) {
return true;
} else if (allowedAttributes.contains('*::*')) {
return true;
}
return false;
}
}
class _CustomElementNodeValidator extends _SimpleNodeValidator {
final bool allowTypeExtension;
final bool allowCustomTag;
_CustomElementNodeValidator(UriPolicy uriPolicy,
Iterable<String> allowedElements,
Iterable<String> allowedAttributes,
Iterable<String> allowedUriAttributes,
bool allowTypeExtension,
bool allowCustomTag):
super(uriPolicy,
allowedElements: allowedElements,
allowedAttributes: allowedAttributes,
allowedUriAttributes: allowedUriAttributes),
this.allowTypeExtension = allowTypeExtension == true,
this.allowCustomTag = allowCustomTag == true;
bool allowsElement(Element element) {
if (allowTypeExtension) {
var isAttr = element.attributes['is'];
if (isAttr != null) {
return allowedElements.contains(isAttr.toUpperCase()) &&
allowedElements.contains(element.tagName);
}
}
return allowCustomTag && allowedElements.contains(element.tagName);
}
bool allowsAttribute(Element element, String attributeName, String value) {
if (allowsElement(element)) {
if (allowTypeExtension && attributeName == 'is' &&
allowedElements.contains(value.toUpperCase())) {
return true;
}
return super.allowsAttribute(element, attributeName, value);
}
return false;
}
}
class _TemplatingNodeValidator extends _SimpleNodeValidator {
static const _TEMPLATE_ATTRS =
const <String>['bind', 'if', 'ref', 'repeat', 'syntax'];
final Set<String> _templateAttrs;
_TemplatingNodeValidator():
super(null,
allowedElements: [
'TEMPLATE'
],
allowedAttributes: _TEMPLATE_ATTRS.map((attr) => 'TEMPLATE::$attr')),
_templateAttrs = new Set<String>.from(_TEMPLATE_ATTRS) {
}
bool allowsAttribute(Element element, String attributeName, String value) {
if (super.allowsAttribute(element, attributeName, value)) {
return true;
}
if (attributeName == 'template' && value == "") {
return true;
}
if (element.attributes['template'] == "" ) {
return _templateAttrs.contains(attributeName);
}
return false;
}
}
class _SvgNodeValidator implements NodeValidator {
bool allowsElement(Element element) {
if (element is svg.ScriptElement) {
return false;
}
if (element is svg.SvgElement) {
return true;
}
return false;
}
bool allowsAttribute(Element element, String attributeName, String value) {
if (attributeName == 'is' || attributeName.startsWith('on')) {
return false;
}
return allowsElement(element);
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* A utility class for representing two-dimensional positions.
*/
class Point {
final num x;
final num y;
const Point([num x = 0, num y = 0]): x = x, y = y;
String toString() => '($x, $y)';
bool operator ==(other) {
if (other is !Point) return false;
return x == other.x && y == other.y;
}
int get hashCode => JenkinsSmiHash.hash2(x.hashCode, y.hashCode);
Point operator +(Point other) {
return new Point(x + other.x, y + other.y);
}
Point operator -(Point other) {
return new Point(x - other.x, y - other.y);
}
Point operator *(num factor) {
return new Point(x * factor, y * factor);
}
/**
* Get the straight line (Euclidean) distance between the origin (0, 0) and
* this point.
*/
num get magnitude => sqrt(x * x + y * y);
/**
* Returns the distance between two points.
*/
double distanceTo(Point other) {
var dx = x - other.x;
var dy = y - other.y;
return sqrt(dx * dx + dy * dy);
}
/**
* Returns the squared distance between two points.
*
* Squared distances can be used for comparisons when the actual value is not
* required.
*/
num squaredDistanceTo(Point other) {
var dx = x - other.x;
var dy = y - other.y;
return dx * dx + dy * dy;
}
Point ceil() => new Point(x.ceil(), y.ceil());
Point floor() => new Point(x.floor(), y.floor());
Point round() => new Point(x.round(), y.round());
/**
* Truncates x and y to integers and returns the result as a new point.
*/
Point toInt() => new Point(x.toInt(), y.toInt());
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Contains the set of standard values returned by HTMLDocument.getReadyState.
*/
abstract class ReadyState {
/**
* Indicates the document is still loading and parsing.
*/
static const String LOADING = "loading";
/**
* Indicates the document is finished parsing but is still loading
* subresources.
*/
static const String INTERACTIVE = "interactive";
/**
* Indicates the document and all subresources have been loaded.
*/
static const String COMPLETE = "complete";
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* A base class for representing two-dimensional rectangles. This will hopefully
* be moved merged with the dart:math Rect.
*/
// TODO(efortuna): Merge with Math rect after finalizing with Florian.
abstract class RectBase {
// Not used, but keeps the VM from complaining about Rect having a const
// constructor and this one not.
const RectBase();
num get left;
num get top;
num get width;
num get height;
num get right => left + width;
num get bottom => top + height;
// NOTE! All code below should be common with Rect.
String toString() {
return '($left, $top, $width, $height)';
}
bool operator ==(other) {
if (other is !Rect) return false;
return left == other.left && top == other.top && width == other.width &&
height == other.height;
}
int get hashCode => JenkinsSmiHash.hash4(left.hashCode, top.hashCode,
width.hashCode, height.hashCode);
/**
* Computes the intersection of this rectangle and the rectangle parameter.
* Returns null if there is no intersection.
*/
Rect intersection(Rect rect) {
var x0 = max(left, rect.left);
var x1 = min(left + width, rect.left + rect.width);
if (x0 <= x1) {
var y0 = max(top, rect.top);
var y1 = min(top + height, rect.top + rect.height);
if (y0 <= y1) {
return new Rect(x0, y0, x1 - x0, y1 - y0);
}
}
return null;
}
/**
* Returns whether a rectangle intersects this rectangle.
*/
bool intersects(Rect other) {
return (left <= other.left + other.width && other.left <= left + width &&
top <= other.top + other.height && other.top <= top + height);
}
/**
* Returns a new rectangle which completely contains this rectangle and the
* input rectangle.
*/
Rect union(Rect rect) {
var right = max(this.left + this.width, rect.left + rect.width);
var bottom = max(this.top + this.height, rect.top + rect.height);
var left = min(this.left, rect.left);
var top = min(this.top, rect.top);
return new Rect(left, top, right - left, bottom - top);
}
/**
* Tests whether this rectangle entirely contains another rectangle.
*/
bool containsRect(Rect another) {
return left <= another.left &&
left + width >= another.left + another.width &&
top <= another.top &&
top + height >= another.top + another.height;
}
/**
* Tests whether this rectangle entirely contains a point.
*/
bool containsPoint(Point another) {
return another.x >= left &&
another.x <= left + width &&
another.y >= top &&
another.y <= top + height;
}
Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
height.floor());
Rect round() => new Rect(left.round(), top.round(), width.round(),
height.round());
/**
* Truncates coordinates to integers and returns the result as a new
* rectangle.
*/
Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
height.toInt());
Point get topLeft => new Point(this.left, this.top);
Point get bottomRight => new Point(this.left + this.width,
this.top + this.height);
}
/**
* A class for representing two-dimensional rectangles.
*
* This class is distinctive from RectBase in that it enforces that its
* properties are immutable.
*/
class Rect extends RectBase {
final num left;
final num top;
final num width;
final num height;
const Rect(this.left, this.top, this.width, this.height): super();
factory Rect.fromPoints(Point a, Point b) {
var left;
var width;
if (a.x < b.x) {
left = a.x;
width = b.x - left;
} else {
left = b.x;
width = a.x - left;
}
var top;
var height;
if (a.y < b.y) {
top = a.y;
height = b.y - top;
} else {
top = b.y;
height = a.y - top;
}
return new Rect(left, top, width, height);
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Patch file for the dart:isolate library.
/********************************************************
Inserted from lib/isolate/serialization.dart
********************************************************/
class _MessageTraverserVisitedMap {
operator[](var object) => null;
void operator[]=(var object, var info) { }
void reset() { }
void cleanup() { }
}
/** Abstract visitor for dart objects that can be sent as isolate messages. */
abstract class _MessageTraverser {
_MessageTraverserVisitedMap _visited;
_MessageTraverser() : _visited = new _MessageTraverserVisitedMap();
/** Visitor's entry point. */
traverse(var x) {
if (isPrimitive(x)) return visitPrimitive(x);
_visited.reset();
var result;
try {
result = _dispatch(x);
} finally {
_visited.cleanup();
}
return result;
}
_dispatch(var x) {
if (isPrimitive(x)) return visitPrimitive(x);
if (x is List) return visitList(x);
if (x is Map) return visitMap(x);
if (x is SendPort) return visitSendPort(x);
if (x is SendPortSync) return visitSendPortSync(x);
// Overridable fallback.
return visitObject(x);
}
visitPrimitive(x);
visitList(List x);
visitMap(Map x);
visitSendPort(SendPort x);
visitSendPortSync(SendPortSync x);
visitObject(Object x) {
// TODO(floitsch): make this a real exception. (which one)?
throw "Message serialization: Illegal value $x passed";
}
static bool isPrimitive(x) {
return (x == null) || (x is String) || (x is num) || (x is bool);
}
}
/** Visitor that serializes a message as a JSON array. */
abstract class _Serializer extends _MessageTraverser {
int _nextFreeRefId = 0;
visitPrimitive(x) => x;
visitList(List list) {
int copyId = _visited[list];
if (copyId != null) return ['ref', copyId];
int id = _nextFreeRefId++;
_visited[list] = id;
var jsArray = _serializeList(list);
// TODO(floitsch): we are losing the generic type.
return ['list', id, jsArray];
}
visitMap(Map map) {
int copyId = _visited[map];
if (copyId != null) return ['ref', copyId];
int id = _nextFreeRefId++;
_visited[map] = id;
var keys = _serializeList(map.keys.toList());
var values = _serializeList(map.values.toList());
// TODO(floitsch): we are losing the generic type.
return ['map', id, keys, values];
}
_serializeList(List list) {
int len = list.length;
var result = new List(len);
for (int i = 0; i < len; i++) {
result[i] = _dispatch(list[i]);
}
return result;
}
}
/** Deserializes arrays created with [_Serializer]. */
abstract class _Deserializer {
Map<int, dynamic> _deserialized;
_Deserializer();
static bool isPrimitive(x) {
return (x == null) || (x is String) || (x is num) || (x is bool);
}
deserialize(x) {
if (isPrimitive(x)) return x;
// TODO(floitsch): this should be new HashMap<int, dynamic>()
_deserialized = new HashMap();
return _deserializeHelper(x);
}
_deserializeHelper(x) {
if (isPrimitive(x)) return x;
assert(x is List);
switch (x[0]) {
case 'ref': return _deserializeRef(x);
case 'list': return _deserializeList(x);
case 'map': return _deserializeMap(x);
case 'sendport': return deserializeSendPort(x);
default: return deserializeObject(x);
}
}
_deserializeRef(List x) {
int id = x[1];
var result = _deserialized[id];
assert(result != null);
return result;
}
List _deserializeList(List x) {
int id = x[1];
// We rely on the fact that Dart-lists are directly mapped to Js-arrays.
List dartList = x[2];
_deserialized[id] = dartList;
int len = dartList.length;
for (int i = 0; i < len; i++) {
dartList[i] = _deserializeHelper(dartList[i]);
}
return dartList;
}
Map _deserializeMap(List x) {
Map result = new Map();
int id = x[1];
_deserialized[id] = result;
List keys = x[2];
List values = x[3];
int len = keys.length;
assert(len == values.length);
for (int i = 0; i < len; i++) {
var key = _deserializeHelper(keys[i]);
var value = _deserializeHelper(values[i]);
result[key] = value;
}
return result;
}
deserializeSendPort(List x);
deserializeObject(List x) {
// TODO(floitsch): Use real exception (which one?).
throw "Unexpected serialized object";
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Interface used to validate that only accepted elements and attributes are
* allowed while parsing HTML strings into DOM nodes.
*
* In general, customization of validation behavior should be done via the
* [NodeValidatorBuilder] class to mitigate the chances of incorrectly
* implementing validation rules.
*/
abstract class NodeValidator {
/**
* Construct a default NodeValidator which only accepts whitelisted HTML5
* elements and attributes.
*
* If a uriPolicy is not specified then the default uriPolicy will be used.
*/
factory NodeValidator({UriPolicy uriPolicy}) =>
new _Html5NodeValidator(uriPolicy: uriPolicy);
factory NodeValidator.throws(NodeValidator base) =>
new _ThrowsNodeValidator(base);
/**
* Returns true if the tagName is an accepted type.
*/
bool allowsElement(Element element);
/**
* Returns true if the attribute is allowed.
*
* The attributeName parameter will always be in lowercase.
*
* See [allowsElement] for format of tagName.
*/
bool allowsAttribute(Element element, String attributeName, String value);
}
/**
* Performs sanitization of a node tree after construction to ensure that it
* does not contain any disallowed elements or attributes.
*
* In general custom implementations of this class should not be necessary and
* all validation customization should be done in custom NodeValidators, but
* custom implementations of this class can be created to perform more complex
* tree sanitization.
*/
abstract class NodeTreeSanitizer {
/**
* Constructs a default tree sanitizer which will remove all elements and
* attributes which are not allowed by the provided validator.
*/
factory NodeTreeSanitizer(NodeValidator validator) =>
new _ValidatingTreeSanitizer(validator);
/**
* Called with the root of the tree which is to be sanitized.
*
* This method needs to walk the entire tree and either remove elements and
* attributes which are not recognized as safe or throw an exception which
* will mark the entire tree as unsafe.
*/
void sanitizeTree(Node node);
}
/**
* Defines the policy for what types of uris are allowed for particular
* attribute values.
*
* This can be used to provide custom rules such as allowing all http:// URIs
* for image attributes but only same-origin URIs for anchor tags.
*/
abstract class UriPolicy {
/**
* Constructs the default UriPolicy which is to only allow Uris to the same
* origin as the application was launched from.
*
* This will block all ftp: mailto: URIs. It will also block accessing
* https://example.com if the app is running from http://example.com.
*/
factory UriPolicy() => new _SameOriginUriPolicy();
/**
* Checks if the uri is allowed on the specified attribute.
*
* The uri provided may or may not be a relative path.
*/
bool allowsUri(String uri);
}
/**
* Allows URIs to the same origin as the current application was loaded from
* (such as https://example.com:80).
*/
class _SameOriginUriPolicy implements UriPolicy {
final AnchorElement _hiddenAnchor = new AnchorElement();
final Location _loc = window.location;
bool allowsUri(String uri) {
_hiddenAnchor.href = uri;
// IE leaves an empty hostname for same-origin URIs.
return (_hiddenAnchor.hostname == _loc.hostname &&
_hiddenAnchor.port == _loc.port &&
_hiddenAnchor.protocol == _loc.protocol) ||
(_hiddenAnchor.hostname == '' &&
_hiddenAnchor.port == '' &&
_hiddenAnchor.protocol == ':');
}
}
class _ThrowsNodeValidator implements NodeValidator {
final NodeValidator validator;
_ThrowsNodeValidator(this.validator) {}
bool allowsElement(Element element) {
if (!validator.allowsElement(element)) {
throw new ArgumentError(element.tagName);
}
return true;
}
bool allowsAttribute(Element element, String attributeName, String value) {
if (!validator.allowsAttribute(element, attributeName, value)) {
throw new ArgumentError('${element.tagName}[$attributeName="$value"]');
}
}
}
/**
* Standard tree sanitizer which validates a node tree against the provided
* validator and removes any nodes or attributes which are not allowed.
*/
class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
NodeValidator validator;
_ValidatingTreeSanitizer(this.validator) {}
void sanitizeTree(Node node) {
void walk(Node node) {
sanitizeNode(node);
var child = node.lastChild;
while (child != null) {
// Child may be removed during the walk.
var nextChild = child.previousNode;
walk(child);
child = nextChild;
}
}
walk(node);
}
void sanitizeNode(Node node) {
switch (node.nodeType) {
case Node.ELEMENT_NODE:
Element element = node;
var attrs = element.attributes;
if (!validator.allowsElement(element)) {
window.console.warn(
'Removing disallowed element <${element.tagName}>');
element.remove();
break;
}
var isAttr = attrs['is'];
if (isAttr != null) {
if (!validator.allowsAttribute(element, 'is', isAttr)) {
window.console.warn('Removing disallowed type extension '
'<${element.tagName} is="$isAttr">');
element.remove();
break;
}
}
// TODO(blois): Need to be able to get all attributes, irrespective of
// XMLNS.
var keys = attrs.keys.toList();
for (var i = attrs.length - 1; i >= 0; --i) {
var name = keys[i];
if (!validator.allowsAttribute(element, name.toLowerCase(),
attrs[name])) {
window.console.warn('Removing disallowed attribute '
'<${element.tagName} $name="${attrs[name]}">');
attrs.remove(name);
}
}
if (element is TemplateElement) {
TemplateElement template = element;
sanitizeTree(template.content);
}
break;
case Node.COMMENT_NODE:
case Node.DOCUMENT_FRAGMENT_NODE:
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
break;
default:
node.remove();
}
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Helper class to implement custom events which wrap DOM events.
*/
class _WrappedEvent implements Event {
final Event wrapped;
_WrappedEvent(this.wrapped);
bool get bubbles => wrapped.bubbles;
bool get cancelBubble => wrapped.bubbles;
void set cancelBubble(bool value) {
wrapped.cancelBubble = value;
}
bool get cancelable => wrapped.cancelable;
DataTransfer get clipboardData => wrapped.clipboardData;
EventTarget get currentTarget => wrapped.currentTarget;
bool get defaultPrevented => wrapped.defaultPrevented;
int get eventPhase => wrapped.eventPhase;
EventTarget get target => wrapped.target;
int get timeStamp => wrapped.timeStamp;
String get type => wrapped.type;
void _initEvent(String eventTypeArg, bool canBubbleArg,
bool cancelableArg) {
throw new UnsupportedError(
'Cannot initialize this Event.');
}
void preventDefault() {
wrapped.preventDefault();
}
void stopImmediatePropagation() {
wrapped.stopImmediatePropagation();
}
void stopPropagation() {
wrapped.stopPropagation();
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* A list which just wraps another list, for either intercepting list calls or
* retyping the list (for example, from List<A> to List<B> where B extends A).
*/
class _WrappedList<E> extends ListBase<E> {
final List _list;
_WrappedList(this._list);
// Iterable APIs
Iterator<E> get iterator => new _WrappedIterator(_list.iterator);
int get length => _list.length;
// Collection APIs
void add(E element) { _list.add(element); }
bool remove(Object element) => _list.remove(element);
void clear() { _list.clear(); }
// List APIs
E operator [](int index) => _list[index];
void operator []=(int index, E value) { _list[index] = value; }
void set length(int newLength) { _list.length = newLength; }
void sort([int compare(E a, E b)]) { _list.sort(compare); }
int indexOf(Object element, [int start = 0]) => _list.indexOf(element, start);
int lastIndexOf(Object element, [int start]) => _list.lastIndexOf(element, start);
void insert(int index, E element) => _list.insert(index, element);
E removeAt(int index) => _list.removeAt(index);
void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
_list.setRange(start, end, iterable, skipCount);
}
void removeRange(int start, int end) { _list.removeRange(start, end); }
void replaceRange(int start, int end, Iterable<E> iterable) {
_list.replaceRange(start, end, iterable);
}
void fillRange(int start, int end, [E fillValue]) {
_list.fillRange(start, end, fillValue);
}
}
/**
* Iterator wrapper for _WrappedList.
*/
class _WrappedIterator<E> implements Iterator<E> {
Iterator _iterator;
_WrappedIterator(this._iterator);
bool moveNext() {
return _iterator.moveNext();
}
E get current => _iterator.current;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class _HttpRequestUtils {
// Helper for factory HttpRequest.get
static HttpRequest get(String url,
onComplete(HttpRequest request),
bool withCredentials) {
final request = new HttpRequest();
request.open('GET', url, async: true);
request.withCredentials = withCredentials;
request.onReadyStateChange.listen((e) {
if (request.readyState == HttpRequest.DONE) {
onComplete(request);
}
});
request.send();
return request;
}
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Iterator for arrays with fixed size.
class FixedSizeListIterator<T> implements Iterator<T> {
final List<T> _array;
final int _length; // Cache array length for faster access.
int _position;
T _current;
FixedSizeListIterator(List<T> array)
: _array = array,
_position = -1,
_length = array.length;
bool moveNext() {
int nextPosition = _position + 1;
if (nextPosition < _length) {
_current = _array[nextPosition];
_position = nextPosition;
return true;
}
_current = null;
_position = _length;
return false;
}
T get current => _current;
}
// Iterator for arrays with variable size.
class _VariableSizeListIterator<T> implements Iterator<T> {
final List<T> _array;
int _position;
T _current;
_VariableSizeListIterator(List<T> array)
: _array = array,
_position = -1;
bool moveNext() {
int nextPosition = _position + 1;
if (nextPosition < _array.length) {
_current = _array[nextPosition];
_position = nextPosition;
return true;
}
_current = null;
_position = _array.length;
return false;
}
T get current => _current;
}
/**
* A custom KeyboardEvent that attempts to eliminate cross-browser
* inconsistencies, and also provide both keyCode and charCode information
* for all key events (when such information can be determined).
*
* KeyEvent tries to provide a higher level, more polished keyboard event
* information on top of the "raw" [KeyboardEvent].
*
* This class is very much a work in progress, and we'd love to get information
* on how we can make this class work with as many international keyboards as
* possible. Bugs welcome!
*/
class KeyEvent extends _WrappedEvent implements KeyboardEvent {
/** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */
KeyboardEvent _parent;
/** The "fixed" value of whether the alt key is being pressed. */
bool _shadowAltKey;
/** Caculated value of what the estimated charCode is for this event. */
int _shadowCharCode;
/** Caculated value of what the estimated keyCode is for this event. */
int _shadowKeyCode;
/** Caculated value of what the estimated keyCode is for this event. */
int get keyCode => _shadowKeyCode;
/** Caculated value of what the estimated charCode is for this event. */
int get charCode => this.type == 'keypress' ? _shadowCharCode : 0;
/** Caculated value of whether the alt key is pressed is for this event. */
bool get altKey => _shadowAltKey;
/** Caculated value of what the estimated keyCode is for this event. */
int get which => keyCode;
/** Accessor to the underlying keyCode value is the parent event. */
int get _realKeyCode => _parent.keyCode;
/** Accessor to the underlying charCode value is the parent event. */
int get _realCharCode => _parent.charCode;
/** Accessor to the underlying altKey value is the parent event. */
bool get _realAltKey => _parent.altKey;
/** Construct a KeyEvent with [parent] as the event we're emulating. */
KeyEvent(KeyboardEvent parent): super(parent) {
_parent = parent;
_shadowAltKey = _realAltKey;
_shadowCharCode = _realCharCode;
_shadowKeyCode = _realKeyCode;
}
/** Accessor to provide a stream of KeyEvents on the desired target. */
static EventStreamProvider<KeyEvent> keyDownEvent =
new _KeyboardEventHandler('keydown');
/** Accessor to provide a stream of KeyEvents on the desired target. */
static EventStreamProvider<KeyEvent> keyUpEvent =
new _KeyboardEventHandler('keyup');
/** Accessor to provide a stream of KeyEvents on the desired target. */
static EventStreamProvider<KeyEvent> keyPressEvent =
new _KeyboardEventHandler('keypress');
/** True if the altGraphKey is pressed during this event. */
bool get altGraphKey => _parent.altGraphKey;
/** Accessor to the clipboardData available for this event. */
DataTransfer get clipboardData => _parent.clipboardData;
/** True if the ctrl key is pressed during this event. */
bool get ctrlKey => _parent.ctrlKey;
int get detail => _parent.detail;
/**
* Accessor to the part of the keyboard that the key was pressed from (one of
* KeyLocation.STANDARD, KeyLocation.RIGHT, KeyLocation.LEFT,
* KeyLocation.NUMPAD, KeyLocation.MOBILE, KeyLocation.JOYSTICK).
*/
int get keyLocation => _parent.keyLocation;
Point get layer => _parent.layer;
/** True if the Meta (or Mac command) key is pressed during this event. */
bool get metaKey => _parent.metaKey;
Point get page => _parent.page;
/** True if the shift key was pressed during this event. */
bool get shiftKey => _parent.shiftKey;
Window get view => _parent.view;
void _initUIEvent(String type, bool canBubble, bool cancelable,
Window view, int detail) {
throw new UnsupportedError("Cannot initialize a UI Event from a KeyEvent.");
}
String get _shadowKeyIdentifier => _parent._keyIdentifier;
int get _charCode => charCode;
int get _keyCode => keyCode;
String get _keyIdentifier {
throw new UnsupportedError("keyIdentifier is unsupported.");
}
void _initKeyboardEvent(String type, bool canBubble, bool cancelable,
Window view, String keyIdentifier, int keyLocation, bool ctrlKey,
bool altKey, bool shiftKey, bool metaKey,
bool altGraphKey) {
throw new UnsupportedError(
"Cannot initialize a KeyboardEvent from a KeyEvent.");
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class Platform {
/**
* Returns true if dart:typed_data types are supported on this
* browser. If false, using these types will generate a runtime
* error.
*/
static final supportsTypedData = true;
/**
* Returns true if SIMD types in dart:typed_data types are supported
* on this browser. If false, using these types will generate a runtime
* error.
*/
static final supportsSimd = true;
/**
* Upgrade all custom elements in the subtree which have not been upgraded.
*
* This is needed to cover timing scenarios which the custom element polyfill
* does not cover.
*
* This is also a workaround for dartbug.com/12642 in Dartium.
*/
static void upgradeCustomElements(Node node) {
// no-op, provided for dart2js polyfill.
if (node is Element) {
(node as Element).queryAll('*');
} else {
node.nodes.forEach(upgradeCustomElements);
}
}
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
_makeSendPortFuture(spawnRequest) {
final completer = new Completer<SendPort>.sync();
final port = new ReceivePort();
port.receive((result, _) {
completer.complete(result);
port.close();
});
// TODO: SendPort.hashCode is ugly way to access port id.
spawnRequest(port.toSendPort().hashCode);
return completer.future;
}
// This API is exploratory.
Future<SendPort> spawnDomFunction(Function f) =>
_makeSendPortFuture((portId) { _Utils.spawnDomFunction(f, portId); });
Future<SendPort> spawnDomUri(String uri) =>
_makeSendPortFuture((portId) { _Utils.spawnDomUri(uri, portId); });
// testRunner implementation.
// FIXME: provide a separate lib for testRunner.
var _testRunner;
TestRunner get testRunner {
if (_testRunner == null)
_testRunner = new TestRunner._(_NPObject.retrieve("testRunner"));
return _testRunner;
}
class TestRunner {
final _NPObject _npObject;
TestRunner._(this._npObject);
display() => _npObject.invoke('display');
dumpAsText() => _npObject.invoke('dumpAsText');
notifyDone() => _npObject.invoke('notifyDone');
setCanOpenWindows() => _npObject.invoke('setCanOpenWindows');
waitUntilDone() => _npObject.invoke('waitUntilDone');
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class _Utils {
static double dateTimeToDouble(DateTime dateTime) =>
dateTime.millisecondsSinceEpoch.toDouble();
static DateTime doubleToDateTime(double dateTime) {
try {
return new DateTime.fromMillisecondsSinceEpoch(dateTime.toInt());
} catch(_) {
// TODO(antonnm): treat exceptions properly in bindings and
// find out how to treat NaNs.
return null;
}
}
static List convertToList(List list) {
// FIXME: [possible optimization]: do not copy the array if Dart_IsArray is fine w/ it.
final length = list.length;
List result = new List(length);
result.setRange(0, length, list);
return result;
}
static List convertMapToList(Map map) {
List result = [];
map.forEach((k, v) => result.addAll([k, v]));
return result;
}
static int convertCanvasElementGetContextMap(Map map) {
int result = 0;
if (map['alpha'] == true) result |= 0x01;
if (map['depth'] == true) result |= 0x02;
if (map['stencil'] == true) result |= 0x4;
if (map['antialias'] == true) result |= 0x08;
if (map['premultipliedAlpha'] == true) result |= 0x10;
if (map['preserveDrawingBuffer'] == true) result |= 0x20;
return result;
}
static List parseStackTrace(StackTrace stackTrace) {
final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)');
List result = [];
for (var match in regExp.allMatches(stackTrace.toString())) {
result.add([match.group(1), match.group(2), int.parse(match.group(3)), int.parse(match.group(4))]);
}
return result;
}
static void populateMap(Map result, List list) {
for (int i = 0; i < list.length; i += 2) {
result[list[i]] = list[i + 1];
}
}
static bool isMap(obj) => obj is Map;
static Map createMap() => {};
static makeUnimplementedError(String fileName, int lineNo) {
return new UnsupportedError('[info: $fileName:$lineNo]');
}
static window() native "Utils_window";
static forwardingPrint(String message) native "Utils_forwardingPrint";
static void spawnDomFunction(Function f, int replyTo) native "Utils_spawnDomFunction";
static void spawnDomUri(String uri, int replyTo) native "Utils_spawnDomUri";
static int _getNewIsolateId() native "Utils_getNewIsolateId";
// The following methods were added for debugger integration to make working
// with the Dart C mirrors API simpler.
// TODO(jacobr): consider moving them to a separate library.
// If Dart supported dynamic code injection, we would only inject this code
// when the debugger is invoked.
/**
* Strips the private secret prefix from member names of the form
* someName@hash.
*/
static String stripMemberName(String name) {
int endIndex = name.indexOf('@');
return endIndex > 0 ? name.substring(0, endIndex) : name;
}
/**
* Takes a list containing variable names and corresponding values and
* returns a map from normalized names to values. Variable names are assumed
* to have list offsets 2*n values at offset 2*n+1. This method is required
* because Dart_GetLocalVariables returns a list instead of an object that
* can be queried to lookup names and values.
*/
static Map<String, dynamic> createLocalVariablesMap(List localVariables) {
var map = {};
for (int i = 0; i < localVariables.length; i+=2) {
map[stripMemberName(localVariables[i])] = localVariables[i+1];
}
return map;
}
/**
* Convenience helper to get the keys of a [Map] as a [List].
*/
static List getMapKeyList(Map map) => map.keys.toList();
/**
* Returns the keys of an arbitrary Dart Map encoded as unique Strings.
* Keys that are strings are left unchanged except that the prefix ":" is
* added to disambiguate keys from other Dart members.
* Keys that are not strings have # followed by the index of the key in the map
* prepended to disambuguate. This scheme is simplistic but easy to encode and
* decode. The use case for this method is displaying all map keys in a human
* readable way in debugging tools.
*/
static List<String> getEncodedMapKeyList(dynamic obj) {
if (obj is! Map) return null;
var ret = new List<String>();
int i = 0;
return obj.keys.map((key) {
var encodedKey;
if (key is String) {
encodedKey = ':$key';
} else {
// If the key isn't a string, return a guaranteed unique for this map
// string representation of the key that is still somewhat human
// readable.
encodedKey = '#${i}:$key';
}
i++;
return encodedKey;
}).toList(growable: false);
}
static final RegExp _NON_STRING_KEY_REGEXP = new RegExp("^#(\\d+):(.+)\$");
static _decodeKey(Map map, String key) {
// The key is a regular old String.
if (key.startsWith(':')) return key.substring(1);
var match = _NON_STRING_KEY_REGEXP.firstMatch(key);
if (match != null) {
int index = int.parse(match.group(1));
var iter = map.keys.skip(index);
if (iter.isNotEmpty) {
var ret = iter.first;
// Validate that the toString representation of the key matches what we
// expect. FIXME: throw an error if it does not.
assert(match.group(2) == '$ret');
return ret;
}
}
return null;
}
/**
* Converts keys encoded with [getEncodedMapKeyList] to their actual keys.
*/
static lookupValueForEncodedMapKey(Map obj, String key) => obj[_decodeKey(obj, key)];
/**
* Builds a constructor name with the form expected by the C Dart mirrors API.
*/
static String buildConstructorName(String className, String constructorName) => '$className.$constructorName';
/**
* Strips the class name from an expression of the form "className.someName".
*/
static String stripClassName(String str, String className) {
if (str.length > className.length + 1 &&
str.startsWith(className) && str[className.length] == '.') {
return str.substring(className.length + 1);
} else {
return str;
}
}
/**
* Removes the trailing dot from an expression ending in a dot.
* This method is used as Library prefixes include a trailing dot when using
* the C Dart debugger API.
*/
static String stripTrailingDot(String str) =>
(str != null && str[str.length - 1] == '.') ? str.substring(0, str.length - 1) : str;
static String addTrailingDot(String str) => '${str}.';
static bool isNoSuchMethodError(obj) => obj is NoSuchMethodError;
// TODO(jacobr): we need a failsafe way to determine that a Node is really a
// DOM node rather than just a class that extends Node.
static bool isNode(obj) => obj is Node;
static bool _isBuiltinType(ClassMirror cls) {
// TODO(vsm): Find a less hackish way to do this.
LibraryMirror lib = cls.owner;
String libName = lib.uri.toString();
return libName.startsWith('dart:');
}
static void register(String tag, Type type) {
// TODO(vsm): Move these checks into native code.
if (type == null) {
throw new UnsupportedError("Invalid null type.");
}
ClassMirror cls = reflectClass(type);
if (_isBuiltinType(cls)) {
throw new UnsupportedError("Invalid custom element from $libName.");
}
ClassMirror superClass = cls.superclass;
Symbol objectName = reflectClass(Object).qualifiedName;
bool isRoot(ClassMirror cls) =>
cls == null || cls.qualifiedName == objectName;
// TODO(vsm): Support extending SvgElement as well.
Symbol elementName = reflectClass(HtmlElement).qualifiedName;
bool isElement(ClassMirror cls) =>
cls != null && cls.qualifiedName == elementName;
ClassMirror nativeClass = _isBuiltinType(superClass) ? superClass : null;
while(!isRoot(superClass) && !isElement(superClass)) {
superClass = superClass.superclass;
if (nativeClass == null && _isBuiltinType(superClass)) {
nativeClass = superClass;
}
}
if (isRoot(superClass)) {
throw new UnsupportedError("Invalid custom element doesn't inherit from HtmlElement.");
}
_register(tag, type, nativeClass.reflectedType);
}
static void _register(String tag, Type customType, Type nativeType) native "Utils_register";
}
class _NPObject extends NativeFieldWrapperClass1 {
_NPObject.internal();
static _NPObject retrieve(String key) native "NPObject_retrieve";
property(String propertyName) native "NPObject_property";
invoke(String methodName, [List args = null]) native "NPObject_invoke";
}
class _DOMWindowCrossFrame extends NativeFieldWrapperClass1 implements
WindowBase {
_DOMWindowCrossFrame.internal();
// Fields.
HistoryBase get history native "Window_history_cross_frame_Getter";
LocationBase get location native "Window_location_cross_frame_Getter";
bool get closed native "Window_closed_Getter";
int get length native "Window_length_Getter";
WindowBase get opener native "Window_opener_Getter";
WindowBase get parent native "Window_parent_Getter";
WindowBase get top native "Window_top_Getter";
// Methods.
void close() native "Window_close_Callback";
void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) native "Window_postMessage_Callback";
// Implementation support.
String get typeName => "Window";
}
class _HistoryCrossFrame extends NativeFieldWrapperClass1 implements HistoryBase {
_HistoryCrossFrame.internal();
// Methods.
void back() native "History_back_Callback";
void forward() native "History_forward_Callback";
void go(int distance) native "History_go_Callback";
// Implementation support.
String get typeName => "History";
}
class _LocationCrossFrame extends NativeFieldWrapperClass1 implements LocationBase {
_LocationCrossFrame.internal();
// Fields.
void set href(String) native "Location_href_Setter";
// Implementation support.
String get typeName => "Location";
}
class _DOMStringMap extends NativeFieldWrapperClass1 implements Map<String, String> {
_DOMStringMap.internal();
bool containsValue(String value) => Maps.containsValue(this, value);
bool containsKey(String key) native "DOMStringMap_containsKey_Callback";
String operator [](String key) native "DOMStringMap_item_Callback";
void operator []=(String key, String value) native "DOMStringMap_setItem_Callback";
String putIfAbsent(String key, String ifAbsent()) => Maps.putIfAbsent(this, key, ifAbsent);
String remove(String key) native "DOMStringMap_remove_Callback";
void clear() => Maps.clear(this);
void forEach(void f(String key, String value)) => Maps.forEach(this, f);
Iterable<String> get keys native "DOMStringMap_getKeys_Callback";
Iterable<String> get values => Maps.getValues(this);
int get length => Maps.length(this);
bool get isEmpty => Maps.isEmpty(this);
bool get isNotEmpty => Maps.isNotEmpty(this);
}
final Future<SendPort> __HELPER_ISOLATE_PORT =
spawnDomFunction(_helperIsolateMain);
// Tricky part.
// Once __HELPER_ISOLATE_PORT gets resolved, it will still delay in .then
// and to delay Timer.run is used. However, Timer.run will try to register
// another Timer and here we got stuck: event cannot be posted as then
// callback is not executed because it's delayed with timer.
// Therefore once future is resolved, it's unsafe to call .then on it
// in Timer code.
SendPort __SEND_PORT;
_sendToHelperIsolate(msg, SendPort replyTo) {
if (__SEND_PORT != null) {
__SEND_PORT.send(msg, replyTo);
} else {
__HELPER_ISOLATE_PORT.then((port) {
__SEND_PORT = port;
__SEND_PORT.send(msg, replyTo);
});
}
}
final _TIMER_REGISTRY = new Map<SendPort, Timer>();
const _NEW_TIMER = 'NEW_TIMER';
const _CANCEL_TIMER = 'CANCEL_TIMER';
const _TIMER_PING = 'TIMER_PING';
const _PRINT = 'PRINT';
_helperIsolateMain() {
port.receive((msg, replyTo) {
final cmd = msg[0];
if (cmd == _NEW_TIMER) {
final duration = new Duration(milliseconds: msg[1]);
bool periodic = msg[2];
ping() { replyTo.send(_TIMER_PING); };
_TIMER_REGISTRY[replyTo] = periodic ?
new Timer.periodic(duration, (_) { ping(); }) :
new Timer(duration, ping);
} else if (cmd == _CANCEL_TIMER) {
_TIMER_REGISTRY.remove(replyTo).cancel();
} else if (cmd == _PRINT) {
final message = msg[1];
// TODO(antonm): we need somehow identify those isolates.
print('[From isolate] $message');
}
});
}
final _printClosure = window.console.log;
final _pureIsolatePrintClosure = (s) {
_sendToHelperIsolate([_PRINT, s], null);
};
final _forwardingPrintClosure = _Utils.forwardingPrint;
class _Timer implements Timer {
var _canceler;
_Timer(int milliSeconds, void callback(Timer timer), bool repeating) {
if (repeating) {
int id = window._setInterval(() {
callback(this);
}, milliSeconds);
_canceler = () => window._clearInterval(id);
} else {
int id = window._setTimeout(() {
_canceler = null;
callback(this);
}, milliSeconds);
_canceler = () => window._clearTimeout(id);
}
}
void cancel() {
if (_canceler != null) {
_canceler();
}
_canceler = null;
}
bool get isActive => _canceler != null;
}
get _timerFactoryClosure =>
(int milliSeconds, void callback(Timer timer), bool repeating) {
return new _Timer(milliSeconds, callback, repeating);
};
class _PureIsolateTimer implements Timer {
bool _isActive = true;
final ReceivePort _port = new ReceivePort();
SendPort _sendPort; // Effectively final.
static SendPort _SEND_PORT;
_PureIsolateTimer(int milliSeconds, callback, repeating) {
_sendPort = _port.toSendPort();
_port.receive((msg, replyTo) {
assert(msg == _TIMER_PING);
_isActive = repeating;
callback(this);
if (!repeating) _cancel();
});
_send([_NEW_TIMER, milliSeconds, repeating]);
}
void cancel() {
_cancel();
_send([_CANCEL_TIMER]);
}
void _cancel() {
_isActive = false;
_port.close();
}
_send(msg) {
_sendToHelperIsolate(msg, _sendPort);
}
bool get isActive => _isActive;
}
get _pureIsolateTimerFactoryClosure =>
((int milliSeconds, void callback(Timer time), bool repeating) =>
new _PureIsolateTimer(milliSeconds, callback, repeating));