|
|
@@ -1244,11 +1244,15 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
if (!validResource) {
|
|
|
content = EMPTY_DATA_URI;
|
|
|
}
|
|
|
- declaration.value.children.forEach(token => {
|
|
|
- if (token.type == "Url" && DOM.removeQuotes(DomUtil.getCSSValue(token.value)) == originalResourceURL) {
|
|
|
- token.value.value = content;
|
|
|
- }
|
|
|
- });
|
|
|
+ if (declaration.value.children) {
|
|
|
+ declaration.value.children.forEach(token => {
|
|
|
+ if (token.type == "Url" && DOM.removeQuotes(DomUtil.getCSSValue(token.value)) == originalResourceURL) {
|
|
|
+ token.value.value = content;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ declaration.value = "url(" + DOM.removeQuotes(DomUtil.getCSSValue(content)) + ")";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}));
|
|
|
@@ -1259,7 +1263,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
|
|
|
static async processStyle(declarations, baseURI, options, cssVariables, batchRequest) {
|
|
|
await Promise.all(declarations.map(async declaration => {
|
|
|
- if (declaration.type == "Declaration") {
|
|
|
+ if (declaration.type == "Declaration" && declaration.value.children) {
|
|
|
const urlFunctions = DomUtil.getUrlFunctions(DomUtil.getCSSValue(declaration.value));
|
|
|
await Promise.all(urlFunctions.map(async urlFunction => {
|
|
|
const originalResourceURL = DomUtil.matchURL(urlFunction);
|