Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
more compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Aug 2, 2014
1 parent e8ecdad commit ab963cf
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 8 deletions.
18 changes: 11 additions & 7 deletions polymer.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@
}
})();
</script>
<script src="src/platform/compat.js"></script>
<script src="src/platform/microtask.js"></script>
<script src="src/platform/module.js"></script>
<script src="src/platform/unresolved.js"></script>
<script src="src/system/compat.js"></script>
<script src="../HTMLImports/src/base.js"></script>
<script src="src/system/module.js"></script>
<script src="src/system/unresolved.js"></script>

<!-- move from Platform to polymer! -->
<script src="src/platform/url.js"></script>
<script src="src/platform/loader.js"></script>
<script src="src/platform/styleloader.js"></script>
<script src="src/system/microtask.js"></script>
<script src="src/system/url.js"></script>
<script src="src/system/loader.js"></script>
<script src="src/system/styleloader.js"></script>
<script src="../observe-js/src/observe.js"></script>
<script src="../NodeBind/src/NodeBind.js"></script>
<script src="../TemplateBinding/src/TemplateBinding.js"></script>
<script src="src/system/patches-mdv.js"></script>

</scripts>



<script src="src/lib/lang.js"></script>
<script src="src/lib/job.js"></script>
<script src="src/lib/dom.js"></script>
Expand Down
2 changes: 2 additions & 0 deletions src/platform/compat.js → src/system/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
with the polyfills, we stub out minimal functionality.
*/
if (!window.Platfrom) {
logFlags = window.logFlags || {};


Platform = {
flush: function() {}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
58 changes: 58 additions & 0 deletions src/system/patches-mdv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

(function(scope) {

// inject style sheet
var style = document.createElement('style');
style.textContent = 'template {display: none !important;} /* injected by platform.js */';
var head = document.querySelector('head');
head.insertBefore(style, head.firstChild);

// flush (with logging)
var flushing;
function flush() {
if (!flushing) {
flushing = true;
scope.endOfMicrotask(function() {
flushing = false;
logFlags.data && console.group('Platform.flush()');
scope.performMicrotaskCheckpoint();
logFlags.data && console.groupEnd();
});
}
};

// polling dirty checker
// flush periodically if platform does not have object observe.
if (!Observer.hasObjectObserve) {
var FLUSH_POLL_INTERVAL = 125;
window.addEventListener('WebComponentsReady', function() {
flush();
scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);
});
} else {
// make flush a no-op when we have Object.observe
flush = function() {};
}

if (window.CustomElements && !CustomElements.useNative) {
var originalImportNode = Document.prototype.importNode;
Document.prototype.importNode = function(node, deep) {
var imported = originalImportNode.call(this, node, deep);
CustomElements.upgradeAll(imported);
return imported;
}
}

// exports
scope.flush = flush;

})(window.Platform);

File renamed without changes.
1 change: 0 additions & 1 deletion src/platform/unresolved.js → src/system/unresolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// It would make sense to put inside some HTMLImport but
// the HTMLImports polyfill does not allow loading of stylesheets
// that block rendering. Therefore this injection is tolerated here.

var style = document.createElement('style');
style.textContent = ''
+ 'body {'
Expand Down
File renamed without changes.

0 comments on commit ab963cf

Please sign in to comment.