Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5e8e53d41007fe7d8e3fd3a39dd74ae64b7ba82a
      
https://github.com/WebKit/WebKit/commit/5e8e53d41007fe7d8e3fd3a39dd74ae64b7ba82a
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-12 (Tue, 12 May 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008.html
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h
    M Source/WebCore/rendering/RenderReplaced.cpp

  Log Message:
  -----------
  Percentage max-width on aspect-ratio box resolves against wrong axis in 
perpendicular writing mode
https://bugs.webkit.org/show_bug.cgi?id=314554

Reviewed by Antti Koivisto.

We had two functions:
- computeLogicalWidthFromAspectRatioInternal: height x aspect-ratio, no clamping
- computeLogicalWidthFromAspectRatio: calls Internal, then clamps with min/max

The "Internal" naming was confusing - callers had to know which one to pick
based on context. But the split is simple: preferred-width computation never
wants clamping (min/max is applied later by a shared helper), layout always 
does.

Remove the split. Keep one function (the unconstrained one) named
computeLogicalWidthFromAspectRatio(). The two layout callsites now call
constrainLogicalWidthByMinMax() inline, just like the normal width path already
does. This also fixes an inconsistency (see test case): the old wrapper used
containingBlockLogicalWidthForContent() to resolve percentage min/max, but the
normal path in computeLogicalWidth uses a containerWidthInInlineDirection
variable that accounts for perpendicular writing modes. The aspect-ratio path
now uses the same variable.

Tests: 
imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-ref.html
       
imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008.html:
 Added.
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidth const):
(WebCore::RenderBox::computeIntrinsicKeywordLogicalWidths const):
(WebCore::RenderBox::computeOutOfFlowPositionedLogicalWidthUsing const):
(WebCore::RenderBox::computeLogicalWidthFromAspectRatio const):
(WebCore::RenderBox::computeLogicalWidthFromAspectRatioInternal const): Deleted.
* Source/WebCore/rendering/RenderBox.h:
(WebCore::RenderBox::isUnresolveableStretchSize const):
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computePreferredLogicalWidths):

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



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

Reply via email to