Files
sdk/tools/dom/templates/html/impl/impl_Document.darttemplate
T
Terry Lucas bc75856e54 Update getClientRects, removed xtab, removed bogus entry in dom.json,
expose ServiceWorker, removed query and queryAll from in dart:html,
added constructor to MessageChannel and removed getCssCanvasContext.

Fixed all tests using query and queryAll.

Fixes https://github.com/dart-lang/sdk/issues/25664
Fixes https://github.com/dart-lang/sdk/issues/26349
Fixes https://github.com/dart-lang/sdk/issues/32323
Fixes https://github.com/dart-lang/sdk/issues/32659
Fixes https://github.com/dart-lang/sdk/issues/32675

R=kevmoo@google.com

Change-Id: I687471e80b8fe9c7040673113f424dbaab7c64d4
Reviewed-on: https://dart-review.googlesource.com/48381
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-03-27 20:45:33 +00:00

94 lines
3.6 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)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME extends Node
{
$!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<T> querySelectorAll<T extends Element>(String selectors) =>
new _FrozenElementList<T>._wrap(_querySelectorAll(selectors));
/// Checks if [registerElement] is supported on the current platform.
bool get supportsRegisterElement {
return JS('bool', '("registerElement" in #)', this);
}
/// *Deprecated*: use [supportsRegisterElement] instead.
@deprecated
bool get supportsRegister => supportsRegisterElement;
void registerElement(String tag, Type customElementClass,
{String extendsTag}) {
registerElement2(tag, {'prototype': customElementClass, 'extends': extendsTag});
}
@DomName('Document.createElement')
@ForceInline() // Almost all call sites have one argument.
Element createElement(String tagName, [String typeExtension]) {
return (typeExtension == null)
? _createElement_2(tagName)
: _createElement(tagName, typeExtension);
}
// The two-argument version of this is automatically generated, but we need to
// omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
@DomName('Document.createElement')
_createElement_2(String tagName) =>
JS('Element', '#.createElement(#)', this, tagName);
// The three-argument version of this is automatically generated, but we need to
// omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
@DomName('Document.createElementNS')
_createElementNS_2(String namespaceURI, String qualifiedName) =>
JS('Element', '#.createElementNS(#, #)', this, namespaceURI, qualifiedName);
@DomName('Document.createElementNS')
@DocsEditable()
Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) {
return (typeExtension == null)
? _createElementNS_2(namespaceURI, qualifiedName)
: _createElementNS(namespaceURI, qualifiedName, typeExtension);
}
@DomName('Document.createNodeIterator')
NodeIterator _createNodeIterator(Node root,
[int whatToShow, NodeFilter filter])
=> JS('NodeIterator', '#.createNodeIterator(#, #, #, false)',
this, root, whatToShow, filter);
@DomName('Document.createTreeWalker')
TreeWalker _createTreeWalker(Node root,
[int whatToShow, NodeFilter filter])
=> JS('TreeWalker', '#.createTreeWalker(#, #, #, false)',
this, root, whatToShow, filter);
@DomName('Document.visibilityState')
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@Experimental()
String get visibilityState => JS('String',
'(#.visibilityState || #.mozVisibilityState || #.msVisibilityState ||'
'#.webkitVisibilityState)', this, this, this, this);
}