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

Commit

Permalink
restore IE10 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Aug 11, 2014
1 parent 697a143 commit ca92658
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

var IMPORT_LINK_TYPE = 'import';
var flags = scope.flags;
var isIe = /Trident/.test(navigator.userAgent);
var isIE = scope.isIE;
// TODO(sorvell): SD polyfill intrusion
var mainDoc = window.ShadowDOMPolyfill ?
window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;
Expand Down Expand Up @@ -173,7 +173,7 @@ var importParser = {

// NOTE: IE does not fire "load" event for styles that have already loaded
// This is in violation of the spec, so we try our hardest to work around it
if (isIe && elt.localName === 'style') {
if (isIE && elt.localName === 'style') {
var fakeLoad = false;
// If there's not @import in the textContent, assume it has loaded
if (elt.textContent.indexOf('@import') == -1) {
Expand Down Expand Up @@ -330,6 +330,5 @@ var path = {
// exports
scope.parser = importParser;
scope.path = path;
scope.isIE = isIe;

})(HTMLImports);
5 changes: 4 additions & 1 deletion src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
var hasNative = ('import' in document.createElement('link'));
var useNative = hasNative;

isIE = /Trident/.test(navigator.userAgent);

// TODO(sorvell): SD polyfill intrusion
var mainDoc = window.ShadowDOMPolyfill ?
ShadowDOMPolyfill.wrapIfNeeded(document) : document;
Expand Down Expand Up @@ -41,7 +43,7 @@ function whenImportsReady(callback, doc) {
}

// call the callback when the document is in a ready state (has dom)
var requiredReadyState = HTMLImports.isIE ? 'complete' : 'interactive';
var requiredReadyState = isIE ? 'complete' : 'interactive';
var READY_EVENT = 'readystatechange';
function isDocumentReady(doc) {
return (doc.readyState === 'complete' ||
Expand Down Expand Up @@ -152,6 +154,7 @@ whenImportsReady(function() {
scope.useNative = useNative;
scope.isImportLoaded = isImportLoaded;
scope.whenReady = whenImportsReady;
scope.isIE = isIE;

// deprecated
scope.whenImportsReady = whenImportsReady;
Expand Down

0 comments on commit ca92658

Please sign in to comment.