Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b7b9c435e3b760397d09d20d7ba773ae6e1c766f
      
https://github.com/WebKit/WebKit/commit/b7b9c435e3b760397d09d20d7ba773ae6e1c766f
  Author: Elika Etemad <[email protected]>
  Date:   2026-01-08 (Thu, 08 Jan 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-014-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-002-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-003-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-overflow-002-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/scrollable-overflow-height-with-flex-item-margin-inline-end-rtl-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/scrollable-overflow-zero-one-axis-expected.txt
    R 
LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-002-expected.txt
    M Source/WebCore/platform/graphics/LayoutRect.h
    M Source/WebCore/rendering/LegacyInlineFlowBox.cpp
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBlock.h
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderBlockFlow.h
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBox.h
    M Source/WebCore/rendering/RenderBoxFragmentInfo.h
    M Source/WebCore/rendering/RenderBoxInlines.h
    M Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderGrid.cpp
    M Source/WebCore/rendering/RenderGrid.h
    M Source/WebCore/rendering/RenderMultiColumnSet.cpp
    M Source/WebCore/rendering/RenderOverflow.h
    M Source/WebCore/rendering/RenderTable.cpp
    M Source/WebCore/rendering/RenderTextControlSingleLine.cpp
    M Source/WebCore/rendering/svg/RenderSVGBlock.cpp
    M Source/WebCore/rendering/svg/RenderSVGBlock.h

  Log Message:
  -----------
  Handle padding and margins correctly for flex and grid in all writing modes
https://bugs.webkit.org/show_bug.cgi?id=218579
rdar://71046552

Reviewed by Alan Baradlay.

Encodes tracking of in-flow scrollable content edges into RenderOverflow
as rectangles, and more cleanly tracks margin-box overflow of items by
handling it as an option within the existing addOverflow* methods.

Using rectangles means we can easily handle all the writing modes correctly,
thus many tests are fixed. \^_^/

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-014-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-002-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-003-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/scrollable-overflow-height-with-flex-item-margin-inline-end-rtl-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/scrollable-overflow-zero-one-axis-expected.txt:
* 
LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-002-expected.txt:
 Removed.

Pass more tests.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-overflow-002-expected.txt:

Rebaseline. (The test needs to be fixed upstream; the behavior is correct.)

* Source/WebCore/platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::floorSize):

Add utility method.

* Source/WebCore/rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::setVisualOverflow):

Update call to RenderOverflow constructor.

* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow):

Remove tangled up writing mode handling with simpler logic using stored
content area rectangle. This is now more correct.

(WebCore::RenderBlock::clearLayoutOverflow):

Update to also clear the content area rectangle.

(WebCore::RenderBlock::simplifiedLayout):
* Source/WebCore/rendering/RenderBlock.h:
(WebCore::RenderBlock::computeOverflow):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::computeOverflow):
* Source/WebCore/rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::computeOverflow):

Update to retrieve / track / pass content area rectangle instead of single 
coord.

* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::addOverflowWithRendererOffset):

Remove code that has super tangled up writing mode handling and embeds
subclass logic into this superclass, and replace with a generic option
to track margin areas.

(WebCore::RenderBox::ensureOverflow):

Update call to RenderOverflow constructor.

* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderBoxInlines.h:
(WebCore::RenderBox::flippedContentBoxRect const):

Add new convenience method to retrieve flipped contentBoxRect().
Add more options to ComputeOverflowOptions for addOverflow*

* Source/WebCore/rendering/RenderBoxFragmentInfo.h:
(WebCore::RenderBoxFragmentInfo::createOverflow):

Update call to RenderOverflow constructor.

* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::RenderDeprecatedFlexibleBox::layoutSingleClampedFlexItem):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):

Update computeOverflow call to use new API and margin tracking option.

* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGrid):
(WebCore::RenderGrid::layoutMasonry):
Update computeOverflow call to use new API and margin tracking option.

(WebCore::RenderGrid::contentOverflowRect const):
(WebCore::RenderGrid::computeOverflow): Deleted.
* Source/WebCore/rendering/RenderGrid.h:

Add method to calculate the content area rectangle to pass to computeOverflow
and remove now unneeded computeOverflow method.

* Source/WebCore/rendering/RenderOverflow.h:
(WebCore::RenderOverflow::RenderOverflow):
(WebCore::RenderOverflow::contentArea const):
(WebCore::RenderOverflow::addContentOverflow):
(WebCore::RenderOverflow::setContentArea):
(WebCore::RenderOverflow::move):
(WebCore::RenderOverflow::layoutClientAfterEdge const): Deleted.
(WebCore::RenderOverflow::setLayoutClientAfterEdge): Deleted.

Set up tracking for content area rectangle.

* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* Source/WebCore/rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
* Source/WebCore/rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::computeOverflow):
* Source/WebCore/rendering/svg/RenderSVGBlock.h:

Update to new computeOverflow API.

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



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

Reply via email to