You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Must reflect the element's ID [DOM4]. The ‘id’ attribute must be any value other than the empty string.
Some problems with that:
Lots of uses of id (target fragments, ARIA ID REF values) at least assume that each id is a single token. If you have an id with whitespace, it becomes pretty much useless. Similarly, if ids are not unique, things don't work correctly.
Even the HTML spec requires "When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element's tree and must contain at least one character. The value must not contain any space characters."
If the SVG is in an XML document (including a stand-alone SVG), XML validity puts many additional requirements on id. Exactly which requirements depends on whether it's XML 1.0 (default) or 1.1 (specified by a processing instruction at the top of the file).
Since SVG elements can be inside HTML documents, I'm okay with making any valid HTML id a valid SVG id. But that's still more restrictive then what we currently have, and we should definitely add a warning that not all id values that meet that requirement will be valid in an XML document.
The text was updated successfully, but these errors were encountered:
Currently the section on the
id
attribute says:Some problems with that:
id
(target fragments, ARIA ID REF values) at least assume that eachid
is a single token. If you have anid
with whitespace, it becomes pretty much useless. Similarly, ifid
s are not unique, things don't work correctly.id
. Exactly which requirements depends on whether it's XML 1.0 (default) or 1.1 (specified by a processing instruction at the top of the file).Since SVG elements can be inside HTML documents, I'm okay with making any valid HTML
id
a valid SVGid
. But that's still more restrictive then what we currently have, and we should definitely add a warning that not allid
values that meet that requirement will be valid in an XML document.The text was updated successfully, but these errors were encountered: