Skip to content

Commit

Permalink
fix(client): CSS injection broken in older browsers due to use of Arr…
Browse files Browse the repository at this point in the history
…ay.from - fixes #1539
  • Loading branch information
shakyShane committed Apr 20, 2018
1 parent 61faee1 commit 66dd19c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
14 changes: 6 additions & 8 deletions client/dist/index.js
Expand Up @@ -8373,16 +8373,14 @@ var Reloader = /** @class */ (function () {
})());
// find all imported stylesheets
var imported = [];
for (var _i = 0, _a = Array.from(this.document.getElementsByTagName('style')); _i < _a.length; _i++) {
var style = _a[_i];
[].slice.call(this.document.getElementsByTagName('style')).forEach(function (style) {
if (style.sheet) {
this.collectImportedStylesheets(style, style.sheet, imported);
_this.collectImportedStylesheets(style, style.sheet, imported);
}
}
for (var _b = 0, _c = Array.from(links); _b < _c.length; _b++) {
link = _c[_b];
this.collectImportedStylesheets(link, link.sheet, imported);
}
});
links.forEach(function (link) {
_this.collectImportedStylesheets(link, link.sheet, imported);
});
// handle prefixfree
if (this.window.StyleFix && this.document.querySelectorAll) {
[].slice.call(this.document.querySelectorAll('style[data-href]')).forEach(function (style) {
Expand Down
2 changes: 1 addition & 1 deletion client/dist/index.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions client/vendor/Reloader.ts
Expand Up @@ -265,14 +265,16 @@ export class Reloader {

// find all imported stylesheets
const imported = [];
for (var style of Array.from(this.document.getElementsByTagName('style'))) {

[].slice.call(this.document.getElementsByTagName('style')).forEach((style) => {
if (style.sheet) {
this.collectImportedStylesheets(style, style.sheet, imported);
}
}
for (link of Array.from(links)) {
});

links.forEach(link => {
this.collectImportedStylesheets(link, link.sheet, imported);
}
});

// handle prefixfree
if (this.window.StyleFix && this.document.querySelectorAll) {
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Expand Up @@ -1926,7 +1926,11 @@ immutable@3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.0.tgz#5175514f70cb2a8218b58183d33747134a81c697"

immutable@3.8.1, immutable@^3.7.4, immutable@^3.7.6:
immutable@3.8.2:
version "3.8.2"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"

immutable@^3.7.4, immutable@^3.7.6:
version "3.8.1"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.1.tgz#200807f11ab0f72710ea485542de088075f68cd2"

Expand Down

0 comments on commit 66dd19c

Please sign in to comment.