javafxports / openjdk-jfx

The openjfx repo has moved to:
https://github.com/openjdk/jfx
GNU General Public License v2.0
1.01k stars 145 forks source link

JavaFX and MathML. #71

Closed scientificware closed 6 years ago

scientificware commented 6 years ago

The purpose of this issue is to repair MathML display in WebView.

When I discovered that JavaFX could manage MathML, I also discovered that it was buggy. Becauseof MathML is rendered with WebKit, I compared with other WebKit based web browsers. I also noticed that since 2016 that those web browser make good progress with MaltML display. First I thought that the differences were due to outdated WebKit version used by JavaFX but last releases, with an uptodate WebKit version, show that the problem is the same.

I contacted F. Wang from Igalia who worked to port or improve MathML support in FireFox and later in WebKit. He confirms that it was a bug in JavaFX not in WebKit witch displays MathML correctly.

As he suggested me, I wrote to the JavaFX mailing list and had a short discussion about this issue on OpenJDK.Java.net :

http://mail.openjdk.java.net/pipermail/openjfx-dev/2017-December/021112.html https://bugs.openjdk.java.net/browse/JDK-8147476

So, as suggested by mainteners, I'm trying to find by myself what's wrong with MathML in javaFX HTMLEditor.

I tested all applications with Mozilla MathML Torture Test (https://developer.mozilla.org/fr/docs/Mozilla/MathML_Project/MathML_Torture_Test)

Could someone help me ?

scientificware commented 6 years ago

Problems with Windows CR when editing files.

Definitively stays on linux when working on GitHub OpenJFX project.

vbox_logo2_gradient

scientificware commented 6 years ago

Kevin comment

For ease of review, to address Arun's concern, can you please squash your commits into a single commit ? You should do this on your existing branch (meaning you will need to use git push --force after you squash it), so that you don't need a new PR. If you are worried about losing information, you can create a new local branch to save all of your commits.

Presuming you have an upstream remote pointing to javafxports/openjdk-jfx called 'upstream" the basic recipe is :

git fetch upstream
// this will put you into an editor where you can select which commits are squashed
git rebase -i upstream/develop

and then change the pick to squash in your editor for all commits except the first one (leaving that first commit as 'pick') like this :

But I prefered to use rewrote and fixup.

reword 78bf9df Bug JDK-8147476, commit of the following:
fixup 47d9135 Update FontJava.cpp
fixup 91023c1 Update FontJava.cpp
fixup 2c89846 Update FontJava.cpp
...

Alternatively, if you use a GUI front-end to git there will be options to allow you to squash the commits into a single commit.

kevinrushforth commented 6 years ago

As long as the end result is the same, you can use any method you like. My suggestion was just an example of one way to do it.

scientificware commented 6 years ago

Thank you very much Kevin. Sure I would never succed without this and would be still stuck with Git :-) I feel better this morning. That was exactly what I needed. I'm writing a "How to" and a notes for me. So I post here all helps and suggestions that you and your team gave. And of course all you teached me. With comments for future. I'll hope it will be helpfull for someone else.

scientificware commented 6 years ago

To execute all web test gradle :web:test

To render only MathMLRenderTest gradle :web:test --tests MathMLRenderTest gives :

...

scientificware commented 6 years ago

Something new ? Yes, Unified Source. The announce :

Follow this link to understand :

scientificware commented 6 years ago

Can't build WebCore with WebKit 606.1. And a problem with gradle : can't clean ? May be because I disable java 9 ?

Resolved : In fact a problem with ant.

=================================================================== WebKit is now built (1h:09m:04s). To run FXLauncher with this newly-built code, use the "../../src/main/native/Tools/Scripts/run-minibrowser" script.

Task :web:compileJavaDOMBindingLinux Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :fxml:compileJava Note: /home/scientificware2016/Documents/openjdk-jfx-compile/modules/javafx.fxml/src/main/java/javafx/fxml/FXMLLoader.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :swing:compileJava Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL in 1h 13m 38s 124 actionable tasks: 124 executed

- [x] Build branch with MathML patch.

==================================================================== WebKit is now built (02m:58s). To run FXLauncher with this newly-built code, use the "../../src/main/native/Tools/Scripts/run-minibrowser" script.

Task :web:compileJavaDOMBindingLinux Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL in 3m 37s 124 actionable tasks: 22 executed, 102 up-to-date

kevinrushforth commented 6 years ago

This was fixed some time ago by PR #117

scientificware commented 6 years ago

@kevinrushforth For a better MathML experience, a mathml.css comment suggests that at least one of these fonts must be installed (in order of preference).

Is it possible to indicate that to users somewhere in the documentation or elsewhere.

Before Latin Modern Math install : screenshot_20180830_235258

After Latin Modern Math install : the greek small letter PI is well rendered, better than with the default font. screenshot_20180831_013116