SummerOfCode/2012/DynamicMathML: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 3: Line 3:
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.
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. In my project, I intend to develop a full ''maction'' support in Mozilla MathML and fix known bugs, related with ''maction'' and Javascript.
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.  
 
In this project I intend to do several things. Firstly, I intend to develop a full maction support (for example, to implement 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's MathML demo pages are incomplete and out of date, so I want to update them to follow our current maction implementation and to use MathML syntax instead of HTML+CSS.
 
Finally, there are some things in MathML REC that are not clear and cases when Mozilla's implementation differs from the REC, e.g. [https://bugzilla.mozilla.org/show_bug.cgi?id=749044 bug 749044]. During this summer I plan to discuss these issues with MathML WG, fix them in Mozilla's MathML engine and possibly implement more features from the MathML spec.


==Project Goals==
==Project Goals==


*To implement the "tooltip" actiontype. "Tooltip" actiontype provides the ability to display a tooltip when the cursor is pointed over the expression.
*To implement the "tooltip" actiontype. "Tooltip" actiontype provides the ability to display a tooltip when the cursor is pointed over the expression. <br>[[https://bugzilla.mozilla.org/show_bug.cgi?id=544001 bug 544001]]
*To fix known maction bugs, such as [https://bugzilla.mozilla.org/show_bug.cgi?id=734729 734729], [https://bugzilla.mozilla.org/show_bug.cgi?id=739556 739556], [https://bugzilla.mozilla.org/show_bug.cgi?id=700440 700440] etc.
*To improve implementation of maction, fix known maction bugs. [[https://bugzilla.mozilla.org/show_bug.cgi?id=734729 bug 734729]][[https://bugzilla.mozilla.org/show_bug.cgi?id=748779 bug 748779]][[https://bugzilla.mozilla.org/show_bug.cgi?id=749044 bug 749044]][[https://bugzilla.mozilla.org/show_bug.cgi?id=544036 tracking bug 544036]]
*To verify that Javascript works well with MathML, report and fix related bugs (for example, [https://bugzilla.mozilla.org/show_bug.cgi?id=657279 657279]).
*To improve handling of attribute/child changes of MathML frames. [[https://bugzilla.mozilla.org/show_bug.cgi?id=734729 bug 734729]][[https://bugzilla.mozilla.org/show_bug.cgi?id=750169 bug 750169]][[https://bugzilla.mozilla.org/show_bug.cgi?id=744783 tracking bug 744783]]
*To rewrite MathML demo pages using REC syntax (this should be done after implementing "tooltip"). Currently, we have demo pages, but they use CSS and Javascript instead of maction.
*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"). [[https://bugzilla.mozilla.org/show_bug.cgi?id=700440 bug 700440]][[https://bugzilla.mozilla.org/show_bug.cgi?id=749103 bug 749103]]<br>[[https://bugzilla.mozilla.org/show_bug.cgi?id=585142 MathML demo pages tracking bug 585142]]
*To write reftests to compare dynamically generated MathML / static MathML.
*To write reftests to compare dynamically generated MathML / static MathML.


Line 20: Line 25:


==Weekly updates==
==Weekly updates==
===18/05 - 25/05===
===21/05 - 27/05===


This week I've been doing two things. I started to work on MathML tooltip implementation and started to work on [https://bugzilla.mozilla.org/show_bug.cgi?id=749044 bug 749044].  
This week I've been doing two things. I started to work on MathML tooltip implementation and started to work on [https://bugzilla.mozilla.org/show_bug.cgi?id=749044 bug 749044].  
Line 30: Line 35:


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.
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.
===28/05 - 03/06===
This week I was continuing my work on the MathML tooltip implementation and on [https://bugzilla.mozilla.org/show_bug.cgi?id=749044 bug 749044].
Investigation of the HTML tooltip implementation revealed that MathML tooltip can be implemented in browser.js simply by attaching the <math> element to the <tooltip> element that is shown. This will make code is browser.js a bit more complex, but I hope that UI reviewers will accept the code. Otherwise, I'll have to switch to other options, listed in my previous update.
I uploaded the patch to [https://bugzilla.mozilla.org/show_bug.cgi?id=749044 bug 749044] and now I'm waiting for a review. List of changes:
*Selection attribute on <maction> is now considered by default, i.e. when actiontype is unknown.
*MathML error is now generated when there is no actiontype attribute in <maction> element.
*MathML error is now generated when <maction> selection attribute is out of range (except in cases when actiontype attribute allows to ignore selection, e.g. statusline or tooltip).
*Fixed a bug when <maction> element could never throw a MathML error.
Also I updated my project summary, to give out some more information about the project. Next week I will continue to work on tooltip implementation, and if everything goes well, next week I could also work on MathML tooltip demo pages as well.
===04/06 - 10/06===
Another GSoC week has passed. During this week I was finishing work on previously mentioned bugs and starting to write Mochitest tests and demo pages for <maction> element. [https://bugzilla.mozilla.org/show_bug.cgi?id=749044 Bug 749044] was already pushed into the tree, but unfortunately some Android tests have failed. However, it needs only a small fix, which I will upload shortly. (''update'': patch is pushed into m-c)
I am sorry to announce that after an attempt to implement MathML tooltip we agreed to abandon this enhancement due to increased code complexity and security issues. For now only <mtext> tooltip will be supported, patch is already uploaded and is waiting for a review. I want to mention that MathML tooltip is not a MathML REC requirement:
''QUOTE'': "The renderer displays the first child. When the pointer pauses over the expression for a long enough delay time, the renderer displays a rendering of the message in a pop-up "tooltip" box near the expression. Many systems may limit the popup to be text, so the second child should be an mtext element in most circumstances. For non-mtext messages, renderers may provide a natural language translation of the markup if full MathML rendering is not practical, but this is not required." [[http://www.w3.org/TR/MathML3/chapter3.html#presm.maction Presentation Markup]]
Next week I am going to finish my work on [https://bugzilla.mozilla.org/show_bug.cgi?id=544001 bug 544001], write Mochitest tests and update MathML demo pages according to our current syntax.

Latest revision as of 19:03, 13 June 2012

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.

In this project I intend to do several things. Firstly, I intend to develop a full maction support (for example, to implement 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's MathML demo pages are incomplete and out of date, so I want to update them to follow our current maction implementation and to use MathML syntax instead of HTML+CSS.

Finally, there are some things in MathML REC that are not clear and cases when Mozilla's 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's MathML engine and possibly implement more features from the MathML spec.

Project Goals

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

21/05 - 27/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.

28/05 - 03/06

This week I was continuing my work on the MathML tooltip implementation and on bug 749044.

Investigation of the HTML tooltip implementation revealed that MathML tooltip can be implemented in browser.js simply by attaching the <math> element to the <tooltip> element that is shown. This will make code is browser.js a bit more complex, but I hope that UI reviewers will accept the code. Otherwise, I'll have to switch to other options, listed in my previous update.

I uploaded the patch to bug 749044 and now I'm waiting for a review. List of changes:

  • Selection attribute on <maction> is now considered by default, i.e. when actiontype is unknown.
  • MathML error is now generated when there is no actiontype attribute in <maction> element.
  • MathML error is now generated when <maction> selection attribute is out of range (except in cases when actiontype attribute allows to ignore selection, e.g. statusline or tooltip).
  • Fixed a bug when <maction> element could never throw a MathML error.

Also I updated my project summary, to give out some more information about the project. Next week I will continue to work on tooltip implementation, and if everything goes well, next week I could also work on MathML tooltip demo pages as well.

04/06 - 10/06

Another GSoC week has passed. During this week I was finishing work on previously mentioned bugs and starting to write Mochitest tests and demo pages for <maction> element. Bug 749044 was already pushed into the tree, but unfortunately some Android tests have failed. However, it needs only a small fix, which I will upload shortly. (update: patch is pushed into m-c)

I am sorry to announce that after an attempt to implement MathML tooltip we agreed to abandon this enhancement due to increased code complexity and security issues. For now only <mtext> tooltip will be supported, patch is already uploaded and is waiting for a review. I want to mention that MathML tooltip is not a MathML REC requirement:

QUOTE: "The renderer displays the first child. When the pointer pauses over the expression for a long enough delay time, the renderer displays a rendering of the message in a pop-up "tooltip" box near the expression. Many systems may limit the popup to be text, so the second child should be an mtext element in most circumstances. For non-mtext messages, renderers may provide a natural language translation of the markup if full MathML rendering is not practical, but this is not required." [Presentation Markup]

Next week I am going to finish my work on bug 544001, write Mochitest tests and update MathML demo pages according to our current syntax.