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

Unified Diff: tools/dom/src/native_DOMImplementation.dart

Issue 24653006: Adding Element.created constructor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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:
View side-by-side diff with in-line comments
Download patch
Index: tools/dom/src/native_DOMImplementation.dart
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index 8991ee140adbac41c3e9300cdc05b3dc95839f99..f736004a48ef4bc6ce3139b12e94aa8d5454c5e7 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -289,6 +289,10 @@ class _Utils {
if (_isBuiltinType(cls)) {
throw new UnsupportedError("Invalid custom element from $libName.");
}
+ var className = MirrorSystem.getName(cls.simpleName);
+ if (!cls.constructors.containsKey(new Symbol('$className.created'))) {
+ throw new UnsupportedError('Class is missing constructor $className.created');
+ }
_register(document, tag, type, extendsTagName);
}
@@ -296,6 +300,8 @@ class _Utils {
String extendsTagName) native "Utils_register";
static Element createElement(Document document, String tagName) native "Utils_createElement";
+
+ static void initializeCustomElement(HtmlElement element) native "Utils_initializeCustomElement";
}
class _NPObject extends NativeFieldWrapperClass1 {
@@ -517,3 +523,7 @@ class _PureIsolateTimer implements Timer {
get _pureIsolateTimerFactoryClosure =>
((int milliSeconds, void callback(Timer time), bool repeating) =>
new _PureIsolateTimer(milliSeconds, callback, repeating));
+
+void _initializeCustomElement(Element e) {
+ _Utils.initializeCustomElement(e);
+}

Powered by Google App Engine
This is Rietveld 408576698