Skip to content

Commit

Permalink
Fix brave/brave-ios#7877: Fix NightMode applying to elements with a b…
Browse files Browse the repository at this point in the history
…ackground-image (brave/brave-ios#8498)
  • Loading branch information
Brandon-T authored Nov 29, 2023
1 parent 1d9e9b7 commit a08126a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function getStyleElement() {
}

function applyInvertFilterToChildBackgroundImageElements(parentNode) {
parentNode.querySelectorAll("[style*=\"background\"]").forEach(function(el) {
if ((el.style.backgroundImage || "").startsWith("url")) {
[...parentNode.children].forEach(function(el) {
if ((getComputedStyle(el)["background-image"] || "").startsWith("url")) {
applyInvertFilterToElement(el);
}
});
Expand Down

0 comments on commit a08126a

Please sign in to comment.