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

Unified Diff: pkg/web_components/lib/interop.dart

Issue 333073002: Support upgrading existing elements already on the page. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « pkg/web_components/lib/dart_support.js ('k') | pkg/web_components/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/web_components/lib/interop.dart
diff --git a/pkg/web_components/lib/interop.dart b/pkg/web_components/lib/interop.dart
index 058ce76d637cf914d151c9c7a507ea8d413d0aa3..415c7feae439fbe9864c8baf8414deb75ac4bf46 100644
--- a/pkg/web_components/lib/interop.dart
+++ b/pkg/web_components/lib/interop.dart
@@ -31,3 +31,13 @@ void registerDartType(String tagName, Type dartType, {String extendsTag}) {
dartType, extendsTag: extendsTag);
_doc.callMethod('_registerDartTypeUpgrader', [tagName, upgrader.upgrade]);
}
+
+/// This function is mainly used to save resources. By default, we save a log of
+/// elements that are created but have no Dart type associated with them. This
+/// is so we can upgrade them as soon as [registerDartType] is invoked. This
+/// function can be called to indicate that we no longer are interested in
+/// logging element creations and that it is sufficient to only upgrade new
+/// elements as they are being created. Typically this is called after the last
+/// call to [registerDartType] or as soon as you know that no element will be
+/// created until the call to [registerDartType] is made.
+void onlyUpgradeNewElements() => _doc.callMethod('_onlyUpgradeNewElements');
« no previous file with comments | « pkg/web_components/lib/dart_support.js ('k') | pkg/web_components/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698