Fixed input profile¶
Source is1..1MiB UTF8 XML, no SVGZ. XML admission allows8192 total nodes (including
text/comments),4096 elements,32 element levels,64 attributes/namespaces per element
and65536 bytes per attribute. At most1024 distinct ASCII IDs have1..128 bytes and
use letters/digits/underscore/hyphen/dot. The exact SVG namespace is required;
namespace-qualified attributes, nested SVG viewports, duplicate IDs, processing
instructions and the literal <!DOCTYPE sequence are rejected. XML declarations
and predefined/numeric character references remain legal. DTD parsing and external
entity resolution are disabled. Text content is permitted in title/desc; other
text must contain only ASCII XML whitespace. Metadata role/aria labels are inert
strings, with no accessibility certification implied.
Supported elements are svg, g, defs, path, rect, circle, ellipse,
line, polyline, polygon, linearGradient, radialGradient, stop, clipPath,
title and desc. Element-child profiles are checked; gradients contain stops,
clip paths contain only shapes/transformed groups, and shapes contain no elements.
Root width/height use finite positive unitless/px values, or each missing dimension
comes from a valid viewBox. Positive root/viewBox dimensions and all source numeric
coordinates are<=65536 in magnitude. Root viewBox, standard preserveAspectRatio
alignments/meet/slice/none, and matrix/translate/scale/rotate/skew transforms are
explicit. Physical/font units, shape percentages and environment-dependent root
fallback are rejected. Gradient coordinates and stop offsets may use percentages.
Path grammar includes absolute/relative move, line, horizontal/vertical, cubic,
quadratic, smooth cubic/quadratic, elliptical arcs and close. Each source and
normalized path accepts<=4096 segments, with<=65536 cumulative source and normalized
segments. Relative accumulation is checked in normalized geometry. Points accept
<=4096 coordinate pairs. Valid degenerate/quantized/invisible shapes do not promise
visible ink; an empty supplied path d is rejected. Each transform list has<=256
expanded tokens; values/composed transforms/normalized transformed path controls
must remain finite and within65536 magnitude. This is a bounded image profile,
not complete browser SVG support.
Presentation attributes and inline style support fill/stroke/color/currentColor, fill/stroke/overall/group opacity, fill/clip winding rules, stroke width/caps/joins/ miter/dashes, transform, display and visibility, stop color/opacity and clipping. Gradient coordinates/units/transform/spread and stop offsets use SVG attributes; inline styles do not admit those geometry attributes. Stroke width is0..256, miter1..16, dash arrays<=256 unitless entries in 0..256 with positive total, and dash offset magnitude<=256. Opacity is a unitless 0..1 number or inherit; line caps are butt/round/square and joins miter/round/bevel. Gradients select userSpaceOnUse/objectBoundingBox, finite gradientTransform and pad/reflect/repeat. Stop offsets are0..1, <=256 stops per gradient/4096 total.
Inline style uses<=32 semicolon-separated declarations. Every nonempty declaration must have exactly one colon and one matching parsed token for a supported presentation property. Unknown/malformed declarations, important, escapes, comments, custom variables, braces and at-rules are refused. This deliberately narrow syntax does not permit semicolons/colons inside values. Inline declarations override presentation attributes; ordinary supported inheritance remains explicit. Selector stylesheets/style elements and injected CSS are outside this API.
Paint and clipping may reference only validated local IDs with typed url(#id)
syntax (including quoted local IDs); paints target linear/radial gradients and
clips target clipPath. Gradient href inheritance, clip references inside clip
subtrees and all resource-bearing href attributes are refused. Normalized traversal
counts<=8192 visits including repeated referenced clip subroots and<=32 levels.
Text/fonts, use/symbol instances, images/data images, patterns, masks, filters,
foreignObject, scripts/handlers, anchors and animation are rejected before backend
conversion. Both image resolver closures unconditionally return None, even though
the backend's defaults permit local-file loading. No consumer options expose a
resource directory, font database, external stylesheet or resolver.