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

[CSS] getUserAgentStylesheet() gets called too often causing lower performance

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8u40
    • javafx

      The method Region.getUserAgentStylesheet() gets called many times in the context of a (tree) table view. I noticed that my app calls it 1800 times before the UI is initially shown. If the method is overriden by a custom control and performs a resource lookup then the performance will degrade significantly.

      To test simply override getUserAgentStylesheet() of a tree table view like this:

                              int counter = 0;
      public String getUserAgentStylesheet() {
      System.out.println("method called " + (counter++));
      return super.getUserAgentStylesheet();
      }

      I would expect that this method gets called exactly once per custom control.

            jgiles Jonathan Giles
            dlemmermajfx Dirk Lemmermann (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: