haikuwebkit/LayoutTests/mathml/mn-as-list-item-assert.html

16 lines
297 B
HTML
Raw Permalink Normal View History

<!doctype html>
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
Refactor RenderMathMLUnderOver layout functions to avoid using flexbox https://bugs.webkit.org/show_bug.cgi?id=153742 Patch by Frederic Wang <fwang@igalia.com> on 2016-04-11 Reviewed by Sergio Villar Senin. Source/WebCore: Based on a patch by Javier Fernandez <jfernandez@igalia.com> Refactor the UnderOver renderer to use its own layoutBlock method that does all the layout calculations without considering the flexbox restrictions. * css/mathml.css: (mo, mfrac, munder, mover, munderover): Delete the underover elements from the line defining the column direction. (munder, mover, munderover): Deleted. This flexbox property is no longer needed. (mover > :last-child, munderover > :last-child): Deleted. This flexbox property is no longer needed. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::firstLineBaseline): Use ascentForChild. (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Avoid stretching operators that are not stretchy. (WebCore::RenderMathMLUnderOver::isValid): Helper function to ensure that the child list is valid with respect to the MathML specification. (WebCore::RenderMathMLUnderOver::base): Added. Helper function. (WebCore::RenderMathMLUnderOver::under): Added. Helper function. (WebCore::RenderMathMLUnderOver::over): Added. Helper function. (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Added. The preferred width is the maximum preferred width of the base, under and over scripts. (WebCore::RenderMathMLUnderOver::horizontalOffset): Added, helper to calculate the horizontal position of children (horizontally centered). (WebCore::RenderMathMLUnderOver::layoutBlock): Added, it lays out the base, underscript and overscript. It calculates the exact logical width, which may differ from the preferred width when one child contains stretchy operators. It later sets the locations of children accordingly and sets the heigth of the render element. (WebCore::RenderMathMLUnderOver::paintChildren): Added, we have to use the usual traverse instead of the one that comes from the flexbox. This will be removed in a follow-up patch. (WebCore::RenderMathMLUnderOver::layout): Deleted. * rendering/mathml/RenderMathMLUnderOver.h: Added new functions definitions. LayoutTests: Apply some small adjustments to the expectations of MathML tests after the refactoring of RenderMathMLUnderOver. We also add a test for non-stretchy horizontal operators in underover. * platform/gtk/mathml/opentype/horizontal-expected.png: * platform/gtk/mathml/opentype/horizontal-expected.txt: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * mathml/mn-as-list-item-assert.html: Move the test description out of the invalid munderover so that it is still displayed. * mathml/mn-as-list-item-assert-expected.txt: Update the text expectation. * mathml/presentation/underover-nonstretchy-horizontal.html: Ensure that nonstretchy horizontal operators are not stretched in munderover. * mathml/presentation/underover-nonstretchy-horizontal-expected.html: Ditto. Canonical link: https://commits.webkit.org/174553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-11 12:11:18 +00:00
<p>This test PASSES if it does not CRASH or ASSERT.</p>
<math>
<munderover>
Refactor RenderMathMLUnderOver layout functions to avoid using flexbox https://bugs.webkit.org/show_bug.cgi?id=153742 Patch by Frederic Wang <fwang@igalia.com> on 2016-04-11 Reviewed by Sergio Villar Senin. Source/WebCore: Based on a patch by Javier Fernandez <jfernandez@igalia.com> Refactor the UnderOver renderer to use its own layoutBlock method that does all the layout calculations without considering the flexbox restrictions. * css/mathml.css: (mo, mfrac, munder, mover, munderover): Delete the underover elements from the line defining the column direction. (munder, mover, munderover): Deleted. This flexbox property is no longer needed. (mover > :last-child, munderover > :last-child): Deleted. This flexbox property is no longer needed. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::firstLineBaseline): Use ascentForChild. (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Avoid stretching operators that are not stretchy. (WebCore::RenderMathMLUnderOver::isValid): Helper function to ensure that the child list is valid with respect to the MathML specification. (WebCore::RenderMathMLUnderOver::base): Added. Helper function. (WebCore::RenderMathMLUnderOver::under): Added. Helper function. (WebCore::RenderMathMLUnderOver::over): Added. Helper function. (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Added. The preferred width is the maximum preferred width of the base, under and over scripts. (WebCore::RenderMathMLUnderOver::horizontalOffset): Added, helper to calculate the horizontal position of children (horizontally centered). (WebCore::RenderMathMLUnderOver::layoutBlock): Added, it lays out the base, underscript and overscript. It calculates the exact logical width, which may differ from the preferred width when one child contains stretchy operators. It later sets the locations of children accordingly and sets the heigth of the render element. (WebCore::RenderMathMLUnderOver::paintChildren): Added, we have to use the usual traverse instead of the one that comes from the flexbox. This will be removed in a follow-up patch. (WebCore::RenderMathMLUnderOver::layout): Deleted. * rendering/mathml/RenderMathMLUnderOver.h: Added new functions definitions. LayoutTests: Apply some small adjustments to the expectations of MathML tests after the refactoring of RenderMathMLUnderOver. We also add a test for non-stretchy horizontal operators in underover. * platform/gtk/mathml/opentype/horizontal-expected.png: * platform/gtk/mathml/opentype/horizontal-expected.txt: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * mathml/mn-as-list-item-assert.html: Move the test description out of the invalid munderover so that it is still displayed. * mathml/mn-as-list-item-assert-expected.txt: Update the text expectation. * mathml/presentation/underover-nonstretchy-horizontal.html: Ensure that nonstretchy horizontal operators are not stretched in munderover. * mathml/presentation/underover-nonstretchy-horizontal-expected.html: Ditto. Canonical link: https://commits.webkit.org/174553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-11 12:11:18 +00:00
<mn style="display: list-item;">mn</mn>
</munderover>
</math>