mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-07 20:31:04 +03:00
LibWeb: Ensure layout is up-to-date before blinking the input cursor
This commit is contained in:
parent
a7d7c5b7b4
commit
94e55768f6
Notes:
sideshowbarker
2024-07-17 02:39:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/94e55768f6 Pull-request: https://github.com/SerenityOS/serenity/pull/23626
@ -279,9 +279,15 @@ BrowsingContext::BrowsingContext(JS::NonnullGCPtr<Page> page)
|
||||
m_cursor_blink_timer = Core::Timer::create_repeating(500, [this] {
|
||||
if (!is_focused_context())
|
||||
return;
|
||||
if (m_cursor_position && m_cursor_position->node()->paintable()) {
|
||||
if (!m_cursor_position)
|
||||
return;
|
||||
auto node = m_cursor_position->node();
|
||||
if (!node)
|
||||
return;
|
||||
node->document().update_layout();
|
||||
if (node->paintable()) {
|
||||
m_cursor_blink_state = !m_cursor_blink_state;
|
||||
m_cursor_position->node()->paintable()->set_needs_display();
|
||||
node->paintable()->set_needs_display();
|
||||
}
|
||||
}).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user