Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 848ee4cc0d22b595329273257109a97c98134f9e
      
https://github.com/WebKit/WebKit/commit/848ee4cc0d22b595329273257109a97c98134f9e
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-cross-size-border-box-001-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-cross-size-border-box-001-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-cross-size-border-box-001.html
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.h

  Log Message:
  -----------
  Flex container with border-box sizing provides wrong cross size to stretched 
flex items
https://bugs.webkit.org/show_bug.cgi?id=314673

Reviewed by Antti Koivisto.

  <div style="display: flex; height: 200px; box-sizing: border-box; border: 
10px solid">
    <img src="1x1.png" style="display: block">
  </div>

The image should be 180x180 (content-box height = 200 - 20px border), but was
200x200. computeCrossSizeForFlexItemUsingContainerCrossSize used the raw CSS
height value without adjusting for box-sizing. The percent path and the
column-flow path both correctly return content-box values, but the fixed path
and the min/max clamping did not.

Add adjustContentBoxLogicalHeightForBoxSizing to the fixed height, min-height,
and max-height resolution in computeCrossSizeForFlexItemUsingContainerCrossSize 
(and rename the function).

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-cross-size-border-box-001-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-cross-size-border-box-001-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-cross-size-border-box-001.html:
 Added.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::ScopedCrossAxisOverrideForFlexItem::ScopedCrossAxisOverrideForFlexItem):
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const):
(WebCore::RenderFlexibleBox::innerCrossSizeForFlexItem const):
(WebCore::RenderFlexibleBox::computeCrossSizeForFlexItemUsingContainerCrossSize 
const): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:

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



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

Reply via email to