Skip to content

Commit

Permalink
fix: ensure CSSOM ownerNode content is present (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robdel12 committed Nov 5, 2019
1 parent 978b229 commit 7d1be16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/percy-agent-client/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class DOM {
const hasHref = styleSheet.href
const ownerNode = styleSheet.ownerNode as HTMLElement
const ownerNodeInnerContent = ownerNode.innerText && ownerNode.innerText.trim()
const hasStyleInDom = ownerNodeInnerContent.length > 0
const hasStyleInDom = !!ownerNodeInnerContent && ownerNodeInnerContent.length > 0

return !hasHref && !hasStyleInDom && styleSheet.cssRules
}
Expand Down

0 comments on commit 7d1be16

Please sign in to comment.