[webkit-changes] [WebKit/WebKit] 6329f3: [LFC][Floating] LineBuilder shouldn't mutate float...

Alan Baradlay noreply at github.com
Thu May 4 19:10:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6329f3456d6a2794ee1e553a7714668da90d985f
      https://github.com/WebKit/WebKit/commit/6329f3456d6a2794ee1e553a7714668da90d985f
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M Source/WebCore/layout/floats/FloatingState.cpp
    M Source/WebCore/layout/floats/FloatingState.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h

  Log Message:
  -----------
  [LFC][Floating] LineBuilder shouldn't mutate float box geometry
https://bugs.webkit.org/show_bug.cgi?id=256268

Reviewed by Antti Koivisto.

This is in preparation for ensuring LineBuilder does not mutate any state and can be used for probing line layout with various constraints.

Let's just return the placed float list and let the caller decide what to do with them whether updating the associated BoxGeometry or just accumulate their widths.
This also ensures that non-placed floats (where we initially try placing them, but they "don't fit")
don't accidentally get stale geometry (this is by not mutating box geometry as part of the "let's find where this float should go" process).

* Source/WebCore/layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::append):
* Source/WebCore/layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::layoutBox const):
(WebCore::Layout::FloatingState::FloatItem::floatBox const): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
(WebCore::Layout::InlineFormattingContext::createDisplayContentForLine):
(WebCore::Layout::InlineFormattingContext::resetGeometryForClampedContent):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::inlineItemWidth const):
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::placeInlineContent):
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::tryPlacingFloatBox):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h:

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




More information about the webkit-changes mailing list