haikuwebkit/LayoutTests/mathml/invalid-markup.html

91 lines
2.2 KiB
HTML
Raw Permalink Normal View History

Ensure MathML render tree are clean by the end of FrameView::layout(). https://bugs.webkit.org/show_bug.cgi?id=162824 Patch by Frederic Wang <fwang@igalia.com> on 2016-11-12 Reviewed by Darin Adler. Source/WebCore: clearNeedsLayout is not called during the layout of invalid MathML markup. We introduce a new helper function to perform proper layout of such markup and we now call it from the various MathML layoutBlock functions. Additionally, we ensure that the preferred width is dirty after computation in RenderMathMLScripts::computePreferredLogicalWidths. Test: mathml/invalid-markup.html * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::layoutInvalidMarkup): Helper function to layout invalid markup. * rendering/mathml/RenderMathMLBlock.h: Declare layoutInvalidMarkup. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::layoutBlock): Call layoutInvalidMarkup. * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::layoutBlock): Ditto. * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Set the preferred width dirty after computation to avoid that it is computed again and again. (WebCore::RenderMathMLScripts::layoutBlock): Call layoutInvalidMarkup. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto. LayoutTests: * mathml/invalid-markup-expected.txt: Added. * mathml/invalid-markup.html: Added. * mathml/mn-as-list-item-assert-expected.txt: Update text expectation now that invalid subtree appears in the output. * mathml/msubsup-fuzz-expected.txt: Ditto. * accessibility/mac/mathml-multiscript.txt: Ditto. Canonical link: https://commits.webkit.org/182366@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-12 14:50:50 +00:00
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
<script>
description("Test passes if it does not debug assert.");
</script>
</head>
<body>
<div>
<p>Test 1: Invalid &lt;mfrac&gt; tag:</p>
<math>
<mfrac></mfrac>
<mfrac><mn>1</mn><mn>2</mn><mn>3</mn></mfrac>
</math>
</div>
<div>
<p>Test 2: Invalid &lt;mroot&gt; tag:</p>
<math>
<mroot></mroot>
<mroot><mn>1</mn><mn>2</mn><mn>3</mn></mroot>
</math>
</div>
<div>
<p>Test 3: Invalid &lt;munder&gt; tag:</p>
<math>
<munder></munder>
<munder><mn>1</mn><mn>2</mn><mn>3</mn></munder>
</math>
</div>
<div>
<p>Test 4: Invalid &lt;mover&gt; tag:</p>
<math>
<mover></mover>
<mover><mn>1</mn><mn>2</mn><mn>3</mn></mover>
</math>
</div>
<div>
<p>Test 5: Invalid &lt;munderover&gt; tag:</p>
<math>
<munderover></munderover>
<munderover><mn>1</mn><mn>2</mn></munderover>
<munderover><mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn></munderover>
</math>
</div>
<div>
<p>Test 6: Invalid &lt;msub&gt; tag:</p>
<math>
<msub></msub>
<msub><mn>1</mn><mn>2</mn><mn>3</mn></msub>
</math>
</div>
<div>
<p>Test 7: Invalid &lt;msup&gt; tag:</p>
<math>
<msup></msup>
<msup><mn>1</mn><mn>2</mn><mn>3</mn></msup>
</math>
</div>
<div>
<p>Test 8: Invalid &lt;msubsup&gt; tag:</p>
<math>
<msubsup></msubsup>
<msubsup><mn>1</mn><mn>2</mn></msubsup>
<msubsup><mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn></msubsup>
</math>
</div>
<div>
<p>Test 9: Invalid &lt;mmultiscripts&gt; tag:</p>
<math>
<mmultiscripts>
</mmultiscripts>
<mmultiscripts>
<mn>1</mn>
<mn>2</mn>
<mn>3</mn>
<mprescripts/>
<mn>4</mn>
</mmultiscripts>
<mmultiscripts>
<mn>1</mn>
<mn>2</mn>
<mprescripts/>
<mn>3</mn>
<mn>4</mn>
</mmultiscripts>
</math>
</div>
</body>
</html>