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

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

Issue 1832713002: Optimize dartium dart:html bindings so real world application performance is acceptable. Improves d… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update cached patches Created 4 years, 9 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 | « tools/dom/scripts/systemnative.py ('k') | tools/dom/src/dartium_KeyEvent.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/dartium_CustomElementSupport.dart
diff --git a/tools/dom/src/dartium_CustomElementSupport.dart b/tools/dom/src/dartium_CustomElementSupport.dart
index e769e888882d95f9fd1295fa7bef63373d936144..c957145bae339af04774198e472440e238d2e49b 100644
--- a/tools/dom/src/dartium_CustomElementSupport.dart
+++ b/tools/dom/src/dartium_CustomElementSupport.dart
@@ -29,40 +29,11 @@ class _VMElementUpgrader implements ElementUpgrader {
}
Element upgrade(element) {
- var jsObject;
- var tag;
- var isNativeElementExtension = false;
-
- try {
- tag = _getCustomElementName(element);
- } catch (e) {
- isNativeElementExtension = element.localName == _extendsTag;
+ // Only exact type matches are supported- cannot be a subclass.
+ if (element.runtimeType != _nativeType) {
+ throw new ArgumentError('element is not subclass of $_nativeType');
}
-
- if (element.runtimeType == HtmlElement || element.runtimeType == TemplateElement) {
- if (tag != _extendsTag) {
- throw new UnsupportedError('$tag is not registered.');
- }
- jsObject = unwrap_jso(element);
- } else if (element.runtimeType == js.JsObject) {
- // It's a Polymer core element (written in JS).
- jsObject = element;
- } else if (isNativeElementExtension) {
- // Extending a native element.
- jsObject = element.blink_jsObject;
-
- // Element to extend is the real tag.
- tag = element.localName;
- } else if (tag != null && element.localName != tag) {
- throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected native Html or Svg element to extend.');
- } else if (tag == null) {
- throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected HtmlElement/JsObject.');
- }
-
- // Remember Dart class to tagName for any upgrading done in wrap_jso.
- addCustomElementType(tag, _type, _extendsTag);
-
- return _createCustomUpgrader(_type, jsObject);
+ return _createCustomUpgrader(_type, element);
}
}
« no previous file with comments | « tools/dom/scripts/systemnative.py ('k') | tools/dom/src/dartium_KeyEvent.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698