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

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

Issue 2828603002: Format samples and samples-dev directories. (Closed)
Patch Set: Created 3 years, 8 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
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 Timer.run(f); 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) {
18 f();
19 });
18 } 20 }
19 } 21 }
20 22
21 /** Adds the given <style> text to the page. */ 23 /** Adds the given <style> text to the page. */
22 static void addStyle(String cssText) { 24 static void addStyle(String cssText) {
23 StyleElement style = new Element.tag('style'); 25 StyleElement style = new Element.tag('style');
24 style.type = 'text/css'; 26 style.type = 'text/css';
25 style.text = cssText; 27 style.text = cssText;
26 document.head.nodes.add(style); 28 document.head.nodes.add(style);
27 } 29 }
28 } 30 }
OLDNEW
« no previous file with comments | « samples-dev/swarm/swarm_ui_lib/base/Device.dart ('k') | samples-dev/swarm/swarm_ui_lib/base/Env.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698