[webkit-changes] [WebKit/WebKit] 7e9c27: Fix caret move by line when padding-top is set

Ahmad Saleem noreply at github.com
Mon Feb 6 12:06:27 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7e9c27142b2f82dbc3ccc4021e02546e9eafccd9
      https://github.com/WebKit/WebKit/commit/7e9c27142b2f82dbc3ccc4021e02546e9eafccd9
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    A LayoutTests/editing/selection/move-with-padding-top-expected.txt
    A LayoutTests/editing/selection/move-with-padding-top.html
    M Source/WebCore/editing/VisibleUnits.cpp
    M Source/WebCore/editing/VisibleUnits.h

  Log Message:
  -----------
  Fix caret move by line when padding-top is set

Fix caret move by line when padding-top is set
https://bugs.webkit.org/show_bug.cgi?id=248413
rdar://problem/102991672

Reviewed by Ryosuke Niwa.

This patch is to align WebKit behavior with Gecko / Firefox and Blink / Chromium.

Partial Merge - https://chromium.googlesource.com/chromium/blink/+/87805d6f9313997171b970d847e141a18b95dcf7

Moving carets by line, either forward or backward, could be
prevented because the large part of the relevant code path
for that case (previousLinePosition(), nextLinePosition(),
etc.) uses int and IntPoint.

This patch fixes all relevant functions to use LayoutUnit
and LayoutPoint in VisibleUnits.

* Source/WebCore/editing/VisibleUnits.cpp:
(absoluteLineDirectionPointToLocalPointInBlock): Modify "IntPoint" and
"int" to "LayoutPoint" and "LayoutUnit"
(previousLinePosition): Ditto
(nextLinePosition): Ditto
(previousParagraphPosition): Ditto
(nextParagraphPosition): Ditto
* Source/WebCore/editing/VisibleUnits.h: Introduce 'LayoutUnit' class
and use it in similar functions as our changes in .cpp file
* LayoutTests/editing/selection/move-with-padding-top.html: Add Test Case
* LayoutTests/editing/selection/move-with-padding-top-expected.txt: Add Test Case Expectation

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




More information about the webkit-changes mailing list