From 1871843acb56773f852d1718f096527e5e52875b Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 16 Jun 2025 16:53:56 +0200 Subject: [PATCH] LibWeb: Reformat `Node/PaintableBox::has_css_transform()` Slightly more visually pleasing. No functional changes. --- Libraries/LibWeb/Layout/Node.h | 14 +++++--------- Libraries/LibWeb/Painting/PaintableBox.h | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Libraries/LibWeb/Layout/Node.h b/Libraries/LibWeb/Layout/Node.h index 80b85f5f4a2..ba6bd9cd6e3 100644 --- a/Libraries/LibWeb/Layout/Node.h +++ b/Libraries/LibWeb/Layout/Node.h @@ -178,15 +178,11 @@ public: [[nodiscard]] bool has_css_transform() const { - if (!computed_values().transformations().is_empty()) - return true; - if (computed_values().rotate().has_value()) - return true; - if (computed_values().translate().has_value()) - return true; - if (computed_values().scale().has_value()) - return true; - return false; + auto const& computed_values = this->computed_values(); + return !computed_values.transformations().is_empty() + || computed_values.rotate().has_value() + || computed_values.translate().has_value() + || computed_values.scale().has_value(); } // https://drafts.csswg.org/css-ui/#propdef-user-select diff --git a/Libraries/LibWeb/Painting/PaintableBox.h b/Libraries/LibWeb/Painting/PaintableBox.h index 11366391c85..04770c9ddbe 100644 --- a/Libraries/LibWeb/Painting/PaintableBox.h +++ b/Libraries/LibWeb/Painting/PaintableBox.h @@ -115,15 +115,11 @@ public: [[nodiscard]] bool has_css_transform() const { - if (!computed_values().transformations().is_empty()) - return true; - if (computed_values().rotate().has_value()) - return true; - if (computed_values().translate().has_value()) - return true; - if (computed_values().scale().has_value()) - return true; - return false; + auto const& computed_values = this->computed_values(); + return !computed_values.transformations().is_empty() + || computed_values.rotate().has_value() + || computed_values.translate().has_value() + || computed_values.scale().has_value(); } [[nodiscard]] Optional scrollable_overflow_rect() const