This website requires JavaScript.
Explore
Help
Sign In
nephele
/
haikuwebkit
Watch
1
Star
0
Fork
You've already forked haikuwebkit
0
Code
Issues
Releases
Activity
haiku
haikuwebkit
/
LayoutTests
/
mathml
/
msub-anonymous-child-render...
10 lines
53 B
Plaintext
Raw
Permalink
Normal View
History
Unescape
Escape
MathML crash in WebCore::Node::previousSibling() https://bugs.webkit.org/show_bug.cgi?id=80773 Patch by Jacky Jiang <zhajiang@rim.com> on 2012-03-13 Reviewed by Julien Chaffraix. Source/WebCore: When adding child for msub render, if the child is mtr or mtd render, we will creat an anonymous render as the container. As the anonymous render's node is 0, accessing it directly can cause crash. We should do a valid check of the node before using. In addition to that, for msub, attach the anonymous render and it's children to render tree. For msubsup, such kind of situation should never happen based on the current codebase. Test: mathml/msub-anonymous-child-render-crash.html * rendering/mathml/RenderMathMLSubSup.cpp: (WebCore::RenderMathMLSubSup::addChild): LayoutTests: * mathml/msub-anonymous-child-render-crash-expected.txt: Added. * mathml/msub-anonymous-child-render-crash.html: Added. Canonical link: https://commits.webkit.org/98216@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-13 23:45:53 +00:00
This test passes if it does not crash.
r123492 Changed output of msub-anonymous-child-render-crash.html LayoutTest https://bugs.webkit.org/show_bug.cgi?id=92284 Rubber-stamped by Beth Dakin. Rebaselined test output. * mathml/msub-anonymous-child-render-crash-expected.txt: r123492 changed the way inline-tables are rendered. Canonical link: https://commits.webkit.org/110089@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-25 20:15:31 +00:00
X
Convert MathML to use flexboxes https://bugs.webkit.org/show_bug.cgi?id=96843 Reviewed by Eric Seidel. Source/WebCore: Using the CSS Flexible Box Model simplifies MathML in many ways. Control over alignment, row vs. column layout, and child layout order are all much easier. Complexities involving floats, continuations, and most anonymous boxes are eliminated, as are their potential for crashes and security vulnerabilities. In a flexbox, column alignment is done with align-items or align-self, instead of text-align. vertical-align and baselinePosition() are replaced by the firstLineBoxBaseline() virtual function. Tested by existing tests. * css/mathml.css: (math): (math[display="block"]): (mo, mrow, mfenced, mfrac, msub, msup, msubsup, munder, mover, munderover, msqrt, mroot): (math, mrow, mfenced, msqrt, mroot): (msqrt > *): (mo, mfrac, munder, mover, munderover): (munder, mover, munderover): (mfrac > *): (mfrac[numalign="left"] > :first-child): (mfrac[numalign="right"] > :first-child): (mfrac[denomalign="left"] > :last-child): (mfrac[denomalign="right"] > :last-child): (msubsup > :last-child, mover > :last-child, munderover > :last-child): (msub > * + *, msup > * + *, msubsup > * + *, munder > * + *, mover > * + *, munderover > * + *): (mroot): (mroot > * + *): (mtable): * mathml/MathMLInlineContainerElement.cpp: (WebCore::MathMLInlineContainerElement::createRenderer): * mathml/mathtags.in: * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::RenderMathMLBlock): (WebCore::RenderMathMLBlock::computePreferredLogicalWidths): (WebCore::RenderMathMLBlock::baselinePosition): (WebCore::RenderMathMLBlock::renderName): (WebCore::RenderMathMLBlock::paint): (WebCore::RenderMathMLTable::firstLineBoxBaseline): * rendering/mathml/RenderMathMLBlock.h: (RenderMathMLBlock): (RenderMathMLTable): (WebCore::RenderMathMLTable::RenderMathMLTable): - Change RenderMathMLBlock's base class to RenderFlexibleBox, and its display to FLEX or INLINE_FLEX. - Add RenderMathMLTable for its firstLineBoxBaseline() function, like { vertical-align: middle }. * rendering/mathml/RenderMathMLFenced.cpp: (WebCore::RenderMathMLFenced::createMathMLOperator): (WebCore::RenderMathMLFenced::makeFences): - Use RenderMathMLRow::addChild as a more robust name for RenderBlock::addChild. (WebCore::RenderMathMLFenced::addChild): - All inline children of a flexbox are treated as blocks automatically. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::fixChildStyle): (WebCore::RenderMathMLFraction::updateFromElement): - numalign and denomalign attributes are now handled by mathml.css. (WebCore::RenderMathMLFraction::addChild): (WebCore::RenderMathMLFraction::layout): (WebCore::RenderMathMLFraction::firstLineBoxBaseline): * rendering/mathml/RenderMathMLFraction.h: (RenderMathMLFraction): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::updateFromElement): (WebCore::RenderMathMLOperator::createStackableStyle): (WebCore::RenderMathMLOperator::firstLineBoxBaseline): * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::createAnonymousWithParentRenderer): * rendering/mathml/RenderMathMLSubSup.cpp: (WebCore::RenderMathMLSubSup::RenderMathMLSubSup): (WebCore::RenderMathMLSubSup::fixScriptsStyle): (WebCore::RenderMathMLSubSup::addChild): (WebCore::RenderMathMLSubSup::styleDidChange): (WebCore::RenderMathMLSubSup::layout): * rendering/mathml/RenderMathMLSubSup.h: - Rename Sup to Super, to make it more readable vs. Sub. - Instead of vertical-align, msub and msup now use the m_scripts anonymous box like msubsup does. - Individual anonymous block wrappers are no longer needed around the superscript and subscript to lay them out in a column. - Handle msub and msup layout, and improve msubsup layout, by requiring a superscript's baseline to be at least (int) fontSize / 3 + 1 above the main baseline, and a subscript's baseline to be at least (int) fontSize / 5 + 1 below it. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::unembellishedOperator): (WebCore::RenderMathMLUnderOver::firstLineBoxBaseline): * rendering/mathml/RenderMathMLUnderOver.h: (RenderMathMLUnderOver): - RenderMathMLUnderOver no longer needs to use anonymous wrappers for column layout. Centering and child layout order (overscript first) are also handled by mathml.css. LayoutTests: * mathml/EmptyMFracCrash-expected.txt: * mathml/EmptyMunderOverCrash-expected.txt: * mathml/empty-mroot-crash-expected.txt: * mathml/fenced-whitespace-separators-crash-expected.txt: * mathml/msub-anonymous-child-render-crash-expected.txt: * mathml/msubsup-no-grandchild-expected.txt: * mathml/msubsup-remove-children-expected.txt: * mathml/munderover-remove-children-expected.txt: * mathml/presentation/fenced.xhtml: * mathml/presentation/mo.xhtml: * mathml/presentation/row.xhtml: * mathml/xHeight.xhtml: - The <div>s are wrapped in <mtext> elements to make them valid in MathML, with the intended layout. * platform/mac/mathml/presentation/attributes-expected.png: * platform/mac/mathml/presentation/attributes-expected.txt: * platform/mac/mathml/presentation/fenced-expected.txt: * platform/mac/mathml/presentation/fenced-mi-expected.png: * platform/mac/mathml/presentation/fenced-mi-expected.txt: * platform/mac/mathml/presentation/fractions-expected.txt: * platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt: * platform/mac/mathml/presentation/mo-expected.png: * platform/mac/mathml/presentation/mo-expected.txt: * platform/mac/mathml/presentation/mo-stretch-expected.png: * platform/mac/mathml/presentation/mo-stretch-expected.txt: * platform/mac/mathml/presentation/mroot-pref-width-expected.txt: * platform/mac/mathml/presentation/over-expected.png: * platform/mac/mathml/presentation/over-expected.txt: * platform/mac/mathml/presentation/roots-expected.png: * platform/mac/mathml/presentation/roots-expected.txt: * platform/mac/mathml/presentation/row-alignment-expected.png: * platform/mac/mathml/presentation/row-alignment-expected.txt: * platform/mac/mathml/presentation/row-expected.png: * platform/mac/mathml/presentation/row-expected.txt: * platform/mac/mathml/presentation/style-expected.png: * platform/mac/mathml/presentation/style-expected.txt: * platform/mac/mathml/presentation/sub-expected.png: * platform/mac/mathml/presentation/sub-expected.txt: * platform/mac/mathml/presentation/subsup-expected.png: * platform/mac/mathml/presentation/subsup-expected.txt: * platform/mac/mathml/presentation/sup-expected.txt: * platform/mac/mathml/presentation/tables-expected.png: * platform/mac/mathml/presentation/tables-expected.txt: * platform/mac/mathml/presentation/tokenElements-expected.txt: * platform/mac/mathml/presentation/under-expected.txt: * platform/mac/mathml/presentation/underover-expected.png: * platform/mac/mathml/presentation/underover-expected.txt: * platform/mac/mathml/xHeight-expected.txt: Canonical link: https://commits.webkit.org/114903@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-18 01:37:18 +00:00
Y
X
2
Y
2