Skip to content

SVG 2 new features

Tavmjong edited this page Jun 9, 2016 · 15 revisions

I'd like to move this into a proper matrix where we can list implementer feedback and support, but for now here's a basic list of what is new in SVG 2.

Note: this list is still being built and is incomplete.

API Changes

  • Added "length" attribute and indexed property access to all list interfaces.
  • Replace SVGMatrix with DOMMatrix or DOMMatrixReadOnly
  • Replace SVGRect with DOMRect or DOMRectReadOnly
  • Replace SVGPoint with DOMPoint or DOMPointReadOnly

Markup Changes

  • Allow the script element anywhere
  • Add crossorigin attribute to the image and script elements

Graphical Features

  • Inclusion of audio and video elements
  • Mesh gradients
  • Hatch path paint server
  • Multiple paints for fill and stroke.
  • 'context-fill' and 'context-stroke' values for 'fill' and 'stroke'
    These allow, for example, markers to inherit the stroke color.
  • Marker auto-start-reverse
    Has implementations in Firefox, WebKit, Blink, and Inkscape
  • Complete overhaul of text layout
    • CSS based multi-line text.
      • Text wrapping given a fixed width/height.
      • Text in a shape.
    • Text-on-a-path changes:
      • Text on a shape.
      • Text on either side of a path.
    • Todo: Add more
  • Font features (alternative glyphs, etc.)
  • Path features:
    • Auto-closing paths.
    • New line joins (miter-clip, arcs)
  • z-index support
  • SVG Root and foreignObject are no longer overflow:hidden by default
  • Allow scroll bars to be shown for overflow:auto in special cases
  • Allow scroll bars when overflow:scroll is set on svg elements
Clone this wiki locally