Closed Bug 875294 Opened 11 years ago Closed 11 years ago

Implement menclose notation "updiagonalarrow"

Categories

(Core :: MathML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: fredw, Assigned: fredw)

References

()

Details

(Keywords: dev-doc-complete)

Attachments

(2 files, 1 obsolete file)

In order to implement the \cancelto command MathJax uses the nonstandard syntax 

    <menclose notation="updiagonalstrike" class="MJX-arrow">

and render it as an up "diagonal arrow". Unfortunately other MathML rendering engines won't draw the arrow head. I suggested to replace that by a new notation "updiagonalarrow" (the list of menclose notation is open-ended). I think it would be good to implement this notation in Gecko.

Note that MathJax will actually generate

    <menclose notation="updiagonalstrike updiagonalarrow">

for backwards compatibility with rendering engines that only support "updiagonalstrike". So Gecko should make "updiagonalarrow" override "updiagonalstrike".
(In reply to Frédéric Wang (:fredw) from comment #0)
> So Gecko should make "updiagonalarrow" override "updiagonalstrike".

If the arrow is drawn such that its shaft is the same as the strike, then no special case is required when the two occur together.  MathML notations are usually all drawn iirc.
(In reply to Karl Tomlinson (:karlt) from comment #1)
> If the arrow is drawn such that its shaft is the same as the strike, then no
> special case is required when the two occur together.  MathML notations are
> usually all drawn iirc.

Yes, I agree. I think I was more thinking about how menclose is handled in MathJax. That should not be a problem in Gecko.
Attached file testcase
Here is a test case. See also attachment 389368 [details] for a dynamic version where you can select the dimensions and notations.
Attachment #756937 - Flags: review?(karlt)
Comment on attachment 756937 [details] [diff] [review]
Patch V1

>+        rect.TopRight(),
>+        rect.TopRight() + gfxPoint(-w -.4*h, h - .4*w),

For a wide rect, this point may be more than e/2 above the top of rect, which can lead to parts not being invalidated correctly, on scrolling or selection, for example.
Attachment #756937 - Flags: review?(karlt) → review+
Attached patch Patch V2Splinter Review
OK, I modified the patch to limit the overflow by a maximum of e/2.

That preserves the shape of the arrow head in normal cases and that seems to be what MathJax HTML-CSS does too (but only for the y coordinates??).
Attachment #756937 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/dc78a3d303c8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
As I indicated on the MathJax issue, this does not work very well in RTL. See also discussion on the LaTeXML mailing list:
http://lists.jacobs-university.de/pipermail/project-latexml/2013-June/001379.html
Depends on: 963324
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: