New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor caret painting logic #10049
Refactor caret painting logic #10049
Conversation
EWS run on previous version of this PR (hash 624ed1e) |
624ed1e
to
711cc96
Compare
EWS run on previous version of this PR (hash 711cc96) |
711cc96
to
56f0933
Compare
EWS run on previous version of this PR (hash 56f0933) |
56f0933
to
796c63b
Compare
EWS run on previous version of this PR (hash 796c63b) |
796c63b
to
c2c4eee
Compare
EWS run on previous version of this PR (hash c2c4eee) |
c2c4eee
to
22c59ca
Compare
EWS run on previous version of this PR (hash 22c59ca) |
22c59ca
to
6d639cf
Compare
EWS run on previous version of this PR (hash 6d639cf) |
6d639cf
to
4d456e9
Compare
EWS run on previous version of this PR (hash 4d456e9) |
@@ -1120,6 +1129,11 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | |||
if (pushedClip) | |||
popContentsClip(paintInfo, phase, adjustedPaintOffset); | |||
|
|||
if (paintInfo.phase == PaintPhase::Foreground && !renderCaretInsideContentsClip()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smfr I want to render the caret outside of the RenderBlock / text field's clipping rectangle. Is there a better way to do this than ignoring the clipping rectangle? Should I paint the caret as part of a different paint phase?
paintCaret(paintInfo, adjustedPaintOffset, CursorCaret); | ||
paintCaret(paintInfo, adjustedPaintOffset, DragCaret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we factor these two lines into a separate method, since it's duplicated below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I'll make that change
4d456e9
to
1832b98
Compare
EWS run on current version of this PR (hash 1832b98) |
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/260775@main
1832b98
to
e314f57
Compare
Committed 260775@main (e314f57): https://commits.webkit.org/260775@main Reviewed commits have been landed. Closing PR #10049 and removing active labels. |
e314f57
1832b98
π§ͺ mac-wk2π§ͺ mac-AS-debug-wk2π watch