Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1042

Batik requires 'splitText' to have a parent node

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Linux, SL/RHEL 6, Java 1.6.0_24

      Description

      'splitText' fails and throws an exception ("A text node needs a parent node in order to be split") when the text node is created directly in 'document'. It doesn't appear to be a requirement of 'splitText' that it should be lower down in the DOM. This isn't an issue in Chrome, Firefox, Safari, Opera, and IE9+.

      This code works in the 5 major browsers, but fails in squiggle (and fails silently in the rasteriser):

      var ltnode, rtnode;
      ...
      ltnode = svg_doc.createTextNode(input); // 'svg_doc' is 'document'
      while(1)

      { sindx = ltnode.nodeValue.indexOf(" ", 1); if(sindx < 0) finished = true; // no more spaces; 'ltnode' is the last word else rtnode = ltnode.splitText(sindx); // squiggle throws exception ... }

      When the exception is thrown, the debugger shoes 'svg_doc' as 'org.apache.batik.dom.svg.SVGOMDocument'. The Chrome debugger shows it as 'document' at the same point in execution.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              elavelle EL
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: