Bug 119043 - Large stretch size error for MathML operators.
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Feb 2014 09:50:47 +0000 (09:50 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Feb 2014 09:50:47 +0000 (09:50 +0000)
commit2c87abb26755aa2bb366d56aac52a0268b565d23
tree1f6907eaa36d14fcfc5404ad6dfab3d5701ed575
parent69bc6b2fa3fb4c25543167b044d596d59ba74954
Bug 119043 - Large stretch size error for MathML operators.
https://bugs.webkit.org/show_bug.cgi?id=119043

Reviewed by Chris Fleizach.

Source/WebCore:

The MathML code used some arbitrary gOperatorExpansion factor for the
stretch size and 2/3 1/2 constants for the baseline. This change tries
to consider height/depth of siblings of the stretchy operator so that
the stretchy operator now matches its target.

Test: mathml/presentation/stretchy-depth-height.html

* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderMathMLTable):
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
(WebCore::RenderMathMLOperator::stretchTo):
(WebCore::RenderMathMLOperator::findAcceptableStretchyCharacter):
(WebCore::RenderMathMLOperator::updateStyle):
(WebCore::RenderMathMLOperator::firstLineBaseline):
(WebCore::RenderMathMLOperator::computeLogicalHeight):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layout):

LayoutTests:

This adds a test to check that the depth/height of stretchy operators match the maximum of their siblings. This also fixes the reference of mo-stretch.html to ignore the stretch error.

* mathml/presentation/stretchy-depth-height-expected.txt: Added.
* mathml/presentation/stretchy-depth-height.html: Added.
* platform/mac/mathml/presentation/mo-stretch-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/mathml/presentation/stretchy-depth-height-expected.txt [new file with mode: 0644]
LayoutTests/mathml/presentation/stretchy-depth-height.html [new file with mode: 0644]
LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/mathml/RenderMathMLBlock.h
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp