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

Side by Side Diff: client/base/DomWrapper.dart

Issue 8835006: New version of dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos Created 9 years 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
« no previous file with comments | « no previous file | client/fling/dist/runtime/apps/adminz/adminz.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * Embedded DSL for generating DOM elements. 6 * Embedded DSL for generating DOM elements.
7 */ 7 */
8 class Dom { 8 class Dom {
9 static void ready(void f()) { 9 static void ready(void f()) {
10 if (document.readyState == 'interactive' || 10 if (document.readyState == 'interactive' ||
11 document.readyState == 'complete') { 11 document.readyState == 'complete') {
12 window.setTimeout(f, 0); 12 window.setTimeout(f, 0);
13 } else { 13 } else {
14 // TODO(jacobr): give this event a named property. 14 // TODO(jacobr): give this event a named property.
15 window.on.contentLoaded.add((Event e) { f(); }); 15 window.on.contentLoaded.add((Event e) { f(); });
16 } 16 }
17 } 17 }
18 18
19 /** Adds the given <style> text to the page. */ 19 /** Adds the given <style> text to the page. */
20 static void addStyle(String cssText) { 20 static void addStyle(String cssText) {
21 StyleElement style = document.createElement('style'); 21 StyleElement style = new Element.tag('style');
22 style.type = 'text/css'; 22 style.type = 'text/css';
23 style.text = cssText; 23 style.text = cssText;
24 document.head.nodes.add(style); 24 document.head.nodes.add(style);
25 } 25 }
26 } 26 }
OLDNEW
« no previous file with comments | « no previous file | client/fling/dist/runtime/apps/adminz/adminz.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698