haikuwebkit/LayoutTests/mathml/opentype/munderover-stretch-width-ex...

41 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

Incorrect bounds inside <mover>/<munder> when a stretchy operator is present https://bugs.webkit.org/show_bug.cgi?id=179682 Patch by Minsheng Liu <lambda@liu.ms> on 2017-12-10 Reviewed by Frédéric Wang. Source/WebCore: Currently a stretchy operator inside <mover>/<munder>/<munderover> is stretched during paint() rather than layout(), which leads to both end user confusion and many unexpected behaviors. This patch rewrites RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren() to both eliminate the issue and make operator stretching more standard conforming. A test is added to check the stretch width of stretchy operators in various scenarios: mathml/opentype/munderover-stretch-width.html A previous test is updated: mathml/opentype/opentype-stretchy-horizontal.html * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::stretchTo): (WebCore::RenderMathMLOperator::resetStretchSize): (WebCore::RenderMathMLOperator::paint): * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::setStretchWidthLocked): (WebCore::RenderMathMLOperator::isStretchWidthLocked const): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::toHorizontalStretchyOperator): (WebCore::fixLayoutAfterStretch): (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren): LayoutTests: Added test case: mathml/opentype/munderover-stretch-width.html Updated test case: mathml/opentype/opentype-stretchy-horizontal We update the test file to make sure the stretchy <mo> has zero lspace/rspace. Expected results for macOS and iOS are included. * mathml/opentype/munderover-stretch-width-expected.txt: Added. * mathml/opentype/munderover-stretch-width.html: Added. * mathml/opentype/opentype-stretchy-horizontal.html: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Removed. * platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/win/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Removed. Canonical link: https://commits.webkit.org/196552@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-11 03:10:41 +00:00
This test passes if you see the black thing has the same width as the red bar.
This test passes if you see the black thing has the same width as the red bar.
This test passes if you see the black thing has the same width as the red bar below and wider than the green bar above.
This test passes if you see the black thing has the same width as the red bar below and narrower than the green bar above.
This test passes if you see all three things have the same width.
This test passes if you see the black thing has the same width as the red bar.
This test passes if you see the black thing has the same width as the red bar.
This test passes if you see the black thing has the same width as the red bar.
Add comments and improve code styles for RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren() and related functions https://bugs.webkit.org/show_bug.cgi?id=180923 Patch by Minsheng Liu <lambda@liu.ms> on 2017-12-23 Reviewed by Frédéric Wang. Source/WebCore: The patch improves the code for RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren() and related function, incorporating the following suggestions from bug 179682: - Remove several lines of trailing spaces. - Change several pointers to references. - Rewrite horizontalStretchyOperator() (formerly toHorizontalStretchyOperator()) to make it more conforming to WebKit's coding style. - Make unembellishedOperator() a const method. - Add comments for stretchHorizontalOperatorsAndLayoutChildren(). - Eliminate an unnecessary call to fixLayoutAfterStretch() in stretchHorizontalOperatorsAndLayoutChildren(). Add one more case for the test "mathml/opentype/munderover-stretch-width.html" to handle the corner case where all components of <munderover>/<munder>/<mover> are stretchy. Since there is no behavior change, no new test is required. * rendering/mathml/RenderMathMLBlock.h: (WebCore::RenderMathMLBlock::unembellishedOperator const): (WebCore::RenderMathMLBlock::unembellishedOperator): Deleted. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::unembellishedOperator const): (WebCore::RenderMathMLFraction::unembellishedOperator): Deleted. * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::resetStretchSize): * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::unembellishedOperator const): (WebCore::RenderMathMLScripts::unembellishedOperator): Deleted. * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::horizontalStretchyOperator): (WebCore::fixLayoutAfterStretch): (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren): (WebCore::RenderMathMLUnderOver::layoutBlock): (WebCore::toHorizontalStretchyOperator): Deleted. LayoutTests: Add one more case for the test "mathml/opentype/munderover-stretch-width.html" to handle the corner case where all components of <munderover>/<munder>/<mover> are stretchy. Since there is no behavior change, no new test is required. * mathml/opentype/munderover-stretch-width-expected.txt: * mathml/opentype/munderover-stretch-width.html: Canonical link: https://commits.webkit.org/197011@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-23 16:05:41 +00:00
This test passes if you see both the red and blue things have the same width as the black bar.
Incorrect bounds inside <mover>/<munder> when a stretchy operator is present https://bugs.webkit.org/show_bug.cgi?id=179682 Patch by Minsheng Liu <lambda@liu.ms> on 2017-12-10 Reviewed by Frédéric Wang. Source/WebCore: Currently a stretchy operator inside <mover>/<munder>/<munderover> is stretched during paint() rather than layout(), which leads to both end user confusion and many unexpected behaviors. This patch rewrites RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren() to both eliminate the issue and make operator stretching more standard conforming. A test is added to check the stretch width of stretchy operators in various scenarios: mathml/opentype/munderover-stretch-width.html A previous test is updated: mathml/opentype/opentype-stretchy-horizontal.html * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::stretchTo): (WebCore::RenderMathMLOperator::resetStretchSize): (WebCore::RenderMathMLOperator::paint): * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::setStretchWidthLocked): (WebCore::RenderMathMLOperator::isStretchWidthLocked const): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::toHorizontalStretchyOperator): (WebCore::fixLayoutAfterStretch): (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren): LayoutTests: Added test case: mathml/opentype/munderover-stretch-width.html Updated test case: mathml/opentype/opentype-stretchy-horizontal We update the test file to make sure the stretchy <mo> has zero lspace/rspace. Expected results for macOS and iOS are included. * mathml/opentype/munderover-stretch-width-expected.txt: Added. * mathml/opentype/munderover-stretch-width.html: Added. * mathml/opentype/opentype-stretchy-horizontal.html: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Removed. * platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/win/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Removed. Canonical link: https://commits.webkit.org/196552@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-11 03:10:41 +00:00
PASS simple stretchy over
PASS simple stretchy under
PASS embellished op over with wide base
PASS embellished op over with narrow base
PASS unembellished op under with plain op over
PASS nested embellished op
PASS nested non-munderover embellished op
PASS simple stretchy under should equal over
PASS all stretchy embellished op
Incorrect bounds inside <mover>/<munder> when a stretchy operator is present https://bugs.webkit.org/show_bug.cgi?id=179682 Patch by Minsheng Liu <lambda@liu.ms> on 2017-12-10 Reviewed by Frédéric Wang. Source/WebCore: Currently a stretchy operator inside <mover>/<munder>/<munderover> is stretched during paint() rather than layout(), which leads to both end user confusion and many unexpected behaviors. This patch rewrites RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren() to both eliminate the issue and make operator stretching more standard conforming. A test is added to check the stretch width of stretchy operators in various scenarios: mathml/opentype/munderover-stretch-width.html A previous test is updated: mathml/opentype/opentype-stretchy-horizontal.html * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::stretchTo): (WebCore::RenderMathMLOperator::resetStretchSize): (WebCore::RenderMathMLOperator::paint): * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::setStretchWidthLocked): (WebCore::RenderMathMLOperator::isStretchWidthLocked const): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::toHorizontalStretchyOperator): (WebCore::fixLayoutAfterStretch): (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren): LayoutTests: Added test case: mathml/opentype/munderover-stretch-width.html Updated test case: mathml/opentype/opentype-stretchy-horizontal We update the test file to make sure the stretchy <mo> has zero lspace/rspace. Expected results for macOS and iOS are included. * mathml/opentype/munderover-stretch-width-expected.txt: Added. * mathml/opentype/munderover-stretch-width.html: Added. * mathml/opentype/opentype-stretchy-horizontal.html: * platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Removed. * platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.png: * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: * platform/win/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Removed. Canonical link: https://commits.webkit.org/196552@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-11 03:10:41 +00:00