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

Better "auto" implementation for CSS "-fx-background-size"

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • fx2.0
    • javafx
    • None

      Currently JavaFX uses the image's intrinsic size if no height value is specified (or auto). This implementation does meet the CSS 3 specification on background size in (Section 3.9 of http://www.w3.org/TR/css3-background/). However it is better to support "auto" by using the image's intrinsic ratio and the size of the other dimension, and we can file a new feature request to do this. As for now, there is a relative easy way to what user want, ie. specify both width and height dimension. (See RT-14454 for details)

      Section 3.9:

          "The first value gives the width of the corresponding image, the second value its height. If only one value is given the second is assumed to be 'auto'.

          A percentage is relative to the background positioning area.

          An 'auto' value for one dimension is resolved by using the image's intrinsic ratio and the size of the other dimension, or failing that, using the image's intrinsic size, or failing that, treating it as 100%.

          If both values are 'auto' then the intrinsic width and/or height of the image should be used, if any. If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.

          Negative values are not allowed."

            Unassigned Unassigned
            ckyang Chien Yang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported: