[webkit-changes] [WebKit/WebKit] 6a0a83: REGRESSION(257219 at main): [GTK] Cursor blinks oddly...

Adrian Perez noreply at github.com
Fri Apr 14 04:29:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6a0a83593474f3c4c6959c4d36de25315094b643
      https://github.com/WebKit/WebKit/commit/6a0a83593474f3c4c6959c4d36de25315094b643
  Author: Adrian Perez de Castro <aperez at igalia.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M Source/WebCore/SourcesGTK.txt
    M Source/WebCore/platform/CaretAnimator.h
    M Source/WebCore/platform/SimpleCaretAnimator.cpp
    M Source/WebCore/rendering/RenderTheme.h
    M Source/WebCore/rendering/RenderThemeAdwaita.cpp
    M Source/WebCore/rendering/RenderThemeAdwaita.h
    R Source/WebCore/rendering/RenderThemeGtk.cpp
    R Source/WebCore/rendering/RenderThemeGtk.h

  Log Message:
  -----------
  REGRESSION(257219 at main): [GTK] Cursor blinks oddly in text fields, even if blinking disabled
https://bugs.webkit.org/show_bug.cgi?id=252687

Reviewed by Carlos Garcia Campos.

Before 257219 at 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




More information about the webkit-changes mailing list