Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1e430f5db737bb67c883106c684a478d57c45482
      
https://github.com/WebKit/WebKit/commit/1e430f5db737bb67c883106c684a478d57c45482
  Author: Alan Baradlay <[email protected]>
  Date:   2025-11-22 (Sat, 22 Nov 2025)

  Changed paths:
    A 
LayoutTests/fast/inline/blocks-in-inline-layout-with-margin-after-expected.html
    A LayoutTests/fast/inline/blocks-in-inline-layout-with-margin-after.html
    M Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h
    M 
Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationPagination.cpp

  Log Message:
  -----------
  [blocks-in-inline] Add support for block after side of margin handling
https://bugs.webkit.org/show_bug.cgi?id=302995

Reviewed by Antti Koivisto.

When MarginState has non-zero margin _after_ the last line, it means this margin
is getting collapsed over to the end side of the IFC block (it essentially means
that the last content in this IFC is a block box with margin end and it is 
adjacent
to the IFC root's margin end.)
However since this margin already stretches the last line (we don't know ahead 
of time
whether it is going to be the last one) we need to re-adjust it by shrinking 
(and moving).

Test: fast/inline/blocks-in-inline-layout-with-margin-after.html

* 
LayoutTests/fast/inline/blocks-in-inline-layout-with-margin-after-expected.html:
 Added.
* LayoutTests/fast/inline/blocks-in-inline-layout-with-margin-after.html: Added.
* Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h:
(WebCore::Layout::BlockLayoutState::MarginState::resetMarginValues):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::updateLayoutStateWithLineLayoutResult):
Reset the margin when it is adjacent to inline content -no collapsing.

* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLine.h:
(WebCore::InlineDisplay::Line::moveInBlockDirection):
(WebCore::InlineDisplay::Line::shrinkInBlockDirection):
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp:
(WebCore::Layout::InlineDisplayLineBuilder::adjustLineBlockAfterSideWithCollapsedMargin):
* 
Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayLineBuilder.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::shiftLinesBy):
* Source/WebCore/layout/integration/inline/LayoutIntegrationPagination.cpp:
(WebCore::LayoutIntegration::adjustLinePositionsForPagination):

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



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

Reply via email to