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

[Linux] Pasting HTML from Firefox does not work

XMLWordPrintable

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


      ADDITIONAL OS VERSION INFORMATION :
      Linux 3.13.0-61-generic #100-Ubuntu SMP Wed Jul 29 11:21:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Using Firefox 39.0

      A DESCRIPTION OF THE PROBLEM :
      When copying text in Firefox and then pasting it into a JavaFX Node the String returned from Clipboard.getSystemClipboard().getHtml() is garbage.
      Can be tested with the HTMLEditor class.

      Copying the same content into OpenOffice Writer works as expected.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a simple Application containing only a HTMLEditor() instance and copy & paste content from
      a Webpage openend in Firefox.

      public class CopyAndPasteTest extends Application
      {
      @Override
      public void start(Stage primaryStage) throws Exception {
      primaryStage.setScene(new Scene(new HTMLEditor()));
      primaryStage.setTitle("Copy & Paste Data from Firefox");
      primaryStage.show();
      }
      }


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Text selected and copied in Firefox should be shown in the HTMLEditor after pasting.
      The text should be styled as shown in Firefox.
      ACTUAL -
      Illegible Characters are pasted into HTMLEditor, e.g. "ÿþ<"

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.web.HTMLEditor;
      import javafx.stage.Stage;

      public class CopyAndPasteTest extends Application
      {
      @Override
      public void start(Stage primaryStage) throws Exception {
      primaryStage.setScene(new Scene(new HTMLEditor()));
      primaryStage.setTitle("Copy & Paste Data from Firefox");
      primaryStage.show();
      }
      }


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

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: