1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibWeb: Replace Length::set_calculated_style() with ::make_calculated()

There's no need to modify the Length's calculated-value after creating
it, so let's make it immutable. :^)
This commit is contained in:
Sam Atkins 2022-01-25 12:11:23 +00:00 committed by Andreas Kling
parent db04b5687d
commit ce0a516e59
4 changed files with 12 additions and 18 deletions

View file

@ -43,6 +43,7 @@ public:
static Length make_auto();
static Length make_px(float value);
static Length make_calculated(NonnullRefPtr<CalculatedStyleValue>);
Length percentage_of(Percentage const&) const;
Length resolved(Length const& fallback_for_undefined, Layout::Node const& layout_node) const;
@ -131,8 +132,6 @@ public:
return !(*this == other);
}
void set_calculated_style(CalculatedStyleValue* value);
float relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontMetrics const& font_metrics, float root_font_size) const;
private: