[webkit-changes] [WebKit/WebKit] a58f00: [IFC] InlineFormattingContext should not cache any...

Alan Baradlay noreply at github.com
Wed Aug 30 16:34:42 PDT 2023


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

  Changed paths:
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    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/InlineFormattingState.h
    M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.h
    A Source/WebCore/layout/formattingContexts/inline/LineLayoutResult.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h

  Log Message:
  -----------
  [IFC] InlineFormattingContext should not cache any state
https://bugs.webkit.org/show_bug.cgi?id=260919

Reviewed by Antti Koivisto.

FormattingContext classes are essentially just a collection of static-like functions with no state whatsoever.
This patch moves m_maximumIntrinsicWidthResultForSingleLine from InlineFormattingContext to InlineFormattingState.

(It is used to cache some state between preferred width computation and the subsequent line layout.)

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.h:
(): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::computedIntrinsicSizes):
(WebCore::Layout::InlineFormattingContext::createDisplayContentForLineFromCachedContent):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h:
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::setMaximumIntrinsicWidthLayoutResult):
(WebCore::Layout::InlineFormattingState::clearMaximumIntrinsicWidthLayoutResult):
(WebCore::Layout::InlineFormattingState::maximumIntrinsicWidthLayoutResult):
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.h:
(WebCore::Layout::IntrinsicWidthHandler::maximumIntrinsicWidthResult):
(WebCore::Layout::IntrinsicWidthHandler::maximumIntrinsicWidthResult const): 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/267472@main




More information about the webkit-changes mailing list