The CSSStyleSheet constructor supports a baseURL option in CSSStyleSheetInit, allowing developers to explicitly control how relative URLs are resolved for constructed stylesheets.
Currently, Chromium does not support the baseURL option in the CSSStyleSheet constructor, and constructed stylesheets inherit the base URL of the associated Document. This can lead to incorrect resolution of relative URLs when stylesheets are dynamically created, reused across components, or loaded from different origins such as CDNs. As a result, developers often resort to hardcoded absolute paths or brittle JavaScript-based rewriting of URLs. Introducing a baseURL property in CSSStyleSheetInit allows developers to explicitly define the stylesheet’s base URL, ensuring consistent resource resolution and aligning Chromium with the CSSOM specification.
[1]: https://drafts.csswg.org/cssom-1/#dom-cssstylesheetinit-baseurl
[2]: https://github.com/WICG/construct-stylesheets/issues/95
[3]: https://github.com/w3c/csswg-drafts/pull/6304