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

CSS pseudo class state inconsistent for TreeCell and TreeTableRow with null item

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8, openjfx11, openjfx16
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:

      Description

      This is a follow-on to JDK-8089913 that was discovered during the code review.

      TreeCell and TreeTableRow are constructed with a null TreeItem, and no pseudo-class state for "collapsed" or "expanded". An item is set on a cell, will correctly update the pseudo-class state to set exactly one of "collapsed" or "expanded". Setting the item back to null will not remove the previously set pseudo-class. This should probably be changed to either:

      A. remove any pseudoclass when the item is set to null, or
      B. set the :collapsed pseudoclass and remove the :expanded pseudoclass when the item is set to null.

      I don't know whether it matters in practice, since an application doesn't directly manage the creation of the cells (other than by providing a cell factory) or setting the item. The pseudo-class state of the cell is a proxy for the item it points to. Ideally, it would only contain the "empty" state if the item is null, but given that such a cell would never be rendered it would be hard to point to something that doesn't work as a result.

      See the discussion in https://git.openjdk.java.net/jfx/pull/413 for more information.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aghaisas Ajit Ghaisas
              Reporter:
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: