Skip to content
Permalink
Browse files

Get the right copy of HTMLImports/base.js

  • Loading branch information
Ian MacLeod
Ian MacLeod committed Nov 1, 2014
1 parent 87b3815 commit a340f886b0a0eda634d142d7beeb169296cd0c8f
Showing with 2 additions and 28 deletions.
  1. +2 −28 src/system/HTMLImports/base.js
@@ -6,6 +6,7 @@
* 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
*/

/*
Create polyfill scope and feature detect native support.
*/
@@ -20,18 +21,6 @@ window.HTMLImports = window.HTMLImports || {flags:{}};
var IMPORT_LINK_TYPE = 'import';
var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement('link'));

// world's simplest module initializer
var modules = [];
var addModule = function(module) {
modules.push(module);
};

var initializeModules = function() {
modules.forEach(function(module) {
module(scope);
});
};

/**
Support `currentScript` on all browsers as `document._currentScript.`
@@ -212,18 +201,6 @@ if (useNative) {

}

// IE shim for CustomEvent
if (typeof window.CustomEvent !== 'function') {
window.CustomEvent = function(inType, dictionary) {
var e = document.createEvent('HTMLEvents');
e.initEvent(inType,
dictionary.bubbles === false ? false : true,
dictionary.cancelable === false ? false : true,
dictionary.detail);
return e;
};
}

// Fire the 'HTMLImportsLoaded' event when imports in document at load time
// have loaded. This event is required to simulate the script blocking
// behavior of native imports. A main document script that needs to be sure
@@ -239,11 +216,8 @@ whenReady(function() {
// exports
scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;
scope.useNative = useNative;
scope.addModule = addModule;
scope.initializeModules = initializeModules;
scope.rootDocument = rootDocument;
scope.whenReady = whenReady;
scope.isIE = isIE;

})(window.HTMLImports);

})(HTMLImports);

0 comments on commit a340f88

Please sign in to comment.
You can’t perform that action at this time.