haikuwebkit/LayoutTests/mathml/cells-and-scripts-crash.html

40 lines
677 B
HTML
Raw Permalink Normal View History

ASSERTION FAILED: !needsLayout() in WebCore::RenderMathMLScripts::firstLineBaseline https://bugs.webkit.org/show_bug.cgi?id=174131 Patch by Frederic Wang <fwang@igalia.com> on 2017-11-21 Reviewed by Alejandro G. Castro. Source/WebCore: RenderMathMLScripts::firstLineBaseline() has an ASSERT at the beginning to ensure that the function is called after the element was laid out. However, this is not respected by HTML table layout as RenderBlock::firstLineBaseline() is called for elements in a table cell before they are laid out. This happens for example for RenderGrid::firstLineBaseline() and probably for other renderers. Additionally, RenderMathMLScripts::firstLineBaseline() only involves calling firstLineBaseline(); logicalTop() or logicalHeight() on the first child box so it is safe to call it before layout, even if the return value might be wrong at that time. This patch removes this too restrictive ASSERT for RenderMathMLScripts, for consistency with other implementations of firstLineBaseline(). Test: mathml/cells-and-scripts-crash.html * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::firstLineBaseline const): Remove the ASSERT. LayoutTests: Add tests for calling RenderMathMLScripts::firstLineBaseline with needsLayout() == true. * mathml/cells-and-scripts-crash-expected.txt: Added. * mathml/cells-and-scripts-crash.html: Added. Canonical link: https://commits.webkit.org/195937@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-21 08:37:59 +00:00
<!DOCTYPE html>
<html>
<head>
<title>ASSERTION with cell layout and math scripts</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>
<table>
<tr>
<td>
<math display="block">
<munder>
<mtext>a</mtext>
<mtext>b</mtext>
</munder>
</math>
</td>
</tr>
</table>
</p>
<p>
<math>
<mtr>
<msub></msub>
</mtr>
</math>
</p>
</body>
</html>