REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2016 19:47:16 +0000 (19:47 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2016 19:47:16 +0000 (19:47 +0000)
commitf0eecad7fb419704911734aacb8d85122ebff4b0
tree039a64ece3bd67ef9e4cd6008638aee31916c3cd
parentb39ca0dcdaadbb6980c7933d47b8b79ad4f1fb34
REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
https://bugs.webkit.org/show_bug.cgi?id=162933
<rdar://problem/28570590>

Reviewed by Dean Jackson.

Source/WebCore:

A debug assertion is triggered when an empty <mo> tag is used with a "stretchy" flag.

We shouldn't be trying to apply stretch operations on an empty MathML element. Create a
helper function (isStretchy) to encapsulate the fact that only non-empty elements with
the 'MathMLOperatorDictionary::Stretchy' operator flag should have stretching applied.

Test: mathml/empty-mo.html

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::stretchTo): Revise assertion to use new 'isStretchy' predicate.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::isStretchy): Added.
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computeLineVerticalStretch): Use new 'isStretchy' predicate.
(WebCore::RenderMathMLRow::layoutRowItems): Ditto.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Ditto.
(WebCore::RenderMathMLUnderOver::verticalParameters): Ditto.

LayoutTests:

* mathml/empty-mo-expected.txt: Added.
* mathml/empty-mo.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/mathml/empty-mo-expected.txt [new file with mode: 0644]
LayoutTests/mathml/empty-mo.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp