Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91904fc633cb4554e1fdc653b170f4fe1087636d
      
https://github.com/WebKit/WebKit/commit/91904fc633cb4554e1fdc653b170f4fe1087636d
  Author: Ahmad Saleem <[email protected]>
  Date:   2025-12-31 (Wed, 31 Dec 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/mpadded/mpadded-002-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/mpadded/mpadded-percentage-002-expected.txt
    M Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp

  Log Message:
  -----------
  <mpadded> should treat percentage values as absent for width/height/depth 
attribute
https://bugs.webkit.org/show_bug.cgi?id=304790
rdar://167350169

Reviewed by Alan Baradlay.

According to the MathML Core specification [1], if the width, height, or
depth attributes are percentages, they should be treated as if absent
(using default values based on the inner box dimensions). Previously, these
percentage values were incorrectly resolved relative to the content dimensions.

This patch checks for LengthType::Percentage in mpaddedWidth(), mpaddedHeight(),
and mpaddedDepth(), and returns the content dimension directly when a percentage
is encountered, matching the behavior for absent/invalid attributes.

[1] https://w3c.github.io/mathml-core/#inner-box-and-requested-parameters

As drive-by, we updated to use std::max(0_lu, ..) rather than explicity
std::max<LayoutUnit> similar to through out other code.

* Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp:
(WebCore::RenderMathMLPadded::lspace const): Drive-by fix
(WebCore::RenderMathMLPadded::mpaddedWidth const):
(WebCore::RenderMathMLPadded::mpaddedHeight const):
(WebCore::RenderMathMLPadded::mpaddedDepth const):

> Progressions:
* 
LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/mpadded/mpadded-002-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/mpadded/mpadded-percentage-002-expected.txt:

Canonical link: https://commits.webkit.org/305027@main



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

Reply via email to