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

Side by Side Diff: pkg/polymer/lib/src/boot.dart

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « pkg/polymer/lib/polymer.dart ('k') | pkg/polymer/lib/src/build/linter.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** Ported from `polymer/src/boot.js`. **/ 5 /** Ported from `polymer/src/boot.js`. **/
6 part of polymer; 6 part of polymer;
7 7
8 /** Prevent a flash of unstyled content. */ 8 /** Prevent a flash of unstyled content. */
9 _preventFlashOfUnstyledContent() { 9 _preventFlashOfUnstyledContent() {
10 10
11 var style = new StyleElement(); 11 var style = new StyleElement();
12 style.text = '.$_VEILED_CLASS { ' 12 style.text = '.$_VEILED_CLASS { '
13 'opacity: 0; } \n' 13 'opacity: 0; } \n'
14 '.$_UNVEIL_CLASS{ ' 14 '.$_UNVEIL_CLASS{ '
15 '-webkit-transition: opacity ${_TRANSITION_TIME}s; ' 15 '-webkit-transition: opacity ${_TRANSITION_TIME}s; '
16 'transition: opacity ${_TRANSITION_TIME}s; }\n'; 16 'transition: opacity ${_TRANSITION_TIME}s; }\n';
17 17
18 // Note: we use `query` and not `document.head` to make sure this code works 18 // Note: we use `query` and not `document.head` to make sure this code works
19 // with the shadow_dom polyfill (a limitation of the polyfill is that it can't 19 // with the shadow_dom polyfill (a limitation of the polyfill is that it can't
20 // override the definitions of document, document.head, or document.body). 20 // override the definitions of document, document.head, or document.body).
21 var head = document.querySelector('head'); 21 var head = document.querySelector('head');
22 head.insertBefore(style, head.firstChild); 22 head.insertBefore(style, head.firstChild);
23 23
24 _veilElements(); 24 _veilElements();
25 25
26 // hookup auto-unveiling 26 // hookup auto-unveiling
27 Polymer.onReady.then((_) { 27 Polymer.onReady.then((_) => Polymer.unveilElements());
28 Polymer.unveilElements();
29 });
30 } 28 }
31 29
32 // add polymer styles 30 // add polymer styles
33 const _VEILED_CLASS = 'polymer-veiled'; 31 const _VEILED_CLASS = 'polymer-veiled';
34 const _UNVEIL_CLASS = 'polymer-unveil'; 32 const _UNVEIL_CLASS = 'polymer-unveil';
35 const _TRANSITION_TIME = 0.3; 33 const _TRANSITION_TIME = 0.3;
36 34
37 // apply veiled class 35 // apply veiled class
38 _veilElements() { 36 _veilElements() {
39 for (var selector in Polymer.veiledElements) { 37 for (var selector in Polymer.veiledElements) {
40 for (var node in document.querySelectorAll(selector)) { 38 for (var node in document.querySelectorAll(selector)) {
41 node.classes.add(_VEILED_CLASS); 39 node.classes.add(_VEILED_CLASS);
42 } 40 }
43 } 41 }
44 } 42 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/polymer.dart ('k') | pkg/polymer/lib/src/build/linter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698