Skip to content

Stalls out on long background-image URLs #349

@nex3

Description

@nex3

Long url()s that appear in background-image properties can cause RTLCSS to stall out. It's not clear to me if this is an infinite loop or just an extremely long-running performance hole, but either way it takes too long to be practical. This has come up in real stylesheets that have several-megabyte SVGs embedded in them.

To reproduce:

$ npm i postcss-cli rtlcss
$ (printf 'div {background-image: url("'; printf 'abcdefghij%.0s' {1..100000}; printf '")}\n') > test.css
$ npx postcss-cli test.css -u rtlcss > out.css

Tested on postcss-cli 11.0.1 and rtlcss 4.3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions