|
|
@@ -129,7 +129,7 @@ this.singlefile.lib.modules.matchedRules = this.singlefile.lib.modules.matchedRu
|
|
|
|
|
|
function invalidSelector(selectorText, workStylesheet) {
|
|
|
workStylesheet.textContent = selectorText + "{}";
|
|
|
- return !workStylesheet.sheet.cssRules.length;
|
|
|
+ return workStylesheet.sheet ? !workStylesheet.sheet.cssRules.length : workStylesheet.sheet;
|
|
|
}
|
|
|
|
|
|
function getMatchedElementsSelector(doc, selectorInfo, styles, matchedElementsCache) {
|
|
|
@@ -282,7 +282,7 @@ this.singlefile.lib.modules.matchedRules = this.singlefile.lib.modules.matchedRu
|
|
|
function invalidDeclaration(declarationText, workStylesheet) {
|
|
|
let invalidDeclaration;
|
|
|
workStylesheet.textContent = "single-file-declaration { " + declarationText + "}";
|
|
|
- if (!workStylesheet.sheet.cssRules[0].style.length) {
|
|
|
+ if (workStylesheet.sheet && !workStylesheet.sheet.cssRules[0].style.length) {
|
|
|
if (!declarationText.match(REGEXP_VENDOR_IDENTIFIER)) {
|
|
|
invalidDeclaration = true;
|
|
|
}
|