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

Side by Side Diff: samples/swarm/swarm_ui_lib/base/DomWrapper.dart

Issue 12253011: Reapply remove setInterval. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of base; 5 part of base;
6 6
7 /** 7 /**
8 * Embedded DSL for generating DOM elements. 8 * Embedded DSL for generating DOM elements.
9 */ 9 */
10 class Dom { 10 class Dom {
11 static void ready(void f()) { 11 static void ready(void f()) {
12 if (document.readyState == 'interactive' || 12 if (document.readyState == 'interactive' ||
13 document.readyState == 'complete') { 13 document.readyState == 'complete') {
14 window.setTimeout(f, 0); 14 Timer.run(f);
15 } else { 15 } else {
16 // TODO(jacobr): give this event a named property. 16 // TODO(jacobr): give this event a named property.
17 window.onContentLoaded.listen((Event e) { f(); }); 17 window.onContentLoaded.listen((Event e) { f(); });
18 } 18 }
19 } 19 }
20 20
21 /** Adds the given <style> text to the page. */ 21 /** Adds the given <style> text to the page. */
22 static void addStyle(String cssText) { 22 static void addStyle(String cssText) {
23 StyleElement style = new Element.tag('style'); 23 StyleElement style = new Element.tag('style');
24 style.type = 'text/css'; 24 style.type = 'text/css';
25 style.text = cssText; 25 style.text = cssText;
26 document.head.nodes.add(style); 26 document.head.nodes.add(style);
27 } 27 }
28 } 28 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/base/AnimationScheduler.dart ('k') | samples/swarm/swarm_ui_lib/base/base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698