[webkit-changes] [WebKit/WebKit] 9f5be0: [LFC][IFC] Move overflowing float boxes to the nex...

alan noreply at github.com
Mon Sep 5 17:19:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9f5be0d753945349297204f8c99853aa0a928263
      https://github.com/WebKit/WebKit/commit/9f5be0d753945349297204f8c99853aa0a928263
  Author: Alan Bujtas <zalan at apple.com>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h

  Log Message:
  -----------
  [LFC][IFC] Move overflowing float boxes to the next line
https://bugs.webkit.org/show_bug.cgi?id=244782

Reviewed by Antti Koivisto.

1. We should not stop placing inline content on the current line, when float boxes start overflowing the line (even if it means that some content gets placed out of DOM order).
e.g.
  <div style="width: 500px">
    This floating image does not fit the line anymore
    <img style="float: left; width: 400px; height: 100px; border: solid;">
    but this text still does.
  </div>
^^ the inline content (text) after the overflowing float box (<img>) needs to be placed on the first line.

2. Overflowing float boxes get placed on the subsequent line, but not constrained by the line box anymore (only constrained by the root containing block) -i.e. we just keep placing these overflowing floats.

* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::lineLayout): Place overflowing float boxes from previous line first.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
(WebCore::Layout::InlineFormattingGeometry::logicalTopForNextLine const):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
(WebCore::Layout::LineBuilder::computedIntrinsicWidth):
(WebCore::Layout::LineBuilder::initialize):
(WebCore::Layout::LineBuilder::placeInlineContent):
(WebCore::Layout::LineBuilder::close):
(WebCore::Layout::LineBuilder::tryPlacingFloatBox): Rename this function to indicate we may not be able to place ever float box on the current line.

(WebCore::Layout::LineBuilder::handleFloatContent): Deleted.
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:

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




More information about the webkit-changes mailing list