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

CSS Parser stops parsing on bad rule and ignores subsequent rules

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.14
    • None
    • CSS
    • None

    Description

      A conforming CSS parser should ignore rules with values that are not understood.

      Batik's CSS parser instead throws an immediate exception, thereby terminating the parsing and skipping the rest of the rules in the relevant block. This leads to missed rules. 

      The parsing should instead collect all errors, and only report them after having processed the rest of the rules. 

      Note that the default behavior is to ignore CSS parsing errors, so this leads to silent rendering errors. 

      The attached example SVG contains: 

      <circle cx="1" cy="1" r="1" style="fill:#FF0000;text-align:this-value-doesnt-exist;fill:#00FF00;"/>

      In a conforming browser (e.g. Chrome, Firefox, Edge, ...) the circle renders green as directed by the last fill:#00FF00 statement.

      In batik it renders red as indicated by the first fill:#FF0000 - the last CSS statement is ignored due to the not understood "this-value-doesnt-exist" value for text-align. 

       

      Attachments

        1. SVG_Circle.svg
          0.2 kB
          Jxtps

        Activity

          People

            Unassigned Unassigned
            jxtps Jxtps
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: