[webkit-changes] [WebKit/WebKit] 1fe3e4: [LFC][Floats] Float layout is BFC concept

Alan Baradlay noreply at github.com
Sat Nov 12 13:11:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1fe3e43cf187f7c68b49b3c1e78addd856b94463
      https://github.com/WebKit/WebKit/commit/1fe3e43cf187f7c68b49b3c1e78addd856b94463
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2022-11-12 (Sat, 12 Nov 2022)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/layout/FormattingState.cpp
    M Source/WebCore/layout/FormattingState.h
    M Source/WebCore/layout/LayoutState.cpp
    M Source/WebCore/layout/LayoutState.h
    M Source/WebCore/layout/floats/FloatingState.cpp
    M Source/WebCore/layout/floats/FloatingState.h
    M Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp
    M Source/WebCore/layout/formattingContexts/block/BlockFormattingState.cpp
    M Source/WebCore/layout/formattingContexts/block/BlockFormattingState.h
    M Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h
    M Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingState.cpp
    M Source/WebCore/layout/formattingContexts/flex/FlexFormattingState.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h
    M Source/WebCore/layout/formattingContexts/table/TableFormattingState.cpp
    M Source/WebCore/layout/formattingContexts/table/TableFormattingState.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h
    M Source/WebCore/layout/layouttree/LayoutBox.cpp

  Log Message:
  -----------
  [LFC][Floats] Float layout is BFC concept
https://bugs.webkit.org/show_bug.cgi?id=247821

Reviewed by Antti Koivisto.

Floats always belong to a block formatting context.

1. Only BlockFormattingState should instantiate a FloatingState (ICB in many cases).
2. FloatingState should be pushed to the InlineFormattingContext as part of the block layout state (instead of adding it to the InlineFormattingState).
3. When a block container establishes both BFC and IFC, we should not skip instantiating the associated BFC (FIXME).

(The integration IFC codepath now explicitly creates the parent BFC state. This is more inline with how the full LFC logic will look like.)

* Source/WebCore/layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* Source/WebCore/layout/FormattingState.h:
(WebCore::Layout::FormattingState::floatingState const): Deleted.
* Source/WebCore/layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::ensureInlineFormattingState):
(WebCore::Layout::LayoutState::ensureBlockFormattingState):
(WebCore::Layout::LayoutState::ensureTableFormattingState):
(WebCore::Layout::LayoutState::ensureFlexFormattingState):
* Source/WebCore/layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatingState):
* Source/WebCore/layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::root const):
(WebCore::Layout::FloatingState::create): Deleted.
* Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp:
(WebCore::Layout::FormattingGeometry::complicatedCases const):
* Source/WebCore/layout/formattingContexts/block/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* Source/WebCore/layout/formattingContexts/block/BlockFormattingState.h:
(WebCore::Layout::BlockFormattingState::floatingState const):
(WebCore::Layout::BlockFormattingState::floatingState):
* Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h:
(WebCore::Layout::BlockLayoutState::floatingState):
(WebCore::Layout::BlockLayoutState::BlockLayoutState):
* Source/WebCore/layout/formattingContexts/block/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockMarginCollapse::marginsCollapseThrough const):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingState.cpp:
(WebCore::Layout::FlexFormattingState::FlexFormattingState):
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingState.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntegration):
(WebCore::Layout::InlineFormattingContext::usedContentHeight const):
(WebCore::Layout::InlineFormattingContext::lineLayout):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h:
* Source/WebCore/layout/formattingContexts/table/TableFormattingState.cpp:
(WebCore::Layout::TableFormattingState::TableFormattingState):
* Source/WebCore/layout/formattingContexts/table/TableFormattingState.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::LineLayout):
(WebCore::LayoutIntegration::LineLayout::layout):
(WebCore::LayoutIntegration::LineLayout::constructContent):
(WebCore::LayoutIntegration::LineLayout::prepareFloatingState):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:

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




More information about the webkit-changes mailing list