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

Rule added to an already loaded CSS file have no effect when loaded in a new Scene

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx2.1
    • fx2.0
    • javafx
    • Mac and Windows.

      This is VT specific. I attached a testcase that shows it all.
      - Update the path to the 2 CSS in App.java.
      - Run the project
      - Click on the button to update the CSS. It has the effect to add some rules to the loaded CSS file, then start a new Stage+scene.
      - In the new Stage, the Rectangle is Blue, it should be Chartreuse.
      - Close the project. Relaunch it, you will see that the Rectangle is Chartreuse.

      In The VT, when previewing an FXML document, we are creating a new Stage+Scene and makes the scene to load the CSS files that were already loaded by the VT.
      These CSS files could have been edited post load in the VT.In such case, the added rules have no effect.

      It seems that there is some URI caching bad side effect somewhere...

      To workaround the problem, I am copying the CSS files to some tmp file and make the new scene to load them. In this case, the CSS is fully applied.

            dgrieve David Grieve
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: