blob: 554ad3f026a20637aa8a6596e64ced3213a8687b [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for 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 - unless you are editing documentation as per:
// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
// Auto-generated dart:html library.
/**
* 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:typed_data';
// Not actually used, but imported since dart:html can generate these objects.
import 'dart:svg' as svg;
import 'dart:web_audio' as web_audio;
import 'dart:web_gl' as gl;
import 'dart:web_sql';
import 'dart:_js_helper' show
convertDartClosureToJS, Creates, JavaScriptIndexingBehavior,
JSName, Null, Returns,
findDispatchTagForInterceptorClass, setNativeSubclassDispatchRecord;
import 'dart:_interceptors' show
Interceptor, JSExtendableArray, findInterceptorConstructorForType,
getNativeInterceptor;
import 'dart:_isolate_helper' show IsolateNatives;
import 'dart:_foreign_helper' show JS;
$!GENERATED_DART_FILES
part '$AUXILIARY_DIR/AttributeMap.dart';
part '$AUXILIARY_DIR/CanvasImageSource.dart';
part '$AUXILIARY_DIR/CrossFrameTypes.dart';
part '$AUXILIARY_DIR/CssClassSet.dart';
part '$AUXILIARY_DIR/CssRectangle.dart';
part '$AUXILIARY_DIR/Dimension.dart';
part '$AUXILIARY_DIR/EventListener.dart';
part '$AUXILIARY_DIR/EventStreamProvider.dart';
part '$AUXILIARY_DIR/Html5NodeValidator.dart';
part '$AUXILIARY_DIR/ImmutableListMixin.dart';
part '$AUXILIARY_DIR/Isolates.dart';
part '$AUXILIARY_DIR/KeyCode.dart';
part '$AUXILIARY_DIR/KeyLocation.dart';
part '$AUXILIARY_DIR/KeyName.dart';
part '$AUXILIARY_DIR/KeyboardEventStream.dart';
part '$AUXILIARY_DIR/Microtask.dart';
part '$AUXILIARY_DIR/NodeValidatorBuilder.dart';
part '$AUXILIARY_DIR/Point.dart';
part '$AUXILIARY_DIR/ReadyState.dart';
part '$AUXILIARY_DIR/Rectangle.dart';
part '$AUXILIARY_DIR/Serialization.dart';
part '$AUXILIARY_DIR/WrappedEvent.dart';
part '$AUXILIARY_DIR/WrappedList.dart';
part '$AUXILIARY_DIR/_HttpRequestUtils.dart';
part '$AUXILIARY_DIR/_ListIterators.dart';
part '$AUXILIARY_DIR/dart2js_Conversions.dart';
part '$AUXILIARY_DIR/dart2js_CustomElementSupport.dart';
part '$AUXILIARY_DIR/dart2js_DOMImplementation.dart';
part '$AUXILIARY_DIR/dart2js_KeyEvent.dart';
part '$AUXILIARY_DIR/dart2js_LocationWrapper.dart';
part '$AUXILIARY_DIR/dart2js_Platform.dart';
part '$AUXILIARY_DIR/Validators.dart';
/**
* 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 => JS('Window', 'window');
/**
* Root node for all content in a web page.
*/
HtmlDocument get document => JS('HtmlDocument', 'document');
Element query(String selector) => document.query(selector);
ElementList queryAll(String selector) => document.queryAll(selector);
// Workaround for tags like <cite> that lack their own Element subclass --
// Dart issue 1990.
class HtmlElement extends Element native "HTMLElement" {
factory HtmlElement() { throw new UnsupportedError("Not supported"); }
/**
* Constructor instantiated by the DOM when a custom element has been created.
*
* This can only be called by subclasses from their created constructor.
*/
HtmlElement.created() : super.created();
}
// EntryArray type was removed, so explicitly adding it to allow support for
// older Chrome versions.
// Issue #12573.
abstract class _EntryArray implements List<Entry> native "EntryArray" {}
// Support for Send/ReceivePortSync.
int _getNewIsolateId() {
if (JS('bool', r'!window.$dart$isolate$counter')) {
JS('void', r'window.$dart$isolate$counter = 1');
}
return JS('int', r'window.$dart$isolate$counter++');
}
// Fast path to invoke JS send port.
_callPortSync(int id, message) {
return JS('var', r'ReceivePortSync.dispatchCall(#, #)', id, message);
}