mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
LibWeb: Reset the HTML editing cursor blink cycle on arrow key movement
Also stop exposing the DOM cursor as a mutable reference on Frame, since event handling code was using that to mess with the text offset directly. Setting the cursor now always goes through the Frame where we can reset the blink cycle appropriately. This makes cursor movement look a lot more natural. :^)
This commit is contained in:
parent
2c4829cb14
commit
ace1b34798
3 changed files with 33 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -94,9 +94,8 @@ public:
|
|||
Gfx::IntPoint to_main_frame_position(const Gfx::IntPoint&);
|
||||
Gfx::IntRect to_main_frame_rect(const Gfx::IntRect&);
|
||||
|
||||
DOM::Position& cursor_position() { return m_cursor_position; }
|
||||
const DOM::Position& cursor_position() const { return m_cursor_position; }
|
||||
void set_cursor_position(const DOM::Position&);
|
||||
void set_cursor_position(DOM::Position);
|
||||
|
||||
bool cursor_blink_state() const { return m_cursor_blink_state; }
|
||||
|
||||
|
@ -108,6 +107,8 @@ private:
|
|||
explicit Frame(DOM::Element& host_element, Frame& main_frame);
|
||||
explicit Frame(Page&);
|
||||
|
||||
void reset_cursor_blink_cycle();
|
||||
|
||||
void setup();
|
||||
|
||||
WeakPtr<Page> m_page;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue