Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c19c7a86d4fa753ed165ccfd96665c209ca5a93c
      
https://github.com/WebKit/WebKit/commit/c19c7a86d4fa753ed165ccfd96665c209ca5a93c
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-18 (Sat, 18 Jul 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-column-reverse-multiline-item-position-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-column-reverse-multiline-item-position-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-column-reverse-multiline-item-position.html
    M Source/WebCore/rendering/RenderFlexLayout.cpp
    M Source/WebCore/rendering/RenderFlexLayout.h

  Log Message:
  -----------
  [cleanup] Reverse column-reverse flex lines against the finalized container 
main size instead of reading it back mid-placement
https://bugs.webkit.org/show_bug.cgi?id=318685

Reviewed by Antti Koivisto.

placeFlexItems grew the column flex container's logical height while 
positioning a line's items and, for
column-reverse, then called updateLogicalHeight() and layoutColumnReverse() 
from inside that same per-line
call, so it produced the container main size and read it back to reverse the 
line in one breath, before the
other lines were placed and before 
distributeMainAxisFreeSpaceForMultilineColumnIfNeeded re-resolved the
short ones.

Move the reverse repositioning out of placeFlexItems into 
reverseColumnLinesFromContainerMainEndIfNeeded, a
single pass run from layout() after the container's main size is finalized 
(updateFlexContainerLogicalHeight)
and after distribute has run. layoutColumnReverse
now takes the finalized main-axis border-box extent as a parameter instead of 
reading m_flexBox.logicalHeight()
back, and placeFlexItems keeps only its height accumulation. This follows the 
spec order: css-flexbox-1 9.2
determines the flex container's main size before 9.5 aligns the items along the 
main axis, and reverse
placement is part of 9.5.

Every line now reverses against the one finalized main size, matching what 
distribute already did when it
re-placed short lines. Single-line, definite-height, and multi-line wrapping 
column-reverse place items
identically; the last is covered by the added test.

* Source/WebCore/rendering/RenderFlexLayout.cpp:
* Source/WebCore/rendering/RenderFlexLayout.h:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-column-reverse-multiline-item-position.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-column-reverse-multiline-item-position-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-column-reverse-multiline-item-position-expected.html:
 Added.

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



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

Reply via email to