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

Unified Diff: pkg/polymer/lib/src/boot.dart

Issue 27518006: Practically remove boot.js, adds the initialization from the Dart side of (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: pkg/polymer/lib/src/boot.dart
diff --git a/pkg/polymer/lib/src/boot.dart b/pkg/polymer/lib/src/boot.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b4fb82275d9255ec0d771af214791d869e11dff7
--- /dev/null
+++ b/pkg/polymer/lib/src/boot.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/** Ported from `polymer/src/boot.js`. **/
Siggi Cherem (dart-lang) 2013/10/17 01:46:49 this matches polymer's code structure. The code be
+part of polymer;
+
+/** Prevent a flash of unstyled content. */
+preventFuoc() {
+ var style = new StyleElement();
+ style.text = r'body {opacity: 0;}';
+ // Note: we use `query` and not `document.head` to make sure this code works
+ // with the shadow_dom polyfill (a limitation of the polyfill is that it can't
+ // override the definitions of document, document.head, or document.body).
+ var head = query('head');
+ head.insertBefore(style, head.firstChild);
+
+ Polymer.onReady.then((_) {
+ document.body.style.transition = 'opacity 0.3s';
+ document.body.style.opacity = '1';
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698