Skip to content

Commit

Permalink
Use localName over tagName.toLowerCase() (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth authored Aug 23, 2022
1 parent 495de2e commit 80ea697
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/drive/head_snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,22 @@ function elementIsTracked(element: Element) {
}

function elementIsScript(element: Element) {
const tagName = element.tagName.toLowerCase()
const tagName = element.localName
return tagName == "script"
}

function elementIsNoscript(element: Element) {
const tagName = element.tagName.toLowerCase()
const tagName = element.localName
return tagName == "noscript"
}

function elementIsStylesheet(element: Element) {
const tagName = element.tagName.toLowerCase()
const tagName = element.localName
return tagName == "style" || (tagName == "link" && element.getAttribute("rel") == "stylesheet")
}

function elementIsMetaElementWithName(element: Element, name: string) {
const tagName = element.tagName.toLowerCase()
const tagName = element.localName
return tagName == "meta" && element.getAttribute("name") == name
}

Expand Down

0 comments on commit 80ea697

Please sign in to comment.