-
- Downloads
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
Loading
Please register or sign in to comment