mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb: Update absolutize
to take a ComputationContext
struct
This struct will in the future hold information other than a length resolution context (e.g. context for tree counting functions) and a single struct is easier to work with than multiple parameters.
This commit is contained in:
parent
47ffffb775
commit
52192a308b
Notes:
github-actions[bot]
2025-10-07 09:51:56 +00:00
Author: https://github.com/Calme1709
Commit: 52192a308b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6375
Reviewed-by: https://github.com/AtkinsSJ ✅
26 changed files with 146 additions and 113 deletions
|
@ -28,12 +28,12 @@ String CursorStyleValue::to_string(SerializationMode mode) const
|
|||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
ValueComparingNonnullRefPtr<StyleValue const> CursorStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
|
||||
ValueComparingNonnullRefPtr<StyleValue const> CursorStyleValue::absolutized(ComputationContext const& computation_context) 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); }));
|
||||
m_properties.image->absolutized(computation_context)->as_abstract_image(),
|
||||
m_properties.x.map([&](NumberOrCalculated const& value) { return value.absolutized(computation_context); }),
|
||||
m_properties.y.map([&](NumberOrCalculated const& value) { return value.absolutized(computation_context); }));
|
||||
}
|
||||
|
||||
Optional<Gfx::ImageCursor> CursorStyleValue::make_image_cursor(Layout::NodeWithStyle const& layout_node) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue