[MathML] Use unstretched size for minsize/maxsize default and percentages#59200
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Mar 23, 2026
Conversation
Collaborator
|
EWS run on previous version of this PR (hash cc1c8a6) Details |
cc1c8a6 to
dd3e4f1
Compare
Collaborator
|
EWS run on previous version of this PR (hash dd3e4f1) Details |
Contributor
|
dd3e4f1 to
39e1a01
Compare
Collaborator
|
EWS run on previous version of this PR (hash 39e1a01) Details |
Contributor
Author
You are right about both issues:
|
39e1a01 to
fdcb08a
Compare
Collaborator
|
EWS run on previous version of this PR (hash fdcb08a) Details |
fred-wang
approved these changes
Mar 10, 2026
Contributor
fred-wang
left a comment
There was a problem hiding this comment.
LGTM, but please see comments.
fdcb08a to
9755a02
Compare
Collaborator
|
EWS run on previous version of this PR (hash 9755a02) Details |
9755a02 to
495acd9
Compare
Collaborator
|
EWS run on current version of this PR (hash 495acd9) Details |
…ages https://bugs.webkit.org/show_bug.cgi?id=308423 rdar://170908253 Reviewed by Frédéric Wang. Per MathML Core section 3.2.4.3 "Layout of operators" (https://w3c.github.io/mathml-core/#layout-of-operators), under the block (vertical) stretch axis path, the spec says: "Let minsize and maxsize be the minsize and maxsize properties on the operator. Percentage values are interpreted relative to the height of g." This says percentage values for minsize/maxsize are relative to the height of the base glyph (the unstretched size). Store the unstretched size in MathOperator during reset() and use it as the reference value for minsize/maxsize calculations. Per step 5 of the layout algorithm, the spec also says: "If minsize < 0 then set minsize to 0. If maxsize < minsize then set maxsize to minsize." This clamping is performed in stretchTo() to match the spec's algorithm structure, where minSize()/maxSize() return unclamped values. Note that minsize/maxsize only appear in the block (vertical) stretch axis section of the spec. The inline (horizontal) stretch path has no minsize/maxsize step, so we only compute the unstretched size for vertical operators. * LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001-expected.txt: Progressions * LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/size-and-position-of-stretchy-fences-with-default-font-001-expected.txt: Rebaseline * LayoutTests/platform/glib/mathml/opentype/vertical-expected.txt: Ditto * LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/size-and-position-of-stretchy-fences-with-default-font-001-expected.txt: Platform Specific Expectation * Source/WebCore/rendering/mathml/MathOperator.cpp: (WebCore::MathOperator::reset): * Source/WebCore/rendering/mathml/MathOperator.h: (WebCore::MathOperator::unstretchedSize const): * Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::minSize const): (WebCore::RenderMathMLOperator::maxSize const): (WebCore::RenderMathMLOperator::stretchTo): Canonical link: https://commits.webkit.org/309764@main
495acd9 to
e142f1f
Compare
Collaborator
|
Committed 309764@main (e142f1f): https://commits.webkit.org/309764@main Reviewed commits have been landed. Closing PR #59200 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 mac-apple
e142f1f
495acd9