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 10:08:02 +0000 (10:08 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Feb 2014 10:08:02 +0000 (10:08 +0000)
commitf52ce7d4a363e70cc8e8e4b5ea9287466873011b
tree401a11dc359cba53412f9ce91569da535794aea8
parenta6e2bc553739316e27733b7eb0673bf09f389ac3
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@164536 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