Proposals/AttributeWhitespace
This is for ISSUE-2447.
Based on SVG2 attribute appendix (snapshot @ Feb 27, 2014).
For reference, HTML5 attributes.
In the tables below, lightgreen row background means that leading and trailing whitespace is allowed.
Note: the attributes corresponding to the removed custom shaders in Filter Effects have been omitted.
Float values, type: <number>
Proposal:
- For consumer UAs (browsers, viewers): strip leading whitespace and ignore trailing garbage, DOM getters must normalize the values to valid values.
- For producer UAs (validators, editors): leading and trailing whitespace (and garbage) is invalid.
HTML testcase: [1] (drag the slider, first one being the reference. FF, Chrome, Opera(Presto): not allowed. IE: allowed) Note: html has just a few float attributes.
SVG testcase: [2] (FF: not allowed. Chrome: not allowed. IE: allowed, except for garbage. Opera(Presto): allowed.
| Attribute | On elements | Value |
|---|---|---|
| accent-height | font-face | <number> |
| alphabetic | font-face | <number> |
| amplitude | feFuncA, feFuncB, feFuncG, feFuncR | <number> |
| aria-valuemax | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | <number> |
| aria-valuemin | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | <number> |
| aria-valuenow | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | <number> |
| ascent | font-face | <number> |
| azimuth | feDistantLight | <number> |
| baseFrequency | feTurbulence | <number-optional-number> |
| bias | feConvolveMatrix | <number> |
| cap-height | font-face | <number> |
| descent | font-face | <number> |
| diffuseConstant | feDiffuseLighting | <number> |
| divisor | feConvolveMatrix | <number> |
| elevation | feDistantLight | <number> |
| exponent | feFuncA, feFuncB, feFuncG, feFuncR | <number> |
| filterRes | filter | <number-optional-number> |
| hanging | font-face | <number> |
| horiz-adv-x | font, glyph, missing-glyph | <number> |
| horiz-origin-x | font | <number> |
| horiz-origin-y | font | <number> |
| ideographic | font-face | <number> |
| intercept | feFuncA, feFuncB, feFuncG, feFuncR | <number> |
| k | hkern, vkern | <number> |
| k1 | feComposite | <number> |
| k2 | feComposite | <number> |
| k3 | feComposite | <number> |
| k4 | feComposite | <number> |
| kernelMatrix | feConvolveMatrix | <list of numbers> |
| kernelUnitLength | feConvolveMatrix, feDiffuseLighting, feSpecularLighting | <number-optional-number> |
| keyPoints | animateMotion | <list-of-numbers> |
| keySplines | animate, animateMotion, animateTransform | <list> (doesn't say of what except in prose, but are 4 control points per spline, so essentially <list-of-number>) |
| keyTimes | animate, animateMotion, animateTransform | <list> (essentially <list-of-number> with additional restrictions on the number of items in the list and the number range) |
| limitingConeAngle | feSpotLight | <number> |
| mathematical | font-face | <number> |
| offset | feFuncA, feFuncB, feFuncG, feFuncR | <number> |
| offset | stop | <percentage> |
| order | feConvolveMatrix | <number-optional-number> |
| overline-position | font-face | <number> |
| overline-thickness | font-face | <number> |
| pathLength | path | <number> |
| pointsAtX | feSpotLight | <number> |
| pointsAtY | feSpotLight | <number> |
| pointsAtZ | feSpotLight | <number> |
| radius | feMorphology | <number-optional-number> |
| repeatCount | animate, animateMotion, animateTransform, set | <number> | indefinite |
| rotate | altGlyph, text, tspan, tref | <list-of-numbers> |
| rotate | animateMotion | <number> | auto | auto-reverse |
| scale | feDisplacementMap | <number> |
| seed | feTurbulence | <number> |
| slope | feFuncA, feFuncB, feFuncG, feFuncR, font-face | <number> |
| specularConstant | feSpecularLighting | <number> |
| specularExponent | feSpecularLighting, feSpotLight | <number> |
| stdDeviation | feDropShadow, feGaussianBlur | <number-optional-number> |
| stemh | font-face | <number> |
| stemv | font-face | <number> |
| strikethrough-position | font-face | <number> |
| strikethrough-thickness | font-face | <number> |
| surfaceScale | feDiffuseLighting, feSpecularLighting | <number> |
| tabindex | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, source, svg, switch, symbol, text, textPath, track, tref, tspan, use, video, view | <number> (ISSUE: should be <integer>, html5: valid integer strips leading and trailing WS) |
| tableValues | feFuncA, feFuncB, feFuncG, feFuncR | <list-of-numbers> |
| underline-position | font-face | <number> |
| underline-thickness | font-face | <number> |
| units-per-em | font-face | <number> |
| v-alphabetic | font-face | <number> |
| v-hanging | font-face | <number> |
| v-ideographic | font-face | <number> |
| v-mathematical | font-face | <number> |
| values | feColorMatrix | <list-of-numbers> |
| version | svg | <number> |
| vert-adv-y | font, glyph, missing-glyph | <number> |
| vert-origin-x | font, glyph, missing-glyph | <number> |
| vert-origin-y | font, glyph, missing-glyph | <number> |
| viewBox | marker, pattern, svg, symbol, view | a list of four numbers <min-x>, <min-y>, <width> and <height>, separated by whitespace and/or a comma |
| x | fePointLight, feSpotLight, glyphRef | <number> |
| x-height | font-face | <number> |
| y | fePointLight, feSpotLight, glyphRef | <number> |
| z | fePointLight, feSpotLight | <number> |
Angle values
Proposal: Treat the same as the <length> values.
| Attribute | On elements | Value |
|---|---|---|
| rotate | hatch | <angle> |
Integer values, type: <integer>
Proposal:
- For consumer UAs (browsers, viewers): strip leading whitespace and ignore trailing garbage, DOM getters must normalize the values to valid values.
- For producer UAs (validators, editors): leading and trailing whitespace (and garbage) is invalid.
HTML testcase: [3] (All: allowed, garbage is ignored)
SVG testcase: [4] (FF: not allowed. IE: allowed, except for garbage => default. Chrome: allowed, except for garbage => no output)
| Attribute | On elements | Value |
|---|---|---|
| aria-level | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | integer |
| aria-posinset | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | integer |
| aria-setsize | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | integer |
| numOctaves | feTurbulence | <integer> |
| panose-1 | font-face | [<integer>]{10} |
| targetX | feConvolveMatrix | <integer> |
| targetY | feConvolveMatrix | <integer> |
Length values, type: <length>
Proposal:
- For consumer UAs (browsers, viewers): strip leading whitespace and ignore trailing garbage, DOM getters must normalize the values to valid values.
- For producer UAs (validators, editors): leading and trailing whitespace (and garbage) is invalid.
SVG testcase: [5] (FF, Chrome: not allowed. Opera(Presto), IE: allowed, except garbage.)
| Attribute | On elements | Value |
|---|---|---|
| canvasHeight | canvas | <length> |
| canvasWidth | canvas | <length> |
| cx | circle, ellipse, radialGradient | <length> |
| cy | circle, ellipse, radialGradient | <length> |
| dx | feDropShadow, feOffset | <length> |
| dx | altGlyph, glyphRef, text, tref, tspan | <list-of-lengths> |
| dy | feDropShadow, feOffset | <length> |
| dy | altGlyph, glyphRef, text, tref, tspan | <list-of-lengths> |
| fr | radialGradient | <length> |
| frameHeight | iframe | <length> |
| frameWidth | iframe | <length> |
| fx | radialGradient | <length> |
| fy | radialGradient | <length> |
| height | canvas, iframe, image, video | auto |
| height | feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence, filter, foreignObject, pattern, rect, text, use | <length> |
| height | mask, svg | <length> | <percentage> (Presumably related to the issue about percentages in [6]) |
| markerHeight | marker | <length> |
| markerWidth | marker | <length> |
| offset | hatchPath | <length> |
| pitch | hatchPath | currently undefined (but should probably be either <length> or <number>) |
| position | marker | <length> | <percentage> |
| r | circle, radialGradient | <length> |
| refX | marker | <length> |
| refY | marker | <length> |
| rx | ellipse, rect | <length> |
| ry | ellipse, rect | <length> |
| startOffset | textPath | <length> |
| textLength | text, textPath, tref, tspan | <length> |
| width | canvas, iframe, image, video | auto |
| width | foreignObject, rect, pattern, text, use, filter, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence | <length> |
| width | mask, svg | <length> | <percentage> |
| x | altGlyph, text, tref, tspan | <list-of-coordinates> (ISSUE: not linked to a definition of <coordinate>, seems to be missing in SVG2, in SVG 1.1 it was the same as <length>) |
| x | audio, canvas, cursor, foreignObject, hatch, iframe, image, pattern, rect, svg, use, video | <length> |
| x | filter, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence | <coordinate> |
| x | mask | <length> | <percentage> |
| x | meshGradient | ISSUE: currently undefined (but should probably be <length>) |
| x1 | line, linearGradient | <length> |
| x2 | line, linearGradient | <length> |
| y | altGlyph, text, tref, tspan | <list-of-coordinates> (ISSUE: not linked to a definition of <coordinate>, seems to be missing in SVG2, in SVG 1.1 it was the same as <length>) |
| y | audio, canvas, cursor, foreignObject, hatch, iframe, image, pattern, rect, svg, use, video | <length> |
| y | filter, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence | <coordinate> |
| y | mask | <length> | <percentage> |
| y | meshGradient | ISSUE: currently undefined (but should probably be <length>) |
| y1 | line, linearGradient | <length> |
| y2 | line, linearGradient | <length> |
Enumerated values
Proposal: Don't allow leading or trailing whitespace.
HTML testcase: [7] (all: not allowed)
SVG testcase: [8] (tweak the clipPathUnits attribute, all: not allowed)
| Attribute | On elements | Value |
|---|---|---|
| accumulate | animate, animateMotion, animateTransform | none | sum |
| additive | animate, animateMotion, animateTransform | replace | sum |
| arabic-form | glyph | initial | medial | terminal | isolated |
| aria-atomic | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-autocomplete | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | inline | list | both | none |
| aria-busy | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-checked | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false | mixed | undefined |
| aria-disabled | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-dropeffect | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | copy | move | link | execute | popup | none |
| aria-expanded | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false | undefined |
| aria-grabbed | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false | undefined |
| aria-haspopup | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-hidden | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-invalid | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false | grammar | spelling |
| aria-live | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | off | polite | assertive |
| aria-multiline | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-multiselectable | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-orientation | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | horizontal | vertical |
| aria-pressed | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false | mixed | undefined |
| aria-readonly | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-relevant | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | additions | removals | text | all |
| aria-required | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false |
| aria-selected | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | true | false | undefined |
| aria-sort | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | ascending | descending | none | other |
| attributeType | animate, animateTransform, set | CSS | XML | auto |
| calcMode | animate, animateMotion, animateTransform | discrete | linear | paced | spline |
| clipPathUnits | clipPath | userSpaceOnUse | objectBoundingBox |
| crossorigin | audio, video | anonymous | use-credentials (Note, in html5 this is a CORS settings attribute) |
| edgeMode | feConvolveMatrix | duplicate | wrap | none |
| fill | animate, animateMotion, animateTransform, set | freeze | remove |
| filterUnits | filter | userSpaceOnUse | objectBoundingBox |
| font-stretch | font-face | all | [ normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded] [, [ normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded] ]* |
| font-style | font-face | all | [ normal | italic | oblique] [, [normal | italic | oblique]]* |
| font-variant | font-face | [normal | small-caps] [,[normal | small-caps]]* |
| font-weight | font-face | all | [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900] [, [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900]]* |
| gradientUnits | linearGradient, meshGradient, radialGradient | userSpaceOnUse | objectBoundingBox |
| hatchContentUnits | hatch | userSpaceOnUse | objectBoundingBox |
| hatchUnits | hatch | userSpaceOnUse | objectBoundingBox |
| kind | track | subtitles | captions | descriptions | chapters | metadata |
| lengthAdjust | text, textPath, tref, tspan | spacing | spacingAndGlyphs |
| markerUnits | marker | strokeWidth | userSpaceOnUse |
| maskContentUnits | mask | userSpaceOnUse | objectBoundingBox |
| maskUnits | mask | userSpaceOnUse | objectBoundingBox |
| method | textPath | align | stretch |
| mode | feBlend | normal | multiply | screen | darken | lighten |
| operator | feComposite | over | in | out | atop | xor | arithmetic |
| operator | feMorphology | erode | dilate |
| orientation | glyph | h | v |
| origin | animateMotion | default (the attribute "has no effect in SVG" according to spec, do we need to keep it at all?) |
| patternContentUnits | pattern | userSpaceOnUse | objectBoundingBox |
| patternUnits | pattern | userSpaceOnUse | objectBoundingBox |
| playbackOrder | svg | forwardOnly | all |
| preload | audio, video | none | metadata | auto |
| preserveAlpha | feConvolveMatrix | true | false |
| preserveAspectRatio | canvas, feImage, iframe, image, marker, pattern, svg, symbol, video, view | [defer] <align> [<meetOrSlice>] |
| primitiveUnits | filter | userSpaceOnUse | objectBoundingBox |
| requiredFeatures | a, altGlyph, animate, animateMotion, animateTransform, audio, canvas, circle, clipPath, discard, ellipse, foreignObject, g, iframe, image, line, mask, path, polygon, polyline, rect, set, svg, switch, text, textPath, tref, tspan, use, video (should be any element) | list-of-features (whitespace separated feature strings) |
| restart | animate, animateMotion, animateTransform, set | always | whenNotActive | never |
| role | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | white-space space separated tokens having values defined in Definition of Roles ([ARIA, section 5.4)] |
| spacing | textPath | auto | exact |
| spreadMethod | linearGradient, radialGradient | pad | reflect | repeat |
| stitchTiles | feTurbulence | stitch | noStitch |
| timelineBegin | svg | onLoad | onStart |
| type | animateTransform | translate | scale | rotate | skewX | skewY |
| type | feColorMatrix | matrix | saturate | hueRotate | luminanceToAlpha |
| type | feFuncA, feFuncB, feFuncG, feFuncR | identity | table | discrete | linear | gamma |
| type | feTurbulence | fractalNoise | turbulence |
| xChannelSelector | feDisplacementMap | R | G | B | A |
| xlink:actuate | a | onRequest |
| xlink:show | a, altGlyph, animate, animateMotion, animateTransform, cursor, feImage, filter, font-face-uri, glyphRef, hatch, image, linearGradient, meshGradient, mpath, pattern, radialGradient, script, set, textPath, tref, use | new | replace | embed | other | none |
| xlink:type | a, altGlyph, animate, animateMotion, animateTransform, cursor, feImage, filter, font-face-uri, glyphRef, hatch, image, linearGradient, meshGradient, mpath, pattern, radialGradient, script, set, textPath, tref, use | simple |
| xml:space | a, altGlyph, altGlyphDef, altGlyphItem, animate, animateMotion, animateTransform, audio, canvas, circle, clipPath, cursor, defs, desc, discard, ellipse, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDistantLight, feDropShadow, feFlood, feFuncA, feFuncB, feFuncG, feFuncR, feGaussianBlur, feImage, feMerge, feMergeNode, feMorphology, feOffset, fePointLight, feSpecularLighting, feSpotLight, feTile, feTurbulence, filter, font, font-face, font-face-format, font-face-name, font-face-src, font-face-uri, foreignObject, g, glyph, glyphRef, hatch, hatchPath, hkern, iframe, image, line, linearGradient, marker, mask, meshGradient, meshPatch, meshRow, metadata, missing-glyph, mpath, path, pattern, polygon, polyline, radialGradient, rect, script, set, solidColor, source, stop, style, svg, switch, symbol, text, textPath, title, track, tref, tspan, use, video, view, vkern | default | preserve |
| yChannelSelector | feDisplacementMap | R | G | B | A |
| zoomAndPan | svg, view | disable | magnify |
Boolean values
Boolean attributes in HTML5 are empty, or have the attribute name as the value. Whitespace is not allowed. Neither are the values "true" and "false".
HTML testcase: [9] (all: not allowed)
| Attribute | On elements | Value |
|---|---|---|
| autoplay | audio, video | |
| controls | audio, video | |
| default | track | |
| loop | audio, video | |
| muted | audio, video | |
| seamless | iframe |
ID values
| Attribute | On elements | Value |
|---|---|---|
| aria-activedescendant | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | ID |
| aria-controls | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | list of whitespace separated IDs |
| aria-describedby | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | list of whitespace separated IDs |
| aria-flowto | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | list of whitespace separated IDs |
| aria-labelledby | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | list of whitespace separated IDs |
| aria-owns | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | list of whitespace separated IDs |
| id | all elements | name (Issue in spec to define the term 'name' [10]) |
Text values
HTML/SVG testcase: [11] (all: allowed)
| Attribute | On elements | Value |
|---|---|---|
| aria-label | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | string |
| aria-valuetext | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | string |
| attributeName | animate, animateTransform, set | <XMLName> |
| baseProfile | svg | <anything> |
| bbox | font-face | <string> |
| by | animate, animateMotion, animateTransform | <value> (defined in SMIL, strips leading and trailing whitespace, value should be parsed in the context it's used in) |
| class | a, altGlyph, audio, canvas, circle, clipPath, defs, desc, ellipse, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence, filter, font, foreignObject, g, glyph, glyphRef, hatch, hatchPath, iframe, image, line, linearGradient, marker, mask, meshGradient, meshPatch, meshRow, missing-glyph, path, pattern, polygon, polyline, radialGradient, rect, solidColor, source, stop, svg, switch, symbol, text, textPath, title, track, tref, tspan, use, video | whitespace separated list - HTML5 allows leading and trailing whitespace [12]. |
| font-family | font-face | <string> |
| font-size | font-face | <string> |
| format | altGlyph, glyphRef | <string> |
| from | animate, animateMotion, animateTransform | <value> (defined in SMIL, strips leading and trailing whitespace, value should be parsed in the context it's used in) |
| g1 | hkern, vkern | <author-ident> [, <author-ident> ]* (Note, <author-ident> is undefined, and doesn't link to anywhere in the spec) |
| g2 | hkern, vkern | <author-ident> [, <author-ident> ]* (Note, <author-ident> is undefined, and doesn't link to anywhere in the spec) |
| glyph-name | hkern, vkern | <author-ident> [, <author-ident> ]* (Note, <author-ident> is undefined, and doesn't link to anywhere in the spec) |
| glyphRef | altGlyph, glyphRef | <string> |
| in | feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feGaussianBlur, feMorphology, feOffset, feSpecularLighting, feTile | SourceGraphic | SourceAlpha | BackgroundImage | BackgroundAlpha | FillPaint | StrokePaint | <filter-primitive-reference> (mix of enumerated and string) |
| in2 | feBlend, feComposite, feDisplacementMap | SourceGraphic | SourceAlpha | BackgroundImage | BackgroundAlpha | FillPaint | StrokePaint | <filter-primitive-reference> (mix of enumerated and string) |
| label | track | Text (cannot be the empty string) |
| mediagroup | audio, video | Text |
| name | font-face-name | <anything> |
| result | eBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence | <filter-primitive-reference> (unclear if leading & trailing whitespace is stripped or not) |
| sandbox | iframe | Unordered set of unique space-separated tokens, ASCII case-insensitive, consisting of "allow-forms", "allow-pointer-lock", "allow-popups", "allow-same-origin", "allow-scripts and "allow-top-navigation" |
| string | font-face-name | <anything> |
| target | a | _replace | _self | _parent | _top | _blank | <XML-Name> |
| title | audio, iframe, track, video | <anything> (in html5: Text) |
| title | style | advisory-title (in html5: Text) |
| to | animate, animateMotion, animateTransform | <value> (defined in SMIL, strips leading and trailing whitespace, value should be parsed in the context it's used in) |
| to | set | <value> (svg doesn't state that leading and trailing whitespace is ignored) |
| type | script, style | content-type (in HTML5: valid MIME type) |
| type | source | valid MIME type |
| u1 | hkern, vkern | [<character> | <urange> ] [, [<character> | <urange>] ]* |
| u2 | hkern, vkern | [<character> | <urange> ] [, [<character> | <urange>] ]* |
| unicode | glyph | <string> |
| unicode-range | font-face | <urange> [, <urange>]* |
| values | animate, animateMotion, animateTransform | <list> (defined in SMIL, strips leading and trailing whitespace, value should be parsed in the context it's used in) |
| viewTarget | view | <XML-Name> |
| widths | font-face | <string> |
| xlink:title | a, altGlyph, animate, animateMotion, animateTransform, cursor, feImage, filter, font-face-uri, glyphRef, hatch, image, linearGradient, meshGradient, mpath, pattern, radialGradient, script, set, textPath, tref, use | <anything> |
| xlink:title | source | <anything> |
Event handler content attribute values
The event attributes should be defined to be event handler content attributes to match html.
| Attribute | On elements | Value |
|---|---|---|
| onabort | svg | <anything> |
| onbegin | animate, animateMotion, animateTransform, set | <anything> |
| onclick | a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onend | animate, animateMotion, animateTransform, set | <anything> |
| onerror | svg (should be any element, or alternatively the 'structurally external' elements) | <anything> |
| onfocusin | , altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onfocusout | , altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onload | animate, animateMotion, animateTransform, set, a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element, or alternatively the 'structurally external' elements) | <anything> |
| onmousedown | a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onmousemove | a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onmouseout | a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onmouseover | a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onmouseup | a, altGlyph, audio, canvas, circle, defs, ellipse, foreignObject, g, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video (should be any element) | <anything> |
| onrepeat | animate, animateMotion, animateTransform, set | <anything> |
| onresize | svg | <anything> |
| onscroll | svg | <anything> |
| onunload | svg | <anything> |
| onzoom | svg | <anything> |
Lang values
| Attribute | On elements | Value |
|---|---|---|
| lang | desc, glyph, title | %LanguageCodes; (a comma-separated list of language codes, in html it's a single language code or empty) |
| srclang | track | Valid BCP 47 language tag |
| systemLanguage | a, altGlyph, animate, animateMotion, animateTransform, audio, canvas, circle, clipPath, discard, ellipse, foreignObject, g, iframe, image, line, mask, path, polygon, polyline, rect, set, svg, switch, text, textPath, tref, tspan, use, video | a comma-separated list of language names as defined in BCP 47 |
| xml:lang | a, altGlyph, altGlyphDef, altGlyphItem, animate, animateMotion, animateTransform, audio, canvas, circle, clipPath, cursor, defs, desc, discard, ellipse, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDistantLight, feDropShadow, feFlood, feFuncA, feFuncB, feFuncG, feFuncR, feGaussianBlur, feImage, feMerge, feMergeNode, feMorphology, feOffset, fePointLight, feSpecularLighting, feSpotLight, feTile, feTurbulence, filter, font, font-face, font-face-format, font-face-name, font-face-src, font-face-uri, foreignObject, g, glyph, glyphRef, hatch, hatchPath, hkern, iframe, image, line, linearGradient, marker, mask, meshGradient, meshPatch, meshRow, metadata, missing-glyph, mpath, path, pattern, polygon, polyline, radialGradient, rect, script, set, solidColor, source, stop, style, svg, switch, symbol, text, textPath, title, track, tref, tspan, use, video, view, vkern | languageID (undefined what it means) |
Valid browsing context values
| Attribute | On elements | Value |
|---|---|---|
| name | iframe | A valid browsing context name or keyword |
Media query values
| Attribute | On elements | Value |
|---|---|---|
| media | source | A valid media query (in other words: leading and trailing WS allowed) |
| media | style | media (ISSUE: should be the same as for the source element, and the style element in html5) |
URL values
Proposal: Reference the html5 definition "Valid non-empty URL potentially surrounded by spaces" and use that instead of <iri>, same for validators and viewers, but perhaps with a recommendation to not add leading and trailing whitespace.
SVG testcase: [13] (all: allowed, stripped away. IE: also allows unprefixed href)
| Attribute | On elements | Value |
|---|---|---|
| aria-describedat | a, altGlyph, altGlyphItem, audio, canvas, circle, cursor, discard, ellipse, foreignObject, g, hkern, iframe, image, line, path, polygon, polyline, rect, svg, switch, symbol, text, textPath, tref, tspan, use, video, view | URI |
| poster | video | Valid non-empty URL potentially surrounded by spaces |
| requiredExtensions | a, altGlyph, animate, animateMotion, animateTransform, audio, canvas, circle, clipPath, discard, ellipse, foreignObject, g, iframe, image, line, mask, path, polygon, polyline, rect, set, svg, switch, text, textPath, tref, tspan, use, video (should be any element) | list-of-extensions (whitespace separated IRIs) |
| src | audio, video, iframe, source, track | Valid non-empty URL potentially surrounded by spaces |
| xlink:href | a, altGlyph, animate, animateMotion, animateTransform, cursor, feImage, filter, font-face-uri, glyphRef, hatch, image, linearGradient, mpath, pattern, radialGradient, script, set, textPath, tref, use | <iri> (doesn't allow leading or trailing whitespace) |
| xlink:href | meshGradient | ISSUE: currently undefined |
| xlink:role | a, altGlyph, animate, animateMotion, animateTransform, cursor, feImage, filter, font-face-uri, glyphRef, hatch, image, linearGradient, meshGradient, mpath, pattern, radialGradient, script, set, textPath, tref, use | <iri> |
| xml:base | a, altGlyph, altGlyphDef, altGlyphItem, animate, animateMotion, animateTransform, audio, canvas, circle, clipPath, cursor, defs, desc, discard, ellipse, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDistantLight, feDropShadow, feFlood, feFuncA, feFuncB, feFuncG, feFuncR, feGaussianBlur, feImage, feMerge, feMergeNode, feMorphology, feOffset, fePointLight, feSpecularLighting, feSpotLight, feTile, feTurbulence, filter, font, font-face, font-face-format, font-face-name, font-face-src, font-face-uri, foreignObject, g, glyph, glyphRef, hatch, hatchPath, hkern, iframe, image, line, linearGradient, marker, mask, meshGradient, meshPatch, meshRow, metadata, missing-glyph, mpath, path, pattern, polygon, polyline, radialGradient, rect, script, set, solidColor, source, stop, style, svg, switch, symbol, text, textPath, title, track, tref, tspan, use, video, view, vkern | <iri> |
The source of an iframe srcdoc document
| Attribute | On elements | Value |
|---|---|---|
| srcdoc | iframe | The source of an iframe srcdoc document* (allows whitespace in html, in xml it depends on the xml spec) |
Path data values
| Attribute | On elements | Value |
|---|---|---|
| d | glyph, missing-glyph, hatchPath, path, textPath | <path-data> (grammar allows leading and trailing whitespace) |
| path | animateMotion | <path-data> |
| path | stop | "mesh path data" (undefined term, but if the normal path data allows whitespace this probably should too) |
Points values
| Attribute | On elements | Value |
|---|---|---|
| points | polyline, polygon | <list-of-points> (allows leading and trailing whitespace) |
Style values
| Attribute | On elements | Value |
|---|---|---|
| style | a, altGlyph, audio, canvas, circle, clipPath, defs, desc, ellipse, feBlend, feColorMatrix, feComponentTransfer, feComposite, feConvolveMatrix, feCustom, feDiffuseLighting, feDisplacementMap, feDropShadow, feFlood, feGaussianBlur, feImage, feMerge, feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence, filter, font, foreignObject, g, glyph, glyphRef, hatch, hatchPath, iframe, image, line, linearGradient, marker, mask, meshGradient, meshPatch, meshRow, missing-glyph, path, pattern, polygon, polyline, radialGradient, rect, solidColor, source, stop, svg, switch, symbol, text, textPath, title, track, tref, tspan, use, video (should be any element) | style (should reference CSS Style Attributes instead for the syntax definition, in any case CSS allows whitespace) |
Transform list values
SVG testcase: [14] (Opera(Presto): allowed, garbage ignored. IE, FF, Chrome: allowed, except for garbage.
| Attribute | On elements | Value |
|---|---|---|
| gradientTransform | linearGradient, meshGradient, radialGradient | <transform-list> (which is equivalent to "list of <transform-function>". Should this reference http://www.w3.org/TR/css3-transforms/#svg-syntax? It's not clear if leading and trailing whitespace is allowed.) |
| hatchTransform | hatch | <transform-list> |
| patternTransform | pattern | <transform-list> |
"It's complicated" values
| Attribute | On elements | Value |
|---|---|---|
| begin | animate, animateMotion, animateTransform, set, discard | <begin-value-list> (allows whitespace in some but not all cases) |
| dur | animate, animateMotion, animateTransform, set | <Clock-value> | media | indefinite (allows whitespace for the clockvalue) |
| end | animate, animateMotion, animateTransform, set | <end-value-list> (allows whitespace in some but not all cases) |
| max | animate, animateMotion, animateTransform, set | <Clock-value> | media (allows whitespace for the clockvalue) |
| min | animate, animateMotion, animateTransform, set | <Clock-value> | media (allows whitespace for the clockvalue) |
| orient | marker | auto | auto-start-reverse | <angle> | <number> |
| repeatDur | animate, animateMotion, animateTransform, set | <Clock-value> | indefinite (allows whitespace for the clockvalue) |