From 0cfc7f2c8a70258313d737832a3a6fdcab03a828 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 27 Jan 2025 12:07:30 +0100 Subject: [PATCH] LibWeb: Move LayoutState::set_content_* methods inline I see no good reason to keep them out of line, and having the methods named differently than the property they're updating caused me some confusion initially. --- Libraries/LibWeb/Layout/LayoutState.cpp | 16 ---------------- Libraries/LibWeb/Layout/LayoutState.h | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/Libraries/LibWeb/Layout/LayoutState.cpp b/Libraries/LibWeb/Layout/LayoutState.cpp index 8e1f3d1431b..c05d330eed0 100644 --- a/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Libraries/LibWeb/Layout/LayoutState.cpp @@ -691,22 +691,6 @@ AvailableSpace LayoutState::UsedValues::available_inner_space_or_constraints_fro return AvailableSpace(inner_width, inner_height); } -void LayoutState::UsedValues::set_content_offset(CSSPixelPoint new_offset) -{ - set_content_x(new_offset.x()); - set_content_y(new_offset.y()); -} - -void LayoutState::UsedValues::set_content_x(CSSPixels x) -{ - offset.set_x(x); -} - -void LayoutState::UsedValues::set_content_y(CSSPixels y) -{ - offset.set_y(y); -} - void LayoutState::UsedValues::set_indefinite_content_width() { m_has_definite_width = false; diff --git a/Libraries/LibWeb/Layout/LayoutState.h b/Libraries/LibWeb/Layout/LayoutState.h index a6e24c1a548..b20f5dada59 100644 --- a/Libraries/LibWeb/Layout/LayoutState.h +++ b/Libraries/LibWeb/Layout/LayoutState.h @@ -101,9 +101,9 @@ struct LayoutState { // the constraint is used in that axis instead. AvailableSpace available_inner_space_or_constraints_from(AvailableSpace const& outer_space) const; - void set_content_offset(CSSPixelPoint); - void set_content_x(CSSPixels); - void set_content_y(CSSPixels); + void set_content_offset(CSSPixelPoint new_offset) { offset = new_offset; } + void set_content_x(CSSPixels x) { offset.set_x(x); } + void set_content_y(CSSPixels y) { offset.set_y(y); } CSSPixelPoint offset;