mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
LibWeb: Retreive CSS cursor before changing hovered node
This fixes an elusive issue where changing the hovered node would cause a JS event handler to run, changing the shape of the paint tree before we had a chance to get the cursor. A more robust fix here will be to let paintables own their used/computed values (so they don't have to look into the layout tree for them) but that's a much bigger change.
This commit is contained in:
parent
8118ea764f
commit
81daf1752b
1 changed files with 1 additions and 2 deletions
|
@ -465,6 +465,7 @@ bool EventHandler::handle_mousemove(CSSPixelPoint position, CSSPixelPoint screen
|
|||
return false;
|
||||
}
|
||||
|
||||
auto const cursor = paintable->computed_values().cursor();
|
||||
auto pointer_events = paintable->computed_values().pointer_events();
|
||||
// FIXME: Handle other values for pointer-events.
|
||||
VERIFY(pointer_events != CSS::PointerEvents::None);
|
||||
|
@ -482,13 +483,11 @@ bool EventHandler::handle_mousemove(CSSPixelPoint position, CSSPixelPoint screen
|
|||
is_hovering_link = true;
|
||||
|
||||
if (node->is_text()) {
|
||||
auto cursor = paintable->computed_values().cursor();
|
||||
if (cursor == CSS::Cursor::Auto)
|
||||
hovered_node_cursor = Gfx::StandardCursor::IBeam;
|
||||
else
|
||||
hovered_node_cursor = cursor_css_to_gfx(cursor);
|
||||
} else if (node->is_element()) {
|
||||
auto cursor = paintable->computed_values().cursor();
|
||||
if (cursor == CSS::Cursor::Auto)
|
||||
hovered_node_cursor = Gfx::StandardCursor::Arrow;
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue