Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 268313002: [dart:html] rename register to registerElement per spec (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index bb00f1769cfd353a1dcabd840e22c8bbc6957e71..fbbdd1a49d8fb2d2a1218a1358f84769d501f267 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -7752,11 +7752,15 @@ class Document extends Node native "Document"
ElementList queryAll(String relativeSelectors) =>
querySelectorAll(relativeSelectors);
- /// Checks if [register] is supported on the current platform.
- bool get supportsRegister {
+ /// 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;
+
@DomName('Document.createElement')
Element createElement(String tagName, [String typeExtension]) {
return _createElement(tagName, typeExtension);
@@ -9317,7 +9321,7 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
* // Perform any element initialization.
* }
* }
- * document.register('x-custom', CustomElement);
+ * document.registerElement('x-custom', CustomElement);
*/
Element.created() : super._created() {
// Validate that this is a custom element & perform any additional
@@ -14352,7 +14356,7 @@ class HtmlDocument extends Document native "HTMLDocument" {
* }
*
* main() {
- * document.register('x-foo', FooElement);
+ * document.registerElement('x-foo', FooElement);
* var myFoo = new Element.tag('x-foo');
* // prints 'FooElement created!' to the console.
* }
@@ -14369,7 +14373,7 @@ class HtmlDocument extends Document native "HTMLDocument" {
* }
*
* main() {
- * document.register('x-bar', BarElement);
+ * document.registerElement('x-bar', BarElement);
* var myBar = new Element.tag('input', 'x-bar');
* // prints 'BarElement created!' to the console.
* }
@@ -14378,11 +14382,19 @@ class HtmlDocument extends Document native "HTMLDocument" {
* `<input is="x-bar"></input>`
*
*/
- void register(String tag, Type customElementClass, {String extendsTag}) {
+ void registerElement(String tag, Type customElementClass,
+ {String extendsTag}) {
_registerCustomElement(JS('', 'window'), this, tag, customElementClass,
extendsTag);
}
+ /** *Deprecated*: use [registerElement] instead. */
+ @deprecated
+ @Experimental()
+ void register(String tag, Type customElementClass, {String extendsTag}) {
+ return registerElement(tag, customElementClass, extendsTag: extendsTag);
+ }
+
/**
* Static factory designed to expose `visibilitychange` events to event
* handlers that are not necessarily instances of [Document].
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698