[webkit-changes] [WebKit/WebKit] 2cbf36: Refactor `caretWidth` into a more reasonable place

Richard Robinson noreply at github.com
Wed Dec 7 20:44:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2cbf36c7e9b2b2a70eddd1f839b876a1acab3f13
      https://github.com/WebKit/WebKit/commit/2cbf36c7e9b2b2a70eddd1f839b876a1acab3f13
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2022-12-07 (Wed, 07 Dec 2022)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/rendering/CaretRectComputation.cpp
    M Source/WebCore/rendering/CaretRectComputation.h
    M Source/WebCore/rendering/RenderBlockFlow.h
    M Source/WebCore/rendering/RenderObject.h

  Log Message:
  -----------
  Refactor `caretWidth` into a more reasonable place
https://bugs.webkit.org/show_bug.cgi?id=248899
rdar://102449973

Reviewed by Tim Horton.

The `caretWidth` constant is just sitting at the top of `RenderObject.h` currently.
This PR refactors it into a method in a more sensical place.

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/editing/Editor.cpp:
(WebCore::collapseCaretWidth):
* Source/WebCore/rendering/CaretRectComputation.cpp:
(WebCore::caretWidth):
(WebCore::computeCaretRectForEmptyElement):
(WebCore::computeCaretRectForLinePosition):
(WebCore::computeCaretRectForSVGInlineText):
(WebCore::computeCaretRectForBox):
* Source/WebCore/rendering/CaretRectComputation.h:
* Source/WebCore/rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::endPaddingWidthForCaret const):
* Source/WebCore/rendering/RenderObject.h:

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




More information about the webkit-changes mailing list