Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should happen when trying to insert empty strings or separators into SVGStringList #930

Open
longsonr opened this issue Jan 13, 2024 · 0 comments

Comments

@longsonr
Copy link

longsonr commented Jan 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant