Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 411d06d64c29c07e5f685564bab966a45c56caa8
      
https://github.com/WebKit/WebKit/commit/411d06d64c29c07e5f685564bab966a45c56caa8
  Author: Alan Baradlay <[email protected]>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M Source/WebCore/editing/VisibleUnits.cpp

  Log Message:
  -----------
  [anon-block-removal] Fix editing/selection/end-of-document.html
https://bugs.webkit.org/show_bug.cgi?id=321205

Reviewed by Antti Koivisto.

previousLinePosition() and nextLinePosition() step to the adjacent line box and 
put the caret on it. They
already skip lines that are not lines of text to land on - zero height ones, 
and ones with no leaf box -
and fall back to a candidate search that walks the tree for the real position 
instead.

A line holding a block level box belongs in that same category. The caret does 
not go on that line, it
goes on a line inside the block, which is what the candidate search finds. 
Accepting the line instead
resolves the position through the block level box: 
closestBoxForHorizontalPosition() returns it,
editingIgnoresContent() is true for it, and the caret ends up in front of the 
whole block. In
end-of-document.html moving the caret backward by line from the end of the 
document lands it at the very
start instead of on the previous line.

* Source/WebCore/editing/VisibleUnits.cpp:
(WebCore::previousLinePosition):
(WebCore::nextLinePosition):

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



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

Reply via email to