[webkit-changes] [WebKit/WebKit] 11d258: contentEditable caret is left aligned instead of c...
Ahmad Saleem
noreply at github.com
Mon Oct 10 00:05:46 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 11d258f9db329fa814a7a5466d2a9bae81a6025d
https://github.com/WebKit/WebKit/commit/11d258f9db329fa814a7a5466d2a9bae81a6025d
Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
Date: 2022-10-10 (Mon, 10 Oct 2022)
Changed paths:
A LayoutTests/editing/selection/caret-in-empty-div-with-pseudo-content-expected.txt
A LayoutTests/editing/selection/caret-in-empty-div-with-pseudo-content.html
M Source/WebCore/rendering/CaretRectComputation.cpp
Log Message:
-----------
contentEditable caret is left aligned instead of centered when :before pseudoelement is used
contentEditable caret is left aligned instead of centered when :before pseudoelement is used
https://bugs.webkit.org/show_bug.cgi?id=135914
Reviewed by Alan Bujtas.
Merge - https://chromium.googlesource.com/chromium/src.git/+/e4c0c0a729891099c502c8e330b71acca7041ce3
It is to align Webkit to show caret /cursor respect text align in contenteditable with
pseudo element with Blink and Gecko.
Avoid considering PseudoElement's content as first child
so that caret rect for empty element is calculated.
* Source/WebCore/rendering/CaretRectComputation.cpp:
(CaretRectComputation::computeCaretRectForEmptyElement): Update Assert
(CaretRectComputation::computeCaretRectForBox): Add "firstChild" being Pseudo Element condition with "AND" logic
* LayoutTests/editing/selection/caret-in-empty-div-with-pseudo-content.html: Added Test Case
* LayoutTests/editing/selection/caret-in-empty-div-with-pseudo-content-expected.txt: Added Test Case Expectations
Canonical link: https://commits.webkit.org/255333@main
More information about the webkit-changes
mailing list