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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 1401703002: Added for registerElement checking (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 62c902c63a633c628b95b2405f66b4749386dc14..a77cddabed6779e9ed70265014261f84e6af0f3c 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -20428,6 +20428,16 @@ class HtmlDocument extends Document {
// Figure out which DOM class is being extended from the user's Dart class.
var classMirror = reflectClass(customElementClass);
+
+ var locationUri = classMirror.location.sourceUri.toString();
+ if (locationUri == 'dart:html' || locationUri == 'dart:svg') {
+ throw new DomException.jsInterop("HierarchyRequestError: Cannot register an existing dart:html or dart:svg type.");
+ }
+
+ if (classMirror.isAbstract) {
+ throw new DomException.jsInterop("HierarchyRequestError: Cannot register an abstract class.");
+ }
+
var jsClassName = _getJSClassName(classMirror);
if (jsClassName == null) {
// Only components derived from HTML* can be extended.
« no previous file with comments | « no previous file | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698