Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Use the MathOperator to handle some non-stretchy operators
https://bugs.webkit.org/show_bug.cgi?id=157519 Patch by Frederic Wang <fwang@igalia.com> on 2016-06-20 Reviewed by Brent Fulgham. Source/WebCore: To prepare for the removal of anonymous text node from the render classes of token elements we use MathOperator to handle two cases where the actual text to display may not be available in the DOM: mfenced and minus operators. This change removes support for the case of mfenced operators with multiple characters since that it is not supported by MathOperator. It is a edge case that is not used in practice since fences and separators are only made of a single character. However, it would still be possible to duplicate some code/logic to add it back if that turns out to be necessary. No new tests, already covered by existing tests. * rendering/mathml/MathOperator.cpp: (WebCore::MathOperator::MathOperator): Rename UndefinedOperator. (WebCore::RenderMathMLOperator::firstLineBaseline): Improve rounding of ascent so that mfenced operators are correctly aligned. * rendering/mathml/MathOperator.h: Rename UndefinedOperator, since it can now be used to draw non-stretchy operators. (WebCore::MathOperator::isStretched): Deleted. This function is no longer used by RenderMathMLOperator. (WebCore::MathOperator::unstretch): Deleted. This function is no longer used by RenderMathMLOperator. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use useMathOperator. (WebCore::RenderMathMLOperator::rebuildTokenContent): Set the MathOperator when useMathOperator() is true. When the operator is not likely to stretch we just leave its type as NormalOperator. (WebCore::RenderMathMLOperator::useMathOperator): Helper function to determine when MathOperator should be used. (WebCore::RenderMathMLOperator::firstLineBaseline): Use useMathOperator. (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto. (WebCore::RenderMathMLOperator::paint): Ditto. (WebCore::RenderMathMLOperator::paintChildren): Ditto. * rendering/mathml/RenderMathMLOperator.h: Declare useMathOperator. LayoutTests: We adjust fenced-mi.html to handle one edge case that we no longer support. We also update some test references on Mac and iOS. * mathml/presentation/fenced-mi-expected.html: Indicate that this is no longer supported. * mathml/presentation/fenced-mi.html: Adjust the reference since no text is shown. * platform/mac/mathml/opentype/large-operators-expected.txt: Update reference. * platform/mac/mathml/opentype/opentype-stretchy-expected.txt: Ditto. * platform/mac/mathml/opentype/vertical-expected.txt: Ditto. * platform/ios-simulator/mathml/opentype/horizontal-munderover-expected.txt: Ditto. * platform/ios-simulator/mathml/opentype/opentype-stretchy-expected.txt: Ditto. Canonical link: https://commits.webkit.org/177038@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
12 changed files
with
307 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -68,11 +68,11 @@ | ||
<p> | ||
<math> | ||
<mrow> | ||
<mo>ABC</mo> | ||
<mo></mo> | ||
<mrow> | ||
<mi>x</mi> | ||
</mrow> | ||
<mo>DEF</mo> | ||
<mo></mo> | ||
</mrow> | ||
</math> | ||
</p> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.