Index: tools/dom/templates/html/dartium/html_dartium.darttemplate |
diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate |
index 7e7453e02a457360b2f47f88ff15ef09015dcf48..af195b8e67dbcd43be2ac913b6766095afb8de33 100644 |
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate |
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate |
@@ -36,6 +36,7 @@ import 'dart:collection'; |
import 'dart:_internal' hide Symbol, deprecated; |
import 'dart:html_common'; |
import 'dart:indexed_db'; |
+import 'dart:indexed_db' show indexed_dbBlinkMap; |
import 'dart:isolate'; |
import 'dart:js' as js; |
import "dart:convert"; |
@@ -46,12 +47,15 @@ import 'dart:mirrors'; |
import 'dart:nativewrappers'; |
import 'dart:typed_data'; |
import 'dart:web_gl' as gl; |
+import 'dart:web_gl' show web_glBlinkMap; |
import 'dart:web_sql'; |
// Not actually used, but imported since dart:html can generate these objects. |
import 'dart:svg' as svg; |
+import 'dart:svg' show svgBlinkMap; |
import 'dart:svg' show Matrix; |
import 'dart:svg' show SvgSvgElement; |
import 'dart:web_audio' as web_audio; |
+import 'dart:web_audio' show web_audioBlinkMap; |
$if DART_USE_BLINK |
import 'dart:_blink' as _blink; |
$endif |
@@ -156,4 +160,93 @@ $!TYPE_MAP |
// post Chrome 35. We still generate the old mapping from 'Clipboard'. |
'DataTransfer': () => DataTransfer, |
}; |
+ |
+// TODO(leafp): We may want to move this elsewhere if html becomes |
+// a package to avoid dartium depending on pkg:html. |
+Type _getType(String key) { |
+ var result; |
+ |
+ // TODO(vsm): Add Cross Frame and JS types here as well. |
+ |
+ // Check the html library. |
+ result = _getHtmlType(key); |
+ if (result != null) { |
+ return result; |
+ } |
+ |
+ // Check the web gl library. |
+ result = _getWebGlType(key); |
+ if (result != null) { |
+ return result; |
+ } |
+ |
+ // Check the indexed db library. |
+ result = _getIndexDbType(key); |
+ if (result != null) { |
+ return result; |
+ } |
+ |
+ // Check the web audio library. |
+ result = _getWebAudioType(key); |
+ if (result != null) { |
+ return result; |
+ } |
+ |
+ // Check the web sql library. |
+ result = _getWebSqlType(key); |
+ if (result != null) { |
+ return result; |
+ } |
+ |
+ // Check the svg library. |
+ result = _getSvgType(key); |
+ if (result != null) { |
+ return result; |
+ } |
+ |
+ return null; |
+} |
+ |
+Type _getHtmlType(String key) { |
+ if (htmlBlinkMap.containsKey(key)) { |
+ return htmlBlinkMap[key](); |
+ } |
+ return null; |
+} |
+ |
+Type _getWebGlType(String key) { |
+ if (web_glBlinkMap.containsKey(key)) { |
+ return web_glBlinkMap[key](); |
+ } |
+ return null; |
+} |
+ |
+Type _getIndexDbType(String key) { |
+ if (indexed_dbBlinkMap.containsKey(key)) { |
+ return indexed_dbBlinkMap[key](); |
+ } |
+ return null; |
+} |
+ |
+Type _getWebAudioType(String key) { |
+ if (web_audioBlinkMap.containsKey(key)) { |
+ return web_audioBlinkMap[key](); |
+ } |
+ return null; |
+} |
+ |
+Type _getWebSqlType(String key) { |
+ if (web_sqlBlinkMap.containsKey(key)) { |
+ return web_sqlBlinkMap[key](); |
+ } |
+ return null; |
+} |
+ |
+Type _getSvgType(String key) { |
+ if (svgBlinkMap.containsKey(key)) { |
+ return svgBlinkMap[key](); |
+ } |
+ return null; |
+} |
+ |
$endif |