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

Region should support insets property that adds border and padding together

    Details

      Description

      Currently Region supports CSS styling based on the CSS Box model which allows padding and border attributes to be set via CSS (see http://www.w3.org/TR/css3-background/#introduction).

      However, the current Region implementation only factors padding into layout calculations; the border is simply drawn on top, which is not in line with the CSS specification. The border size + padding should be added together when computing the total insets around the content. If we delay fixing this to a future release, it will introduce a stylesheet incompatibility (suddenly any region with a border will become larger by the border's thickness). And the closer we follow the w3c CSS spec, the easier it will be for developers/designers coming from that space.

      To fix this we should add a read-only "insets" property to Region and modify all layout code to call getInsets() rather than getPadding().
      Currently read-only properties are problematic, so initially we can just provide the public getInsets() method and worry about adding the property support when its ready.

      The impact is roughly 2 days work in engineering/testing the change in javafx.scene.layout and 1-2 days to ensure the control skins access insets rather than padding.

      The only impact on SQE would be to modify tests where CSS borders are set, which should be minimal.

      Ensemble2 may need to update CSS to deal with the change where borders are set, but that should be minimal.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amfowler Anne Fowler (Inactive)
                Reporter:
                amfowler Anne Fowler (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: