blob: b39ee908c75d7338f19be84ebaa6f7d90e552a50 [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.
part of $LIBRARYNAME;
@DocsEditable()
$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME extends Node $NATIVESPEC
{
$!MEMBERS
/**
* Finds all descendant elements of this document that match the specified
* group of selectors.
*
* Unless your webpage contains multiple documents, the top-level
* [querySelectorAll]
* 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.querySelectorAll('.itemClassName');
*
* For details about CSS selector syntax, see the
* [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
*/
ElementList querySelectorAll(String selectors) {
return new _FrozenElementList._wrap(_querySelectorAll(selectors));
}
/**
* Alias for [querySelector]. Note this function is deprecated because its
* semantics will be changing in the future.
*/
@deprecated
@Experimental()
@DomName('Document.querySelector')
Element query(String relativeSelectors) => querySelector(relativeSelectors);
/**
* Alias for [querySelectorAll]. Note this function is deprecated because its
* semantics will be changing in the future.
*/
@deprecated
@Experimental()
@DomName('Document.querySelectorAll')
ElementList queryAll(String relativeSelectors) =>
querySelectorAll(relativeSelectors);
/// Checks if [register] is supported on the current platform.
bool get supportsRegister {
$if DART2JS
return JS('bool', '("registerElement" in #)', this);
$else
return true;
$endif
}
@DomName('Document.createElement')
Element createElement(String tagName, [String typeExtension]) {
$if DART2JS
return _createElement(tagName, typeExtension);
$else
if (typeExtension != null) {
return _createElement(tagName, typeExtension);
} else {
// Fast-path for Dartium when typeExtension is not needed.
return _Utils.createElement(this, tagName);
}
$endif
}
}