Implement special handling for operators using U+0338 and U+20D2
Categories
(Core :: MathML, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: fredw, Assigned: fredw)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files, 1 obsolete file)
After bug 1789583, I noticed we still have many obsolete entries for "negation" operators.
egrep 'u0338|u20D2' layout/mathml/mathfont.properties
operator.\u003C\u20D2.infix = lspace:5 rspace:5 # <⃒
operator.\u003E\u20D2.infix = lspace:5 rspace:5 # >⃒
operator.\u2242\u0338.infix = lspace:5 rspace:5 # ≂̸
operator.\u224E\u0338.infix = lspace:5 rspace:5 # ≎̸
operator.\u224F\u0338.infix = lspace:5 rspace:5 # ≏̸
operator.\u2266\u0338.infix = lspace:5 rspace:5 # ≧̸
operator.\u226A\u0338.infix = lspace:5 rspace:5 # ≪̸
operator.\u226B\u0338.infix = lspace:5 rspace:5 # ≫̸
operator.\u227F\u0338.infix = lspace:5 rspace:5 # ≿̸
operator.\u2282\u20D2.infix = lspace:5 rspace:5 # subset of with vertical line
operator.\u2283\u20D2.infix = lspace:5 rspace:5 # superset of with vertical line
operator.\u228F\u0338.infix = lspace:5 rspace:5 # ⊏̸
operator.\u2290\u0338.infix = lspace:5 rspace:5 # ⊐̸
operator.\u29CF\u0338.infix = lspace:5 rspace:5 # ⧏̸
operator.\u29D0\u0338.infix = lspace:5 rspace:5 # ⧐̸
operator.\u2A7D\u0338.infix = lspace:5 rspace:5 # ⩽̸
operator.\u2A7E\u0338.infix = lspace:5 rspace:5 # ⩾̸
operator.\u2AA1\u0338.infix = lspace:5 rspace:5 # ⪡̸
operator.\u2AA2\u0338.infix = lspace:5 rspace:5 # ⪢̸
operator.\u2AAF\u0338.infix = lspace:5 rspace:5 # ⪯̸
operator.\u2AB0\u0338.infix = lspace:5 rspace:5 # ⪰̸
operator.\u2AC5\u0338.infix = lspace:5 rspace:5 # ⫅̸
operator.\u2AC6\u0338.infix = lspace:5 rspace:5 # ⫅̸
operator.\u2ADD\u0338.infix = lspace:5 rspace:5 # nonforking with slash
I believe they can just be removed once we implement the thing from MathML Core:
If the second character is U+0338 COMBINING LONG SOLIDUS OVERLAY or U+20D2 COMBINING LONG VERTICAL LINE OVERLAY then replace Content with the first character and move to step 3.
https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
nsMathMLOperators::LookupOperators(s) methods are currently use in three
places:
(1) In nsMathMLmoFrame::ProcessTextData(), where we need to check the
flags for each form of the operator and take the bitwise-or of all
of them, ignoring lspace/rspace.
(2) In nsMathMLOperators::GetStretchyDirection::ProcessTextData(), where
we need to check the direction for each form of the operator (in any
order) and return the first found, ignoring lspace/rspace.
(3) In nsMathMLmoFrame::ProcessOperatorData, where need to check the
specified form, and try fallback forms in the order prefix, postfix,
infix. When an entry is found, the code also clears the form bits of
mFlags and bitwise-or the found flags.
This commit modifies nsMathMLOperators::LookupOperator to only check
one form at once and can be used to easily implement (1) and (2). This
removes the need for nsMathMLOperators::LookupOperators.
A new method nsMathMLOperators::LookupOperatorWithFallback is introduced
to preserve the fallback prefix/postfix/infix check that is needed for
(3). Undocumented bitwise logic is moved out of that method.
Assignee | ||
Comment 3•3 years ago
|
||
MathML Core specifies that operators containing a UTF-16 strings whose
length is not 1 or 2 should use the default properties [1]. This
commit removes the obsolete strings of length 3 from our operator
dictionary and tweak updateOperatorDictionary.pl to ensure it only
accepts strings of 1 or 2 characters. This also adds an early return
in LookupOperator to immediately fallback to default properties.
[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator
Assignee | ||
Comment 4•3 years ago
|
||
MathML Core specifies that operators containing a UTF-16 strings of
length 2 ending with U+0338 COMBINING LONG SOLIDUS OVERLAY or U+20D2
COMBINING LONG VERTICAL LINE OVERLAY should just use the properties of
the first character. This commit implements that behavior. It removes
obsolete entries that are superseded by this rule and modifies
updateOperatorDictionary.pl to ensure that no such entries are present.
Existing WPT test operator-dictionary-combining.html is already passing
after bug 1789583 because the operators tested use the default spacing.
So extend it to try operators with different spacing.
[1] https://w3c.github.io/mathml-core/#dfn-algorithm-to-determine-the-category-of-an-operator
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Backed out for causing mochitest failures at browser_misused_characters_in_strings.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/9c68dcab599d253b8e419d142673db0b71562cdd
Push where failures started: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=ddd9b4ac6f847aa0e758a7559fb284eda9210d39&selectedTaskRun=IDqsMDlaSM6Dppb3RhcuAw.0
Failure log: https://treeherder.mozilla.org/logviewer?job_id=391035678&repo=autoland&lineNumber=3152
Assignee | ||
Comment 9•3 years ago
|
||
This seems to be an existing problem in mathfonts.properties (not one added by my patches) since it uses double-quote and three periods in comments. I guess the easiest approach for now is to add it to the exception list for now. Hopefully we can get rid of this file in the future...
Assignee | ||
Comment 10•3 years ago
|
||
I stand corrected, there is already an exception for mathfont.properties, but we can remove it now:
{
file: "mathfont.properties",
key: "operator.\u002E\u002E\u002E.postfix",
type: "ellipsis",
},
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d1d90ef37546
https://hg.mozilla.org/mozilla-central/rev/c11bfdb26abb
https://hg.mozilla.org/mozilla-central/rev/35725e846f2e
Description
•