SummerOfCode/2012/DynamicMathML
Project Summary
The ability for Web authors to make dynamic pages is important and was requested by many users. In the case of MathML it allows such things as writing interactive pages, i.e. math quiz or similar. For the simplest interactions, the MathML specification provides the maction element, which is partially implemented in Mozilla's MathML engine.
However, Mozilla's maction implementation has several bugs/spec violations and some features asked by users such as the tooltip actiontype are not still implemented. Similarly, the rendering of MathML formulas created by Javascript is not always updated correctly. This is problematic, for example to render the MathML code generated by the MathJax library.
This project consists of several parts. Firstly, I intend to develop a full maction support (for example, implementing the tooltip actiontype) and to fix known maction bugs. I intend to write tests for maction and dynamic MathML rendering in general to reveal previously unknown bugs and make the implementation more reliable. Also Mozilla MathML demo pages are incomplete and out of date, so I want to update them to follow our current maction implementation and using MathML syntax instead of HTML+CSS.
Finally, there are some things in MathML REC that are not clear or cases when Mozilla implementation differs from the REC, e.g. bug 749044. During this summer I plan to discuss these issues with MathML WG, fix them in Mozilla MathML implementation and possibly implement more features from the MathML spec.
Project Goals
- To implement the "tooltip" actiontype. "Tooltip" actiontype provides the ability to display a tooltip when the cursor is pointed over the expression.
[bug 544001] - To improve implementation of maction, fix known maction bugs. [bug 734729][bug 748779][bug 749044][tracking bug 544036]
- To improve handling of attribute/child changes of MathML frames. [bug 734729][bug 750169][tracking bug 744783]
- To verify that Javascript works well with MathML, report and fix related bugs.
- To rewrite MathML demo pages using MathML REC syntax (this should be done after implementing "tooltip"). [bug 700440][bug 749103]
[MathML demo pages tracking bug 585142] - To write reftests to compare dynamically generated MathML / static MathML.
Work done before the coding period
- maction statusline syntax was changed to follow MathML specification. [Gecko-specific notes][bug 729924]
- Fixed the bug related to maction selection attribute. According to MathML spec, it should be taken into account only with actiontype toggle. [bug 739556]
- Detected and fixed the bug when dynamic change of the maction actiontype attribute didn't work. [bug 745535]
Weekly updates
18/05 - 25/05
This week I've been doing two things. I started to work on MathML tooltip implementation and started to work on bug 749044.
It seems that there are 3 options for tooltip implementation:
- First option is implementing it using tooltip implementation in browser.js (and also mirrored here). The problem with this option may be that this part of the code is marked as temporary, and I don't know if I can modify it. Now I am trying to contact UI team to find it out.
- Second option is about modifying mathml.css file, similar to this implementation (maction is in the bottom). The advantage of this implementation is that it allows to implement both text and MathML messages, but the disadvantage is that we will get the message in the top right corner instead of placing it near the object.
- Finally, the third option is implementing tooltip using XUL tooltip implementation. I haven't quite considered this option, so I just leave it for now.
Along with the tooltip, I am also working with bug 749044, which is a regression from bug 739556, where I fixed an issue related to maction selection attribute. By MathML REC it shouldn't be taken into account when actiontype="statusline" or "tooltip". This was done in the patch, but the behavior of the unknown actiontype was implemented improperly. There was some discussion in the MathML list, and though there was no answer from MathML WG yet, we think that selection attribute should be considered by default.