82fb93d181
Review URL: https://codereview.chromium.org//65333002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30069 260f80e4-7a28-3924-810f-c04153c831b5
74 lines
2.2 KiB
Plaintext
74 lines
2.2 KiB
Plaintext
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for 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', '("register" 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
|
|
}
|
|
}
|