Project

Profile

Help

Bug #1483

closed

[Specific to Opera browser] The case of mixed case SVG elements, such as svg:textArea is not preserved

Added by Philip Fearon about 12 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
2012-04-19
Due date:
% Done:

100%

Estimated time:
Platforms:

Description

[Originaly reported by Manfred Staudinger]

When SVG elements are added to the DOM by a Saxon-CE XSLT transform, the name of the element, such as textArea is converted to all lower-case: textarea

Testing the same XSLT with Firefox showed the case of such SVG elements to be preserved.

To assess the underlying cause, the following HTML/JavaScript was used to emulate the behaviour of Saxon-CE to reproduce this issue:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>new stuff</title>
    <script type="text/javascript" language="javascript">
        function addSVG() {
            var el = document.createElementNS("http://www.w3.org/2000/svg", "svg:textArea");
            var newtext = document.createTextNode("This is a test");
            var sw = document.getElementsByTagNameNS("http://www.w3.org/2000/svg", "switch")[0];
            el.setAttribute("xmlns:svg", "http://www.w3.org/2000/svg");
            var newAtt = document.createAttribute("x");
            newAtt.nodeValue = "10";
            el.setAttributeNode(newAtt);
            newAtt = document.createAttribute("y");
            newAtt.nodeValue = "10";
            el.setAttributeNode(newAtt);
            newAtt = document.createAttribute("height");
            newAtt.nodeValue = "50";
            el.setAttributeNode(newAtt);
            newAtt = document.createAttribute("width");
            newAtt.nodeValue = "50";
            el.setAttributeNode(newAtt);
            el.appendChild(newtext);
            sw.insertBefore(el, null);
            return "done";
        }
    </script>
</head>
<body>
    <h1>
        A test reproducing the issue of textArea being converted to svg:testarea by Opera</h1>
    <svg id="abc" xmlns="http://www.w3.org/2000/svg" version="1.2">
<switch></switch>
</svg>
    <div id="result">
        <p onclick="addSVG()">
            Result text</p>
    </div>
</body>
</html>

With this test, svg:textArea is converted to svg:textarea by Opera (as shown by inspecting the DOM). Removing the 'svg' prefix from the created element, resulted in the case of the element being preserved.

The HTML5 specification doesn't support the use of such prefixes, instead the SVG namespace should be declared as the default namespace for top level SVG elements embedded within HTML.

Saxon-CE has now been (for the next release) amended to conform to this spec when writing to the HTML or XHTML DOM - thus fixing the Opera issue at the same time.

Actions #1

Updated by Philip Fearon almost 12 years ago

  • Fixed in version set to Beta 0.2
Actions #2

Updated by Philip Fearon almost 12 years ago

  • Sprint/Milestone set to Beta 0.2
Actions #3

Updated by O'Neil Delpratt about 11 years ago

  • Status changed from Resolved to Closed
  • Fixed in version changed from Beta 0.2 to 1.0

Fixed in Saxon-CE version 1.0

Actions #4

Updated by O'Neil Delpratt about 11 years ago

  • Sprint/Milestone changed from Beta 0.2 to Release 1.0
  • % Done changed from 0 to 100

Please register to edit this issue

Also available in: Atom PDF