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

Side by Side Diff: pkg/template_binding/lib/js/patches_mdv.js

Issue 558673004: update polymer js to 0.4.0 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review updates Created 6 years, 3 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/template_binding/lib/js/observe.js ('k') | pkg/template_binding/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt
4 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt
5 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt
6 * Code distributed by Google as part of the polymer project is also
7 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt
8 */
9
10 (function(scope) {
11
12 // inject style sheet
13 var style = document.createElement('style');
14 style.textContent = 'template {display: none !important;} /* injected by platfor m.js */';
15 var head = document.querySelector('head');
16 head.insertBefore(style, head.firstChild);
17
18 // flush (with logging)
19 var flushing;
20 function flush() {
21 if (!flushing) {
22 flushing = true;
23 scope.endOfMicrotask(function() {
24 flushing = false;
25 logFlags.data && console.group('Platform.flush()');
26 scope.performMicrotaskCheckpoint();
27 logFlags.data && console.groupEnd();
28 });
29 }
30 };
31
32 // polling dirty checker
33 // flush periodically if platform does not have object observe.
34 if (!Observer.hasObjectObserve) {
35 var FLUSH_POLL_INTERVAL = 125;
36 window.addEventListener('WebComponentsReady', function() {
37 flush();
38 scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);
39 });
40 } else {
41 // make flush a no-op when we have Object.observe
42 flush = function() {};
43 }
44
45 if (window.CustomElements && !CustomElements.useNative) {
46 var originalImportNode = Document.prototype.importNode;
47 Document.prototype.importNode = function(node, deep) {
48 var imported = originalImportNode.call(this, node, deep);
49 CustomElements.upgradeAll(imported);
50 return imported;
51 }
52 }
53
54 // exports
55 scope.flush = flush;
56
57 })(window.Platform);
58
OLDNEW
« no previous file with comments | « pkg/template_binding/lib/js/observe.js ('k') | pkg/template_binding/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698