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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 1400843002: Added Alan's CL 1398603003 and augmented with upgrade for HtmlElement and HTMLElement (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 | « sdk/lib/_blink/dartium/_blink_dartium.dart ('k') | tools/deps/dartium.deps/DEPS » ('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 580fcb4d1ba26b2b8eb7bb839183413dbaae48da..e7d064e5f6c942597b207de87812cc0b62b7ba2e 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -51,6 +51,7 @@ import 'dart:web_audio' as web_audio;
import 'dart:web_audio' show web_audioBlinkMap;
import 'dart:web_audio' show web_audioBlinkFunctionMap;
import 'dart:_blink' as _blink;
+import 'dart:developer';
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -47090,15 +47091,23 @@ class _VMElementUpgrader implements ElementUpgrader {
}
Element upgrade(element) {
- if (element.runtimeType != js.JsObjectImpl) {
- throw new UnsupportedError('Element is incorrect type');
+ var jsObject;
+ var tag;
+ if (element.runtimeType == HtmlElement) {
+ jsObject = unwrap_jso(element);
+ tag = element.localName;
+ } else if (element.runtimeType == js.JsObjectImpl) {
+ // It's a Polymer core element (written in JS).
+ jsObject = element;
+ tag = element['localName'];
+ } else {
+ throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected HtmlElement/JsObjectImpl.');
}
// Remember Dart class to tagName for any upgrading done in wrap_jso.
- var tag = element['localName'];
_knownCustomeElements[tag] = _type;
- return createCustomUpgrader(_nativeType, element);
+ return createCustomUpgrader(_nativeType, jsObject);
}
}
« no previous file with comments | « sdk/lib/_blink/dartium/_blink_dartium.dart ('k') | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698