SVG 1.1 vs SVG 2 Deprecated and Simplified Features
The transition from SVG 1.1 to SVG 2 modernizes Scalable Vector Graphics by aligning the specification directly with contemporary HTML5, CSS, and DOM standards. To reduce complexity and remove redundant technologies, the SVG working group deprecated obsolete elements, replaced legacy namespaces with native attributes, and simplified how geometry and styling interact with CSS.
Deprecated and Removed Elements
- SVG Fonts (
<font>,<font-face>,<glyph>,<missing-glyph>): SVG 1.1 included its own font format. SVG 2 deprecates native SVG fonts in favor of standard web font formats such as WOFF, WOFF2, and OpenType, which are styled directly using CSS@font-face. - Alternate Glyphs (
<altGlyph>,<altGlyphDef>,<altGlyphItem>,<glyphRef>): These elements allowed manual glyph substitution in SVG 1.1. They were removed in SVG 2 because OpenType font features and CSS handle glyph selection natively. <cursor>Element: SVG 1.1 allowed defining custom cursors via an XML element. SVG 2 deprecates this element in favor of the standard CSScursorproperty with URL values.<color-profile>Element: Deprecated in favor of the CSS Color Module specifications, which provide broader color-space management across all web standards.- Tref (
<tref>): This element allowed referencing external text nodes directly into a text flow. It was removed due to lack of implementation and security concerns; text reuse is now handled via standard DOM manipulation or standard templates.
Deprecated and Replaced Attributes
xlink:hrefNamespace: In SVG 1.1, hyperlinking and referencing resources required the XLink namespace (e.g.,xlink:href="..."). SVG 2 introduces the unqualifiedhrefattribute to match HTML5.xlink:hrefis kept only as a fallback for backwards compatibility.xml:spaceandxml:lang: SVG 2 deprecates these XML-specific attributes in favor of standard CSS properties (such aswhite-space) and the standard HTMLlangattribute.enable-background: Used in SVG 1.1 to establish a background snapshot for filter effects, this property has been deprecated. CSS Compositing and Blending modules now manage backdrop isolation natively.clipProperty: Deprecated in favor of the standardizedclip-pathproperty, eliminating confusion with CSS rectangular clipping.
Simplified and Modernized Features
- Geometry Attributes as Presentation Attributes: In
SVG 1.1, spatial coordinates (such as
cx,cy,r,rx,ry,x,y,width, andheight) were structural attributes. SVG 2 converts these into presentation attributes, allowing developers to set, override, and animate geometric properties directly via external CSS. <use>Element Implementation: SVG 2 simplifies the behavior of cloned subtrees by defining<use>through a closed shadow DOM model. This aligns SVG cloning behavior with standard Web Components.- Transform Functions: SVG 2 harmonizes the
transformattribute syntax with CSS Transforms, allowing standard transform properties (such asrotate(),scale(), andtranslate()) to be applied seamlessly across both CSS stylesheets and presentation attributes. - Text Auto-Wrapping: SVG 2 simplifies multi-line
text by allowing the
<text>element to wrap content automatically within specified geometric boundaries using CSSinline-size, removing the complex manual<tspan>positioning required in SVG 1.1.