Skip to content

Cursor not displayed in <mi> with only one character. #1

@scientificware

Description

@scientificware

The purpose of this issue is to solve problems with MathML <mi> element and caret when contains only one character.

This is tracked in WebKit Bugzilla Stream as

Status :

Description Understood Patch Writing Internal Tests Pull Resqueted Accepted
✔️ ✔️ 🚧

?

Description : Cursor disappears in <mi> token when the identifier name has only one character. If the name of the identifier is longer than 1 character, the cursor appears normaly. Note : in W3C description, The default font style should (typically) be "normal" (non-slanted) unless the content is a single character, in which case it should be "italic". This not occurs in <mn> and <mo>.

Understood : La capture d'écran et l'arbre ci-dessous confirme que l'implémentation de MathML casse l'algorithme d'affichage de WebCore.
En particulier, pour l'algorithme MathML courcircuite celui de WebCore d'où les problèmes rencontrés sur OpenJFX pour l'affichage du curseur.

  • Si <mi> contient un seul caractère, c'est l'algorithme MathML qui s'occupe de la représentation du contenu. C'est pour suivre les spécifications de MathML. Mais l'implémentation n'est pas correcte du point de vue de WebCore et le curseur n'est pas affiché.
  • Si <mi> contient plus d'un caractère, c'est l'algorithme WebCore normal qui s'occuper de l'affichage. Le curseur est affiché correctement.

Screenshot_20220730_204646

<html>
   <head>
      <meta charset=\"UTF-8\">
      <title>Petite démonstration de JavaFW et MathML.</title>
   </head>
<style>
 #html{ height: 100%;}"
 #body{ height: 100%;} "
</style>
   <body>
      <p>Ce texte comprenant du code MathML est affiché avec l'éditeur HTML de JavaFX</p>
      <p>
         <math>
            <mrow>
               <msup><mi>m</mi><mn>1</mn></msup>
               <mo>+</mo>
               <msup><mi>mby</mi><mn>23</mn></msup>
               <mo>=</mo>
               <msup><mi>pcz</mi><mn>456</mn></msup>
            </mrow>
         </math>
      </p>
      ...
   </body>
</html>
├─ RenderView (false)
│     ├─ RenderBlowFlow (false)
│     │     ├─ RenderBlowFlow (false)
│     │     │     ├─ RenderBlowFlow (false)
│     │     │     │     ├─ RenderText (false) ⟷  [Ce texte comprenant du code MathML est affiché avec l'éditeur HTML de JavaFX]
│     │     │     ├─ RenderBlowFlow (false)
│     │     │     │     ├─ RenderMathMLMath (false)
│     │     │     │     │     ├─ RenderMathMLRow (false)
│     │     │     │     │     │     ├─ RenderMathMLScripts (false)
│     │     │     │     │     │     │     ├─ RenderMathMLToken (false)
│     │     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [m]
│     │     │     │     │     │     │     ├─ RenderMathMLToken (false)
│     │     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [1]
│     │     │     │     │     │     ├─ RenderMathMLOperator (false)
│     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [+]
│     │     │     │     │     │     ├─ RenderMathMLScripts (false)
│     │     │     │     │     │     │     ├─ RenderMathMLToken (false)
│     │     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [mby]
│     │     │     │     │     │     │     ├─ RenderMathMLToken (false)
│     │     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [23]
│     │     │     │     │     │     ├─ RenderMathMLOperator (false)
│     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [=]
│     │     │     │     │     │     ├─ RenderMathMLScripts (false)
│     │     │     │     │     │     │     ├─ RenderMathMLToken (false)
│     │     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [pcz]
│     │     │     │     │     │     │     ├─ RenderMathMLToken (false)
│     │     │     │     │     │     │     │     ├─ RenderBlockFlow (anonymous) (false)
│     │     │     │     │     │     │     │     │     ├─ RenderText (false) ⟷  [456]
│     │     │     │     ├─ RenderText (false) ⟷  [      ]
│     │     │     ├─ RenderBlowFlow (false)
│     │     │     │     ├─ RenderListItem (false)
│     │     │     │     │     ├─ RenderListMarker (false)
│     │     │     │     │     ├─ RenderText (false) ⟷  [Version de Java.. : 17.0.3+7-jvmci-22.1-b06]
│     │     │     │     ├─ RenderListItem (false)
│     │     │     │     │     ├─ RenderListMarker (false)
│     │     │     │     │     ├─ RenderText (false) ⟷  [Version de JavaFX : 19-internal+0-2022-07-26-073720]
│     │     │     │     ├─ RenderListItem (false)
│     │     │     │     │     ├─ RenderListMarker (false)
│     │     │     │     │     ├─ RenderText (false) ⟷  [OS .............. : Linux]
│     │     │     │     ├─ RenderListItem (false)
│     │     │     │     │     ├─ RenderListMarker (false)
│     │     │     │     │     ├─ RenderText (false) ⟷  [CPU ............. : amd64]
│     │     │     │     ├─ RenderListItem (false)
│     │     │     │     │     ├─ RenderListMarker (false)
│     │     │     │     │     ├─ RenderText (false) ⟷  [User Agent ...... : Mozilla/5.0 (Linux x86_64) AppleWebKit/613.1 (KHTML, like Gecko) JavaFX/19 Safari/613.1]

https://github.com/mathml-refresh/mathml/issues/211

Metadata

Metadata

Labels

BugSomething isn't workingWIPWork In Progress

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions