[webkit-changes] [WebKit/WebKit] c28da9: [Multicol][IFC] Support floats in multicolumn content

Antti Koivisto noreply at github.com
Tue Sep 19 08:54:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c28da984b5ca8fb4bf7941f1b932dd6dd92c0724
      https://github.com/WebKit/WebKit/commit/c28da984b5ca8fb4bf7941f1b932dd6dd92c0724
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M LayoutTests/fast/multicol/simple-line-layout-line-index-after-strut.html
    M LayoutTests/platform/glib/fast/multicol/float-paginate-complex-expected.txt
    M LayoutTests/platform/ios/fast/multicol/float-paginate-complex-expected.txt
    M LayoutTests/platform/mac/fast/multicol/float-paginate-complex-expected.txt
    M Source/WebCore/layout/floats/FloatingContext.cpp
    M Source/WebCore/layout/floats/FloatingContext.h
    M Source/WebCore/layout/floats/FloatingState.cpp
    M Source/WebCore/layout/floats/FloatingState.h
    M Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationCoverage.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationPagination.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationPagination.h
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderBlockFlow.h

  Log Message:
  -----------
  [Multicol][IFC] Support floats in multicolumn content
https://bugs.webkit.org/show_bug.cgi?id=261683
rdar://115665905

Reviewed by Alan Baradlay.

* LayoutTests/fast/multicol/simple-line-layout-line-index-after-strut.html:
* LayoutTests/platform/mac/fast/multicol/float-paginate-complex-expected.txt:
* Source/WebCore/layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::makeFloatItem const):
(WebCore::Layout::FloatingContext::toFloatItem const): Deleted.
* Source/WebCore/layout/floats/FloatingContext.h:
(WebCore::Layout::FloatingContext::makeFloatItem):
* Source/WebCore/layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatItem::FloatItem):
* Source/WebCore/layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::placedByLine const):
* Source/WebCore/layout/formattingContexts/block/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFloatContentOnly):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::tryPlacingFloatBox):

Save the line index that placed the float.

* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForChild):

Enable floats in multicol.

* Source/WebCore/layout/integration/LayoutIntegrationCoverage.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateRenderTreePositions):

Adjust the float render tree positions.

(WebCore::LayoutIntegration::LineLayout::adjustContent):
* Source/WebCore/layout/integration/inline/LayoutIntegrationPagination.cpp:
(WebCore::LayoutIntegration::computeAdjustmentsForPagination):

Pass the float bottom to the pagination adjustment code so we don't break page in the middle of a float.
In case of a float containing inline content, breaking is allowed after the first line.

* Source/WebCore/layout/integration/inline/LayoutIntegrationPagination.h:
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeLineAdjustmentForPagination):
* Source/WebCore/rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::computeLineAdjustmentForPagination):

Apply the provided line height minimum from a float.
Allow breaking on the first line if the line contains a float.

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




More information about the webkit-changes mailing list