[webkit-changes] [WebKit/WebKit] 36dcac: Refactor caret painting logic

mwyrzykowski noreply at github.com
Fri Feb 24 15:49:58 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 36dcac2d81891f118431e2889179ab71c4cf63c1
      https://github.com/WebKit/WebKit/commit/36dcac2d81891f118431e2889179ab71c4cf63c1
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M Source/WebCore/editing/FrameSelection.cpp
    M Source/WebCore/editing/FrameSelection.h
    M Source/WebCore/platform/CaretAnimator.h
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBlock.h

  Log Message:
  -----------
  Refactor caret painting logic
https://bugs.webkit.org/show_bug.cgi?id=252148
<radar://104975415>

Reviewed by Ryosuke Niwa and Aditya Keerthi.

Continue previous refactorings to the caret painting
logic to allow some additional flexibility.

* Source/WebCore/editing/FrameSelection.cpp:
(WebCore::fillCaretRect):
Pass not just the presentation properties but the entire
animator to allow for additional flexibility.

(WebCore::repaintCaretRectForLocalRect):
(WebCore::repaintCaretForLocalRect):
Allow the animator to influence the repaint rect.

(WebCore::FrameSelection::invalidateCaretRect):
(WebCore::CaretBase::invalidateCaretRect):
(WebCore::FrameSelection::paintCaret):
(WebCore::CaretBase::paintCaret const):
(WebCore::DragCaretController::paintDragCaret const):
* Source/WebCore/editing/FrameSelection.h:
Pass the caret animator instead of just its properties.

* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::renderCaretInsideContentsClip):
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::paintObject):
Allow rendering the caret outside the element's clipping rectangle.

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




More information about the webkit-changes mailing list