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

Provide API to exclude parts of the SceneGraph from being processed by the CSS-Engine

XMLWordPrintable

    • Fix Understood

      There are situations a component/control developer wants portion of the SG below itself to skipped by the CSS-Engine. The following reasons come to my mind:
      * you have a very complex and deep scenegraph where parts are not shown to the user so processing those because of CSS-Changes might not make sense (eg detaching a TabPane with 100s of Tabs with Deep-Scenegraphs)
      * you want to rule out side-effects produced by incorrect/to global CSS-Selectors and/or you want to make sure that what your controls displays is not hacked via CSS (eg display a PDF)

      In Java8 there was the possibility to make impl_processCSS a no-op which is not possible anymore in Java9.

      I would propose the following API
      {code:java}
      private boolean cssSensitive = true;

      public boolean isCssSensitive() {
         return cssSensitive;
      }

      public void setCssSensitive(boolean cssSensitive) {
         if( this.cssSensitive != cssSensitive ) {
             this.cssSensitive = cssSensitive;
             if( cssSensitive ) {
                 reapplyCSS(); // or is applyCSS() not sure
             }
         }
      }
      {code}

      If I'd had a wish getting a package-scoped boolean field in JavaFX9 to make doProcessCSS() a no-op would provide me a way to carry over the performance improvements from Java8 to Java9

            aghaisas Ajit Ghaisas
            tschindl Tom Schindl
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: