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

Pressing ALT-RIGHT jumps two words instead of one word to the right in the HTMLEditor.

XMLWordPrintable

    • web
    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_172-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_172-ea-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 25.172-b03, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      macOS 10.12.6

      A DESCRIPTION OF THE PROBLEM :
      Pressing ALT-RIGHT, ALT-LEFT, ALT-SHIFT-RIGHT and ALT-SHIFT-LEFT should jump one word in the given direction. It works fine in Google Chrome and Safari and Java 1.8.0_144. But it doesn't work in 1.8.0_162 and 1.8.0_172. There it jumps two words instead.

      REGRESSION. Last worked in version 8u151

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Enter text, e.g. "This is a test." into an HTMLEditor. Then place the cursor e.g. at the beginning and press ALT-RIGHT.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The cursor should jump to the end of "This", i.e. the cursor should be after "This".
      ACTUAL -
      The cursor jumps to the end of "is", i.e. it is after "is". The cursor jumped two words instead of one.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Controller implements Initializable {
          public HTMLEditor htmlEditor;

          @Override
          public void initialize(URL location, ResourceBundle resources) {
              htmlEditor.setHtmlText("<html>\n" +
                      "<head>\n" +
                      " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n" +
                      "</head>\n" +
                      "<body style=\"font-family: san-serif\">\n" +
                      "<p>This is a test.</p>\n" +
                      "</body>\n" +
                      "</html>");
          }

          public void onPrintConsole(ActionEvent actionEvent) {
              System.out.println(htmlEditor.getHtmlText());
          }
      }

      and

      <BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="433.0" prefWidth="671.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.bug4_htmleditor.Controller">
         <center>
            <HTMLEditor fx:id="htmlEditor" />
         </center>
         <bottom>
            <ToolBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
              <items>
                <Button mnemonicParsing="false" onAction="#onPrintConsole" text="Print to console" />
              </items>
            </ToolBar>
         </bottom>
      </BorderPane>

      ---------- END SOURCE ----------

        1. Controller.java
          0.8 kB
          Priyanka Mangal
        2. fxml.fxml
          0.9 kB
          Priyanka Mangal
        3. Main.java
          0.6 kB
          Priyanka Mangal

            pmangal Priyanka Mangal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: