anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

Poor performance of a particular example on ie 6 #95

Closed marekdedic closed 3 years ago

marekdedic commented 5 years ago

Hi I get very poor performance for elements with :focus:hover when checking them against ie 6. Example:

$ time doiuse --browsers "ie 6" example.css
example.css:1:1: CSS 2.1 selectors not supported by: IE (6) (css-sel2)
doiuse --browsers "ie 6" example.css  59,04s user 0,06s system 100% cpu 59,014 total

where example.css is:

.imagelightbox-arrow:focus:hover {
}

I've found that changing the name of the class sometimes resolves the issue, as does removing either the hover or the focus. From what I can tell, the content of the class has no effect.

I am using version 4.2.0

marekdedic commented 5 years ago

I tried profiling the problem and 99% of the time is spent in RegExp: ^((\[[^\]]*\]|\([^\)]*\))?[^\[\]\(\)]*)*\.

marekdedic commented 5 years ago

processed.txt

marekdedic commented 5 years ago

See here - catastrophic backtracking: https://regex101.com/r/MlbAhW/1