New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in interpretation of mfrac's shifts? #123
Comments
From https://docs.microsoft.com/en-us/typography/opentype/spec/math "Shift — Defines a vertical shift applied to an element sitting on a baseline." So I think this means shifts are relative to the baseline. The description for each constant does not give more details. |
I can confirm nominator shift up and denominator shift down are from baseline. This is consistent with shifts for other math structures, e.g. superscript, where making it relative to math axis doesn't make sense. We will see how to make it clear in the spec. |
@SergeyMalkin Thank you for the confirmation! I'll update the spec/test. Currently the tests use AxisHeight=0 so they work in all browsers, whether or not they use the baseline or math axis as a reference. I need to change that. |
OK spec updated. Waiting for web-platform-tests/wpt#18299 to land before closing. |
This is no longer involved in the layout. See w3c/mathml#123
AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123
AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123
… fraction shifts, a=testonly Automatic update from web-platform-tests MathML: Use non-zero axis height to test fraction shifts (#18299) See w3c/mathml#123 -- wpt-commits: 67aa02fa5eece637bf8ed99f0e3e3f52f1b0aa72 wpt-pr: 18299
…eight parameter., a=testonly Automatic update from web-platform-tests mfrac without bar: Remove test for AxisHeight parameter. (#18323) AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 -- wpt-commits: 3abd8090b7e83bb9271f8a4dcab83dea7b5e97c0 wpt-pr: 18323
… fraction shifts, a=testonly Automatic update from web-platform-tests MathML: Use non-zero axis height to test fraction shifts (#18299) See w3c/mathml#123 -- wpt-commits: 67aa02fa5eece637bf8ed99f0e3e3f52f1b0aa72 wpt-pr: 18299
…eight parameter., a=testonly Automatic update from web-platform-tests mfrac without bar: Remove test for AxisHeight parameter. (#18323) AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 -- wpt-commits: 3abd8090b7e83bb9271f8a4dcab83dea7b5e97c0 wpt-pr: 18323
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 --HG-- extra : moz-landing-system : lando
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 --HG-- extra : moz-landing-system : lando
…m-tests#18323) AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123
https://bugs.webkit.org/show_bug.cgi?id=201242 Patch by Frederic Wang <fwang@igalia.com> on 2019-08-31 Reviewed by Rob Buis. LayoutTests/imported/w3c: Update tests and support files for fractions/stacks parameters. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt: Update expectation now that AxisHeight is no longer involved in stacks. * web-platform-tests/fonts/math/fraction-denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-denominatorshiftdown3000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratorshiftup11000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomdisplaystyleshiftdown5000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomshiftdown6000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topdisplaystyleshiftup3000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topshiftup9000-axisheight1000.woff: Added. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html: * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html: * web-platform-tests/mathml/support/feature-detection.js: Added. (MathMLFeatureDetection.has_mspace): (MathMLFeatureDetection.has_operator_spacing): (MathMLFeatureDetection.has_mfrac): (MathMLFeatureDetection.has_msqrt): (MathMLFeatureDetection.has_menclose): (MathMLFeatureDetection.has_dir): (MathMLFeatureDetection.ensure_for_match_reftest): Source/WebCore: In fractions, numerator/denominator shifts are currently interpreted relative to the math axis while they should be relative to the baseline [1]. This patch refactors the RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious rendering bugs in fractions. [1] w3c/mathml#123 [2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness [3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness No new tests, existing tests updated. * rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with fractionAscent() which gives the actual baseline position rather than the math axis position. fractionParameters() and stackParameters() are modified so that they only return the shifts, now stored in a shared FractionParameters struct. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local variables and perform adjustments to the shift values so that the minimal gap constraints are satisfied. Return them as a FractionParameters. (WebCore::RenderMathMLFraction::stackParameters const): Ditto. (WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize changeset, this continues to ignore contribution of denominator size and not to distinguish ink or non-ink metrics. (WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just calculated as a shift from the baseline. The height is given by the bottom of the denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any sense. (WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of ascentOverHorizontalAxis(). (WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto. LayoutTests: * TestExpectations: Skip mathml/presentation/stretchy-depth-height-symmetric.html since it cannot work in a reliable way and should be rewritten. Equivalent checks seem essentially covered by WPT test mathml/presentation-markup/operators/mo-axis-height-1.html. See bug 201356. * platform/win/mathml/presentation/roots-expected.txt: Update windows expectation. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@249360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=201242 Patch by Frederic Wang <fwang@igalia.com> on 2019-08-31 Reviewed by Rob Buis. LayoutTests/imported/w3c: Update tests and support files for fractions/stacks parameters. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt: Update expectation now that AxisHeight is no longer involved in stacks. * web-platform-tests/fonts/math/fraction-denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-denominatorshiftdown3000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratorshiftup11000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomdisplaystyleshiftdown5000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomshiftdown6000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topdisplaystyleshiftup3000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topshiftup9000-axisheight1000.woff: Added. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html: * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html: * web-platform-tests/mathml/support/feature-detection.js: Added. (MathMLFeatureDetection.has_mspace): (MathMLFeatureDetection.has_operator_spacing): (MathMLFeatureDetection.has_mfrac): (MathMLFeatureDetection.has_msqrt): (MathMLFeatureDetection.has_menclose): (MathMLFeatureDetection.has_dir): (MathMLFeatureDetection.ensure_for_match_reftest): Source/WebCore: In fractions, numerator/denominator shifts are currently interpreted relative to the math axis while they should be relative to the baseline [1]. This patch refactors the RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious rendering bugs in fractions. [1] w3c/mathml#123 [2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness [3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness No new tests, existing tests updated. * rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with fractionAscent() which gives the actual baseline position rather than the math axis position. fractionParameters() and stackParameters() are modified so that they only return the shifts, now stored in a shared FractionParameters struct. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local variables and perform adjustments to the shift values so that the minimal gap constraints are satisfied. Return them as a FractionParameters. (WebCore::RenderMathMLFraction::stackParameters const): Ditto. (WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize changeset, this continues to ignore contribution of denominator size and not to distinguish ink or non-ink metrics. (WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just calculated as a shift from the baseline. The height is given by the bottom of the denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any sense. (WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of ascentOverHorizontalAxis(). (WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto. LayoutTests: * TestExpectations: Skip mathml/presentation/stretchy-depth-height-symmetric.html since it cannot work in a reliable way and should be rewritten. Equivalent checks seem essentially covered by WPT test mathml/presentation-markup/operators/mo-axis-height-1.html. See bug 201356. * platform/win/mathml/presentation/roots-expected.txt: Update windows expectation. git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.26@249406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… fraction shifts, a=testonly Automatic update from web-platform-tests MathML: Use non-zero axis height to test fraction shifts (#18299) See w3c/mathml#123 -- wpt-commits: 67aa02fa5eece637bf8ed99f0e3e3f52f1b0aa72 wpt-pr: 18299 UltraBlame original commit: ff1a1dfad00a10f6bd4ef00e49b40487696f002c
…eight parameter., a=testonly Automatic update from web-platform-tests mfrac without bar: Remove test for AxisHeight parameter. (#18323) AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 -- wpt-commits: 3abd8090b7e83bb9271f8a4dcab83dea7b5e97c0 wpt-pr: 18323 UltraBlame original commit: a4e156a747af12993126a764404b99124a24d5c5
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 UltraBlame original commit: a5d589b74745dca4d522d3abb362103074b03bde
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 UltraBlame original commit: aa4c230df929a0387b38bb4e0d13c24142000113
… fraction shifts, a=testonly Automatic update from web-platform-tests MathML: Use non-zero axis height to test fraction shifts (#18299) See w3c/mathml#123 -- wpt-commits: 67aa02fa5eece637bf8ed99f0e3e3f52f1b0aa72 wpt-pr: 18299 UltraBlame original commit: ff1a1dfad00a10f6bd4ef00e49b40487696f002c
…eight parameter., a=testonly Automatic update from web-platform-tests mfrac without bar: Remove test for AxisHeight parameter. (#18323) AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 -- wpt-commits: 3abd8090b7e83bb9271f8a4dcab83dea7b5e97c0 wpt-pr: 18323 UltraBlame original commit: a4e156a747af12993126a764404b99124a24d5c5
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 UltraBlame original commit: a5d589b74745dca4d522d3abb362103074b03bde
… fraction shifts, a=testonly Automatic update from web-platform-tests MathML: Use non-zero axis height to test fraction shifts (#18299) See w3c/mathml#123 -- wpt-commits: 67aa02fa5eece637bf8ed99f0e3e3f52f1b0aa72 wpt-pr: 18299 UltraBlame original commit: ff1a1dfad00a10f6bd4ef00e49b40487696f002c
…eight parameter., a=testonly Automatic update from web-platform-tests mfrac without bar: Remove test for AxisHeight parameter. (#18323) AxisHeight is no longer involved in the layout: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 -- wpt-commits: 3abd8090b7e83bb9271f8a4dcab83dea7b5e97c0 wpt-pr: 18323 UltraBlame original commit: a4e156a747af12993126a764404b99124a24d5c5
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 UltraBlame original commit: a5d589b74745dca4d522d3abb362103074b03bde
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 UltraBlame original commit: aa4c230df929a0387b38bb4e0d13c24142000113
…nts without bar. r=emilio AxisHeight is not involved in the layout of <mfrac> with zero linethickness: https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness Confirmed by Microsoft: https://lists.w3.org/Archives/Public/public-mathml4/2019Aug/0019.html See w3c/mathml#123 Differential Revision: https://phabricator.services.mozilla.com/D41189 UltraBlame original commit: aa4c230df929a0387b38bb4e0d13c24142000113
https://bugs.webkit.org/show_bug.cgi?id=201242 Patch by Frederic Wang <fwang@igalia.com> on 2019-08-31 Reviewed by Rob Buis. LayoutTests/imported/w3c: Update tests and support files for fractions/stacks parameters. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt: Update expectation now that AxisHeight is no longer involved in stacks. * web-platform-tests/fonts/math/fraction-denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-denominatorshiftdown3000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratorshiftup11000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomdisplaystyleshiftdown5000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomshiftdown6000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topdisplaystyleshiftup3000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topshiftup9000-axisheight1000.woff: Added. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html: * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html: * web-platform-tests/mathml/support/feature-detection.js: Added. (MathMLFeatureDetection.has_mspace): (MathMLFeatureDetection.has_operator_spacing): (MathMLFeatureDetection.has_mfrac): (MathMLFeatureDetection.has_msqrt): (MathMLFeatureDetection.has_menclose): (MathMLFeatureDetection.has_dir): (MathMLFeatureDetection.ensure_for_match_reftest): Source/WebCore: In fractions, numerator/denominator shifts are currently interpreted relative to the math axis while they should be relative to the baseline [1]. This patch refactors the RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious rendering bugs in fractions. [1] w3c/mathml#123 [2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness [3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness No new tests, existing tests updated. * rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with fractionAscent() which gives the actual baseline position rather than the math axis position. fractionParameters() and stackParameters() are modified so that they only return the shifts, now stored in a shared FractionParameters struct. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local variables and perform adjustments to the shift values so that the minimal gap constraints are satisfied. Return them as a FractionParameters. (WebCore::RenderMathMLFraction::stackParameters const): Ditto. (WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize changeset, this continues to ignore contribution of denominator size and not to distinguish ink or non-ink metrics. (WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just calculated as a shift from the baseline. The height is given by the bottom of the denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any sense. (WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of ascentOverHorizontalAxis(). (WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto. LayoutTests: * TestExpectations: Skip mathml/presentation/stretchy-depth-height-symmetric.html since it cannot work in a reliable way and should be rewritten. Equivalent checks seem essentially covered by WPT test mathml/presentation-markup/operators/mo-axis-height-1.html. See bug 201356. * platform/win/mathml/presentation/roots-expected.txt: Update windows expectation. Canonical link: https://commits.webkit.org/215029@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=201242 Patch by Frederic Wang <fwang@igalia.com> on 2019-08-31 Reviewed by Rob Buis. LayoutTests/imported/w3c: Update tests and support files for fractions/stacks parameters. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt: Update expectation now that AxisHeight is no longer involved in stacks. * web-platform-tests/fonts/math/fraction-denominatordisplaystyleshiftdown6000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-denominatorshiftdown3000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratordisplaystyleshiftup2000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/fraction-numeratorshiftup11000-axisheight1000-rulethickness1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomdisplaystyleshiftdown5000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-bottomshiftdown6000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topdisplaystyleshiftup3000-axisheight1000.woff: Added. * web-platform-tests/fonts/math/stack-topshiftup9000-axisheight1000.woff: Added. * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html: * web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html: * web-platform-tests/mathml/support/feature-detection.js: Added. (MathMLFeatureDetection.has_mspace): (MathMLFeatureDetection.has_operator_spacing): (MathMLFeatureDetection.has_mfrac): (MathMLFeatureDetection.has_msqrt): (MathMLFeatureDetection.has_menclose): (MathMLFeatureDetection.has_dir): (MathMLFeatureDetection.ensure_for_match_reftest): Source/WebCore: In fractions, numerator/denominator shifts are currently interpreted relative to the math axis while they should be relative to the baseline [1]. This patch refactors the RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious rendering bugs in fractions. [1] w3c/mathml#123 [2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness [3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness No new tests, existing tests updated. * rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with fractionAscent() which gives the actual baseline position rather than the math axis position. fractionParameters() and stackParameters() are modified so that they only return the shifts, now stored in a shared FractionParameters struct. * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local variables and perform adjustments to the shift values so that the minimal gap constraints are satisfied. Return them as a FractionParameters. (WebCore::RenderMathMLFraction::stackParameters const): Ditto. (WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize changeset, this continues to ignore contribution of denominator size and not to distinguish ink or non-ink metrics. (WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just calculated as a shift from the baseline. The height is given by the bottom of the denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any sense. (WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of ascentOverHorizontalAxis(). (WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto. LayoutTests: * TestExpectations: Skip mathml/presentation/stretchy-depth-height-symmetric.html since it cannot work in a reliable way and should be rewritten. Equivalent checks seem essentially covered by WPT test mathml/presentation-markup/operators/mo-axis-height-1.html. See bug 201356. * platform/win/mathml/presentation/roots-expected.txt: Update windows expectation.
cc @rwlbuis
In https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness and https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness, MathML Core follows figure 2 of
https://www.tug.org/~vieth/papers/bachotex2009/ot-math-paper.pdf
which interprets shifts relative to math axis. I would need to check the TeXBook but at least Firefox interpret them relative to the baseline:
https://searchfox.org/mozilla-central/source/layout/mathml/nsMathMLmfracFrame.cpp#360
The text was updated successfully, but these errors were encountered: