conditions-07.svg 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/publicdomain/zero/1.0/
  4. -->
  5. <svg id="svg-root" width="100%" height="100%"
  6. xmlns="http://www.w3.org/2000/svg"
  7. xmlns:xlink="http://www.w3.org/1999/xlink" onload="runtest()">
  8. <title>Test conditional processing DOM interface for foreignObject</title>
  9. <defs>
  10. <script>
  11. function runtest() {
  12. try {
  13. var f1 = document.getElementById("f1");
  14. var i0 = f1.systemLanguage.getItem(0);
  15. if(i0 != "x") {
  16. return;
  17. }
  18. f1.removeAttribute("systemLanguage");
  19. } catch(e) {
  20. var f = document.getElementById("fail");
  21. f.setAttribute("fill", "red");
  22. }
  23. }
  24. </script>
  25. </defs>
  26. <rect width="100%" height="100%" fill="lime"/>
  27. <!-- background images -->
  28. <rect x="100" y="100" width="100" height="100" fill="red"/>
  29. <!-- tests -->
  30. <foreignObject id="f1" x="100" y="100" width="100" height="100" systemLanguage="x">
  31. <svg>
  32. <rect width="100%" height="100%" fill="lime"/>
  33. </svg>
  34. </foreignObject>
  35. <rect id="fail" width="100%" height="100%" fill="none"/>
  36. </svg>