Skip to content
Snippets Groups Projects
Commit a099935c authored by Frederic Wang's avatar Frederic Wang
Browse files

Bug 1790009, part 1: Refactor nsMathMLOperators::LookupOperator(s). r=emilio

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.

Differential Revision: https://phabricator.services.mozilla.com/D157705
parent c5382442
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment