LibWeb: Prevent crash with custom cursor

We don't support custom cursors, use the default instead of crashing.
Also clean up a bit of dead code from when Cursor was optional.
This commit is contained in:
Gingeh 2025-02-14 20:58:38 +11:00 committed by Sam Atkins
commit 4966fa4aed
Notes: github-actions[bot] 2025-02-17 12:25:53 +00:00
2 changed files with 5 additions and 5 deletions

View file

@ -83,12 +83,9 @@ static bool parent_element_for_event_dispatch(Painting::Paintable& paintable, GC
return node && layout_node;
}
static Gfx::StandardCursor cursor_css_to_gfx(Optional<CSS::Cursor> cursor)
static Gfx::StandardCursor cursor_css_to_gfx(CSS::Cursor cursor)
{
if (!cursor.has_value()) {
return Gfx::StandardCursor::None;
}
switch (cursor.value()) {
switch (cursor) {
case CSS::Cursor::Crosshair:
case CSS::Cursor::Cell:
return Gfx::StandardCursor::Crosshair;