[webkit-changes] [WebKit/WebKit] 53cb61: [text-box-trim] text-box-trim should not get propa...

Alan Baradlay noreply at github.com
Sun Aug 18 13:33:50 PDT 2024


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

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderLayoutState.h
    A Source/WebCore/rendering/TextBoxTrimmer.cpp
    A Source/WebCore/rendering/TextBoxTrimmer.h

  Log Message:
  -----------
  [text-box-trim] text-box-trim should not get propagated into inline-blocks
https://bugs.webkit.org/show_bug.cgi?id=278270

Reviewed by Antti Koivisto.

<div tex-box-trim>
  Some text <div inline-block>inside</div> some more text
</div text-box-trim>

While trimming does not inherit, it gets propagated across nested block containers,
however propagation should stop at inline-block boundary.

This patch
1. moves TextBoxTrimmer from RenderBlockFlow to a dedicated file
2. adds support for stopping and restoring text-box-trim propagation at formatting context boundary
3. fixes firstFormattedLineRoot/lastFormattedLineRoot to match spec
4. corrects various minor issues

* LayoutTests/TestExpectations:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutInFlowChildren):
(WebCore::RenderBlockFlow::layoutModernLines):
(WebCore::firstInlineFormattingContextRoot): Deleted.
(WebCore::lastInlineFormattingContextRoot): Deleted.
(WebCore::TextBoxTrimmer::TextBoxTrimmer): Deleted.
(WebCore::TextBoxTrimmer::~TextBoxTrimmer): Deleted.
(WebCore::TextBoxTrimmer::textBoxTrim): Deleted.
(WebCore::TextBoxTrimmer::setTextBoxTrimForSubtree): Deleted.
(WebCore::TextBoxTrimmer::adjustTextBoxTrimAfterLayout): Deleted.
* Source/WebCore/rendering/RenderLayoutState.h:
(WebCore::RenderLayoutState::setTextBoxTrim):
(WebCore::RenderLayoutState::resetTextBoxTrim): Deleted.
* Source/WebCore/rendering/TextBoxTrimmer.cpp: Added.
(WebCore::textBoxTrim):
(WebCore::shouldIgnoreAsFirstLastFormattedLineContainer):
(WebCore::firstFormattedLineRoot):
(WebCore::lastFormattedLineRoot):
(WebCore::TextBoxTrimmer::TextBoxTrimmer):
(WebCore::TextBoxTrimmer::~TextBoxTrimmer):
(WebCore::TextBoxTrimmer::lastInlineFormattingContextRootForTrimEnd):
(WebCore::TextBoxTrimmer::adjustTextBoxTrimStatusBeforeLayout):
(WebCore::TextBoxTrimmer::adjustTextBoxTrimStatusAfterLayout):
(WebCore::TextBoxTrimmer::handlePropagatedTextBoxTrimBeforeLayout):
* Source/WebCore/rendering/TextBoxTrimmer.h: Added.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list