haikuwebkit/LayoutTests/mathml/invalid-scripts-crash.html

64 lines
2.1 KiB
HTML
Raw Permalink Normal View History

Implement the mmultiscripts tag https://bugs.webkit.org/show_bug.cgi?id=99618 Patch by Frédéric Wang <fred.wang@free.fr> on 2013-09-15 Reviewed by Chris Fleizach. Source/WebCore: Tests: mathml/invalid-scripts-crash.html mathml/presentation/multiscripts-equivalence.html mathml/presentation/multiscripts-noscripts.html mathml/presentation/multiscripts-positions.html mathml/presentation/scripts-base-alignment.html mathml/presentation/scripts-horizontal-alignment.html mathml/presentation/scripts-vertical-alignment.html mathml/scripts-addChild.html mathml/scripts-removeChild.html This relies on the existing msub/msup/msubsup code to implement the mmultiscripts tag. This also improves dynamic addition/removal of children for these MathML elements and adds a specific style for invalid children, so that they render like an merror tag. Finally, this fixes a bad memory access in the Accessibility render object of msubsup. * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::isMathSubscriptSuperscript): (WebCore::AccessibilityRenderObject::mathSuperscriptObject): * css/mathml.css: (mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot): (mover > :last-child, munderover > :last-child): (msub > * + *, msup > * + *, msubsup > * + *, mmultiscripts > * + *, munder > * + *, mover > * + *, munderover > * + *): (merror, msub > * + * + *, msup > * + * + *, msubsup > * + * + * + *, msub > mprescripts, msup > mprescripts, msubsup > mprescripts, msub > none, msup > none, msubsup > none, mmultiscripts > mprescripts ~ mprescripts, mmultiscripts > mprescripts ~ mprescripts ~ *): * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createRenderer): * mathml/mathtags.in: * rendering/mathml/RenderMathMLBlock.h: (WebCore::RenderMathMLBlock::isRenderMathMLScripts): (WebCore::RenderMathMLBlock::isRenderMathMLScriptsWrapper): * rendering/mathml/RenderMathMLScripts.cpp: Added. (WebCore::isMPrescripts): (WebCore::RenderMathMLScripts::RenderMathMLScripts): (WebCore::RenderMathMLScripts::base): (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): (WebCore::RenderMathMLScripts::fixAnonymousStyles): (WebCore::RenderMathMLScripts::addChildInternal): (WebCore::RenderMathMLScripts::removeChildInternal): (WebCore::RenderMathMLScripts::addChild): (WebCore::RenderMathMLScripts::removeChild): (WebCore::RenderMathMLScripts::styleDidChange): (WebCore::RenderMathMLScripts::unembellishedOperator): (WebCore::RenderMathMLScripts::layout): (WebCore::RenderMathMLScripts::firstLineBoxBaseline): (WebCore::RenderMathMLScriptsWrapper::createAnonymousWrapper): (WebCore::RenderMathMLScriptsWrapper::addChildInternal): (WebCore::RenderMathMLScriptsWrapper::addChild): (WebCore::RenderMathMLScriptsWrapper::removeChildInternal): (WebCore::RenderMathMLScriptsWrapper::removeChild): * rendering/mathml/RenderMathMLScripts.h: Added. (WebCore::RenderMathMLScriptsWrapper::RenderMathMLScriptsWrapper): (WebCore::RenderMathMLScriptsWrapper::renderName): (WebCore::RenderMathMLScriptsWrapper::isRenderMathMLScriptsWrapper): (WebCore::toRenderMathMLScriptsWrapper): (WebCore::RenderMathMLScripts::isRenderMathMLScripts): (WebCore::RenderMathMLScripts::renderName): (WebCore::toRenderMathMLScripts): * rendering/mathml/RenderMathMLSubSup.cpp: Removed. * rendering/mathml/RenderMathMLSubSup.h: Removed. LayoutTests: Add many tests for script msub/msup/msubsup/mmultiscripts: - invalid markup - equivalence between mmultiscripts without scripts and mrow - equivalence between mmultiscripts and msub/msup/msubsup - position of scripts in mmultiscripts - baseline alignment of msub/msup/msubsup elements - horizontal/vertical alignment of scripts - adding/removing children with the DOM * TestExpectations: Some remaining MathML pixel tests are broken by this patch. * mathml/invalid-scripts-crash-expected.txt: Added. * mathml/invalid-scripts-crash.html: Added. * mathml/presentation/multiscripts-equivalence-expected.html: Added. * mathml/presentation/multiscripts-equivalence.html: Added. * mathml/presentation/multiscripts-noscripts-expected.html: Added. * mathml/presentation/multiscripts-noscripts.html: Added. * mathml/presentation/multiscripts-positions-expected.html: Added. * mathml/presentation/multiscripts-positions.html: Added. * mathml/presentation/scripts-base-alignment-expected.html: Added. * mathml/presentation/scripts-base-alignment.html: Added. * mathml/presentation/scripts-horizontal-alignment-expected.html: Added. * mathml/presentation/scripts-horizontal-alignment.html: Added. * mathml/presentation/scripts-vertical-alignment-expected.html: Added. * mathml/presentation/scripts-vertical-alignment.html: Added. * mathml/scripts-addChild-expected.html: Added. * mathml/scripts-addChild.html: Added. * mathml/scripts-removeChild-expected.html: Added. * mathml/scripts-removeChild.html: Added. * platform/mac/accessibility/mathml-multiscript-expected.txt: Reference updated. Canonical link: https://commits.webkit.org/139354@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-15 08:08:08 +00:00
<!doctype html>
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<!-- This test contains various invalid msub/msup/msubsup/mmultiscripts elements. -->
<p>This test passes if it does not crash.</p>
<math>
<msub></msub>
<msub><mn></mn></msub>
<msub><mn></mn><mn></mn><mn></mn></msub>
<msub><mprescripts/></msub>
<msub><mn></mn><mprescripts/></msub>
<msub><mprescripts/><mn></mn></msub>
<msub><mn></mn><mn></mn><mn></mn><mprescripts/><mn></mn><mn></mn></msub>
</math>
<math>
<msup></msup>
<msup><mn></mn></msup>
<msup><mn></mn><mn></mn><mn></mn></msup>
<msup><mprescripts/></msup>
<msup><mn></mn><mprescripts/></msup>
<msup><mprescripts/><mn></mn></msup>
<msup><mn></mn><mn></mn><mn></mn><mprescripts/><mn></mn><mn></mn></msup>
</math>
<math>
<msubsup></msubsup>
<msubsup><mn></mn></msubsup>
<msubsup><mn></mn><mn></mn></msubsup>
<msubsup><mn></mn><mn></mn><mn></mn><mn></mn></msubsup>
<msubsup><mprescripts/></msubsup>
<msup><mn></mn><mprescripts/></msup>
<msup><mprescripts/><mn></mn></msup>
<msubsup><mn></mn><mn></mn><mprescripts/></msubsup>
<msubsup><mprescripts/><mn></mn><mn></mn></msubsup>
<msubsup><mn></mn><mn></mn><mn></mn><mprescripts/><mn></mn><mn></mn></msubsup>
</math>
<math>
<mmultiscripts></mmultiscripts>
<mmultiscripts><mn></mn><mn></mn></mmultiscripts>
<mmultiscripts><mn></mn><mn></mn><mn></mn><mn></mn></mmultiscripts>
<mmultiscripts><mprescripts/></mmultiscripts>
<mmultiscripts><mprescripts/><mn></mn><mn></mn></mmultiscripts>
<mmultiscripts><mprescripts/><mn></mn><mn></mn><mn></mn><mn></mn></mmultiscripts>
<mmultiscripts><mn></mn><mprescripts/><mn></mn></mmultiscripts>
<mmultiscripts><mn></mn><mprescripts/><mn></mn><mn></mn><mn></mn></mmultiscripts>
<mmultiscripts><mn></mn><mprescripts/><mn></mn><mn></mn><mprescripts/></mmultiscripts>
<mmultiscripts><mn></mn><mprescripts/><mn></mn><mn></mn><mprescripts/><mn></mn><mn></mn></mmultiscripts>
<mmultiscripts><mn></mn><mprescripts/><mn></mn><mn></mn><mprescripts/><mn></mn><mn></mn><mn></mn><mn></mn></mmultiscripts>
</math>
</body>
</html>