[webkit-changes] [WebKit/WebKit] 8ac5e0: [IFC][Cleanup] InlineFormattingContext should cons...

Alan Baradlay noreply at github.com
Sun Oct 1 09:56:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8ac5e0757320bc7618772f73c7874f5ce56c73a3
      https://github.com/WebKit/WebKit/commit/8ac5e0757320bc7618772f73c7874f5ce56c73a3
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-10-01 (Sun, 01 Oct 2023)

  Changed paths:
    M Source/WebCore/layout/LayoutContext.cpp
    M Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp

  Log Message:
  -----------
  [IFC][Cleanup] InlineFormattingContext should construct/own InlineLayoutState
https://bugs.webkit.org/show_bug.cgi?id=262410

Reviewed by Antti Koivisto.

1. InlineLayoutState holds the state of the current layout.
2. InlineLayoutState is not supposed to outlive the current inline layout frame.

Block containers can use this to pass in context to IFC (e.g. line clamp) and/or builders can use this
to communicate between each other within the current formatting frame.

(Not to confuse it with FormattingState which is where we currently cache content across layout frames)

This is in preparation for cleaning up FormattingState/FormattingContext confusion.

* Source/WebCore/layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createFormattingContext):
* Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp:
(WebCore::Layout::FlexLayout::maxContentForFlexItem const):
(WebCore::Layout::FlexLayout::hypotheticalCrossSizeForFlexItems const):
* Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp:
(WebCore::Layout::InlineContentBalancer::InlineContentBalancer):
(WebCore::Layout::InlineContentBalancer::initialize):
* Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::updateInlineLayoutStateWithLineLayoutResult):
(WebCore::Layout::InlineFormattingContext::createDisplayContentForInlineContent):
(WebCore::Layout::InlineFormattingContext::createDisplayContentForLineFromCachedContent):
(WebCore::Layout::InlineFormattingContext::initializeLayoutState):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLayoutState.h:
(WebCore::Layout::InlineLayoutState::setHyphenationLimitLines):
(WebCore::Layout::InlineLayoutState::setNestedListMarkerOffsets):
(WebCore::Layout::InlineLayoutState::nestedListMarkerOffset const):
(WebCore::Layout::InlineLayoutState::InlineLayoutState):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::LineBoxBuilder):
(WebCore::Layout::LineBoxBuilder::adjustOutsideListMarkersPosition):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h:
(WebCore::Layout::LineBoxBuilder::inlineLayoutState const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::LineBuilder):
(WebCore::Layout::LineBuilder::floatConstrainedRect const):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineBuilder::inlineLayoutState const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
(WebCore::Layout::LineBuilder::blockLayoutState const):
(WebCore::Layout::LineBuilder::inlineLayoutState const): Deleted.
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp:
(WebCore::Layout::IntrinsicWidthHandler::computedIntrinsicSizes):
(WebCore::Layout::IntrinsicWidthHandler::maximumContentSize):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::computeIntrinsicWidthConstraints):
(WebCore::LayoutIntegration::LineLayout::layout):

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




More information about the webkit-changes mailing list