[webkit-changes] [WebKit/WebKit] e918ce: A floating element can cause the following element...

Alan Baradlay noreply at github.com
Sat Nov 4 19:33:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e918cedab35b811edda0f313a4746e645c5515d6
      https://github.com/WebKit/WebKit/commit/e918cedab35b811edda0f313a4746e645c5515d6
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-11-04 (Sat, 04 Nov 2023)

  Changed paths:
    A LayoutTests/fast/text/text-indent-with-wide-float-before-expected.html
    A LayoutTests/fast/text/text-indent-with-wide-float-before.html
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h
    M Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp

  Log Message:
  -----------
  A floating element can cause the following element’s text-indent to fail
https://bugs.webkit.org/show_bug.cgi?id=263698
<rdar://problem/117538081>

Reviewed by Antti Koivisto.

text-indent should work even when the "first line" is completely taken by float(s).

  ______________________
 | ____________________ |
 ||                    ||
 ||    float box       ||
 ||____________________||
 |   this is still con- |
 |sidered first line and|
 |text-indent should    |
 |take affect.          |
 |                      |
 |                      |

text-indent logic consults now both previousLineEndsWithBreak and hasInlineContent.

* LayoutTests/fast/text/text-indent-with-wide-float-before-expected.html: Added.
* LayoutTests/fast/text/text-indent-with-wide-float-before.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp:
(WebCore::Layout::InlineContentBalancer::initialize):
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
(WebCore::Layout::InlineFormattingContext::lineLayout):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::layoutInlineContent):
* Source/WebCore/layout/formattingContexts/inline/InlineLineTypes.h:
* Source/WebCore/layout/formattingContexts/inline/IntrinsicWidthHandler.cpp:
(WebCore::Layout::IntrinsicWidthHandler::computedIntrinsicWidthForConstraint):

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




More information about the webkit-changes mailing list