mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Make absolutized_length()
helper a Length method
There were a mix of users between those who want to know if the Length changed, and those that just want an absolute Length. So, we now have two methods: Length::absolutize() returns an empty Optional if nothing changed, and Length::absolutized() always returns a value.
This commit is contained in:
parent
7d29262b8b
commit
16e3a86393
7 changed files with 27 additions and 20 deletions
|
@ -125,6 +125,10 @@ public:
|
|||
|
||||
CSSPixels relative_length_to_px(CSSPixelRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, CSSPixels font_size, CSSPixels root_font_size, CSSPixels line_height, CSSPixels root_line_height) const;
|
||||
|
||||
// Returns empty optional if it's already absolute.
|
||||
Optional<Length> absolutize(CSSPixelRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, CSSPixels font_size, CSSPixels root_font_size, CSSPixels line_height, CSSPixels root_line_height) const;
|
||||
Length absolutized(CSSPixelRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, CSSPixels font_size, CSSPixels root_font_size, CSSPixels line_height, CSSPixels root_line_height) const;
|
||||
|
||||
private:
|
||||
char const* unit_name() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue