Internet-Draft | IETF SVG profile issues | September 2022 |
Carpenter & Brownlee | Expires 10 March 2023 | [Page] |
This document lists a number of issues observed in practice by authors attempting to include SVG diagrams in RFCs following the profile established by RFC7996.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 10 March 2023.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The latest version of the XML2RFC format for preparing RFCs relies on embedding diagrams in a particular subset of SVG defined in [RFC7996]. The great advantage of SVG is that it is intrinsically XML and therefore is a natural fit for XML2RFC in the way that no bitmap graphical format can be. Discussion of that basic choice is out of scope for this document.¶
A number of RFCs including such diagrams have been successfully published, but their authors have encountered various issues in doing so. This document's only purpose is to describe those issues. Any attempt to resolve them is out of scope for this document, which is not expected to be published as an RFC. However, RFC 7996 itself observes that:¶
The details (particularly any vocabularies) described in this document are expected to change based on experience gained in implementing the new publication toolsets. Revised documents will be published capturing those changes...¶
The authors will be pleased to incorporate brief descriptions of additional issues.¶
[RFC7996] specifies SVG 1.2 RFC, an SVG profile for use in diagrams that may appear in RFCs. It is in fact a subset of SVG 1.2 Tiny, itself a W3C subset of SVG 1. At the time that the RFC Editor chose this approach, it was a reasonable hope that "Tiny" would succeed in the market. This has not happened, and that is at the root of many of the issues listed below.¶
On the other hand, there are good reasons why the RFC Editor cannot allow just any arbitrary SVG construct in RFCs - for example, to satisfy accessibility concerns, to avoid external dependencies in RFCs, and to avoid potentially malicious embedded scripts.¶
These are in no particular order.¶
RFC 7996 doesn't like 'stroke="none"' and 'stroke:none', even though they seem to be harmless and are often present.¶
Colour is represented in various different ways and formats, depending on which drawing tool generated the SVG. So a heuristic to fix up colour has to deal with all of them.¶
There are a number of ways in which RFC 7996 dislikes quite straightforward constructs that all browsers (the consumers of these SVG files) support. Just to give a few essentially random examples:¶
The element 'style' is not allowed as a child of 'svg' The element 'path' does not allow the attribute 'marker-end' Style property 'fill' promoted to attribute Style property 'stroke-opacity' promoted to attribute Style property 'stroke-miterlimit' removed The element 'foreignObject' is not allowed as a child of 'g'¶
There's also some makework in the IETF toolchain:¶
The attribute 'stroke' does not allow the value 'rgb(0,0,0)', replaced with 'black' The attribute 'stroke' does not allow the value 'rgb(0%,0%,0%)', replaced with 'black' The attribute 'font-family' does not allow the value 'Arial, sans-serif', replaced with 'sans-serif'¶
And some things that we will always need:¶
The element 'script' is not allowed as a child of 'svg'¶
None.¶
Any form of scripting should remain forbidden in the SVG included in any Internet Draft or RFC.¶