mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
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:
parent
7be78ec044
commit
4966fa4aed
Notes:
github-actions[bot]
2025-02-17 12:25:53 +00:00
Author: https://github.com/Gingeh
Commit: 4966fa4aed
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3568
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 5 additions and 5 deletions
|
@ -953,6 +953,9 @@ ContentVisibility ComputedProperties::content_visibility() const
|
||||||
Cursor ComputedProperties::cursor() const
|
Cursor ComputedProperties::cursor() const
|
||||||
{
|
{
|
||||||
auto const& value = property(PropertyID::Cursor);
|
auto const& value = property(PropertyID::Cursor);
|
||||||
|
// FIXME: We don't currently support custom cursors.
|
||||||
|
if (value.is_url())
|
||||||
|
return Cursor::Auto;
|
||||||
return keyword_to_cursor(value.to_keyword()).release_value();
|
return keyword_to_cursor(value.to_keyword()).release_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,12 +83,9 @@ static bool parent_element_for_event_dispatch(Painting::Paintable& paintable, GC
|
||||||
return node && layout_node;
|
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()) {
|
switch (cursor) {
|
||||||
return Gfx::StandardCursor::None;
|
|
||||||
}
|
|
||||||
switch (cursor.value()) {
|
|
||||||
case CSS::Cursor::Crosshair:
|
case CSS::Cursor::Crosshair:
|
||||||
case CSS::Cursor::Cell:
|
case CSS::Cursor::Cell:
|
||||||
return Gfx::StandardCursor::Crosshair;
|
return Gfx::StandardCursor::Crosshair;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue