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

Unified Diff: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate

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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
index 3f651f2044d146020a1983d503f2caaa8c460abe..2871d1c7c8dd6666c28f63f088a5f440d1399c1e 100644
--- a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
@@ -358,8 +358,9 @@ $else
// 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 | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698