Refactor the MathML Operator Dictionary
Categories
(Core :: MathML, defect, P5)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox54 | --- | affected |
People
(Reporter: fwang, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: helpwanted, Whiteboard: [good second bug])
Attachments
(2 files)
Updated•8 years ago
|
Comment 1•8 years ago
|
||
| Reporter | ||
Comment 2•8 years ago
•
|
||
Comment 3•8 years ago
|
||
Comment 4•8 years ago
|
||
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
| Reporter | ||
Comment 9•8 years ago
|
||
Comment 10•8 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
| Reporter | ||
Comment 17•7 years ago
|
||
Thanks for working on this Tom (and Amir)!
Comment 18•4 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Updated•3 years ago
|
Comment 19•7 months ago
|
||
hey is this bug worth addressing? is there any new information since?
Comment 20•7 months ago
|
||
I think so, though at this point fred may have the details faster than me :)
| Reporter | ||
Comment 21•7 months ago
|
||
Yes, I believe this is still desired. The MathML operator dictionary is quite big so a statically initialized array could increase binary size significantly.
If that's a concern, note that MathML Core proposes a compact form based on the redundancy (many operator values are duplicate): https://w3c.github.io/mathml-core/#operator-dictionary ; However, this assumes we remove the accent property (i.e. set mathml.operator_dictionary_accent.disabled to true). We have added some pref/warning in bug 1636428, but Eri and I don't have access to statistics I believe.
| Reporter | ||
Comment 22•7 months ago
|
||
(In reply to Frédéric Wang (:fredw) from comment #9)
Yes, (Operator, Form) would be the key of the sorted table. In general,
"Operator" is a Unicode character but it could indeed be a surrogate pairs
(bug 1246657) or a longer string (but I think made of at most two
characters). In any case, you can use lexical ordering on the
character/string. "Form" takes only three values, so you can just pick one
arbitrary order e.g. prefix, infix, postfix.Some remarks:
- If an "Operator" has several "Forms", it's nice to make the corresponding
entries consecutive so you can quickly access all of them. See
MathMLOperatorDictionary::search in WebKit. IIRC, in Mozilla we need that
when retrieving the direction of an operator.
In this previous comment, I mentioned the order of form does not matter. MathML first tries to get an entry using a form determined from this algorithm and if that does not work it tries different forms in the following order: infix, postfix, prefix. See https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator
The remark in WebKit, refers to having this second done with a single binary search: https://searchfox.org/wubkat/rev/0bebf49082ee03d028cd6c079ff4416ae25ddf89/Source/WebCore/mathml/MathMLOperatorDictionary.cpp#1148
Description
•