JDK-8274104 : Unnecessary squares are added when rendering surrogate pair characters in WebView
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: openjfx18
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2021-09-14
  • Updated: 2021-09-27
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
openjfx18Unresolved
Description
ADDITIONAL SYSTEM INFORMATION :
macOS BigSur 11.5.2
OpenJDK 11.0.12
OpenJFX 18 ea

A DESCRIPTION OF THE PROBLEM :
OpenJFX 18(ea)'s WebView may not work correctly with gradient fill. this problem does not occur in OpenJFX 17.

The impact of this problem is considered to be large, and if you are using WebView, it will be a factor that prevents you from upgrading to 18.

**************
(I apologize, but please correct the reproduced environment in another bug report I filed earlier: the version number where the problem occurs in the bug report for the Fill Gradation problem in WebView was wrong. Please make it match the number in this report)

* OpenJFX17 -> OpenJFX 18(ea)
* OpenJFX16 -> OpenJFX 17
***************

The following experimental results suggest that the problem is caused by changes in the Native code, not the Java code.

I was able to avoid this problem by simply replacing it with the libwebkit.dylib file built with the snapshot of 2021-05-05 in my development environment.

Looks like the effect of one of the following three changes, possibly 8268849.

* 2021/8/17 - 8272329: Cherry pick GTK WebKit 2.32.3 changes
* 2021/7/14 - 8268849: Update to 612.1 version of WebKit 
* 2021/6/23 - 8268915: WebKit build fails with Xcode 12.5





STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Launch the attached test application.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The rendering of the attached HTML file matches the web browser.
ACTUAL -
Unnecessary squares are added to characters.

---------- BEGIN SOURCE ----------
import java.net.URI;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebSurrogatePairTest extends Application{

	@Override
	public void start(Stage primaryStage) throws Exception {

		WebView webView = new WebView();
		BorderPane root = new BorderPane(webView);
		Scene scene = new Scene(root, 900, 800);
		
		URI uri = this.getClass().getResource("/test-surrogate.html").toURI();

		webView.getEngine().load(uri.toURL().toString());

		
		primaryStage.setScene(scene);
		primaryStage.show();
	}
	
	public static void main(String[] args) {
		Application.launch(args);
	}
}


------------

<html>
<head>
<meta charset="utf-8"/>
<style>
</style>
</head>
<body>
  <table style="border:1px solid black">
   <tbody>
    <tr>
     <td>U+2000B<br>𠀋</td>
     <td>U+2123D<br>𡈽</td>
     <td>U+2131B<br>𡌛</td>
     <td>U+2146E<br>𡑮</td>
     <td>U+218BD<br>𡢽</td>
     <td>U+20B9F<br>𠮟</td>
     <td>U+216B4<br>𡚴</td>
     <td>U+21E34<br>𡸴</td>
     <td>U+231C4<br>𣇄</td>
     <td>U+235C4<br>𣗄</td>
    </tr>
   </tbody>
  </table> 
</body>
</html>
---------- END SOURCE ----------

FREQUENCY : always



Comments
Also reproduces with 2.32.4 upgrade
27-09-2021

Checked with attached testcase in Windows 10, issue is reproducer in openjfx 18ea, < attached screen short for reference> Test Result ========= openjfx11: Pass openjfx16: Pass openjfx17: Pass openjfx18ea2: Fail <--Regression.
21-09-2021