mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
LibWeb: Absolutize CursorStyleValues in StyleComputer::absolutize_values
This commit is contained in:
parent
c49afd7b28
commit
04ac06f3c4
Notes:
github-actions[bot]
2025-08-06 16:45:32 +00:00
Author: https://github.com/Calme1709
Commit: 04ac06f3c4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5699
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 11 additions and 1 deletions
|
@ -28,6 +28,14 @@ String CursorStyleValue::to_string(SerializationMode mode) const
|
|||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue const> CursorStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
{
|
||||
return CursorStyleValue::create(
|
||||
m_properties.image->absolutized(viewport_rect, font_metrics, root_font_metrics)->as_abstract_image(),
|
||||
m_properties.x.map([&](NumberOrCalculated const& value) { return value.absolutized(viewport_rect, font_metrics, root_font_metrics); }),
|
||||
m_properties.y.map([&](NumberOrCalculated const& value) { return value.absolutized(viewport_rect, font_metrics, root_font_metrics); }));
|
||||
}
|
||||
|
||||
Optional<Gfx::ImageCursor> CursorStyleValue::make_image_cursor(Layout::NodeWithStyle const& layout_node) const
|
||||
{
|
||||
auto const& image = *this->image();
|
||||
|
|
|
@ -33,6 +33,8 @@ public:
|
|||
|
||||
virtual String to_string(SerializationMode) const override;
|
||||
|
||||
virtual ValueComparingNonnullRefPtr<CSSStyleValue const> absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const override;
|
||||
|
||||
bool properties_equal(CursorStyleValue const& other) const { return m_properties == other.m_properties; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -1 +1 @@
|
|||
url("foo.png") calc(1 * sign(1em - 1px)) calc(2 * sign(1em - 1px)), pointer
|
||||
url("foo.png") 1 2, pointer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue