Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121981

QtSvg parser does not handle nested svg elements correctly

    XMLWordPrintable

Details

    • b2d9b36c1 (dev), 5c9457dbd (6.6), 9bbcb7079 (tqtc/lts-6.5), 418e3b417 (tqtc/lts-6.2), 83abe305f (6.7)

    Description

      The SVG Tiny 1.2 standard specifies that nested <svg> elements are not allowed, and they should be treated as an unsupported elements

      https://www.w3.org/TR/SVGTiny12/intro.html#TermSVGDocumentFragment

       

      The parser does not handle this case well, because it stops parsing once it reaches the end of the first <svg> element. This means if an SVG file contains nested <svg> elements, the parser will stop in the middle, and mark it as done. 

      The two attached files can be used with the Svg Viewer to demonstrate this issue. The "struct-svg-203-t.svg" is from the SVG Tiny 1.2 test suite, where the "Revision 1.5" text is not printed.

      The other file is written by me, where the middle red rectangle is enclosed in an <svg> element, this causes the Svg viewer to skip displaying both the red and green rectangles.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hatemelkharashy Hatem ElKharashy
            hatemelkharashy Hatem ElKharashy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes