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

Commit ca92658

Browse files
committed
restore IE10 compatibility
1 parent 697a143 commit ca92658

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Parser.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
var IMPORT_LINK_TYPE = 'import';
1212
var flags = scope.flags;
13-
var isIe = /Trident/.test(navigator.userAgent);
13+
var isIE = scope.isIE;
1414
// TODO(sorvell): SD polyfill intrusion
1515
var mainDoc = window.ShadowDOMPolyfill ?
1616
window.ShadowDOMPolyfill.wrapIfNeeded(document) : document;
@@ -173,7 +173,7 @@ var importParser = {
173173

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

335334
})(HTMLImports);

src/base.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
var hasNative = ('import' in document.createElement('link'));
1111
var useNative = hasNative;
1212

13+
isIE = /Trident/.test(navigator.userAgent);
14+
1315
// TODO(sorvell): SD polyfill intrusion
1416
var mainDoc = window.ShadowDOMPolyfill ?
1517
ShadowDOMPolyfill.wrapIfNeeded(document) : document;
@@ -41,7 +43,7 @@ function whenImportsReady(callback, doc) {
4143
}
4244

4345
// call the callback when the document is in a ready state (has dom)
44-
var requiredReadyState = HTMLImports.isIE ? 'complete' : 'interactive';
46+
var requiredReadyState = isIE ? 'complete' : 'interactive';
4547
var READY_EVENT = 'readystatechange';
4648
function isDocumentReady(doc) {
4749
return (doc.readyState === 'complete' ||
@@ -152,6 +154,7 @@ whenImportsReady(function() {
152154
scope.useNative = useNative;
153155
scope.isImportLoaded = isImportLoaded;
154156
scope.whenReady = whenImportsReady;
157+
scope.isIE = isIE;
155158

156159
// deprecated
157160
scope.whenImportsReady = whenImportsReady;

0 commit comments

Comments
 (0)