Bug 1554727 - Check if selectorText exists before testing its content; r=miker

Differential Revision: https://phabricator.services.mozilla.com/D32737

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Patrick Brosset 2019-05-28 09:37:53 +00:00
parent 8425ca6294
commit a6088694e9

View File

@ -138,9 +138,14 @@ class InactivePropertyHelper {
"vertical-align",
],
when: () => {
return !this.checkStyle("display", ["inline", "table-cell"]) &&
!this.cssRule.selectorText.includes("::first-letter") &&
!this.cssRule.selectorText.includes("::first-line");
const { selectorText } = this.cssRule;
const isFirstLetter = selectorText && selectorText.includes("::first-letter");
const isFirstLine = selectorText && selectorText.includes("::first-line");
const isInlineLevel = this.checkStyle("display", ["inline", "table-cell"]);
return !isInlineLevel && !isFirstLetter && !isFirstLine;
},
fixId: "inactive-css-not-inline-or-tablecell-fix",
msgId: "inactive-css-not-inline-or-tablecell",