[MathML4] Removal of the menclose notation "radical"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[MathML4] Removal of the menclose notation "radical"

Frédéric WANG
Hi everybody,

Continuing on proposal for MathML4, there are two equivalent notations
for square roots:

* <msqrt> child1 child2 ... child3 </msqrt>
* <menclose notation="radical"> child1 child2 ... child3 </menclose>

The latter does not bring anything new but duplicate code or
inconsistencies in implementation. In WebKit, the msqrt and mroot
elements share implementation and menclose@radical was implemented by
creating anonymous nodes. In the past, this kind of implementation has
led to rendering, performance and design/security issues. During phase 1
of our refactoring [1], we thus removed support for menclose@radical. In
Gecko, the msqrt and menclose elements share implementation but then
mroot has duplicate logic, which is bad and Gecko should probably be
aligned on WebKit here.

So we would like menclose@radical to be removed in future versions of
MathML (it is optional in MathML3 anyway). We expect this removal to be
safe for the users given that (except in examples and tests) msqrt is
always preferred over menclose@radical in math documents. The only
rationale for menclose@radical would be to write overlapping notations
(e.g. <menclose notation="radical circle horizontalstrike">) but again
we are not aware of any concrete use cases for that and it's always
possible to nest <msqrt> and <menclose> to get similar rendering without
overlapping notations.

Frédéric, for the Igalia Web Platform team

[1] https://trac.webkit.org/wiki/MathML/Early_2016_Refactoring




signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [MathML4] Removal of the menclose notation "radical"

Stephen Watt-3
Hi Frederic,

I don't see why there would be inconsistencies in implementation.   A reasonable developer would just have <msqrt> call the same code as <menclose notation="radical">.     

From a software engineering point of view, I would think it would make more sense to remove <msqrt>.   But from a "give the people what they think they want" point of view, I would think we need to keep it.

Stephen


On Tue, Jul 26, 2016 at 3:29 AM, Frédéric WANG <[hidden email]> wrote:
Hi everybody,

Continuing on proposal for MathML4, there are two equivalent notations
for square roots:

* <msqrt> child1 child2 ... child3 </msqrt>
* <menclose notation="radical"> child1 child2 ... child3 </menclose>

The latter does not bring anything new but duplicate code or
inconsistencies in implementation. In WebKit, the msqrt and mroot
elements share implementation and menclose@radical was implemented by
creating anonymous nodes. In the past, this kind of implementation has
led to rendering, performance and design/security issues. During phase 1
of our refactoring [1], we thus removed support for menclose@radical. In
Gecko, the msqrt and menclose elements share implementation but then
mroot has duplicate logic, which is bad and Gecko should probably be
aligned on WebKit here.

So we would like menclose@radical to be removed in future versions of
MathML (it is optional in MathML3 anyway). We expect this removal to be
safe for the users given that (except in examples and tests) msqrt is
always preferred over menclose@radical in math documents. The only
rationale for menclose@radical would be to write overlapping notations
(e.g. <menclose notation="radical circle horizontalstrike">) but again
we are not aware of any concrete use cases for that and it's always
possible to nest <msqrt> and <menclose> to get similar rendering without
overlapping notations.

Frédéric, for the Igalia Web Platform team

[1] https://trac.webkit.org/wiki/MathML/Early_2016_Refactoring




Reply | Threaded
Open this post in threaded view
|

Re: [MathML4] Removal of the menclose notation "radical"

Frédéric WANG
Le 26/07/2016 à 14:06, Stephen Watt a écrit :
> I don't see why there would be inconsistencies in implementation.   A
> reasonable developer would just have <msqrt> call the same code as
> <menclose notation="radical">.    
It depends what you mean by "call the same code". Also note that mroot
has similar layout but some differences (more parameters for the index,
only two children and no inferred mrow).

In WebKit, msqrt & mroot share the same C++ class. In the past, the code
of msqrt was reused for menclose by creating anonymous nodes which
caused complaints from Google at the time they review it and will make
things even worse now that they are moving to stricter rules for their
layout classes. Fortunately menclose@notation was removed so it's no
longer an issue.

In Gecko, msqrt & menclose share the same C++ class. At the moment it
does not share code with mroot so there are duplicate logic which may
lead to potential inconsistencies.

Personally, I would say it's best to share msqrt / mroot implementations
as they have clear and simple rules to perform the layout. menclose has
many notations, must handle multiple notations at the same time and is
more complex, so merging it into msqrt (as done is Gecko) makes the code
less readable.

Frédéric

PS: Some developers will be happy to know that they are "unreasonable":
https://github.com/mathjax/MathJax/issues/101



signature.asc (836 bytes) Download Attachment