Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e142f1f93ed0e1e5d9cc4868b880179cf0f5d07d
      
https://github.com/WebKit/WebKit/commit/e142f1f93ed0e1e5d9cc4868b880179cf0f5d07d
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-03-23 (Mon, 23 Mar 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/mo-minsize-maxsize-001-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/size-and-position-of-stretchy-fences-with-default-font-001-expected.txt
    M LayoutTests/platform/glib/mathml/opentype/vertical-expected.txt
    A 
LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/presentation-markup/operators/size-and-position-of-stretchy-fences-with-default-font-001-expected.txt
    M Source/WebCore/rendering/mathml/MathOperator.cpp
    M Source/WebCore/rendering/mathml/MathOperator.h
    M Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

  Log Message:
  -----------
  [MathML] Use unstretched size for minsize/maxsize default and percentages
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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to