v142 · miscellaneous

Support `download` attribute in SVG <a> element

This feature introduces support for the download attribute on the SVGAElement interface in Chromium, aligning with the SVG 2 specification. The download attribute enables authors to specify that the target of an SVG hyperlink should be downloaded rather than navigated to, mirroring the behavior already supported in HTMLAnchorElement. This enhancement promote

concepts

  1. SVG <a> download

    Pick a filename and payload, click the SVG button: Chrome 142+ saves the file, older browsers navigate. Side-by-side with HTML <a download>.

  2. Click-A-Bar Chart Export

    The motivating data-viz case: each bar of an SVG chart is a programmatically-created <a download> wrapping a <rect>. Click a bar to export that quarter's slice as a CSV — Chrome 142+ saves, older Chrome navigates and loses context.

  3. Diagram Pack Exporter

    A flowchart drawn in plain SVG with six nodes; each wrapped in <a download> with a different payload (per-node SVG, PNG raster, CSV data). Click any node and Chrome 142 saves with the correct filename — no Blob URL hop, no click() simulation.

  4. SVG Download Builder

    Compose an inline SVG with text, shapes, and colours via a live editor, then wrap each element in an <a download> pointing at a generated Blob URL. Click any element to download it as an individual SVG fragment. A browser-support badge shows whether SVGAElement.download is present in your browser.

why it shipped

Currently, Chromium does not support the download attribute on SVG <a> elements (SVGAElement), despite its support in other major browsers such as Firefox. This inconsistency leads to fragmented behavior across platforms and complicates web development workflows, especially for applications relying on SVG-based UI components or graphics that include downloadable resources.

references