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

Reduce node count in Controls by allowing a Skin to manipulate the Control's children and layout directly

    XMLWordPrintable

Details

    Description

      The idea behind this feature is to reduce the node count, in some cases spectacularly (such as cells in a TableView) by flattening the hierarchy by one Node in some cases. Presently every Skin must return a node that represents the visuals of the control. The Control takes that node and adds it as a child. During layout, the Control then resizes the Skin. In our implementation, we had to add some trickery (make control & SkinBase have the same id, style class) so that CSS styling works transparently.

      instead, we might be able to have a SkinBase in the javafx.scene.control package. This concrete implementation of Skin would have some special relationship with control, in which when you add children to SkinBase, it adds them into control, and when Control needs to be laid out, it will delegate to the SkinBase. Control would extend from Region. In this way, for some controls such as Label, we can omit the intermediate Region object in the hierarchy. This has the added benefit of allowing us to refine our CSS selector usage in Caspian such that we can do direct child selectors instead of ancestor selectors, which have very poor performance characteristics.

      Attachments

        Issue Links

          Activity

            People

              jgiles Jonathan Giles
              rbair Richard Bair (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: