haikuwebkit/LayoutTests/mathml/out-of-flow-in-token-crash....

157 lines
3.3 KiB
HTML
Raw Permalink Normal View History

ASSERTION FAILED: !renderer->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout with MathML https://bugs.webkit.org/show_bug.cgi?id=178865 Patch by Frederic Wang <fwang@igalia.com> on 2017-11-15 Reviewed by Manuel Rego Casasnovas. Source/WebCore: MathML token elements can contain HTML elements and hence MathML elements can contain out-of-flow positioned descendants. Also all MathML elements can be containing block and hence should position their out-of-flow positioned descendants before calling clearNeedsLayout(). This patch does that in all places in the MathML renderer classes, except a few of them: - RenderMathMLSpace, which can not have descendants. - RenderMathMLToken and RenderMathMLOperator, since they will use the layout implementation of RenderMathMLBlock when they contain non-text children. The patch also fixes an ASSERTION failure in WebCore::RenderBlock::checkPositionedObjectsNeedLayout due to some descendants that are not laid out. Test: mathml/out-of-flow-in-token-crash.html * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::layoutBlock): Call layoutPositionedObjects. (WebCore::RenderMathMLBlock::layoutInvalidMarkup): Ditto and pass the relayoutChildren boolean. * rendering/mathml/RenderMathMLBlock.h: Add a relayoutChildren boolean to layoutInvalidMarkup. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::layoutBlock): Pass the relayoutChildren boolean to layoutInvalidMarkup and call layoutPositionedObjects. * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::layoutBlock): Ditto. * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::layoutBlock): Ditto. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto. * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::layoutBlock): Call layoutPositionedObjects. * rendering/mathml/RenderMathMLPadded.cpp: (WebCore::RenderMathMLPadded::layoutBlock): Ditto. * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::layoutBlock): Ditto. LayoutTests: Add a test to trigger various clearNeedsLayout() in a MathML containing block with out-of-flow positioned descendants. * mathml/out-of-flow-in-token-crash-expected.txt: Added. * mathml/out-of-flow-in-token-crash.html: Added. Canonical link: https://commits.webkit.org/195774@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-15 20:07:51 +00:00
<!DOCTYPE html>
<html>
<head>
<title>ASSERTION with out-of-flow elements inside MathML</title>
<meta charset="utf-8"/>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<p>This test passes if it does not crash</p>
<p>
<math>
<mfenced style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLFenced</span>
</span>
</mtext>
</mfenced>
</math>
</p>
<p>
<math>
<mfrac style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLFraction</span>
</span>
</mtext>
<mspace></mspace>
</mfrac>
</math>
</p>
<p>
<math style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLMath</span>
</span>
</mtext>
</math>
</p>
<p>
<math>
<menclose style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLMenclose</span>
</span>
</mtext>
</menclose>
</math>
</p>
<p>
<math>
<mo style="position: relative">
<span>
<span style="position: absolute">RenderMathMLOperator</span>
</span>
</mo>
</math>
</p>
<p>
<math>
<mpadded style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLPadded</span>
</span>
</mtext>
</mpadded>
</math>
</p>
<p>
<math>
<mroot style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLRoot</span>
</span>
</mtext>
<mspace></mspace>
</mroot>
</math>
</p>
<p>
<math>
<mrow style="position: relative">
<mtext><span><span style="position: absolute">RenderMathMLRow</span><span></mtext>
</mrow>
</math>
</p>
<p>
<math>
<msubsup style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLScripts</span>
</span>
</mtext>
<mspace></mspace>
<mspace></mspace>
</msubsup>
</math>
</p>
<p>
<math>
<mtext style="position: relative">
<span>
<span style="position: absolute">RenderMathMLToken</span>
</span>
</mtext>
</math>
</p>
<p>
<math>
<munderover style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLUnderOver</span>
</span>
</mtext>
<mspace></mspace>
<mspace></mspace>
</munderover>
</math>
</p>
<p>
<math>
<mfrac style="position: relative">
<mtext>
<span>
<span style="position: absolute">RenderMathMLBlock (invalid markup)</span>
</span>
</mtext>
</mfrac>
</math>
</p>
</body>
</html>