systemLanguage not multivalued

Confirmed Issue #12112277 • Assigned to Travis L.


Gerald R.
May 24, 2017
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

In an HTML file, add an inline SVG image:

<svg width="300" height="200" xmlns="">
    <rect x="0" y="0" width="300" height="200" fill="cyan"></rect>
    <switch transform="translate(10,20)">
        <text systemLanguage="en-GB">1. en-GB English (Edge! I'm en-US.)</text>
        <text systemLanguage="en-US, zh-Hans, zh-Hant" id="switchtest">2. en-US English</text>
        <text systemLanguage="en">3. en English (Chrome!)</text>
        <text systemLanguage="de">4. de German</text>
        <text>5. default</text>

Following the SVG, insert a script block:

// next fails in Edge. should give 3 but gives 1
console.log("numberOfItems = "+
// .getItem(1) changed to getItem(0) to avoid error
console.log("systemLanguage (readonly SVGStringList): " +
document.getElementById(“switchtest”).systemLanguage.getItem(0) + " " +
document.getElementById(“switchtest”).systemLanguage.getItem(0) + " " );

The .systemLanguage.numberOfItems) should be 3 ("en-US", "zh-Hant", “zh-Hans”) but only returns 1.

The SVG 1.1 spec section 5.8.5 says the systemLanguage attribute is a comma separated list: “The attribute value is a comma-separated list of language names as defined in BCP 47 [BCP47].”

The SVG 1.1 spec DOM, there is an SVGTests Interface at section 4.5.25.

That interface states element.systemLanguage attribute is a readonly SVGStringList that "Corresponds to attribute ‘systemLanguage’ on the given element".

Edge says the SVGStringList has only one value – the first langtag in the list of three.

The bug also exists in XMLSerializer. If an SVG doc is read and then serialized, multi-valued systemLanguage attributes become single-valued.


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

    • Hello,

      Thank you for providing this information about the issue. Unfortunately, this repro is not actionable because different browsers give different results. Specifically, Edge shows 1, Firefox shows 2 and Chrome shows 3. We will need a reduced sample which shows Edge is not following the standard.

      Best Wishes,
      The MS Edge Team

    • I quoted the standard as saying the SVGStringList should correspond to the systemLanguage attribute on the text#switchtest element. Since that value is “en-US, zh-Hans, zh-Hant” and the specification for the attribute is a comma separated list of langtags, the SVGStringList should have

      ssl.numberOfItems = 3
      ssl.getItem(0) = “en-US”
      ssl.getItem(1) = “zh-Hans”
      ssl.getItem(2) = “zh-Hant”

      That is all gleaned from the specification. I can see one looking at other implementations for confirmation/curiousity, but they are not normative.

      Furthermore, Edge incorrectly getting numberOfItems=1 with getItem(0)="en-US" shows that it has thrown away the two following langtags. My bug report stated one can read an SVG document into Edge (using xhr = new XMLHttpRequest) to get an XML document. One can then obtain a new XMLSerializer and xmlSerializer.serializeToString(xhr.responseXML). The resulting string will have changed


      That is, it has forced all systemLanguage attributes to be single valued. Edge is buggy.

      That means that Edge serialization is not idempotent. It has an obvious explanation that is consistent with the numberOfItems=1 bug above.

      Moreover, Chrome’s implementation is clearly broken because it is looking for a space-separated list. For the example above, Chrome gives

      ssl.getItem(0) = “en-US,”
      ssl.getItem(1) = “zh-Hans,”
      ssl.getItem(2) = “zh-Hant”

      Notice the commas at the end of the first two langtags. Commas are not a part of the langtag spec.

      It the text-element attribute is modified to delete the spaces, further parsing errors are revealed.

      For (no spaces in the attribute value), the list is not separated.


      Chrome’s implementation is clearly inconsistent and broken, and I’ve submitted a bug report to them. An obvious bug is that Chrome used the same parsing routine for the class attribute (which is a space-separated list).

      BTW, the SVG 1.1 (Second edition) specification gives an example that includes a space after the comma:

      See also non-normative where comma-separated list may have whitespace before or after the comma.

      On top of an inconsistent Chrome implmenation, if the three implementations are all different, that should not bring about a conclusion that the problem is "not actionable". It should make one realize that at least two out of three are not following the spec and drive one to study the spec. Put another way, each implementation has a 1/3 or less chance of following the spec.

      I haven’t tried the example on Firefox. Clearly numberOfItems=2 makes no sense at all. There are three language tags.

      If you want to reduce the sample, then delete the rect and other text elements. You could even eliminate the switch element. Maybe if you reduce the systemLanguage="en-US, zh-Hans, zh-Hant" to “en-US, zh-Hans” then both Chrome and Firefox will return numberOfItems=2, but such an effort is nonsense. Edge does not follow the spec. Period. It does not matter that other implementations are also busted.

    • Hmm. The text entry is dropping text with unmatched angle brackets

      The serializer is changing the multivalued attribute

      systemLanguage="en-US, zh-Hans, zh-Hant"



      The SVG 1.1 (2nd) spec has comma-space example with:

      systemLanguage="mi, en"

    • Microsoft Edge Team

      Changed Assigned To to “Travis L.”

    • It is worse – looking directly at the attribute shows the DOM was truncated.


      returns just "en-US".

    • Microsoft Edge Team

      Changed Status to “Confirmed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in