Firefox 158 brings welcome news for developers tired of waiting for next-generation image support. JPEG XL (JXL) is now enabled by default, with no need to dig into hidden about:config flags. The browser supports lossy and lossless compression, transparency, animations, and HDR.
The second long-awaited upgrade lands in CSS. The calc() function now supports typed arithmetic, letting you divide matching units to produce a pure unitless number:
:root {
/* Convert viewport width in pixels into a unitless multiplier */
--viewport-width-ratio: calc(100vw / 1px);
--columns-count: max(1, min(6, calc(var(--viewport-width-ratio) / 320)));
}
For Web Notifications, a new native navigate property lets you declare the click destination URL directly without wiring up service worker handlers:
// Send a system notification with a built-in target link
new Notification('New release', {
body: 'Click to open the documentation.',
navigate: 'https://example.com/docs'
});
The release also adds getStats() for WebTransport along with flags for CSS random() and deferred imports via import defer.
