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
REGRESSION(257219@main): [GTK] Cursor blinks oddly in text fields, even if blinking disabled #12737
REGRESSION(257219@main): [GTK] Cursor blinks oddly in text fields, even if blinking disabled #12737
Conversation
EWS run on previous version of this PR (hash 525120d) |
return shouldBlink ? 500_us * time : 0_s; | ||
if (shouldBlink) | ||
return { 500_us * time }; | ||
return { }; |
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.
Shouldn't this be std::nullopt?
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.
Empty initializer list is equivalent to std::nullopt
, I have seen both styles in WebKit. I can change it before landing if you prefer.
return; | ||
} | ||
|
||
// If blinking is disabled, set isBlinkingSuspended() would have made the | ||
// previuos check return early and at this point there must be an interval. |
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.
// previuos check return early and at this point there must be an interval. | |
// previous check return early and at this point there must be an interval. |
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.
Thanks, I will fix the typo before landing ππΌ
525120d
to
55fc48d
Compare
β¦en if blinking disabled https://bugs.webkit.org/show_bug.cgi?id=252687 Reviewed by Carlos Garcia Campos. Before 257219@main if RenderTheme::caretBlinkInterval() returned zero then the timer controlling the blink animation was never started. When introducing CaretAnimator + SimpleCaretAnimator the check was not carried over, resulting in the animator trying to paint the caret on-and-off as fast as possible when blinking should have been disabled. The fix reintroduces the check, reusing setBlinkingSuspended() to enable (or disable) blinking depending on RenderTheme::caretBlinkInterval(), which in turn is changed to return std::optional<Seconds>, with std::nullopt signalling that blinking is disables. The improved typing ensures that the code explicitly handles the case of blinking being disabled. While at it, remove the RenderThemeGtk.{h,cpp} files, because they only contained an implementation of caretBlinkInterval() that was exactly the same code guarded with PLATFORM(GTK) in RenderThemeAdwaita. * Source/WebCore/SourcesGTK.txt: Remove RenderThemeGtk.cpp from the list. * Source/WebCore/platform/CaretAnimator.h: (WebCore::CaretAnimator::didStart): Adapt to use std::optional<Seconds>. * Source/WebCore/platform/SimpleCaretAnimator.cpp: (WebCore::SimpleCaretAnimator::updateAnimationProperties): Arrange to enable or disable caret blinking, adapting to use std::optional<Seconds>. * Source/WebCore/rendering/RenderTheme.h: (WebCore::RenderTheme::caretBlinkInterval const): Change the return type to std::optional<Seconds>. * Source/WebCore/rendering/RenderThemeAdwaita.cpp: (WebCore::RenderTheme::singleton): Remove PLATFORM(GTK) guard. (WebCore::RenderThemeAdwaita::caretBlinkInterval const): Adapt to use std::optional<Seconds>. * Source/WebCore/rendering/RenderThemeAdwaita.h: Ditto. * Source/WebCore/rendering/RenderThemeGtk.cpp: Removed. * Source/WebCore/rendering/RenderThemeGtk.h: Removed. Canonical link: https://commits.webkit.org/262954@main
EWS run on current version of this PR (hash 55fc48d) |
55fc48d
to
6a0a835
Compare
Committed 262954@main (6a0a835): https://commits.webkit.org/262954@main Reviewed commits have been landed. Closing PR #12737 and removing active labels. |
6a0a835
55fc48d
π§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ api-macπ§ͺ ios-wk2-wptπ§ͺ mac-wk1π§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk2π§ͺ api-gtkπ§ͺ mac-AS-debug-wk2π§ͺ mac-wk2-stress