What should happen when trying to insert empty strings or separators into SVGStringList
longsonr opened this issue · 0 comments
longsonr commented
Please:
The specification https://www.w3.org/TR/SVG2/types.html#InterfaceSVGStringList says that insertItemBefore, replaceItem and appendItem do not throw unless the SVGStringList is read only.
https://www.w3.org/TR/SVG2/types.html#__svg__SVGNameList__insertItemBefore
So what should happen if we
- try to insert an empty string?
- try to insert a string that contains separators?
Currently Firefox will not insert an empty string but Chrome will. All browsers seem to allow inserting strings with separators but if the document is serialised and reparsed you'll get an SVGStringList with more entries than you had originally.
<script> document.documentElement.systemLanguage.appendItem(""); document.documentElement.systemLanguage.appendItem("a, b"); document.documentElement.requiredExtensions.appendItem("a b"); </script>- Should we throw an exception or just ignore the appendItem of an empty string?
- Should we throw an exception, ignore the append, or append multiple items when the string contains separators?
If we just append strings with separators then when we serialise them we'll have additional items.