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: tools/dom/templates/html/dart2js/impl_Window.darttemplate

Issue 12087004: Changing window.requestLayoutFrame into a microtask API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
Index: tools/dom/templates/html/dart2js/impl_Window.darttemplate
diff --git a/tools/dom/templates/html/dart2js/impl_Window.darttemplate b/tools/dom/templates/html/dart2js/impl_Window.darttemplate
index 037ef2d5ab7c5c7123dd4fe666c50f5acb12a531..1d7058681c24a132c9b87d95c38cb969d1005685 100644
--- a/tools/dom/templates/html/dart2js/impl_Window.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_Window.darttemplate
@@ -71,12 +71,13 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "@*DOMWindow" {
}
/**
- * Executes a [callback] after the next batch of browser layout measurements
- * has completed or would have completed if any browser layout measurements
- * had been scheduled.
+ * Executes a [callback] after the immediate execution stack has completed.
+ *
+ * This will cause the callback to be executed after all processing has
+ * completed for the current event, but before any subsequent events.
*/
- void requestLayoutFrame(TimeoutHandler callback) {
- _addMeasurementFrameCallback(callback);
+ void setImmediate(TimeoutHandler callback) {
+ _addMicrotaskCallback(callback);
}
@DomName('DOMWindow.requestAnimationFrame')
@@ -159,5 +160,14 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "@*DOMWindow" {
@DomName('Window.console')
Console get console => Console.safeConsole;
+ /// Checks if _setImmediate is supported.
+ static bool get _supportsSetImmediate =>
+ JS('bool', '!!(window.setImmediate)');
+
+ // Set immediate implementation for IE
+ void _setImmediate(void callback()) {
+ JS('void', '#.setImmediate(#)', this, convertDartClosureToJS(callback, 0));
+ }
+
$!MEMBERS
}
« no previous file with comments | « tools/dom/templates/html/dart2js/html_dart2js.darttemplate ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698