LibWeb: Disable caret blinking in test mode

If we want to test whether or not we're drawing the caret, we need to
prevent it from blinking or otherwise all tests we're going to write
that look at the display list will turn out to be flaky.
This commit is contained in:
Jelle Raaijmakers 2026-02-10 13:34:16 +01:00 committed by Jelle Raaijmakers
parent b29591244e
commit a69df4d25b

View file

@ -6726,7 +6726,10 @@ GC::Ptr<DOM::Position> Document::cursor_position() const
void Document::reset_cursor_blink_cycle()
{
m_cursor_blink_state = true;
m_cursor_blink_timer->restart();
// In testing mode, disable timed blinking so we can deterministically generate display lists.
if (!HTML::Window::in_test_mode())
m_cursor_blink_timer->restart();
}
// https://html.spec.whatwg.org/multipage/document-sequences.html#doc-container-document