blob: 3c2aeddf18b85c8f7242bb9f96d62c1b596f2229 [file] [log] [blame]
<!DOCTYPE HTML>
<title>The "systemLanguage" match the langtag of which the user's preferred language is prefix </title>
<link rel="help" href="https://www.w3.org/TR/SVG2/struct.html#ConditionalProcessingSystemLanguageAttribute">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<svg id="mysvg">
</svg>
<script>
test(() => {
testRunner.setAcceptLanguages("en");
var text1 = document.createElementNS('http://www.w3.org/2000/svg', 'text');
text1.setAttribute('systemLanguage', 'en-US');
text1.textContent = 'English-US';
var mysvg = document.getElementById("mysvg");
mysvg.appendChild(text1);
assert_greater_than(text1.getBoundingClientRect().width, 0);
testRunner.setAcceptLanguages("it");
mysvg.removeChild(text1);
text1.setAttribute('systemLanguage', 'ita');
mysvg.appendChild(text1);
assert_equals(text1.getBoundingClientRect().width, 0);
});
</script>