Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8128890

CSSParser sensitive to empty statements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.1
    • fx2.0
    • javafx
    • None

      By accident I terminated a background color attribute with not one but two semicolons, and the parser was kind enough to log this error:

      WARNING: com.sun.javafx.css.parser.CSSParser parse Expected RBRACE at file:/Users/randahl/Dropbox/Development/wefend/ui/target/classes/styling/wefend.fhd.css[35,5]

      That is all fine and helpful, however what surprised me was that this single semicolon completely trashed my whole UI - the whole app was styled in a weird looking way I have never seen before. So, I am filing this to inform you that the current parser implementation really crashes completely over empty statements. Perhaps you would want to improve that, so that the parser just ignores them after logging the warning above.

      Here is the code that made the parser go crazy:

      .tool-button {
          -fx-background-insets: 0, 1;
          -fx-background-radius: 36, 35;
          -fx-padding: 0 0 0 0;
          -fx-alignment: CENTER;
          -fx-graphic-vpos: CENTER;
      -fx-background-color: linear-gradient(
      to bottom,
      rgb(170, 167, 152) 0%,
      rgb(207, 202, 195) 50%,
      rgb(251, 245, 223) 75%,
      rgb(255, 255, 255) 100%
      );; /* TWO SEMICOLONS HERE */
      }

            dgrieve David Grieve
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: