Skip to content

Conversation

@rtibbles
Copy link
Member

@rtibbles rtibbles commented Jan 20, 2026

Summary

  • Adds test coverage and capability for handling CSS import statements and replacing their URLs with blob url references
  • Fixes browser incompatibility issue caused by usage of regex look behind

References

No open issue, noticed in the process of working on #12805 and browser compatibility testing

Reviewer guidance

I think the test coverage here is sufficient to give assurance, but testing H5Ps on older desktop Safari versions should show the improvement. See the regex look behind caniuse for candidates: https://caniuse.com/js-regexp-lookbehind
Firefox 77 or Safari 16.3 should be old enough!

rtibbles and others added 2 commits January 17, 2026 14:51
The cssPathRegex was using a lookbehind assertion which is not supported
in Safari <16.4 and older JavaScript engines. This change adds a
feature detection at module load and provides both modern and legacy
implementations that produce identical results.

The legacy regex uses alternation to handle quoted and unquoted URLs
separately, with proper escape sequence handling for quoted strings.
Both implementations are exported via _internal for testing, and tests
now run against both versions using jest.each.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants