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

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

Issue 1403683002: Fixed to allow only HtmlElement in registerElement (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 a77cddabed6779e9ed70265014261f84e6af0f3c..b56e3741222131c0e1da7e874447e92356b355ff 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -20429,8 +20429,9 @@ class HtmlDocument extends Document {
// Figure out which DOM class is being extended from the user's Dart class.
var classMirror = reflectClass(customElementClass);
+ var isHtmlElement = classMirror.qualifiedName == #dart.dom.html.HtmlElement;
var locationUri = classMirror.location.sourceUri.toString();
- if (locationUri == 'dart:html' || locationUri == 'dart:svg') {
+ if (!isHtmlElement && (locationUri == 'dart:html' || locationUri == 'dart:svg')) {
throw new DomException.jsInterop("HierarchyRequestError: Cannot register an existing dart:html or dart:svg type.");
}
« 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