Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 983e776f3ae9860a43e123b86aaecce97335f109
      
https://github.com/WebKit/WebKit/commit/983e776f3ae9860a43e123b86aaecce97335f109
  Author: Frédéric Wang <[email protected]>
  Date:   2025-05-15 (Thu, 15 May 2025)

  Changed paths:
    A 
LayoutTests/fast/editing/indent-split-paragraph-at-line-preserving-and-non-whitespace-collapsing-start-expected.txt
    A 
LayoutTests/fast/editing/indent-split-paragraph-at-line-preserving-and-non-whitespace-collapsing-start.html
    M Source/WebCore/editing/ApplyBlockElementCommand.cpp

  Log Message:
  -----------
  Fix start offset adjustment in rangeForParagraphSplittingTextNodesIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=289375

Reviewed by Ryosuke Niwa.

Currently if the start is a text node preserving new lines, we can do

start = startOfParagraph(end.previous()).deepEquivalent();

which may move to a different node. In particular, if start was not
collapsing whitespace then we may try to split at the start position
which is no longer guaranteed to be a text node.

Comparing with what we do for the end position, it seems this is just
a mistake from https://commits.webkit.org/59955@main and we mean to
consider the position before the start instead.

* 
LayoutTests/fast/editing/indent-split-paragraph-at-line-preserving-and-non-whitespace-collapsing-start-expected.txt:
 Added.
* 
LayoutTests/fast/editing/indent-split-paragraph-at-line-preserving-and-non-whitespace-collapsing-start.html:
 Added.
* Source/WebCore/editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
 Use the position before the start instead.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to