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

Empty quoted string not parsed correctly as property value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 1.5
    • None
    • CSS
    • None
    • Operating System: All
      Platform: All

    Description

      The following ruleset does not parse:

      { page: ""; }

      The empty, quoted string seems not to be parsed properly. It works when the string contains at
      least one character.

      My local, uninformed quick fix to the problem is to change

      -code-
      protected int string2() throws IOException {
      nextChar();
      start = position - 1;
      -code-

      to

      -code-
      protected int string2() throws IOException {
      start = position;
      -code-

      to not read one unchecked character from the input before it is checked against specials in
      org.apache.batik.css.parser.Scanner.string2() .

      Please note that I only had a look at the code for about 30 minutes (to find that place) and applied
      that change locally as a quick fix. I have neither tested it against test suites nor any other situation
      than my example above.

      The CSS2.1 grammar seems to allow completely empty strings due to the rule

      string1 \"(\t !#$%&(-~|

      {nl}

      |\'|

      {nonascii}

      |

      {escape}

      )*\"

      A similar fix should probably be applied to string1().

      Regards, Christian

      Attachments

        Activity

          People

            batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
            roth@visualclick.de Christian Roth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: