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

CSS: we can't set border of separator

      To reproduce run following code



      import javafx.application.Application;
      import javafx.scene.Parent;
      import javafx.scene.Scene;
      import javafx.scene.control.Separator;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class SeparatorBorder extends Application {

          public static void main(String[] args) {
              launch( args);
          }

          private Parent getContent() {
              VBox box = new VBox(10);
              Separator separator=new Separator();
              separator.setStyle("-fx-border-color:red; -fx-border-width: 2;");
              box.getChildren().add(separator);
              return box;
          }

          public void start(Stage stage) {
              stage.setX(100);
              stage.setY(100);
              stage.setWidth(300);
              stage.setHeight(300);
              Scene scene = new Scene(getContent());
              stage.setScene(scene);
              stage.setVisible(true);
          }
      }

          [JDK-8114536] CSS: we can't set border of separator

          verified in b39

          Andrey Nazarov (Inactive) added a comment - verified in b39

          Reopening this based on the comment that borders should be painted outside the content and padding, and should be added to the layout bounds of the node.

          See the illustration at the top the CSS spec: http://www.w3.org/TR/CSS2/box.html. We are currently drawing borders inside the padding edge, but it should be outside. A new API is being planned to support a r/o "insets" property, which combines the padding and border width. A new JIRA issue be filed for this work.

          Leif Samuelsson (Inactive) added a comment - Reopening this based on the comment that borders should be painted outside the content and padding, and should be added to the layout bounds of the node. See the illustration at the top the CSS spec: http://www.w3.org/TR/CSS2/box.html . We are currently drawing borders inside the padding edge, but it should be outside. A new API is being planned to support a r/o "insets" property, which combines the padding and border width. A new JIRA issue be filed for this work.

          verified in
          Product: javafx-2.0beta
          Platform: windows-i586
          Build-Number: 2334
          Build-ID: 2011-07-01_16-33-28

          Andrey Nazarov (Inactive) added a comment - verified in Product: javafx-2.0beta Platform: windows-i586 Build-Number: 2334 Build-ID: 2011-07-01_16-33-28

          According to css spec border should be rendered above content.

          Andrey Nazarov (Inactive) added a comment - According to css spec border should be rendered above content.

          This is not a bug.

          A separator consists of a one-pixel line, and since borders are painted inside a Control's bounds, it means that in this case the border is painted under the line and covered by it.

          To make the border visible, add a padding value such as "-fx-padding: 2;".

          Leif Samuelsson (Inactive) added a comment - This is not a bug. A separator consists of a one-pixel line, and since borders are painted inside a Control's bounds, it means that in this case the border is painted under the line and covered by it. To make the border visible, add a padding value such as "-fx-padding: 2;".

          > Leif - do you want to own this?

          Sure.

          Leif Samuelsson (Inactive) added a comment - > Leif - do you want to own this? Sure.

          Leif - do you want to own this?

          Jonathan Giles added a comment - Leif - do you want to own this?

          Affected tests:
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_INSET
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_STYLE_DASHED
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_STYLE_DOTTED
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_WIDTH
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_WIDTH_dashed
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_WIDTH_dotted
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_NO_REPEAT
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_REPEAT_X
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_REPEAT_Y
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_ROUND
          FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_SPACE

          Andrey Nazarov (Inactive) added a comment - Affected tests: FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_INSET FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_STYLE_DASHED FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_STYLE_DOTTED FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_WIDTH FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_WIDTH_dashed FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_BORDER_WIDTH_dotted FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_NO_REPEAT FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_REPEAT_X FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_REPEAT_Y FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_ROUND FXCssAutomated/test/css/controls/functional/SeparatorCssTest/Separators_IMAGE_BORDER_SPACE

            leifs Leif Samuelsson (Inactive)
            anazarov Andrey Nazarov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: