JDK-8331127 : WebView shows boxes if the html source code contains LF or CRLF
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: jfx17.0.11,jfx21.0.3,jfx22.0.1
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows
  • CPU: x86_64
  • Submitted: 2024-04-24
  • Updated: 2024-07-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx24Unresolved
Related Reports
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
I use a WebView that displays a web page. 
The HTML source code contains LF or CRLF. 
With JFX 21.0.3, a box is displayed at the position of the LF or CRLF in the WebView.
This is not the case with JFX 21.0.2.

I have no influence on the content of the website.
A browser (e.g. Chrome, Firefox) normalises this type of formatting and does not display a box. I would expect the WebView to do the same.

REGRESSION : Last worked in version 21

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the source code with the simple example.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No box should be displayed at the position of the LF or CRLF.
ACTUAL -
A box is displayed at the position of the LF or CRLF.

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebViewExample extends Application
{
	public WebViewExample()
	{
	}

	@Override
	public void start(Stage primaryStage)
	{
		WebView webView;
  	 	WebEngine webEngine;
  	 	String htmlContent;
  	 	StackPane root;
  	 	Scene  scene;

  	 	webView  = new WebView();
  	 	webEngine  = webView.getEngine();
  	 	htmlContent = "<html><body><p>test test\r\ntest test</p><body></html>";

  	 	webEngine.loadContent(htmlContent);

  	 	root = new StackPane();
  	 	root.getChildren().add(webView);

  	 	scene = new Scene(root, 300, 200);

  	 	primaryStage.setScene(scene);
  	 	primaryStage.setTitle("WebView Example");
  	 	primaryStage.show();
	}

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

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

FREQUENCY : always



Comments
Checked with attached testcase in Windows 11, issue is reproducible and is a regression. Test Result ========= jfx11.0.23: Pass jfx17.0.10: Pass jfx17.0.11: Fail<-Regression jfx21.0.2: Pass jfx21.0.3: Fail<-Regression jfx22: Pass jfx22.0.1: Fail<-Regression jfx23ea12: Fail
25-04-2024

Based on when it started failing, this regression is introduced by the update to WebKit 617.1, JDK-8318614.
25-04-2024