Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b68701f13edff4a08d91e0a429bb489689d7263d
      
https://github.com/WebKit/WebKit/commit/b68701f13edff4a08d91e0a429bb489689d7263d
  Author: Alan Baradlay <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/inline-flex-column-image-load-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/inline-flex-column-image-load-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/inline-flex-column-image-load.html
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.h

  Log Message:
  -----------
  Inline-flex container with column flex-direction fails to update width for 
uncached images
https://bugs.webkit.org/show_bug.cgi?id=291890
<rdar://problem/150260401>

Reviewed by Antti Koivisto.

1. First layout runs before image loads. Image has 0 intrinsic size,
   so flex sets overriding height to 0 on the image (main axis size).
2. Image loads, relayout is triggered.
3. Preferred width computation (recomputeLogicalWidth) sees stale
   overriding height 0, derives width = 0 * aspect ratio = 0.
4. Container stays at 0x0.

Overriding sizes were only cleared in constructFlexLayoutItem (inside
performFlexLayout) -- after preferred widths are computed.
The fix clears them at the start of layoutBlock.

This is ok because overriding sizes are outputs of flex layout, set
during performFlexLayout. Nothing between the start of layoutBlock and
performFlexLayout is supposed to depend on previous overriding sizes.

Also rename flexItemCrossSizeShouldUseContainerCrossSize to
hasDefiniteCrossSizeForFlexItem for clarity.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/inline-flex-column-image-load-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/inline-flex-column-image-load-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/inline-flex-column-image-load.html:
 Added.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::clearFlexItemOverridingSizes):
(WebCore::RenderFlexibleBox::layoutBlock):
(WebCore::RenderFlexibleBox::constructFlexLayoutItem):
(WebCore::RenderFlexibleBox::hasDefiniteCrossSizeForFlexItem const):
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeReplacedLogicalWidth const):

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



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

Reply via email to