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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the Snow Leopard build.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/12316935> [mac WebKit1]: -[WebView _setPaginationBehavesLikeColumns:] is a no-op
https://bugs.webkit.org/show_bug.cgi?id=96971

Reviewed by Sam Weinig.

* WebView/WebView.mm:
(-[WebView _setPaginationBehavesLikeColumns:]): Added a call to setPagination().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, rebaseline after r128811

* platform/chromium-linux-x86/fast/writing-mode/english-lr-text-expected.png: Removed.
* platform/chromium-linux-x86/transitions/svg-text-shadow-transition-expected.png: Removed.
* platform/chromium-linux/platform/chromium-linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.png:
* platform/chromium-win-xp/fast/multicol/shadow-breaking-expected.png: Added.
* platform/chromium-win-xp/fast/repaint/shadow-multiple-vertical-expected.png: Added.
* platform/chromium-win-xp/fast/text/shadow-translucent-fill-expected.png:
* platform/chromium-win-xp/fast/text/stroking-decorations-expected.png:
* platform/chromium-win-xp/fast/text/stroking-expected.png:
* platform/chromium-win-xp/fast/transforms/shadows-expected.png: Added.
* platform/chromium-win-xp/fast/writing-mode/english-lr-text-expected.png:
* platform/chromium-win-xp/ietestcenter/css3/text/textshadow-002-expected.png: Added.
* platform/chromium-win-xp/ietestcenter/css3/text/textshadow-010-expected.png: Added.
* platform/chromium-win-xp/svg/css/composite-shadow-text-expected.png:
* platform/chromium-win-xp/svg/css/shadow-changes-expected.png:
* platform/chromium-win-xp/svg/css/text-gradient-shadow-expected.png:
* platform/chromium-win-xp/svg/css/text-shadow-multiple-expected.png: Added.
* platform/chromium-win-xp/transitions/svg-text-shadow-transition-expected.png:
* platform/gtk/transitions/svg-text-shadow-transition-expected.png: Removed.
* transitions/svg-text-shadow-transition-expected.png: Renamed from LayoutTests/platform/efl/transitions/svg-text-shadow-transition-expected.png.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, more rebaseline after r128811

* platform/chromium-win-xp/compositing/shadows/shadow-drawing-expected.png:
* platform/chromium-win-xp/fast/css/shadow-multiple-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: remove "unexpected EOF" warnings
https://bugs.webkit.org/show_bug.cgi?id=96970

Reviewed by Ojan Vafai.

After debugging this a bit, it looks like there aren't any cases
that I can reproduce where a read() of zero indicates something
actually wrong; either it is a prelude to a crash, or a false
negative. So, I'm removing these warnings and adding a comment.

* Scripts/webkitpy/layout_tests/port/server_process.py:
(ServerProcess._wait_for_data_and_update_buffers_using_select):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128842 268f45cc-cd09-0410-ab3c-d52691b4dbfc