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

CSS prints 'Could not resolve' errors for custom controls

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • None

      In the ControlsFX side project that I work on I have some controls that still pump out a bunch of warnings to the console. Visually they look fine (as far as I can tell), and all the warnings come from trying to look up in modena.bss.

      Here's an example of the error message:

      Sep 11, 2013 8:02:30 AM javafx.scene.CssStyleHelper calculateValue
      WARNING: Could not resolve '-fx-text-base-color' while resolving lookups for '-fx-text-fill' from rule '*.toggle-button' in stylesheet jar:file:/C:/programming/netbeans/Java-FX/artifacts/sdk/rt/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss

      Here's a patch supplied by David that I have tested (and it works), and I have pushed this on his behalf:

      diff --git a/modules/graphics/src/main/java/javafx/scene/Node.java b/modules/graphics/src/main/java/javafx/scene/Node.java
      --- a/modules/graphics/src/main/java/javafx/scene/Node.java
      +++ b/modules/graphics/src/main/java/javafx/scene/Node.java
      @@ -8680,9 +8680,18 @@
                   // otherwise the styles this node uses will be incomplete (missing lookups, missing inherited styles, etc).
                   // find the top-most parent whose flag is REAPPLY and start from there, if there is one.
                   Parent _parent = getParent();
      - if(_parent != null && _parent.cssFlag == this.cssFlag) {
      - // TODO: danger of infinite loop here!
      - _parent.impl_processCSS();
      + Parent _topmostParent = null;
      + while(_parent != null) {
      + if (_parent.cssFlag == CssFlags.REAPPLY) {
      + _topmostParent = _parent;
      + }
      + _parent = _parent.getParent();
      +
      + }
      + // TODO: danger of infinite loop here!
      + if (_topmostParent != null) {
      + _topmostParent.impl_processCSS();
      + return;
                   }
       
                   // Match new styles if my own indicates I need to reapply

            jgiles Jonathan Giles
            jgiles Jonathan Giles
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: