Merge pull request #29173 from brave/fix-matches-path-fast-path

Fix `matches-path` and `matches-media` fast path in procedural filter script
This commit is contained in:
Anton Lazarev
2025-05-22 10:28:20 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
@@ -2825,8 +2825,8 @@ IN_PROC_BROWSER_TEST_F(AdBlockServiceTest, ProceduralFilterMatchesPath) {
UpdateAdBlockInstanceWithRules(
"a.com##section .positive-string-case "
"p.odd:matches-path(cosmetic_filtering.html)\n"
"a.com##section .positive-regex-case "
"p.odd:matches-path(/c[aeiou]smetic\\_[a-z]{9}/)\n"
"a.com##:matches-path(/c[aeiou]smetic\\_[a-z]{9}/) section "
".positive-regex-case p.odd\n"
"a.com##section .negative-case:matches-path(/some-other-page.html)");
GURL tab_url =
@@ -580,7 +580,7 @@ const applyCompiledSelector = (selector: CompiledProceduralSelector,
// Note that unless we've taken the if-true branch above, then
// the nodesToConsider array will still have all the elements
// it started with.
break
continue
}
let newNodesToConsider: HTMLElement[] = []