[webkit-changes] [WebKit/WebKit] fb99b5: [IFC] Cache last preferred with line layout result

Alan Baradlay noreply at github.com
Sun Aug 13 22:53:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fb99b56f8520df11229930eb65c690161470883b
      https://github.com/WebKit/WebKit/commit/fb99b56f8520df11229930eb65c690161470883b
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-08-13 (Sun, 13 Aug 2023)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/FormattingContext.h
    M Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp
    M Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/TextOnlyLineBuilder.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h

  Log Message:
  -----------
  [IFC] Cache last preferred with line layout result
https://bugs.webkit.org/show_bug.cgi?id=260058

Reviewed by Antti Koivisto.

Let's cache the last preferred with line breaking result and reuse it at the subsequent layout when applicable (currently supported case: one-liner text-only content).

(1. InlineFormattingContext needs to outlive LineLayout::computeIntrinsicWidthConstraints -> promote it to a class member
 2. Pass damage object to layout functions
 3. Move horizontalAlignmentOffset to a helper class
 4. FormattingContext::computedIntrinsicWidthConstraints is non-functioning codepath now )

* PerformanceTests/Layout/line-layout.html:
* Source/WebCore/layout/formattingContexts/FormattingContext.h: This codepath is not used anymore.
(WebCore::Layout::FormattingContext::computedIntrinsicWidthConstraints):
* Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp:
(WebCore::Layout::FlexLayout::maxContentForFlexItem const):
(WebCore::Layout::FlexLayout::hypotheticalCrossSizeForFlexItems const):
* Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::layoutInFlowAndFloatContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicSizes):
(WebCore::Layout::InlineFormattingContext::lineLayout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint):
(WebCore::Layout::InlineFormattingContext::createDisplayContentForLineFromCachedContent):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): Deleted.
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
(WebCore::Layout::InlineFormattingGeometry::contentLeftAfterLastLine const):
(WebCore::Layout::InlineFormattingGeometry::horizontalAlignmentOffset):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::horizontalAlignmentOffset): Deleted.
* Source/WebCore/layout/formattingContexts/inline/TextOnlyLineBuilder.cpp:
(WebCore::Layout::TextOnlyLineBuilder::layoutInlineContent):
(WebCore::Layout::horizontalAlignmentOffset): Deleted.
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::LineLayout):
(WebCore::LayoutIntegration::LineLayout::computeIntrinsicWidthConstraints):
(WebCore::LayoutIntegration::LineLayout::layout):
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:

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




More information about the webkit-changes mailing list