From 06ed0dfcc125abaf774d5f83fc22c63c446771c6 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 16 Jun 2024 12:47:35 -0400 Subject: [PATCH] LibWeb: Run clang-format We mistakenly did not add the clang-format linter to the new repo's CI, and some unformatted code made its way into the repo. --- .../LibWeb/CSS/StyleValues/EasingStyleValue.cpp | 9 +++++---- .../LibWeb/CSS/StyleValues/EasingStyleValue.h | 3 +-- .../Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 17 +++++++++-------- .../Libraries/LibWeb/HTML/ValidityState.cpp | 10 +++++----- Userland/Libraries/LibWeb/HTML/ValidityState.h | 16 ++++++++-------- .../LibWeb/Streams/AbstractOperations.cpp | 1 - 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp index 29172db63de..5dceeafcfd7 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.cpp @@ -40,12 +40,14 @@ EasingStyleValue::CubicBezier EasingStyleValue::CubicBezier::ease_in_out() return bezier; } -EasingStyleValue::Steps EasingStyleValue::Steps::step_start() { +EasingStyleValue::Steps EasingStyleValue::Steps::step_start() +{ static Steps steps { 1, Steps::Position::Start }; return steps; } -EasingStyleValue::Steps EasingStyleValue::Steps::step_end() { +EasingStyleValue::Steps EasingStyleValue::Steps::step_end() +{ static Steps steps { 1, Steps::Position::End }; return steps; } @@ -57,8 +59,7 @@ bool EasingStyleValue::CubicBezier::operator==(Web::CSS::EasingStyleValue::Cubic double EasingStyleValue::Function::evaluate_at(double input_progress, bool before_flag) const { - constexpr static auto cubic_bezier_at = [](double x1, double x2, double t) - { + constexpr static auto cubic_bezier_at = [](double x1, double x2, double t) { auto a = 1.0 - 3.0 * x2 + 3.0 * x1; auto b = 3.0 * x2 - 6.0 * x1; auto c = 3.0 * x1; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h index 81615cbfe34..526e7136a7c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/EasingStyleValue.h @@ -70,8 +70,7 @@ public: bool operator==(Steps const&) const = default; }; - struct Function : public Variant - { + struct Function : public Variant { using Variant::Variant; double evaluate_at(double input_progress, bool before_flag) const; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index 4123b0b89a5..9faedbe02d4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -95,15 +95,16 @@ String HTMLLinkElement::as() const { String attribute_value = get_attribute_value(HTML::AttributeNames::as); - if (attribute_value.equals_ignoring_ascii_case("fetch"sv) || - attribute_value.equals_ignoring_ascii_case("image"sv) || - attribute_value.equals_ignoring_ascii_case("script"sv) || - attribute_value.equals_ignoring_ascii_case("style"sv) || - attribute_value.equals_ignoring_ascii_case("video"sv) || - attribute_value.equals_ignoring_ascii_case("audio"sv) || - attribute_value.equals_ignoring_ascii_case("track"sv) || - attribute_value.equals_ignoring_ascii_case("font"sv)) + if (attribute_value.equals_ignoring_ascii_case("fetch"sv) + || attribute_value.equals_ignoring_ascii_case("image"sv) + || attribute_value.equals_ignoring_ascii_case("script"sv) + || attribute_value.equals_ignoring_ascii_case("style"sv) + || attribute_value.equals_ignoring_ascii_case("video"sv) + || attribute_value.equals_ignoring_ascii_case("audio"sv) + || attribute_value.equals_ignoring_ascii_case("track"sv) + || attribute_value.equals_ignoring_ascii_case("font"sv)) { return attribute_value.to_lowercase().release_value(); + } return String {}; } diff --git a/Userland/Libraries/LibWeb/HTML/ValidityState.cpp b/Userland/Libraries/LibWeb/HTML/ValidityState.cpp index 1d41fa4801a..00a80c3a6af 100644 --- a/Userland/Libraries/LibWeb/HTML/ValidityState.cpp +++ b/Userland/Libraries/LibWeb/HTML/ValidityState.cpp @@ -1,12 +1,12 @@ /* -* Copyright (c) 2024, Shannon Booth -* -* SPDX-License-Identifier: BSD-2-Clause -*/ + * Copyright (c) 2024, Shannon Booth + * + * SPDX-License-Identifier: BSD-2-Clause + */ #include -#include #include +#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/ValidityState.h b/Userland/Libraries/LibWeb/HTML/ValidityState.h index ed21409b3f5..8914630e649 100644 --- a/Userland/Libraries/LibWeb/HTML/ValidityState.h +++ b/Userland/Libraries/LibWeb/HTML/ValidityState.h @@ -1,8 +1,8 @@ /* -* Copyright (c) 2024, Shannon Booth -* -* SPDX-License-Identifier: BSD-2-Clause -*/ + * Copyright (c) 2024, Shannon Booth + * + * SPDX-License-Identifier: BSD-2-Clause + */ #pragma once @@ -12,16 +12,16 @@ namespace Web::HTML { // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#validitystate class ValidityState final : public Bindings::PlatformObject { - WEB_PLATFORM_OBJECT(ValidityState, Bindings::PlatformObject); - JS_DECLARE_ALLOCATOR(ValidityState); + WEB_PLATFORM_OBJECT(ValidityState, Bindings::PlatformObject); + JS_DECLARE_ALLOCATOR(ValidityState); public: - virtual ~ValidityState() override = default; + virtual ~ValidityState() override = default; private: ValidityState(JS::Realm&); - virtual void initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp b/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp index 08f59111b25..26fbe605e41 100644 --- a/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp @@ -2889,7 +2889,6 @@ bool readable_byte_stream_controller_should_call_pull(ReadableByteStreamControll return false; } - // NON-STANDARD: Can be used instead of CreateReadableStream in cases where we need to set up a newly allocated // ReadableStream before initialization of said ReadableStream, i.e. ReadableStream is captured by lambdas in an uninitialized state. // Spec steps are taken from: https://streams.spec.whatwg.org/#create-readable-stream